How many tuples are there in a connection?
Asked Answered
P

2

13

Some people said that there are 4 tuples in a connection

client IP address, client port number, server IP address, server port number

Some said that there are 5

client IP address, client port number, server IP address, server port number, protocol

Which one is correct ?

Position answered 2/4, 2013 at 10:10 Comment(1)
Neither: there are 6 elements, missing the address family.Huntley
P
25

You've misunderstood the terminology. A TCP connection is identified by a 5-tuple. That means one tuple, with 5 elements. The five elements are:

  1. Protocol. This is often omitted as it is understood that we are talking about TCP, which leaves 4.
  2. Source IP address.
  3. Source port.
  4. Target IP address.
  5. Target port.
Poco answered 2/4, 2013 at 12:7 Comment(5)
doesn't that a socket identify a connection ?Position
@Position A TCP socket is an endpoint of a connection. It also has the 5-tuple associated with it, of course.Poco
RFC 9143 describes a transport as a 5-tuple as well: A collection of the following values: source address, source port, destination address, destination port, and transport-layer protocol.Asphyxiate
@Asphyxiate No it doesn't. It defines a 5-tuple as those words. No 'transport' about it.Poco
@Poco Not sure the distinction you're making here. The RFC says what it says.Asphyxiate
B
-1

However, in a ICMP connection, it's identified by a 3-tuple :

1-Source IP address 2-Destination IP address 3-ICMP Identifier

Refer to : RFC 6146

Bunny answered 16/8, 2022 at 10:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.