Wednesday, December 28, 2011

Difference between Protocol number and Port number

Protocol number is the value contained in the “protocol” field of an IPv4 header. It is used to identify the protocol. This is an 8 bit filed. In IPv6 this field is called “Next header” field. Some of the protocol numbers of commonly used routing protocols are given below:
Protocol Protocol Number
EIGRP 88
OSPF 89

In TCP/IP, a port is software based end point in an Operating system. Each port is assigned a number. It is called port number. A port number can be 0 to 65535. There are UDP and TCP port numbers in the same range.

Port numbers are assigned in various ways, based on three ranges: System Ports (0-1023), User Ports (1024-49151), and the Dynamic and/or Private Ports (49152-65535). System Ports are also called well-known ports. Well known ports are assigned to specific services i.e. services uses these ports to work.
web server communication diagram
For example, in the figure, PC contact to the web server’s port 80 to get the web page because HTTP uses well known port number of 80. PC also use a port number from the User port range as the source port (e.g. 1380). This port number is used by the web server to serve the webpage to PC i.e. web server send the page with source port of 80 and destination port of 1380.
Most commonly using port numbers and services are given here
System Ports are assigned by IETF process for standards-track protocols, as per RFC6335.  User Ports are assigned by IANA using the "Expert Review" process, as per RFC6335.  Dynamic Ports are not assigned. Different uses of these ranges are described in RFC6335.

No comments: