8.3.2.3. Port
This module contains the L47 port classes.
The Xena L47 test execution engine has seven states: off
, prepare
, prepare_rdy
, prerun
, prerun_rdy
, running
and stopped
. Traffic is generated in the prerun
and running states only, and configuration of parameters is only valid in state off
except for a few runtime options. Port traffic commands can be given with P4_TRAFFIC
and port state queried by P4_STATE
.
off
- default state. Entered from stopped or prepare onOFF
command. This is the only state that allows configuration commands.P_RESET
is also considered a configuration command. Upon entering off state, some internal ‘’house cleaning’’’ is done. For example: freeing TCP Connections, clearing test specific counters etc.prepare
- this state is entered from state off onPREPARE
command. Here internal data structures relevant for the test configuration are created.prepare_rdy
- entered automatically after activities in prepare have completed successfully.prepare_fail
- entered automatically from prepare, if an error occurs. An error could for example be failure to load a configured replay file.prerun
- entered fromprepare_ready
onPRERUN
command. If enabled, this is where ARP and NDP requests are sent.prerun_rdy
- entered automatically after activities in prerun have completed.running
- entered either fromprepare_ready
orprerun_ready
onON
command. This is where TCP connections are established, payload is generated and connections are closed again.stopping
- entered fromrunning
,prerun_ready
orprerun
onSTOP
command. Stops Rx/Tx traffic. In thestopping
state, post-test data are calculated and captured packets are saved to files.stopped
- entered automatically after activities instopping
are complete. This is where you can read post-test statistics and extract captured packets.
- class P4_APTITUDES[source]
Bases:
object
Returns the ports aptitudes - i.e. what is possible to configure on the port in terms of features and performance.
Current schema of the BSON document:
schema = { 'chassis': { 'type': 'int32', 'required': True, 'enum': ['CHASSIS_TYPE_UNKNOWN', 'CHASSIS_TYPE_APPLIANCE', 'CHASSIS_TYPE_BAY', 'CHASSIS_TYPE_COMPACT', 'CHASSIS_TYPE_SAFIRE'] }, 'tcp_udp': { 'type': 'document', 'required': True, 'properties': { 'cc': { 'type': 'int32', 'required': True, }, } }, 'tls': { 'type': 'document', 'required': True, 'properties': { 'supported': { 'type': 'bool', 'required': True, }, 'cc': { 'type': 'int32', 'required': True, } } } }
- class P4_ARP_CONFIG[source]
Bases:
object
Configure the value of the ARP request transmission rate, retransmission timeout and max. retries.
- get()[source]
Get the ARP configuration on the port.
- Returns:
the ARP configuration on the port
- Return type:
P4_ARP_CONFIG.GetDataAttr
- class P4_ARP_COUNTERS[source]
Bases:
object
Return total Port ARP protocol error statistics since last clear.
- class P4_ARP_RX_COUNTERS[source]
Bases:
object
Return total Port ARP protocol receive statistics since last clear.
- class P4_ARP_TX_COUNTERS[source]
Bases:
object
Return total Port ARP protocol transmit statistics since last clear.
- class P4_CAPTURE[source]
Bases:
object
Starts or stops packet capture on this port.
- get()[source]
Get packet capture state on this port.
- Returns:
packet capture state on this port
- Return type:
P4_CAPTURE.GetDataAttr
- set(on_off)[source]
Set packet capture state on this port.
- Parameters:
on_off (OnOff) – specifying whether to capture traffic on this port
- set_off()
Stop packet capture on this port.
- set_on()
Start packet capture on this port.
- class P4_CAPTURE_GET_FIRST[source]
Bases:
object
Returns the first captured frame on the port. Command is only valid when port is in state STOPPED
- class P4_CAPTURE_GET_NEXT[source]
Bases:
object
Returns the next captured frame on the port. Command is only valid when port is in state STOPPED
- class P4_CLEAR[source]
Bases:
object
Set the Port State to OFF and delete all configured Connection Groups for the port.
- class P4_DEV_NAME[source]
Bases:
object
Report the name of the device (NIC) on which the port is located.
- class P4_DHCP_CONFIG[source]
Bases:
object
Configure DHCP Client in order to aquire a pool of ip addresses.
- get()[source]
Get the DHCP configuration.
- Returns:
the DHCP configuration
- Return type:
P4_DHCP_CONFIG.GetDataAttr
- set(num_requests, retransmit_retries, timeout, base_hw_addr)[source]
Set the DHCP configuration.
- Parameters:
num_requests (unsigned int) – Number of DHCP requests - must be larger than 0
retransmit_retries (unsigned int) – maximum DHCP Request retransmission retries - must be larger than 0
timeout (unsigned int) – retransmission timeout [ms]
base_hw_addr (str) – base hw address for generating DHCP requests (the first 3 bytes is being used)
- class P4_DHCP_VLAN[source]
Bases:
object
Configure a set of VLAN tags for current DHCP Process.
- get()[source]
Get the DHCP VLAN configuration :return: Whether DHCP VLAN is configured or not :rtype: P4_DHCP_RESULT.GetDataAttr :return: A list of vlans :rtype: P4_DHCP_RESULT.GetDataAttr
- set(state, vlans)[source]
Set a list of VLANs for current DHCP Process, up to 8 TCIs can be defined. The order of the VLANs is like the following: ethernet/vlan0/vlan1/../vlanN/uppler_layer(like IPv4)
- Parameters:
state (DhcpVlanState) – Enable/Disable Vlan configuration
vlans (List[subtypes.VlanTag]) – specifying a list of VlanTag
- class P4_ETH_COUNTERS[source]
Bases:
object
Return total port Ethernet statistics since last clear.
- class P4_ETH_QUEUE_COUNTERS[source]
Bases:
object
Get the stats of the all active queues of the port
- get()[source]
Get the stats of the all active queues of the port :return: The current time (mSec since module restart) :rtype: P4_ETH_QUEUE_COUNTERS.GetDataAttr :return: Reference time (mSec for P4_TRAFFIC on) :rtype: P4_ETH_QUEUE_COUNTERS.GetDataAttr :return: Number of Active queues :rtype: P4_ETH_QUEUE_COUNTERS.GetDataAttr :return: A list that each contains stats of a queue :rtype: P4_ETH_QUEUE_COUNTERS.GetDataAttr
- class P4_ETH_RX_COUNTERS[source]
Bases:
object
Return total port Ethernet receive statistics since last clear.
- class P4_ETH_TX_COUNTERS[source]
Bases:
object
Return total port Ethernet transmit statistics since last clear.
- class P4_ICMP_COUNTERS[source]
Bases:
object
Return total Port ICMP protocol error statistics since last clear.
- class P4_ICMP_RX_COUNTERS[source]
Bases:
object
Return total Port ICMP protocol receive statistics since last clear.
- class P4_ICMP_TX_COUNTERS[source]
Bases:
object
Return total Port ICMP protocol transmit statistics since last clear.
- class P4_IPV4_COUNTERS[source]
Bases:
object
Return total Port IPv4 protocol error statistics since last clear.
- class P4_IPV4_RX_COUNTERS[source]
Bases:
object
Return total Port IPv4 protocol receive statistics since last clear.
- class P4_IPV4_TX_COUNTERS[source]
Bases:
object
Return total Port IPv4 protocol transmit statistics since last clear.
- class P4_IPV6_COUNTERS[source]
Bases:
object
Return total Port IPv6 protocol error statistics since last clear.
- class P4_IPV6_RX_COUNTERS[source]
Bases:
object
Return total Port IPv6 protocol receive statistics since last clear.
- class P4_IPV6_TX_COUNTERS[source]
Bases:
object
Return total Port IPv6 protocol transmit statistics since last clear.
- class P4_LICENSE_INFO[source]
Bases:
object
Returns the information on the license assigned to the port - if any.
- class P4_MAX_PACKET_RATE[source]
Bases:
object
Specifies the maximum number of packets per second allowed to be transmitted on the port.
- get()[source]
Get the maximum number of packets per second allowed to be transmitted on the port.
- Returns:
the maximum number of packets per second allowed to be transmitted on the port.
- Return type:
P4_MAX_PACKET_RATE.GetDataAttr
- set(mode, rate, time_window)[source]
Set the maximum number of packets per second allowed to be transmitted on the port.
- Parameters:
mode (AutoOrManual) – specifies the mode of the max. pps mechanism
rate (int) – maximum number of packets per second to transmit on this port
time_window (int) – time window [us] to measure the pps rate
- set_automatic(rate, time_window)
Set port max packet rate mode to Automatic.
- set_manual(rate, time_window)
Set port max packet rate mode to Manual.
- class P4_NDP_CONFIG[source]
Bases:
object
Configure the value of the NDP Neighbor Solicitation transmission rate, retransmission timeout and max. retries.
- get()[source]
Get the NDP configuration on the port.
- Returns:
the NDP configuration on the port
- Return type:
P4_NDP_CONFIG.GetDataAttr
- class P4_NDP_COUNTERS[source]
Bases:
object
Return total Port NDP protocol error statistics since last clear.
- class P4_NDP_RX_COUNTERS[source]
Bases:
object
Return total Port NDP protocol receive statistics since last clear.
- class P4_NDP_TX_COUNTERS[source]
Bases:
object
Return total Port NDP protocol transmit statistics since last clear.
- class P4_PORT_COUNTERS[source]
Bases:
object
Return total port transmit error statistics since last clear.
- class P4_PORT_RX_COUNTERS[source]
Bases:
object
Return total port receive statistics since last clear.
- class P4_PORT_TX_COUNTERS[source]
Bases:
object
Return total port transmit statistics since last clear.
- class P4_PORT_TYPE[source]
Bases:
object
Report the port type. The different possible ports are divided into types.
- class P4_RX_MTU[source]
Bases:
object
Return histogram over received (layer 3) packets sizes in 1 byte intervals. Each bin represents a packet size in the interval [576..1500] bytes.
- class P4_RX_PACKET_SIZE[source]
Bases:
object
Return a histogram over received (layer 2) packets sizes in 100 bytes intervals.
- class P4_SPEEDSELECTION[source]
Bases:
object
Sets the port speed. The selected speed must be one of the speeds supported by the port, which can be retrieved with P4_CAPABILITIES.
- get()[source]
Get the port speed mode.
- Returns:
the port speed mode.
- Return type:
P4_SPEEDSELECTION.GetDataAttr
- set(speed)[source]
Set the port speed mode.
- Parameters:
speed (L47PortSpeed) – specifies the speed mode of the port
- set_auto()
Set the port speed mode to Auto.
- set_f100g()
Set the port speed mode to 100 Gbit/s.
- set_f100m()
Set the port speed mode to 100 Mbit/s.
- set_f10g()
Set the port speed mode to 10 Gbit/s.
- set_f1g()
Set the port speed mode to 1 Gbit/s.
- set_f25g()
Set the port speed mode to 25 Gbit/s.
- set_f2_5g()
Set the port speed mode to 2.5 Gbit/s.
- set_f40g()
Set the port speed mode to 40 Gbit/s.
- set_f50g()
Set the port speed mode to 50 Gbit/s.
- set_f5g()
Set the port speed mode to 5 Gbit/s.
- class P4_STATE_STATUS[source]
Bases:
object
Returns status of the last port state change. If the port state has changed to PREPARE_FAIL, the status contains information about the reason for the fail. Currently the status will be “OK”in all other states.
- class P4_TCP_COUNTERS[source]
Bases:
object
Return total Port TCP protocol error statistics since last clear.
- class P4_TCP_RX_COUNTERS[source]
Bases:
object
Return total Port TCP protocol receive statistics since last clear.
- class P4_TCP_TX_COUNTERS[source]
Bases:
object
Return total Port TCP protocol transmit statistics since last clear.
- class P4_TRAFFIC[source]
Bases:
object
Gives a traffic state command to a L47 port.
- set(traffic_state)[source]
Set L47 port traffic state.
- Parameters:
traffic_state (L47TrafficState) – the traffic state command issued to the port
- set_off()
Set L47 port traffic state to Off.
- set_on()
Set L47 port traffic state to On.
- set_prepare()
Set L47 port traffic state to Prepare.
- set_prerun()
Set L47 port traffic state to Prerun.
- set_stop()
Set L47 port traffic state to Stop.
- class P4_TX_MTU[source]
Bases:
object
Return histogram over transmitted (layer 3) packets sizes in 1 byte intervals. Each bin represents a packet size in the interval [576..1500] bytes.
- class P4_TX_PACKET_SIZE[source]
Bases:
object
Return histogram over transmitted (layer 2) packets sizes in 100 bytes intervals.
- class P4_UDP_COUNTERS[source]
Bases:
object
Return total Port UDP protocol error statistics since last clear.
- class P4_UDP_RX_COUNTERS[source]
Bases:
object
Return total Port UDP protocol receive statistics since last clear.
- class P4_UDP_TX_COUNTERS[source]
Bases:
object
Return total Port UDP protocol transmit statistics since last clear.
- class P4_VLAN_OFFLOAD[source]
Bases:
object
Specifies if 802.1Q VLAN tag should be inserted and stripped by the Ethernet device. If VLAN Offload is switched ON, VLAN tags will not be present in frames captured by the L47 Server.
- get()[source]
Get the VLAN offload status.
- Returns:
VLAN offload status
- Return type:
P4_VLAN_OFFLOAD.GetDataAttr
- set(offload)[source]
Set the VLAN offload state.
- Parameters:
offload (OnOff) – specifies if VLAN Offload is enabled
- set_off()
Disable VLAN offload.
- set_on()
Enable VLAN offload.