Can someone explain it clearly. I know that port numbers are used by applications to differentiate which services you have requested, and routing protocols use protocol numbers in TCP header.

  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer. – Ron Maupin Feb 19 '18 at 19:15

The protocol number is used by the the layer-3 protocol (IPv4 or IPv6) to determine to which layer-4 protocol in the network stack it should send the payload of the packet.

A port number is an address for some layer-4 protocols (TCP or UDP). The port number is used by the layer-4 protocol to determine which application gets the payload of the layer-4 datagram.

And routing protocol use protocol number in TCP header.

I believe you are confusing layer-3 and layer-4. The TCP header (layer 4) doesn't have a field for protocol number - the protocol number is in the IP header (layer 3).

Layers 2 to 4 each encapsulate the datagram of the layer above inside headers for the layer. See this question and answer for more detail

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.