What are ‘protocol numbers’ in IP?

When the kernel receives IP packets, how does it know what they represent? Are they part of a TCP stream, a UDP datagram, or something else?

The answer is that all IP packets contain an IP protocol number. It’s the ninth byte in the packet. Each protocol running over IP has its own number. TCP is number 6; UDP is number 17.

You can see them all at /etc/protocols on your machine! The official list is maintained by IANA (Internet Assigned Numbers Authority, part of ICANN) here: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

Tagged #internet-protocol, #tcp, #udp, #networking.

Similar posts

More by Jim

Want to build a fantastic product using LLMs? I work at Granola where we're building the future IDE for knowledge work. Come and work with us! Read more or get in touch!

This page copyright James Fisher 2016. Content is not associated with my employer. Found an error? Edit this page.