0

In a computer network, how do hosts and routers tell if a datagram is IPv4 or IPv6? Do they just look at the version number field of the packet header?

1
  • 1
    The data-link protocol sends its payload to the protocol. For example, ethernet has the Ether Type field. If it is 0x800, then it sends the payload t the IPv4 process (registered at 0x800), 0x806 the payload goes to the ARP process, 0x86dd to IPv6, etc.
    – Ron Maupin
    May 12, 2021 at 22:43

1 Answer 1

4

If the packet is received over Ethernet then the first thing is to look at the ethertype. 0x0800 is IPv4, 0x86DD is IPv6 and many more have been allocated: https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml

Then look at the version field in the packet, which are the first 4 bits.

Not the answer you're looking for? Browse other questions tagged .