is ipv6 backward compatible with ipv4?

前端 未结 3 1348
庸人自扰
庸人自扰 2021-01-25 01:55

I\'ve got a little udp example program written using ipv4. If I alter the code to ipv6 would I still be able to communicate with anyone using the listener with an ipv4 address?

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-25 02:15

    IPv4 and IPv6 are inherently incompatible with each other.
    A few basic reasons:

    • the address space is completely different (IPv6 has 128 bit addresses, IPv4 has 32 bit addresses)
    • the protocol header of IPv6 looks nothing like the protocol header of IPv4. if you try to parse an IPv6 packet as IPv4 you'll get nonsense.

    The obvious result of these is that if you open an IPv6 socket you can't listen to it using an IPv4 socket.

提交回复
热议问题