What is a port number – Networking interview question

This interview question is asked for networking related jobs. The concept of port numbers in networking and where it is used is explained.

——————————————————————————————————————-
This question is a sample question from the ebook – 250 Network Administrator Interview Questions and Answers – Click here
——————————————————————————————————————-
A port number is a unique number which are used to identify network applications. Consider an analogy where, a person calls up an organization on the board telephone number, which is a unique number. Once the call is established, the automatic calling system would request the caller to enter the extension number to reach the required person. In networking, the board number and the extension number corresponds to IP address and port number. The concept of port numbers is explained in detail.

Assume that a PC access the website www.tcpipguru.com. The website, is available on a Webserver. What exactly is a website ? A website is a set of files , which are hosted (saved in a specific location on the hard disk) on the Web server. The IP address of the web server is to be known before the PC can establish connectivity to the Web server. This is done by the DNS resolution process.

After the DNS resolution process, the IP address of the web server is retrieved. Once the IP address is retrieved, the PC proceeds to establish connectivity to the IP address of the Web server. But the IP address here is like the board number. Every network applications would have a specific port number associated with it. There are client-server based networking applications like DNS, Telnet, HTTP etc.
——————————————————————————————————————-
This question is a sample from the ebook – 250 Network Administrator Interview Questions and Answers – Click here
——————————————————————————————————————-
All of them uses specific port numbers. For example , telnet uses TCP port number 23 on the telnet server, DNS uses UDP port number 53 on the server, HTTP, which is the Web server uses TCP port number 80 on the server
So, in the above scenario, when the PC tries to access the website , which is hosted on the web server, it triggers a request to the IP address along with TCP port number 80.

When the request reaches the web server, it would behave like the analogy example provided above. A call is received (Packet is processed ) and forwarded to the appropriate extension (Based on the TCP port number 80 in the request, the contents of the packet is forwarded to the appropriate application).

So in a real world scenario, what happens to the response, which is sent back from the Web server ? When the client initiates the request, it would generate a random number, which would be used as the port number for identifying the return packet. This port number , which is termed as source port is embedded in the transport layer header (TCP or UDP) in the packet. The destination port number initiated from the client would be TCP port number 80. The server would send the response to the source port specified by the client.

Ebooks for interviews – Click here