The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+2 votes
31 views

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 !).

asked in Computer Networks by (189 points) | 31 views
0
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?
0

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..?

0

do u mean server and host same?

Most of the time they are not same

https://learntomato.com/what-is-a-client-what-is-a-server-what-is-a-host/

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


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

36,157 questions
43,608 answers
123,961 comments
42,860 users