Difference Between IP Address and Port Number



Computers can communicate with each other over a network through port numbers and IP addresses. In this article, we will discuss the difference between IP Address and Port Number.

What is an IP Address?

IP Address can be expanded to Internet Protocol Address. This is an address which is used by a computer to receive data and information from other computers through the Internet. Billions of IP addresses are being used to make a connection between computers. These computers use either IPv4 or IPv6 addresses for making a connection.

Previously IPv4 was used for networking as the number of users was very less. After the boom of the internet, there were chances that IPv4 IP addresses would not be available. This led to the development of IPv6 which was an addressing scheme of 128 bits while IPv4 was of 32 bits. After the year 2000, many operating systems started using IPv6.

What is a Port Number?

A port number can be considered as a virtual communication endpoint of networking. Many processes occur in an operating system and each process has a unique port number. Port numbers can be used to check the incoming traffic which is sent to different processes. Port numbers are also used for sharing information over the internet.

Ports act as a part of the transport layer in the OSI (Open Systems Interconnection) Model. Ports are supported by different devices involved in networking

Popular Port Numbers

Currently, the number of ports available is 65,535 and the popular ones can be found in the table below ?

Protocol Port Number
HTTP 80
FTP 20, 21
Secure Shell 22
Telnet 23
SMTP (Simple Mail Transfer Protocol) 25
Domain Name System 53
NTP 123
DHCP 67, 68
Border Gateway Protocol 179
HTTP Secure 443
Internet Security Association and Key Management Protocol 500
Remote Desktop Protocol 3389
Web Server 8080
TCP/IP 3360

Types of Port Numbers

Port numbers are of three types mentioned below ?

  • Well-Known Port Numbers ? These port numbers range between 0 and 1023. These port numbers are used by different protocols and IANA (Assigned Numbers Authority) allocates them to server services.
  • Registered Port Numbers ? The registered port number comes in the range of 1024 to 49151. These port numbers are used for specific protocols which are used by many software companies.
  • Dynamic Port Numbers ? Dynamic port numbers range between 49152 to 65535 and can be used by anyone.

Difference between IP Address and Port Number

The table below shows the difference between IP Address and Port Number.

IP Address Port Number
IP Address is an address which is used to send messages to a particular device or a host in the network. The port number is a number that identifies a process available on a computer.
IPv4 and IPv6 are being used to allot IP addresses to different computers and devices. IPv4 is of 32 bit and IPv6 is of 128 bit. Port numbers are of 16 bits.
IP addresses are associated with the network layer OSI Model. Port numbers are associated with the transport layer OSI Model.
A network administrator takes care of IP addresses. An operating system takes care of the port numbers.
The ipconfig command can be used to find the IP address. The netstat command is used to know the details of all the TCP ports.
A sender and a receiver machine use the IP address to send and receive information. The port numbers are used by the operating system which helps in sending information to the correct application. Available on the receiver's machine.
Hosts are identified with the help of IP addresses. Processes and services on a system are identified by the port numbers.
IP address belongs to layer 3 IP protocol. Port numbers belong to layer-4 protocols.

Conclusion

IP addresses are used by different devices over the internet. These addresses are used to send and receive messages. Port numbers are related to the [processes going on in a computer. These numbers have to send data from one process to another. Port numbers range between 0 to 65535. Some port numbers are also used for sending information over the Internet.

FAQs on IP Address Vs. Port Number

1. Which devices use IP Address and Port Numbers?

IP addresses are used by sender and receiver machines to send and receive messages. Operating systems use port numbers to send information to different applications and processes running on a system. Port numbers are also used to share information over the internet.

2. Which commands are used to get an IP address and the Port number on a system?

In order to get the IP address of a system, the ipconfig command is used. For getting the port numbers, the netstat command is used.

3. Who provides IP addresses and port numbers?

A network administrator is responsible for providing IP addresses. Port numbers are provided by the operating system.

4. To which layer of the OSI model are the IP address and port number associated?

IP address is associated with the network layer while port numbers are associated with the transport layer of the OSI model.

5. What port numbers are assigned to different protocols?

The port assigned to different protocols can be found in the table below ?

Protocol Port Number
HTTP 80
FTP 20, 21
Secure Shell 22
Telnet 23
SMTP (Simple Mail Transfer Protocol) 25
Domain Name System 53
NTP 123
DHCP 67, 68
Border Gateway Protocol 179
HTTP Secure 443
Internet Security Association and Key Management Protocol 500
Remote Desktop Protocol 3389
Web Server 8080
TCP/IP 3360
Updated on: 2024-08-09T18:06:43+05:30

294 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements