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?
Asked
Active
Viewed 140 times
0
-
1The data-link protocol sends its payload to the protocol. For example, ethernet has the [Ether Type field](https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml). 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 '21 at 22:43
1 Answers
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.

Sander Steffann
- 7,712
- 19
- 29