[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modified IPv6 to unmodified IPv4



On 19-okt-2007, at 10:05, Iljitsch van Beijnum wrote:

[...]

And now let's see if we can make this stateless.

The reason NATs require state is because clients can choose random source port numbers which may clash. So we give each client a small identifier that determines the range of source port numbers they may use. I.e., ID = 1 - 127, source port is 1 + ID bits + 8 bits chosen by the client. This limits the number of clients per translator to 127. Solution: give the translator more IPv4 addresses and encode them like this: 0:0:0:0:<translator IPv4 address>:<destination IPv4 address>. We then use a range of 65536 fake IPv4 private addresses, where the IPv6 host selects one based on its IPv6 address such that the TCP and UDP checksums are the same for the original IPv6 address and the translated and NATed IPv4 address. Only problem is telling both sides about the combination of translator IPv4 address, port ID bits and client IPv6 address. This could be done with DHCP for the client side. So there is SOME state involved for the translator, but this is long-term per-client state rather than ephemeral per-session state so it may be worth the effort.