The Gateway to Computer Science Excellence
+2 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 !).

in Computer Networks by Active (1.3k points) | 201 views
There are many route from client to go different destination. If client not know the destination address , then how do it know , that which destination it needs to go?

No Sir, I think the question asks which fields from the packet sent by the client does the Server (not the client) need to identify a unique connection.

Sir, my doubt is any packet arriving from client to server wil have the destination address set to the host address of the Server itself... (because the packets are arriving at the server).

So why will this server need its own host address (destination address field of client packet) for identifying a TCP connection..?


do u mean server and host same?

Most of the time they are not same

1 Answer

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.
by Active (4k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,291 answers
104,903 users