910 views
3 votes
3 votes

In one of the quizes, they asked the following question :

"A server typically listens for TCP connections on a particular port (e.g. 80 for HTTP or 22 for SSH). Which fields can the server use to distinguish packets for a particular client connection?" 

Please look at the Explanation provided in the answer of the quiz question at their website... I am having doubt as to why the Server would need the destination IP address from the packet received from the client... (After all, this destination IP address corresponds to the Server itself !).

2 Answers

0 votes
0 votes
When port numbers of two clients are same then in that case server will confuse to which process port to be used hence port number is not enough to distinguish.Only using IP address will create same problem. So by using port number along with IP address will solve this problem.

Port number+IP address=Socket

This is how we can say server needs destination address  so that it can distinguish packets from particular client connection.

for example A and B are two clients having IP addresses Ia and Ib  and server Ip address is Is,port number of  A is x and Port number of B is also x, x=80,and server port number is also 80

so from A it is Ia:Is+x(80) and from B it is Ib:Is +x(80) so using source Ip address ,destination ip address ,source port number and destination port number we can distinguish that packets are coming from a particular client.
0 votes
0 votes

Initially the client will make the socket connection. For the socket, the following fields are required-

  1. destination port number
  2. source port number
  3. destination IP
  4. source IP
  5. protocol used

When the socket is formed, then receiver will listen() to the TCP request from sender and hence makes 3 way handshake later for TCP connection.

Related questions

0 votes
0 votes
1 answer
1
Chaitanya Kale asked Jan 19, 2023
861 views
Does TCP use negative acknowledgment? According to me for flow control TCP uses a mix of both SR and GO BACK N protocol, and SR protocol uses negative acknowlegment thus ...
2 votes
2 votes
1 answer
3
Sambhrant Maurya asked Sep 13, 2018
935 views
The intermediate routers between source and destination do not need the following info in the IP header;a)Protocolb)Identification numberc)Source IPd)IP versione)None of ...
2 votes
2 votes
0 answers
4
Sambhrant Maurya asked Sep 12, 2018
725 views
What is the minimum and maximum number of packets required to be exchanged for connection establishment, data transfer and connection termination in a TCP 3 way handshake...