Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Difference between IP address and Port Number in Networking?

What is Difference between IP address and Port Number in Networking?

like image 571
Usama Avatar asked May 28 '16 07:05

Usama


People also ask

Is the IP address the same as the port number?

The answer is no. The IP address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. The port number is used so the data is directed to the correct location within this device.

What is the difference between Port number and protocol number?

in Simple port means to whom you communicate. & Protocol means how to communicate or way of communication. In IP terms, a protocol number is the value assigned to the Layer 4 protocol carried within IP, e.g. 6 for TCP, 17 for UDP, as often found in the /etc/protocols file on most UNIX systems.

How many ports are there in a network?

A port number is used to direct the data to the correct program / task / process within the device. You could compare them with street address (IP) and door number (port). So, there are 65535 ports to every IP address, every one of them can be used by a process to send or receive data.

What is the difference between an IP address and a protocol?

You can call the number (IP address) to talk to the computer, then dial the extension (port) to talk to a specific application. An application needs to be listening on a port in order to communicate. A protocol is just the language that the two applications on either end of a conversation agree to speak in.


3 Answers

IP address is address of the system in the Network.

Port is address of the service within the System.

So IP address + Port defines address of the particular service on the particular system.

like image 168
Dmitry Poroh Avatar answered Oct 07 '22 15:10

Dmitry Poroh


Think about how many application layer protocols exist (HTTP, FTP,DNS, SSH, etc). Now think about how many task/process/programs exist within your device trying to communicate over the internet. Would it be possible just one address, the IP address, to be able to handle all these different assignments and types of protocols alone? The answer is no.

The IP address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. The port number is used so the data is directed to the correct location within this device.

The IP and the port number form the structure IP:port number, 192.168.1.1:8080 for example, and the port number can hold 65536 numbers, with the following division:

  • 0 to 1023 - Well known port numbers. Only special companies like Apple QuickTime, MSN, SQL Services, Gopher Services and other prominent services have these port numbers.

  • 1024 to 49151 - Registered ports; meaning they can be registered to specific protocols by software corporations.

  • 49152 to 65536 - Dynamic or private ports; meaning that they can be used by just about anybody.

like image 35
Caio Gomes Avatar answered Oct 07 '22 15:10

Caio Gomes


IP address is use to identify a host or a group of hosts in a network while port number is used to identify a particular service running in a host

like image 32
ebuka Avatar answered Oct 07 '22 15:10

ebuka