p_lldp_commands module
This module contains the L23 port classes (LLDP) that deal with basic information about, and configuration of L23 test ports. The L23 port command names all have the form P_LLDP_<xxx> and require a module index id and a port index id. In general, port commands cannot be changed while traffic is on. Additionally, every stream must be disabled before changing parameters that affect the bandwidth of the port.
Port Commands - LLDP
Port Commands - LLDP
- class P_LLDP_CLEAR[source]
Bases:
objectClear LLDP information for the specified target.
- clear_all()
Clear both LLDP statistics and neighbor information.
- clear_neighbor()
Clear LLDP neighbor information, but not LLDP statistics.
- clear_none()
Not clear LLDP stats or neighbors
- clear_stats()
Clear LLDP statistics, but not LLDP neighbor information.
- set(target)[source]
Set the LLDP clear target.
- Parameters:
target (LLDPClearTarget) – the LLDP clear target
- class P_LLDP_CONFIG[source]
Bases:
objectLLDP agent configuration for the port, including reinit delay, transmission interval, and transmission hold multiplier.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct- reinit_delay
Reinitialization delay in seconds. When a port is disabled, LLDP is disabled or the switch is rebooted, a LLDP shutdown frame is transmitted to the neighboring units, signaling that the LLDP information is not valid anymore. Tx Reinit controls the amount of seconds between the shutdown frame and a new LLDP initialization.
Default is 2, range is 1 to 10.
- tx_delay
Minimum time between LLDP frames in seconds. If some configuration is changed (for example, the IP address) a new LLDP frame is transmitted, but the time between the LLDP frames will always be at least the value of
tx_delayseconds.tx_delaycannot be larger than 1/4 of thetx_intervalvalue.Valid values are restricted to 1 - 8192 seconds.
- tx_hold_multiplier
Transmission hold multiplier. The number of times the transmission interval is multiplied to determine the hold time for the LLDP packet. It is also used to determine the value of TTL that is carried in LLDP frames transmitted the port.
Default is 4, range is 1 to 100.
- tx_interval
Transmission interval in seconds. This variable defines the time interval in seconds between transmissions during normal transmission periods.
Default is 30, range is 1 to 3600.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- reinit_delay
Reinitialization delay in seconds. When a port is disabled, LLDP is disabled or the switch is rebooted, a LLDP shutdown frame is transmitted to the neighboring units, signaling that the LLDP information is not valid anymore. Tx Reinit controls the amount of seconds between the shutdown frame and a new LLDP initialization.
Default is 2, range is 1 to 10.
- tx_delay
Minimum time between LLDP frames in seconds. If some configuration is changed (for example, the IP address) a new LLDP frame is transmitted, but the time between the LLDP frames will always be at least the value of
tx_delayseconds.tx_delaycannot be larger than 1/4 of thetx_intervalvalue.Valid values are restricted to 1 - 8192 seconds.
- tx_hold_multiplier
Transmission hold multiplier. The number of times the transmission interval is multiplied to determine the hold time for the LLDP packet. It is also used to determine the value of TTL that is carried in LLDP frames transmitted the port.
Default is 4, range is 1 to 100.
- tx_interval
Transmission interval in seconds. This variable defines the time interval in seconds between transmissions during normal transmission periods.
Default is 30, range is 1 to 3600.
- get()[source]
Get the LLDP configuration for the port.
- Returns:
the LLDP configuration for the port
- Return type:
- class P_LLDP_DATA[source]
Bases:
objectConfigures the LLDPDU (LLDP Data Unit) for a specified LLDP agent on the port.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct- data_unit
LLDPDU in hexadecimal string format.
- class P_LLDP_HEADER[source]
Bases:
objectConfigures the LLDP header (DMAC, SMAC, EtherType) for a specified LLDP agent on the port.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct- header
LLDP frame header in hexadecimal string format. The header includes DMAC, SMAC, and Ethertype.
The default DMAC is the MAC address of the test port. If the port MAC address is changed, the default DMAC will also be updated to match the new port MAC address.
The default SMAC is Nearest Bridge MAC address,
0x0180C200000E, as specified in IEEE 802.3-2018.The default Ethertype is
0x88CCfor LLDP frames, as specified in IEEE 802.3-2018.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- header
LLDP frame header in hexadecimal string format. The header includes DMAC, SMAC, and Ethertype.
The default DMAC is the MAC address of the test port. If the port MAC address is changed, the default DMAC will also be updated to match the new port MAC address.
The default SMAC is Nearest Bridge MAC address,
0x0180C200000E, as specified in IEEE 802.3-2018.The default Ethertype is
0x88CCfor LLDP frames, as specified in IEEE 802.3-2018.
- class P_LLDP_INDICES[source]
Bases:
objectCreate multiple LLDP agents or query the existing LLDP agents on the port.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct- lldp_agent_indices
List of LLDP agent indices on the port. Each index ranges from 0 to 7, and a maximum of 8 LLDP agents can be created on the port. The integers do not have to be consecutive. If the list is empty, it indicates that there are no LLDP agents on the port.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- lldp_agent_indices
List of LLDP agent indices on the port. Each index ranges from 0 to 7, and a maximum of 8 LLDP agents can be created on the port. The integers do not have to be consecutive. If the list is empty, it indicates that there are no LLDP agents on the port.
- class P_LLDP_NEIGHBORS[source]
Bases:
objectDisplays LLDP neighbors discovered by the port.
- class P_LLDP_OPMODE[source]
Bases:
objectThis configures the LLDP operational mode for the port.
- get()[source]
Get the LLDP operational mode of the port.
- Returns:
the LLDP operational mode of the port
- Return type:
- set(op_mode)[source]
Set the LLDP operational mode of the port.
- Parameters:
op_mode (LLDPOpMode) – the LLDP operational mode of the port
- set_disable()
Disable LLDP on the port. The port will not transmit LLDP frames, and any received LLDP frames will be discarded.
- set_rx_only()
Enable LLDP reception only. The port will not transmit LLDP frames, but it will process any received LLDP frames and learn neighbors.
- set_tx_only()
Enable LLDP transmission only. The port will transmit LLDP frames, but any received LLDP frames will be discarded.
- set_tx_rx()
Enable both LLDP transmission and reception on the port. The port will transmit LLDP frames, and it will also process any received LLDP frames and learn neighbors.
- class P_LLDP_STATS[source]
Bases:
objectDisplays LLDP interface statistics for the port (all agents on the port combined).
- class GetDataAttr[source]
Bases:
ResponseBodyStruct- rx_aged_out_count
Number of aged out. This counter provides a count of the times that a neighbor’s information has been deleted due to TTL expiration.
- rx_frame_count
Number of LLDP frames received.
- rx_frame_discard_count
Number of LLDP frames discarded. LLDP frames that contain detectable errors in the first three mandatory TLVs are discarded.
- rx_tlv_discarded
Number of TLVs discarded. Optional TLVs that contain detectable errors are discarded.
- rx_tlv_unrecognized
Number of unrecognized TLVs received. An unrecognized TLV is referred to as the TLV whose type value is in the range of reserved TLV types. An unrecognized TLV may be a basic management TLV from a later LLDP version.
- tx_frame_count
Number of LLDP frames transmitted.