Slow¶
-
class
os_ken.lib.packet.slow.
lacp
(version=1, actor_system_priority=0, actor_system='00:00:00:00:00:00', actor_key=0, actor_port_priority=0, actor_port=0, actor_state_activity=0, actor_state_timeout=0, actor_state_aggregation=0, actor_state_synchronization=0, actor_state_collecting=0, actor_state_distributing=0, actor_state_defaulted=0, actor_state_expired=0, partner_system_priority=0, partner_system='00:00:00:00:00:00', partner_key=0, partner_port_priority=0, partner_port=0, partner_state_activity=0, partner_state_timeout=0, partner_state_aggregation=0, partner_state_synchronization=0, partner_state_collecting=0, partner_state_distributing=0, partner_state_defaulted=0, partner_state_expired=0, collector_max_delay=0)¶ Link Aggregation Control Protocol(LACP, IEEE 802.1AX) header encoder/decoder class.
http://standards.ieee.org/getieee802/download/802.1AX-2008.pdf
LACPDU format
LACPDU structure
Octets
Subtype = LACP
1
Version Number
1
TLV Actor
TLV_type = Actor Information
1
Actor_Information_Length = 20
1
Actor_System_Priority
2
Actor_System
6
Actor_Key
2
Actor_Port_Priority
2
Actor_Port
2
Actor_State
1
Reserved
3
TLV Partner
TLV_type = Partner Information
1
Partner_Information_Length = 20
1
Partner_System_Priority
2
Partner_System
6
Partner_Key
2
Partner_Port_Priority
2
Partner_Port
2
Partner_State
1
Reserved
3
TLV Collector
TLV_type = Collector Information
1
Collector_Information_Length = 16
1
Collector_Max_Delay
2
Reserved
12
TLV Terminator
TLV_type = Terminator
1
Terminator_Length = 0
1
Reserved
50
Terminator information uses a length value of 0 (0x00).
- NOTE--The use of a Terminator_Length of 0 is intentional.
In TLV encoding schemes it is common practice for the terminator encoding to be 0 both for the type and the length.
Actor_State and Partner_State encoded as individual bits within a single octet as follows:
7
6
5
4
3
2
1
0
EXPR
DFLT
DIST
CLCT
SYNC
AGGR
TMO
ACT
- ACT
bit 0. about the activity control value with regard to this link.
- TMO
bit 1. about the timeout control value with regard to this link.
- AGGR
bit 2. about how the system regards this link from the point of view of the aggregation.
- SYNC
bit 3. about how the system regards this link from the point of view of the synchronization.
- CLCT
bit 4. about collecting of incoming frames.
- DIST
bit 5. about distributing of outgoing frames.
- DFLT
bit 6. about the opposite system information which the system use.
- EXPR
bit 7. about the expire state of the system.
An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.
Attribute
Description
version
LACP version. This parameter must be set to LACP_VERSION_NUMBER(i.e. 1).
actor_system_priority
The priority assigned to this System.
actor_system
The Actor's System ID, encoded as a MAC address.
actor_key
The operational Key value assigned to the port by the Actor.
actor_port_priority
The priority assigned to this port.
actor_port
The port number assigned to the port by the Actor.
actor_state_activity
about the activity control value with regard to this link.
LACP_STATE_ACTIVE(1)
LACP_STATE_PASSIVE(0)
actor_state_timeout
about the timeout control value with regard to this link.
LACP_STATE_SHORT_TIMEOUT(1)
LACP_STATE_LONG_TIMEOUT(0)
actor_state_aggregation
about how the system regards this link from the point of view of the aggregation.
LACP_STATE_AGGREGATEABLE(1)
LACP_STATE_INDIVIDUAL(0)
actor_state_synchronization
about how the system regards this link from the point of view of the synchronization.
LACP_STATE_IN_SYNC(1)
LACP_STATE_OUT_OF_SYNC(0)
actor_state_collecting
about collecting of incoming frames.
LACP_STATE_COLLECTING_ENABLED(1)
LACP_STATE_COLLECTING_DISABLED(0)
actor_state_distributing
about distributing of outgoing frames.
LACP_STATE_DISTRIBUTING_ENABLED(1)
LACP_STATE_DISTRIBUTING_DISABLED(0)
actor_state_defaulted
about the Partner information which the the Actor use.
LACP_STATE_DEFAULTED_PARTNER(1)
LACP_STATE_OPERATIONAL_PARTNER(0)
actor_state_expired
about the state of the Actor.
LACP_STATE_EXPIRED(1)
LACP_STATE_NOT_EXPIRED(0)
partner_system_priority
The priority assigned to the Partner System.
partner_system
The Partner's System ID, encoded as a MAC address.
partner_key
The operational Key value assigned to the port by the Partner.
partner_port_priority
The priority assigned to this port by the Partner.
partner_port
The port number assigned to the port by the Partner.
partner_state_activity
See actor_state_activity.
partner_state_timeout
See actor_state_timeout.
partner_state_aggregation
partner_state_synchronization
partner_state_collecting
partner_state_distributing
partner_state_defaulted
partner_state_expired
See actor_state_expired.
collector_max_delay
the maximum time that the Frame Collector may delay.
-
classmethod
parser
(buf)¶ Decode a protocol header.
This method is used only when decoding a packet.
Decode a protocol header at offset 0 in bytearray buf. Returns the following three objects.
An object to describe the decoded header.
A packet_base.PacketBase subclass appropriate for the rest of the packet. None when the rest of the packet should be considered as raw payload.
The rest of packet.
-
serialize
(payload, prev)¶ Encode a protocol header.
This method is used only when encoding a packet.
Encode a protocol header. Returns a bytearray which contains the header.
payload is the rest of the packet which will immediately follow this header.
prev is a packet_base.PacketBase subclass for the outer protocol header. prev is None if the current header is the outer-most. For example, prev is ipv4 or ipv6 for tcp.serialize.
-
class
os_ken.lib.packet.slow.
slow
¶ Slow Protocol header decoder class. This class has only the parser method.
http://standards.ieee.org/getieee802/download/802.3-2012_section5.pdf
Slow Protocols Subtypes
Subtype Value
Protocol Name
0
Unused - Illegal Value
1
Link Aggregation Control Protocol(LACP)
2
Link Aggregation - Marker Protocol
3
Operations, Administration, and Maintenance(OAM)
4 - 9
Reserved for future use
10
Organization Specific Slow Protocol(OSSP)
11 - 255
Unused - Illegal values
-
classmethod
parser
(buf)¶ Decode a protocol header.
This method is used only when decoding a packet.
Decode a protocol header at offset 0 in bytearray buf. Returns the following three objects.
An object to describe the decoded header.
A packet_base.PacketBase subclass appropriate for the rest of the packet. None when the rest of the packet should be considered as raw payload.
The rest of packet.
-
classmethod