scapy.contrib.stamp

STAMP (Simple Two-Way Active Measurement Protocol) - RFC 8762.

References

class scapy.contrib.stamp.ErrorEstimate(_pkt, /, *, S=0, Z=0, scale=0, multiplier=1)[source]

Bases: Packet

The Error Estimate specifies the estimate of the error and synchronization. The format of the Error Estimate field (defined in Section 4.1.2 of RFC 4656) is reported below:

0                   1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|S|Z|   Scale   |   Multiplier  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

S is interpreted as follows:

Value

Description

0

there is no notion of external synchronization for the time source

1

the party generating the timestamp has a clock that is synchronized to UTC using an external source

Z is interpreted as follows (defined in Section 2.3 of RFC 8186):

Value

Description

0

NTP 64-bit format of a timestamp

1

PTPv2 truncated format of a timestamp

Scale and Multiplier are linked by the following relationship:

ErrorEstimate = Multiplier*2^(-32)*2^Scale (in seconds)

References

aliastypes = [<class 'scapy.contrib.stamp.ErrorEstimate'>, <class 'scapy.packet.Packet'>]
fields_desc: ClassVar[List[Field[Any, Any] | _FieldContainer]] = [<BitEnumField (ErrorEstimate).S>, <BitEnumField (ErrorEstimate).Z>, <BitField (ErrorEstimate).scale>, <ByteField (ErrorEstimate).multiplier>]
guess_payload_class(payload: str) Packet_metaclass[source]
class scapy.contrib.stamp.STAMPSessionReflectorTestUnauthenticated(_pkt, /, *, seq=0, ts=None, err_estimate=<ErrorEstimate  |>, ssid=1, ts_rx=None, seq_sender=0, ts_sender=None, err_estimate_sender=<ErrorEstimate  |>, mbz1=0, ttl_sender=255, mbz2=0, tlv_objects=[])[source]

Bases: Packet

Extended STAMP Session-Reflector Test Packet in Unauthenticated Mode.

The format (defined in Section 3 of RFC 8972) is shown below:

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Sequence Number                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Timestamp                            |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Error Estimate        |           SSID                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Receive Timestamp                    |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Session-Sender Sequence Number                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Session-Sender Timestamp                     |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Session-Sender Error Estimate |           MBZ                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Ses-Sender TTL |                   MBZ                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                            TLVs                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

References

aliastypes = [<class 'scapy.contrib.stamp.STAMPSessionReflectorTestUnauthenticated'>, <class 'scapy.packet.Packet'>]
fields_desc: ClassVar[List[Field[Any, Any] | _FieldContainer]] = [<IntField (STAMPSessionReflectorTestUnauthenticated).seq>, <scapy.fields.MultipleTypeField object>, <PacketField (STAMPSessionReflectorTestUnauthenticated).err_estimate>, <ShortField (STAMPSessionReflectorTestUnauthenticated).ssid>, <scapy.fields.MultipleTypeField object>, <IntField (STAMPSessionReflectorTestUnauthenticated).seq_sender>, <scapy.fields.MultipleTypeField object>, <PacketField (STAMPSessionReflectorTestUnauthenticated).err_estimate_sender>, <ShortField (STAMPSessionReflectorTestUnauthenticated).mbz1>, <ByteField (STAMPSessionReflectorTestUnauthenticated).ttl_sender>, <NBytesField (STAMPSessionReflectorTestUnauthenticated).mbz2>, <PacketListField (STAMPSessionReflectorTestUnauthenticated).tlv_objects>]
class scapy.contrib.stamp.STAMPSessionSenderTestUnauthenticated(_pkt, /, *, seq=0, ts=None, err_estimate=<ErrorEstimate  |>, ssid=1, mbz=0, tlv_objects=[])[source]

Bases: Packet

Extended STAMP Session-Sender Test Packet in Unauthenticated Mode.

The format (defined in Section 3 of RFC 8972) is shown below:

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Sequence Number                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Timestamp                            |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Error Estimate        |             SSID              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                                                               |
|                         MBZ (28 octets)                       |
|                                                               |
|                                                               |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                            TLVs                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

References

aliastypes = [<class 'scapy.contrib.stamp.STAMPSessionSenderTestUnauthenticated'>, <class 'scapy.packet.Packet'>]
fields_desc: ClassVar[List[Field[Any, Any] | _FieldContainer]] = [<IntField (STAMPSessionSenderTestUnauthenticated).seq>, <scapy.fields.MultipleTypeField object>, <PacketField (STAMPSessionSenderTestUnauthenticated).err_estimate>, <ShortField (STAMPSessionSenderTestUnauthenticated).ssid>, <NBytesField (STAMPSessionSenderTestUnauthenticated).mbz>, <PacketListField (STAMPSessionSenderTestUnauthenticated).tlv_objects>]
class scapy.contrib.stamp.STAMPTestTLV(_pkt, /, *, flags=<Flag 0 ()>, type=None, len=0, value=b'')[source]

Bases: Packet

The STAMP Test TLV defined in Section 4 of [RFC 8972] provides a flexible extension mechanism for optional informational elements.

The TLV Format in a STAMP Test packet is reported below:

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|STAMP TLV Flags|     Type      |           Length              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                            Value                              ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Field

Description

STAMP TLV Flags

8-bit field; for the details about the STAMP TLV Flags Format, see RFC 8972

Type

characterizes the interpretation of the Value field

Length

the length of the Value field in octets

Value

interpreted according to the value of the Type field

References

aliastypes = [<class 'scapy.contrib.stamp.STAMPTestTLV'>, <class 'scapy.packet.Packet'>]
classmethod dispatch_hook(pkt=None, *args, **kargs)[source]
extract_padding(p)[source]
fields_desc: ClassVar[List[Field[Any, Any] | _FieldContainer]] = [<FlagsField (STAMPTestTLV).flags>, <ByteEnumField (STAMPTestTLV).type>, <ShortField (STAMPTestTLV).len>, <StrLenField (STAMPTestTLV).value>]
classmethod register_variant()[source]
registered_stamp_tlv = {None: <class 'scapy.contrib.stamp.STAMPTestTLV'>}