TCP - Transmission Control Protocol¶
pcapkit.protocols.transport.tcp contains
TCP only,
which implements extractor for Transmission Control
Protocol (TCP) *, whose structure is described as
below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Source Port |
2 |
16 |
|
Destination Port |
4 |
32 |
|
Sequence Number |
8 |
64 |
|
Acknowledgement Number (if ACK set) |
12 |
96 |
|
Data Offset |
12 |
100 |
Reserved (must be |
|
12 |
103 |
|
ECN Concealment Protection (NS) |
13 |
104 |
|
Congestion Window Reduced (CWR) |
13 |
105 |
|
ECN-Echo (ECE) |
13 |
106 |
|
Urgent (URG) |
13 |
107 |
|
Acknowledgement (ACK) |
13 |
108 |
|
Push Function (PSH) |
13 |
109 |
|
Reset Connection (RST) |
13 |
110 |
|
Synchronize Sequence Numbers (SYN) |
13 |
111 |
|
Last Packet from Sender (FIN) |
14 |
112 |
|
Size of Receive Window |
16 |
128 |
|
Checksum |
18 |
144 |
|
Urgent Pointer (if URG set) |
20 |
160 |
|
TCP Options (if data offset > 5) |
-
class
pcapkit.protocols.transport.tcp.TCP(file=None, length=None, **kwargs)[source]¶ Bases:
pcapkit.protocols.transport.transport.TransportThis class implements Transmission Control Protocol.
-
classmethod
__index__()[source]¶ Numeral registry index of the protocol.
- Returns
Numeral registry index of the protocol in IANA.
- Return type
-
_read_join_ack(bits, size, kind)[source]¶ Read Join Connection option for Third ACK.
Structure of
MP_JOIN-ACK[RFC 6824]:1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+-------+-----------------------+ | Kind | Length = 24 |Subtype| (reserved) | +---------------+---------------+-------+-----------------------+ | | | | | Sender's HMAC (160 bits) | | | | | +---------------------------------------------------------------+
- Parameters
- Returns
extracted Join Connection (
MP_JOIN-ACK) option for Third ACK- Return type
-
_read_join_syn(bits, size, kind)[source]¶ Read Join Connection option for Initial SYN.
Structure of
MP_JOIN-SYN[RFC 6824]:1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+-------+-----+-+---------------+ | Kind | Length = 12 |Subtype| |B| Address ID | +---------------+---------------+-------+-----+-+---------------+ | Receiver's Token (32 bits) | +---------------------------------------------------------------+ | Sender's Random Number (32 bits) | +---------------------------------------------------------------+
- Parameters
- Returns
extracted Join Connection (
MP_JOIN-SYN) option for Initial SYN- Return type
-
_read_join_synack(bits, size, kind)[source]¶ Read Join Connection option for Responding SYN/ACK.
Structure of
MP_JOIN-SYN/ACK[RFC 6824]:1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+-------+-----+-+---------------+ | Kind | Length = 16 |Subtype| |B| Address ID | +---------------+---------------+-------+-----+-+---------------+ | | | Sender's Truncated HMAC (64 bits) | | | +---------------------------------------------------------------+ | Sender's Random Number (32 bits) | +---------------------------------------------------------------+
- Parameters
- Returns
extracted Join Connection (
MP_JOIN-SYN/ACK) option for Responding SYN/ACK- Return type
-
_read_mode_acopt(size, kind)[source]¶ Read Alternate Checksum Request option.
Structure of TCP
CHKSUM-REQ[RFC 1146][RFC 6247]:+----------+----------+----------+ | Kind=14 | Length=3 | chksum | +----------+----------+----------+
- Parameters
size (int) – length of option
kind (Literal[14]) – option kind value (Alt-Chksum Request)
- Returns
extracted Alternate Checksum Request (
CHKSUM-REQ) option- Return type
-
_read_mode_donone(size, kind)[source]¶ Read options request no process.
- Parameters
- Returns
Extracted option with no operation.
- Return type
-
_read_mode_mptcp(size, kind)[source]¶ Read Multipath TCP option.
Structure of
MP-TCP[RFC 6824]:1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+-------+-----------------------+ | Kind | Length |Subtype| | +---------------+---------------+-------+ | | Subtype-specific data | | (variable length) | +---------------------------------------------------------------+
- Parameters
size (int) – length of option
kind (Literal[30]) – option kind value (Multipath TCP)
- Returns
extracted Multipath TCP (
MP-TCP) option- Return type
-
_read_mode_pocsp(size, kind)[source]¶ Read Partial Order Connection Service Profile option.
Structure of TCP
POC-SPOption [RFC 1693][RFC 6247]:1 bit 1 bit 6 bits +----------+----------+------------+----------+--------+ | Kind=10 | Length=3 | Start_flag | End_flag | Filler | +----------+----------+------------+----------+--------+
- Parameters
size (int) – length of option
kind (Literal[10]) – option kind value (POC-Serv Profile)
- Returns
extracted Partial Order Connection Service Profile (
POC-SP) option- Return type
-
_read_mode_qsopt(size, kind)[source]¶ Read Quick-Start Response option.
Structure of TCP
QSopt[RFC 4782]:0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Kind | Length=8 | Resv. | Rate | TTL Diff | | | | |Request| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | QS Nonce | R | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters
size (int) – length of option
kind (Literal[27]) – option kind value (Quick-Start Response)
- Returns
extracted Quick-Start Response (
QS) option- Return type
-
_read_mode_tcpao(size, kind)[source]¶ Read Authentication option.
Structure of TCP
AOopt[RFC 5925]:+------------+------------+------------+------------+ | Kind=29 | Length | KeyID | RNextKeyID | +------------+------------+------------+------------+ | MAC ... +-----------------------------------... ...-----------------+ ... MAC (con't) | ...-----------------+
- Parameters
size (int) – length of option
kind (Literal[29]) – option kind value (TCP Authentication Option)
- Returns
extracted Authentication (
AO) option- Return type
-
_read_mode_tsopt(size, kind)[source]¶ Read Timestamps option.
Structure of TCP
TSopt[RFC 7323]:+-------+-------+---------------------+---------------------+ |Kind=8 | 10 | TS Value (TSval) |TS Echo Reply (TSecr)| +-------+-------+---------------------+---------------------+ 1 1 4 4
- Parameters
size (int) – length of option
kind (Literal[8]) – option kind value (Timestamps)
- Returns
extracted Timestamps (
TS) option- Return type
-
_read_mode_unpack(size, kind)[source]¶ Read options request unpack process.
- Parameters
- Returns
Extracted option which unpacked.
- Return type
-
_read_mode_utopt(size, kind)[source]¶ Read User Timeout option.
Structure of TCP
TIMEOUT[RFC 5482]:0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Kind = 28 | Length = 4 |G| User Timeout | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters
size (int) – length of option
kind (Literal[28]) – option kind value (User Timeout Option)
- Returns
extracted User Timeout (
TIMEOUT) option- Return type
-
_read_mptcp_add(bits, size, kind)[source]¶ Read Add Address option.
Structure of
ADD_ADDR[RFC 6824]:1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+-------+-------+---------------+ | Kind | Length |Subtype| IPVer | Address ID | +---------------+---------------+-------+-------+---------------+ | Address (IPv4 - 4 octets / IPv6 - 16 octets) | +-------------------------------+-------------------------------+ | Port (2 octets, optional) | +-------------------------------+
- Parameters
- Returns
extracted Add Address (
ADD_ADDR) option- Return type
- Raises
ProtocolError – If the option is malformed.
-
_read_mptcp_capable(bits, size, kind)[source]¶ Read Multipath Capable option.
Structure of
MP_CAPABLE[RFC 6824]:1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+-------+-------+---------------+ | Kind | Length |Subtype|Version|A|B|C|D|E|F|G|H| +---------------+---------------+-------+-------+---------------+ | Option Sender's Key (64 bits) | | | | | +---------------------------------------------------------------+ | Option Receiver's Key (64 bits) | | (if option Length == 20) | | | +---------------------------------------------------------------+
- Parameters
- Returns
extracted Multipath Capable (
MP_CAPABLE) option- Return type
-
_read_mptcp_dss(bits, size, kind)[source]¶ Read Data Sequence Signal (Data ACK and Data Sequence Mapping) option.
Structure of
DSS[RFC 6824]:1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+-------+----------------------+ | Kind | Length |Subtype| (reserved) |F|m|M|a|A| +---------------+---------------+-------+----------------------+ | | | Data ACK (4 or 8 octets, depending on flags) | | | +--------------------------------------------------------------+ | | | Data sequence number (4 or 8 octets, depending on flags) | | | +--------------------------------------------------------------+ | Subflow Sequence Number (4 octets) | +-------------------------------+------------------------------+ | Data-Level Length (2 octets) | Checksum (2 octets) | +-------------------------------+------------------------------+
- Parameters
- Returns
extracted Data Sequence Signal (
DSS) option- Return type
-
_read_mptcp_fail(bits, size, kind)[source]¶ Read Fallback option.
Structure of
MP_FAIL[RFC 6824]:1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+-------+----------------------+ | Kind | Length=12 |Subtype| (reserved) | +---------------+---------------+-------+----------------------+ | | | Data Sequence Number (8 octets) | | | +--------------------------------------------------------------+
- Parameters
- Returns
extracted Fallback (
MP_FAIL) option- Return type
-
_read_mptcp_fastclose(bits, size, kind)[source]¶ Read Fast Close option.
Structure of
MP_FASTCLOSE[RFC 6824]:1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+-------+-----------------------+ | Kind | Length |Subtype| (reserved) | +---------------+---------------+-------+-----------------------+ | Option Receiver's Key | | (64 bits) | | | +---------------------------------------------------------------+
- Parameters
- Returns
extracted Fast Close (
MP_FASTCLOSE) option- Return type
-
_read_mptcp_join(bits, size, kind)[source]¶ Read Join Connection option.
- Parameters
- Returns
extracted Join Connection (
MP_JOIN) option- Return type
-
_read_mptcp_prio(bits, size, kind)[source]¶ Read Change Subflow Priority option.
Structure of
MP_PRIO[RFC 6824]:1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+-------+-----+-+--------------+ | Kind | Length |Subtype| |B| AddrID (opt) | +---------------+---------------+-------+-----+-+--------------+
- Parameters
- Returns
extracted Change Subflow Priority (
MP_PRIO) option- Return type
-
_read_mptcp_remove(bits, size, kind)[source]¶ Read Remove Address option.
Structure of
REMOVE_ADDR[RFC 6824]:1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------+---------------+-------+-------+---------------+ | Kind | Length = 3+n |Subtype|(resvd)| Address ID | ... +---------------+---------------+-------+-------+---------------+ (followed by n-1 Address IDs, if required)
- Parameters
- Returns
extracted Remove Address (
REMOVE_ADDR) option- Return type
-
_read_tcp_options(size)[source]¶ Read TCP option list.
- Parameters
size (int) – length of option list
- Returns
Tuple of TCP option list and extracted TCP options.
- Return type
Tuple[Tuple[pcapkit.const.tcp.option.Option], DataType_TCP_Opt]
-
make(**kwargs)[source]¶ Make (construct) packet data.
- Keyword Arguments
**kwargs – Arbitrary keyword arguments.
- Returns
Constructed packet data.
- Return type
-
read(length=None, **kwargs)[source]¶ Read Transmission Control Protocol (TCP).
Structure of TCP header [RFC 793]:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Acknowledgement Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data | |U|A|P|R|S|F| | | Offset| Reserved |R|C|S|S|Y|I| Window | | | |G|K|H|T|N|N| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | Urgent Pointer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options | Padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters
length (Optional[int]) – Length of packet data.
- Keyword Arguments
**kwargs – Arbitrary keyword arguments.
- Returns
Parsed packet data.
- Return type
-
property
name¶ Name of current protocol.
- Return type
Literal[‘Transmission Control Protocol’]
-
classmethod
-
pcapkit.protocols.transport.tcp.TCP_OPT: DataType_TCP_OPT¶ TCP option
dictparsing mapping.kind
length
type
process
comment
name
0
[RFC 793] End of Option List
1
[RFC 793] No-Operation
2
4
H1
[RFC 793] Maximum Segment Size
3
3
B1
[RFC 7323] Window Scale
4
2
?[RFC 2018] SACK Permitted
5
?
P0
2+8*N[RFC 2018] SACK
6
6
P0
7
6
P0
8
10
II2
[RFC 7323] Timestamps
9
2
?10
3
??P3
11
6
P0
12
6
P0
13
6
P0
14
3
B4
15
?
P0
19
18
P0
[RFC 2385] MD5 Signature Option
27
8
P5
[RFC 4782] Quick-Start Response
28
4
P6
[RFC 5482] User Timeout Option
29
?
P7
[RFC 5925] TCP Authentication Option
30
?
P8
[RFC 6824] Multipath TCP
34
?
P0
[RFC 7413] Fast Open
-
pcapkit.protocols.transport.tcp.process_opt: Dict[int, Callable[[pcapkit.protocols.transport.tcp.TCP, int, int], DataType_TCP_Opt]]¶ Process method for TCP options.
Code
Method
Description
0
do nothing
1
unpack according to size
2
timestamps
3
POC service profile
4
alternate checksum request
5
Quick-Start response
6
user timeout option
7
TCP authentication option
8
multipath TCP
-
pcapkit.protocols.transport.tcp.mptcp_opt: Dict[int, Callable[[pcapkit.protocols.transport.tcp.TCP, str, int, int], DataType_TCP_MP_Opt]]¶ Process method for multipath TCP options [RFC 6824].
Code
Method
Description
0
MP_CAPABLE1
MP_JOIN2
DSS3
ADD_ADDR4
REMOVE_ADDR5
MP_PRIO6
MP_FAIL7
MP_FASTCLOSE
Data Structure¶
Important
Following classes are only for documentation purpose.
They do NOT exist in the pcapkit module.
-
class
pcapkit.protocols.transport.tcp.DataType_TCP¶ - Bases
TypedDict
Structure of TCP header [RFC 793].
-
flags: DataType_TCP_Flags¶ Flags.
-
opt: Tuple[pcapkit.const.tcp.option.Option]¶ Array of TCP options.
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Flags¶ - Bases
TypedDict
Flags.
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt¶ - Bases
TypedDict
Structure of TCP options.
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_OPT¶ - Bases
TypedDict
TCP option
dictparsing mapping.
TCP Miscellaneous Options¶
No Process Options¶
For TCP options require no process, its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind |
1 |
8 |
|
Length |
2 |
16 |
|
Kind-specific Data |
Unpack Process Options¶
For TCP options require unpack process, its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind |
1 |
8 |
|
Length |
2 |
16 |
|
Kind-specific Data |
Timestamps Option¶
For TCP Timestamps (TS) option as described in RFC 7323,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length ( |
2 |
16 |
|
Timestamp Value |
6 |
48 |
|
Timestamps Echo Reply |
Partial Order Connection Service Profile Option¶
For TCP Partial Order Connection Service Profile (POC-SP) option as described in RFC 1693 and RFC 6247,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length ( |
2 |
16 |
|
Start Flag |
2 |
17 |
|
End Flag |
2 |
18 |
|
Filler |
Alternate Checksum Request Option¶
For TCP Alternate Checksum Request (CHKSUM-REQ) option as described in RFC 1146 and RFC 6247,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length ( |
2 |
16 |
|
Checksum Algorithm |
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt_ACOPT¶ - Bases
DataType_TCP_Opt
Structure of TCP
CHKSUM-REQ[RFC 1146][RFC 6247].-
ac: pcapkit.const.tcp.checksum.Checksum¶ Checksum algorithm.
Quick-Start Response Option¶
For TCP Quick-Start Response (QS) option as described in RFC 4782,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length ( |
2 |
16 |
Reserved (must be |
|
2 |
20 |
|
Request Rate |
3 |
24 |
|
TTL Difference |
4 |
32 |
|
QS Nounce |
7 |
62 |
Reserved (must be |
User Timeout Option¶
For TCP User Timeout (TIMEOUT) option as described in RFC 5482,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length ( |
2 |
16 |
|
Granularity |
2 |
17 |
|
User Timeout |
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt_UTOPT¶ - Bases
DataType_TCP_Opt
Structure of TCP
TIMEOUT[RFC 5482].-
granularity: Literal[‘minutes’, ‘seconds’]¶ Granularity.
-
timeout: datetime.timedelta¶ User timeout.
Authentication Option¶
For Authentication (AO) option as described in RFC 5925,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length |
2 |
16 |
|
KeyID |
3 |
24 |
|
RNextKeyID |
4 |
32 |
|
Message Authentication Code |
Multipath TCP Options¶
For Multipath TCP (MP-TCP) options as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length |
2 |
16 |
|
Subtype |
2 |
20 |
|
Subtype-specific Data |
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt_MPTCP¶ - Bases
DataType_TCP_Opt
Structure of
MP-TCP[RFC 6824].-
subtype: pcapkit.const.tcp.mp_tcp_option.MPTCPOption¶ Subtype.
Multipath Capable Option¶
For Multipath Capable (MP_CAPABLE) options as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length ( |
2 |
16 |
|
Subtype ( |
2 |
20 |
|
Version |
3 |
24 |
|
Checksum Require Flag ( |
3 |
25 |
|
Extensibility Flag ( |
3 |
26 |
|
Unassigned ( |
3 |
31 |
|
HMAC-SHA1 Flag ( |
4 |
32 |
|
Option Sender’s Key |
12 |
96 |
|
Option Receiver’s Key
(only if option length is |
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt_MP_CAPABLE¶ - Bases
DataType_TCP_Opt_MPTCP
Structure of
MP_CAPABLE[RFC 6824].-
capable: DataType_TCP_Opt_MP_CAPABLE_Data¶ Subtype-specific data.
Join Connection Option¶
For Join Connection (MP_JOIN) options as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length |
2 |
16 |
|
Subtype ( |
2 |
20 |
|
Handshake-specific Data |
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt_MP_JOIN¶ - Bases
DataType_TCP_Opt_MPTCP
Structure of
MP_JOIN[RFC 6824].-
connection: Optional[Literal[‘SYN/ACK’, ‘SYN’, ‘ACK’]]¶ Join connection type.
-
join: DataType_TCP_Opt_MP_JOIN_Data¶ Subtype-specific data.
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt_MP_JOIN_Data¶ - Bases
TypedDict
Structure of
MP_JOIN[RFC 6824].
MP_JOIN-SYN¶
For Join Connection (MP_JOIN-SYN) option for Initial SYN as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length ( |
2 |
16 |
|
Subtype ( |
2 |
20 |
Reserved (must be |
|
2 |
23 |
|
Backup Path ( |
3 |
24 |
|
Address ID |
4 |
32 |
|
Receiver’s Token |
8 |
64 |
|
Sender’s Random Number |
MP_JOIN-SYN/ACK¶
For Join Connection (MP_JOIN-SYN/ACK) option for Responding SYN/ACK as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length ( |
2 |
16 |
|
Subtype ( |
2 |
20 |
Reserved (must be |
|
2 |
23 |
|
Backup Path ( |
3 |
24 |
|
Address ID |
4 |
32 |
|
Sender’s Truncated HMAC |
12 |
96 |
|
Sender’s Random Number |
MP_JOIN-ACK¶
For Join Connection (MP_JOIN-ACK) option for Third ACK as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length ( |
2 |
16 |
|
Subtype ( |
2 |
20 |
Reserved (must be |
|
4 |
32 |
|
Sender’s HMAC |
Data Sequence Signal Option¶
For Data Sequence Signal (DSS) options as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length |
2 |
16 |
|
Subtype ( |
2 |
20 |
Reserved (must be |
|
3 |
27 |
|
DATA_FIN ( |
3 |
28 |
|
DSN Length ( |
3 |
29 |
|
DSN, SSN, Data-Level Length, CHKSUM Present ( |
3 |
30 |
|
ACK Length ( |
3 |
31 |
|
Data ACK Present ( |
4 |
32 |
|
Data ACK ( |
8/12 |
64/96 |
|
DSN ( |
12/20 |
48/160 |
|
Subflow Sequence Number |
16/24 |
128/192 |
|
Data-Level Length |
18/26 |
144/208 |
|
Checksum |
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt_DSS¶ - Bases
DataType_TCP_Opt_MPTCP
Structure of
DSS[RFC 6824].-
dss: DataType_TCP_Opt_DSS_Data¶ Subtype-specific data.
Add Address Option¶
For Add Address (ADD_ADDR) options as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length |
2 |
16 |
|
Subtype ( |
2 |
20 |
|
IP Version |
3 |
24 |
|
Address ID |
4 |
32 |
|
IP Address ( |
8/20 |
64/160 |
|
Port (optional) |
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt_ADD_ADDR¶ - Bases
DataType_TCP_Opt_MPTCP
Structure of
ADD_ADDR[RFC 6824].-
add_addr: DataType_TCP_Opt_ADD_ADDR_Data¶ Subtype-specific data.
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt_ADD_ADDR_Data¶ - Bases
TypedDict
Structure of
ADD_ADDR[RFC 6824].-
ip_ver: Literal[4, 6]¶ IP version.
-
addr: Union[ipaddress.IPv4Address, ipaddress.IPv6Address]¶ IP address.
Remove Address Option¶
For Remove Address (REMOVE_ADDR) options as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length |
2 |
16 |
|
Subtype ( |
2 |
20 |
Reserved (must be |
|
3 |
24 |
|
Address ID (optional list) |
Change Subflow Priority Option¶
For Change Subflow Priority (MP_PRIO) options as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length |
2 |
16 |
|
Subtype ( |
2 |
23 |
|
Backup Path ( |
3 |
24 |
|
Address ID (optional) |
Fallback Option¶
For Fallback (MP_FAIL) options as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length |
2 |
16 |
|
Subtype ( |
2 |
23 |
Reserved (must be |
|
4 |
32 |
|
Data Sequence Number |
Fast Close Option¶
For Fast Close (MP_FASTCLOSE) options as described in RFC 6824,
its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Kind ( |
1 |
8 |
|
Length |
2 |
16 |
|
Subtype ( |
2 |
23 |
Reserved (must be |
|
4 |
32 |
|
Option Receiver’s Key |
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt_MP_FASTCLOSE¶ - Bases
DataType_TCP_Opt_MPTCP
Structure of
MP_FASTCLOSE[RFC 6824].-
fastclose: DataType_TCP_Opt_MP_FASTCLOSE_Data¶ Subtype-specific data.
-
class
pcapkit.protocols.transport.tcp.DataType_TCP_Opt_MP_FASTCLOSE_Data¶ - Bases
TypedDict
Structure of
MP_FASTCLOSE[RFC 6824].