Hacker News new | ask | show | jobs
by vel0city 876 days ago
> So your IPv6 would be 1.2.3.4.5.6.7.8, and old routers would just see 5.6.7.8 and route to the place where that IP should go.

Thats absolutely not what would happen to an IPv4 only router though. You're fundamentally misunderstanding what IPv4 actually is.

That IPv4 router getting a packet with a source address of 9.10.11.12.13.14.15.16 addressed to 1.2.3.4.5.6.7.8 wouldn't know to route it to 5.6.7.8. That packet would be parsed as a source of 9.10.11.12 and a destination of 13.14.15.16. The real destination would have been spilled over into the Options header or payload of the packet. This is because in IPv4, bits 128-159 are the source address, 160-191 are the destination. Having a 64-bit address mushed into an IPv4 packet would just lead to those bits spilling over to the next location.

An IPv4-only router would not be able to route your theoretical IPv6 packet.

1 comments

I assume the high bits would be in the variable length ip option field. So to an old stack it would look like a packet from 13.14.15.16 to 5.6.7.8. Both of those devices would have to be capable of routing ipv6 packets, but nothing in between would.
Hmm, might work for the middle boxes that just do routing.

This would then only really work with both ends supporting this new IPv6 though. If one side only spoke OG IPv4 and the other side spoke this weird IPv6 with half its address bits in the header, there's a good chance the IPv4 side would just ignore the header bits on its return packets and thus wouldn't address it right. So, while that router in the middle might route these packets OK, you'd still practically need an IPv4 address to talk to other IPv4 devices. Which means we'd still have this mixed support, or that 5.6.7.8 would need to pretty much be a complete stateful NAT keeping track of connections for 6 to 4.

> or that 5.6.7.8 would need to pretty much be a complete stateful NAT keeping track of connections for 6 to 4.

Yeah, that would be the transition period. Where any v6 router would also be a NAT gateway for any OG connections and would have to have both a v4 and v6 address.