PORTS
We may access different websites on different tabs in our browser. The browser gets confused about which tab requested which data. So ports help us solve this problem as different tabs have different port no. There are 65536 TCP ports and another 65536 UDP ports.

Ports can be divided into:

i] Hardware ports — these ports provide a gateway to get inside a system and interact with the hardware. Ex: USB ports, HDMI, Ethernet, audio ports, etc.

ii] Software ports — these ports provide a gateway to get inside a system and interact with the software. Different software or services uses different port no.

The port which is on sending device is known as the local port and the port on the receiving device is known as the remote port.

Ports Classification:

Port numbers 0–1023 are reserved for basic well-known reserved services. These are used by the system and OS.

Port numbers 1024–49151 are reserved for some registered services. Ex: skype, counter strike, etc

Port numbers 49152–65535 are known as temporary/ephemeral ports. These ports are used by the client to send requests to the server and capture the results sent back from the server. Ex: use of another tab in the browser. The browser selects any random port no. from 49152–65535 to connect to the server.

The data packet header traveling inside a network must have:

1] Destination IP address

2] Destination Port no

3] Source IP address

4] Source Port no

The combination of IP address and Port no is known as a socket or virtual socket. Ex: 192.168.23.6:25569

There can be different applications that can run on a client and different services (like HTTP, FTP, etc) that can simultaneously run on a server but all listen on different port numbers. No two services will ever run on the same port number.

Basic commands for port overview:
['Ritesh Swarnakar']
['Hardware', 'Computer Networking', 'Computer Network Security']