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

in Computer Networks 441 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

2 Answers

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

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

1 vote
0 answers
Suppose you are using TCP to transfer a 4 MB file over a network. The receiver advertises a receive window of 4 MB. Assume that the retransmission timers expire after 5 RTTs. (a) If TCP sends 4KB segments, how many RTTs does it take to send the ... using implements fast retransmit and fast recovery. How many RTTs are saved by the fact that your TCP implements fast retransmit and fast recovery?
asked Nov 26, 2018 in Computer Networks akmishra_1947 348 views
1 vote
1 answer
The intermediate routers between source and destination do not need the following info in the IP header; a)Protocol b)Identification number c)Source IP d)IP version e)None of these
asked Sep 13, 2018 in Computer Networks Sambhrant Maurya 242 views
1 vote
0 answers
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?
asked Sep 12, 2018 in Computer Networks Sambhrant Maurya 284 views
1 vote
1 answer
When a TCP segment arrives at a host, in order to direct it to the appropriate socket, the operating system's network stack uses which of the following? (a)Transport protocol number (b)Destination IP Address (c)Source port number (d)Destination port number ( ... why a,b and d are needed. Why source port number is needed? Document Ref:
asked Nov 10, 2018 in Computer Networks Ayush Upadhyaya 359 views