Federico Taschin
Federico Taschin

Reputation: 2195

What does identify the connection of a TCP segment?

I have to design a program that reads all the TCP segments incoming of the same connection. How can I distinguish which connection a packet belongs to, among many packets that I receive? Is it sufficient to discriminate on the basis of the DESTINATION PORT field in the header?

Upvotes: 0

Views: 199

Answers (1)

Malt
Malt

Reputation: 30285

No. Using just the destination port isn't enough. A TCP connection is defined by a combination of the following 4 values:

  • Source port
  • Source ip address
  • Destination port
  • Destination ip address

Upvotes: 1

Related Questions