Transport Layer¶
- class icspacket.proto.dnp3.transport.TPDU(final_segment: bool = False, first_segment: bool = False, sequence: int = 0, app_fragment: bytes = b'')[source]¶
Transport Protocol Data Unit (TPDU) representation for DNP3.
This class implements the Transport Header defined in IEEE 1815 (DNP3 Specification), Section 8.2.1. The header is the first byte of every transport segment and precedes the Application Layer data.
The transport header fields support proper sequencing, ordering, and fragment reassembly for Application Layer messages.
- final_segment: bool = False¶
Indicates whether this is the final (last) transport segment.
- first_segment: bool = False¶
Indicates whether this is the first transport segment.
- sequence: int = 0¶
6-bit sequence number for ordering transport segments.
- app_fragment: bytes = b''¶
Application Layer fragment associated with this TPDU.
Changed in version 0.2.0: Changed type to
bytesin order to support segmentation.
- property real_sequence: int¶
Compute the normalized sequence number modulo 64.
This property ensures compliance with the rollover rule in Section 8.2.1.3 of the DNP3 specification.
- Returns:
Normalized sequence number (0-63).
- Return type:
int