Packets Reassembly

pcapkit.foundation.reassembly bases on algorithms described in RFC 791 and RFC 815, implements datagram reassembly of IP and TCP packets.

See also

For more information on customisation and extension, please refer to Customisation & Extensions.

All reassembly classes are implemented as Reassembly subclasses, which are responsible for processing extracted packets and reassemble the datagrams to a nonfragmented packet. Below is a brief diagram of the class hierarchy of pcapkit.foundation.reassembly:

flowchart LR A{{ReassemblyMeta}} -.->|metaclass| B(ReassemblyBase) B --> IP & TCP IP --> IPv4 & IPv6 B --> C(Reassembly) C --> D([user customisation ...]) click A "/pcapkit/foundation/reassembly/reassembly.html#pcapkit.foundation.reassembly.reassembly.ReassemblyMeta" click B "/pcapkit/foundation/reassembly/reassembly.html#pcapkit.foundation.reassembly.reassembly.ReassemblyBase" click C "/pcapkit/foundation/reassembly/reassembly.html#pcapkit.foundation.reassembly.reassembly.Reassembly" click D "/ext.html#reassembly-and-flow-tracing" click IP "/pcapkit/foundation/reassembly/ip/index.html#pcapkit.foundation.reassembly.ip.IP" click IPv4 "/pcapkit/foundation/reassembly/ip/ipv4.html#pcapkit.foundation.reassembly.ip.ipv4.IPv4" click IPv6 "/pcapkit/foundation/reassembly/ip/ipv6.html#pcapkit.foundation.reassembly.ip.ipv6.IPv6" click TCP "/pcapkit/foundation/reassembly/tcp.html#pcapkit.foundation.reassembly.tcp.TCP"

Auxiliary Data

class pcapkit.foundation.reassembly.ReassemblyManager(*args: VT, **kwargs: VT)[source]

Bases: Info

Reassembly Manager.

ipv4: IPv4_Reassembly

IPv4 reassembly.

ipv6: IPv6_Reassembly

IPv6 reassembly.

tcp: TCP_Reassembly

TCP reassembly.

class pcapkit.foundation.reassembly.data.ReassemblyData(*args: VT, **kwargs: VT)[source]

Bases: Info

Data storage for reassembly.

ipv4: tuple[IP_Datagram, ...]

IPv4 reassembled data.

ipv6: tuple[IP_Datagram, ...]

IPv6 reassembled data.

tcp: tuple[TCP_Datagram, ...]

TCP reassembled data.