-1

It is a question from Networking stanford course.

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?

It is a multiple choice.The given options are

  1. Sequence Number
  2. Acknowledgement Number
  3. Source Port
  4. Destination Port
  5. Source IP
  6. Destination IP
  7. Checksum

The answers are 3, 4, 5, 6.

Some people pointed me to this answer Why is a TCP Socket identified by a 4 tuple?

From my understanding the answer in that question describes how we distinguish different client connections.but here we are asked to

distinguish packets for a particular client connection

My doubt is, if all we want to do is distinguish packets for a particular client connection, why do we need to know the destination IP? and why can't we use the sequence number to distinguish them since every packet has a different sequence number?

1 Answers1

3

The sequence number is a randomly initialized number sequence from the remote host. There is no guarantee that it doesn't collide with that of another connection.

Also, using the source/destination IP/port tuple is much simpler than guessing into which receive window the received sequence number might fit - sequence numbers aren't necessarily received in numerical order, especially when there's packet loss.

The original Stanford question is badly worded. It doesn't clearly differentiate "distinguish packets from separate client connections" (which is obviously meant) and "distinguish packets/segments within a particular client connection" (which would be the sequence number).

The destination IP is required because - theoretically - the client could use the same source port and source IP to establish another connection to a server's secondary IP address.

Zac67
  • 81,287
  • 3
  • 67
  • 131