PTP Functions¶
sth::emulation_ptp_config¶
Purpose¶
The sth::emulation_ptp_config command configures Precision Time Protocol (PTP) master and slave over UDP over IPv4/IPv6 or over Ethernet emulation for a given port.
PTP, known officially as IEEE 1588v2, is a high-precision time protocol for synchronization used in measurement and control systems residing on a local area network. It provides synchronous communications in an asynchronous environment by allowing heterogeneous systems that include clocks of various precision, resolution, and stability to synchronize to a grandmaster clock at the nanosecond level.
Synopsis¶
Note
- M indicates that the argument is Mandatory .
- S indicates the argument is for
scaling
scenarios.
sth::emulation_ptp_config [-mode {create|activate|delete|enable|disable|modify|enable_all|disable_all} M] [-port_handle <port_handle>] [-handle <ptp_device_handle>] [-device_type {ptpSlave|ptpMaster}] [-transport_type {ethernet_ii|ipv4|ipv6}] [-count <integer>] [-name <name>] [-encapsulation {ethernetii|llc_snap|vc_mux|ethernetii_llc_snap|ethernetii_vc_mux}] [-vlan_id1 <0 - 4095>] [-vlan_ether_type1 {0x8100|0x88A8|0x9100|0x9200}] [-vlan_id_mode1 {fixed|increment}] [-vlan_id_step1 <0-4095>] [-vlan_id_repeat1 <0 - 4095>] [-vlan_priority1 <0-7>] [-vlan_id2 <0 - 4095>] [-vlan_ether_type2 {0x8100|0x88A8|0x9100|0x9200}] [-vlan_id_mode2 {fixed|increment}] [-vlan_id_step2 <0 - 4095>] [-vlan_id_repeat2 <0 - 4095>] [-vlan_priority2 <0-7>] [-local_mac_addr <aa:bb:cc:dd:ee:ff>] [-local_mac_addr_step <aa:bb:cc:dd:ee:ff>] [-local_mac_addr_repeat <integer>] [-local_ip_addr <a.b.c.d>] [-local_ip_addr_step <a.b.c.d>] [-local_ip_addr_repeat <integer>] [-local_ip_prefix_len <0-32>] [-local_ipv6_addr <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-local_ipv6_addr_step <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-local_ipv6_addr_repeat <integer>] [-local_ipv6_prefix_len <0-128>] [-remote_ip_addr <a.b.c.d>] [-remote_ip_addr_step <a.b.c.d>] [-remote_ipv6_addr <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-remote_ipv6_addr_step <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-ptp_session_mode {unicast|multicast}] [-ipv4_priority {tos|diff-serv}] [-ip_tos_field <0x0 - 0xFF>] [-tos_precedence {routine|priority|immediate|flash|flash-override|critic-ecp| internet-control|network-control}] [-tos_delay {normal|low}] [-tos_throughput {normal|high}] [-tos_reliability {normal|high}] [-tos_monetary_cost {normal|minimize}] [-tos_unused <0x0-0xF>] [-diff_default <0-255>] [-diff_class <0-7>] [-diff_assured_forwarding {class1-low-drop| class1-medium-drop|class1-high-drop| class2-low-drop|class2-medium-drop|class2-high-drop| class3-low-drop|class3-medium-drop|class3-high-drop| class4-low-drop|class4-medium-drop|class4-high-drop}] [-diff_explicit_forwarding <0-63>] [-diff_ecn {ecn-capable-transport1|ecn-capable-transport0| non-ecn-capable-transport|congestion}] [-ptp_domain_number <0-255>] [-ptp_port_number <0-65535>] [-ptp_clock_id <hexadecimal | colon seperated value>] [-ptp_clock_id_mode {increment|list}] [-ptp_clock_id_step <hexadecimal | colon seperated value>] [-ptp_clock_id_repeat <integer>] [-master_clock_class <0-255>] [-master_clock_priority1 <0-255>] [-master_clock_priority2 <0-255>] [-time_source {atomic-clock|gps|terrestrial-radio|ptp|ntp| handset|other|internal-oscillator|ptp-profile}] [-announce_message_enable {0|1}] [-log_announce_message_interval <-127-127>] [-announce_receipt_timeout <3-20>] [-sync_enable {0|1}] [-sync_two_step_flag { on }] [-log_sync_message_interval <-127-127>] [-path_delay_mechanism {end-to-end }] [-delay_request_enable {0|1}] [-log_minimum_delay_request_interval <-127-127>] [-tx_crc_error_perc <0-100>] [-tx_time_stamp_error_perc <0-100>] [-tx_delay_resp_dropped_perc <0-100>] [-tx_followup_dropped_perc <0-100>] [-enable_correction {0|1}] [-sync_correction <integer>] [-followup_correction <integer>] [-delay_request_correction <integer>] [-delay_response_correction <integer>] [-ptp_scale_mode {normal|gen_tx_no_results}] [-clock_accuracy {local_clock_accuracy|less_025_0ns|less_100_0ns|less_250_0ns| less_001_0us|less_002_5us|less_010_0us|less_025_0us| less_100_0us|less_250_0us|less_001_0ms|less_002_5ms| less_010_0ms|less_025_0ms|less_100_0ms|less_250_0ms| less_001_0s|less_010_0s|greater_010_0s}] [-custom_clock_accuracy <0-255>] [-enable_unicast_negotiation {true|false}] [-frequency_traceable {true|false}] [-leap_flag {leap59|leap61|none}] [-master_clock_selection_method {none|bmca}] [-messaging_mode {multicast|unicast|mixed}] [-multicast_mac {default_mac|primary_mac|pdelay_mac}] [-offset_scaled_log_variance <0-65535>] [-time_traceable {true|false}] [-ptp_ttl <1-255>] [-unicast_master_port_ipv4 <a.b.c.d>] [-unicast_master_port_ipv6 <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-use_custom_clock_accuracy {true|false}] [-use_partial_block_state {true|false}] [-utc_offset <1-255>] [-vci <0-65535>] [-vci_step <0-65535>] [-vpi <0-255>] [-vpi_step <0-255>] [-ptp_domain_number_step <0-255>] [-encap {udp_ipv4|udp_ipv6|ethernet}] [-master_clock_priority1_step <0-255>] [-master_clock_priority2_step <0-255>] [-ptp_profile {default|ieee1588v2_smpte|ieee1588v2_aes67|ieee1588v2_enterprise}] [-unicast_ipv4_addr_type {unicast_ip_list|unicast_ip_increment}] [-unicast_ipv6_addr_type {unicast_ip_list|unicast_ip_increment}] [-unicast_master_port_ipv4_addr_count <integer>] [-unicast_master_port_ipv4_port_step <a.b.c.d>] [-unicast_master_port_ipv4_start <a.b.c.d>] [-unicast_master_port_ipv4_step <a.b.c.d>] [-unicast_master_port_ipv6_addr_count <integer>] [-unicast_master_port_ipv6_port_step <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-unicast_master_port_ipv6_start <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-unicast_master_port_ipv6_step <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-expand {true|false} S]
Arguments¶
-
-mode
¶
Specifies the action to perform on the port (-port_handle) or on the device (-handle). This argument is Mandatory . Possible values are described below:
create - Creates a new PTP device on the port specified by -port_handle. activate - Used for ``Scaling`` scenarios. 1. Enables PTP devices and configures PTP parameters for the devices returned from interface_config() or emulation_device_config(wizard). Requires param_handle value as the input to the -handle option. 2. Creates devices and enables PTP protocol. Requires -port_handle and -block_mode options. .. note:: 1. When -handle is provided for the create mode, the following options will be obsoleted:: -count -mac_address_start -local_ip_addr -local_addr_step -netmask -local_ipv6_addr -next_hop_ip -next_hop_ip_step -local_router_id_enable -local_router_id -local_router_id_step -affiliated_router_target -vci -vci_step -vlan_cfi -vlan_id -vlan_id_mode -vlan_id_step -vlan_user_priority -vpi -vpi_step -tunnel_handle -vlan_outer_id -vlan_outer_id_mode -vlan_outer_id_step -vlan_outer_user_priority 2. For -mode activate, the following set of options are valid:: When -handle option is provided:: -announce_receipt_timeout -ptp_clock_id -ptp_clock_id_step -ptp_domain_number -ptp_domain_number_step -path_delay_mechanism -enable_unicast_negotiation -encap -log_announce_message_interval -log_minimum_delay_request_interval -log_sync_message_interval -messaging_mode -multicast_mac -master_clock_priority1 -master_clock_priority1_step -master_clock_priority2 -master_clock_priority2_step -ptp_port_number -ptp_profile -device_type -sync_two_step_flag -unicast_ipv4_addr_type -unicast_ipv6_addr_type -unicast_master_port_ipv4 -unicast_master_port_ipv6 -unicast_master_port_ipv4_addr_count -unicast_master_port_ipv4_port_step -unicast_master_port_ipv4_start -unicast_master_port_ipv4_step -unicast_master_port_ipv6_addr_count -unicast_master_port_ipv6_port_step -unicast_master_port_ipv6_start -unicast_master_port_ipv6_step When -port_handle and -block_mode options are provided, requires following options along with the above specified options. -block_mode -block_mode_index -count_per_block -count_block_per_port -mac_addr -mac_addr_step -mac_addr_step_per_port -mac_addr_step_per_vlan -ip_step_per_port -ip_step_per_vlan -intf_ipv6_prefix_len -ipv6_step_per_port -ipv6_step_per_vlan -link_local_ipv6_step_per_port -link_local_ipv6_step_per_vlan -name -vlan_id -vlan_id_step -vlan_user_pri -vlan_id_count -vlan_id_repeat_count -vlan_id_stack_count -vlan_tpid -vlan_cfi -vlan_outer_id -vlan_outer_id_step -vlan_outer_id_count -vlan_outer_user_pri -vlan_outer_id_repeat_count -vlan_outer_tpid -vlan_outer_cfi -qinq_incr_mode -vlan_outer_id_count -vlan_outer_user_pri -intf_prefix_len -router_id -router_id_step -link_local_ipv6_prefix_len -router_id_ipv6 -router_id_ipv6_step -link_local_ipv6_addr -link_local_ipv6_addr_step -gateway_ipv6_addr -gateway_ipv6_addr_step -intf_ipv6_addr -intf_ipv6_addr_step .. note:: Please refer to the emulation_device_config documentation. modify - Modifies the PTP device specified by -handle. delete - Deletes the PTP device specified by -handle. enable_all - Activates all the PTP devices on the port specified by -port_handle. disable_all - Deactivates all the PTP devices on the port specified by -port_handle. enable - Active the specific PTP device specified by -handle. disable - Deactivates the specific PTP device specified by -handle.
-
-port_handle
¶
Defines the port on which the PTP emulation will be created. The port handle is returned from the
sth::connect
function. This parameter is Mandatory for the create, the enable_all, and the disable_all mode.
-
-handle
¶
Specifies the handle of the created PTP device. This argument is Mandatory for the modify, the enable, the disable or the delete mode. For the modify mode, you can specify only one handle; For the delete, the enable, or the disable mode, you can specify a list of handles.
-
-device_type
¶
Specifies the port role of the PTP emulation. Possible values are described below:
ptpMaster - The PTP emulation is a master port that transits the synchronous time. This is the default. ptpSlave - The PTP emulation is a slave port that receives the synchronous time only.
-
-transport_type
¶
Defines the protocol layer that carries the PTP packets. This argument is Mandatory for the create mode. Possible values are described below:
ethernet_ii - The PTP protocol will transport directly over Ethernet frames. ipv4 - The PTP protocol will transport over User Datagram Protocol (UDP) over IPv4 encapsulation. ipv6 - The PTP protocol will transport over UDP over IPv6 encapsulation.
Note
This argument determines the encapsulation used by PTP emulation as well as the scope of IP address parameters. For example, if transport_type is set to ipv4, parameters to configure the IPv4 address will take effect;if -transport_type is set to ethernet_ii, IP address setting parameters will not take effect.
-
-count
¶
Specifies the number of PTP emulations to create on the port specified by the -port_handle argument. This argument is available only in the create mode. The default value is 1.
-
-name
¶
Defines the name of the PTP device.
-
-encapsulation
¶
Specifies the Layer2 framing mode for encapsulated devices. The default is ETHERNETII. Possible values are described below:
ETHERNETII - Specifies the Layer 2 encapsulation to be Ethernet II frame. This option is available for Ethernet cards. VC_MUX - Specifies the ATM encapsulation to be VC Multiplexed. Virtual Circuit Multiplexing (VC_MUX) is one of the two mechanisms or identifying the protocol carried in ATM Adaptation Layer5 (AAL5) frame. This option is available for ATM cards. LLC_SNAP - Specifies the ATM encapsulation to be LLC Encapsulated. LLC_SNAP is the other mechanism for identifying the protocol carried in AAL5 frame. This option is available for ATM cards. ETHERNETII_LLC_SNAP - Specifies the Layer 2 encapsulation to be Ethernet over VC Multiplexed ATM which will encapsulate the Ethernet packets inside AAL5 LLC_SNAP frames. This option is available for ATM cards. ETHERNETII_VC_MUX - Specifies the Layer 2 encapsulation to be Ethernet over LLC Encapsulated ATM which will encapsulate the Ethernet packets inside AAL5 VC_MUX frames.This option is available for ATM cards.
Note
When -encapsulation is set to ETHERNETII, ETHERNETII_LLC_SNAP, or ETHERNETII_VC_MUX, you can use -vlan_id1 and related VLAN arguments to configure VLAN interface, or you can use -vlan_id1, -vlan_id2 and related VLAN arguments to configure Q-in-Q interface. See the -vlan_id1 and the -vlan_id2 arguments description for more information.
-
-vlan_id1
¶
Specifies the VLAN ID of the first VLAN for the Ethernet field. When multiple VLAN tags are configured by configuring -vlan_id1 and -vlan_id2 both, the first VLAN (-vlan_id1) is the outer VLAN, also known as the Service Provider VLAN. Possible values range from 0 to 4095. The default value is 100. The Ethernet VLAN encapsulation will be enabled, when you specify -vlan_id1 and leave -vlan_id2 unspecified. The Ethernet Q-in-Q encapsulation will be enabled, when you specify both -vlan_id1 and -vlan_id2.In this case, -vlan_id1 is used as the outer VLAN and -vlan_id2 the inner VLAN. This argument is available when -encapsulation is set to ETHERNETII, ETHERNETII_LLC_SNAP, or ETHERNETII_VC_MUX.
-
-vlan_ether_type1
¶
Specifies the VLAN Ethernet type for the Ethernet field. When vlan_id1 is specified, you can use this argument. Possible values are described below:
0x8100 - Specifies EtherType value 0x8100, a value of 8100 in hexadecimal. When a frame has the VLAN EtherType equal to 8100, this frame carries the tag IEEE 802.1Q. This is the default. 0x88A8 - Specifies EtherType value 0x88a8, a value of 88a8 in hexadecimal. When a frame has the VLAN EtherType equal to 88A8, this frame carries the tag EEE 802.1ad. 0x9100 - Specifies EtherType value 0x9100, a value of 9100 in hexadecimal. When a frame has the VLAN EtherType equal to 9100, this frame carries the tag IEEE standard IEEE 802.1Q-1998. 0x9200 - Specifies EtherType value 0x9200, a value of 9200 in hexadecimal.
-
-vlan_id_mode1
¶
Specifies the VLAN ID assignment for multiple PTP emulations when count is greater than 1.Possible values are fixed and increment. You can use this argument when -vlan_id1 is specified. The default value is increment. If you set this argument to “increment”, then you must also specify the -vlan_id_step1 argument to indicate the step size.
-
-vlan_id_step1
¶
Defines the value by which the VLAN IDs are to be incremented. Possible values range from 0 to 4095. The default value is 1.You can use this argument when -vlan_id_mode is set to increment.
-
-vlan_id_repeat1
¶
Specifies the number of times a VLAN ID is to be repeated before the step specified by the -vlan_id_step1 argument is applied to the VLAN ID specified by -vlan_id1. Possible values range from 0 to 4095. The default value is 0. You can use this argument when the -vlan_id_mode is set to increment.
-
-vlan_priority1
¶
Specifies the priority of the first VLAN under the Ethernet header. Possible values range from 0 (highest) to 7 (lowest). The default value is 0. You can use this argument only when -vlan_id1 is specified.
-
-vlan_id2
¶
Specifies the VLAN ID of the second VLNA for the Ethernet field. When multiple VLAN tags are configured by configuring -vlan_id1 and -vlan_id2 both, the second VLAN is the inner VLAN, also known as Customer VLAN. Possible values range from 0 to 4095. The default value is 100. You can use this argument when -vlan_id1 is specified and -encapsulation is set to ETHERNETII, ETHERNETII_LLC_SNAP, or ETHERNETII_VC_MUX.
-
-vlan_ether_type2
¶
Specifies the inner VLAN Ethernet type for the Ethernet field. When -vlan_id2 is specified, you can use this argument. Possible values are described below:
0x8100 - Specifies EtherType value 0x8100, a value of 8100 in hexadecimal. When a frame has the VLAN EtherType equal to 8100, this frame carries the tag IEEE 802.1Q. This is the default. 0x88A8 - Specifies EtherType value 0x88a8, a value of 88a8 in hexadecimal. When a frame has the VLAN EtherType equal to 88A8, this frame carries the tag IEEE 802.1ad. 0x9100 - Specifies EtherType value 0x9100, a value of 9100 in hexadecimal. When a frame has the VLAN EtherType equal to 9100, this frame carries the tag IEEE standard IEEE 802.1Q-1998. 0x9200 - Specifies EtherType value 0x9200, a value of 9200 in hexadecimal.
-
-vlan_id_mode2
¶
Determines whether the inner VLAN IDs are fixed or increment. Possible values are fixed and increment. You can use this argument when -vlan_id2 is specified. The default value is increment. If you set this argument to “increment”, then you must also specify the -vlan_id_step2 argument to indicate the step size.
-
-vlan_id_step2
¶
Defines the value by which the inner VLAN IDs are to be incremented. Possible values range from 0 to 4095. The default value is 1. You can use this argument -vlan_id_mode2 is set to increment.
-
-vlan_id_repeat2
¶
Specifies the number of times an inner VLAN ID is to be repeated before the step specified by the -vlan_id_step2 argument is applied to the VLAN ID specified by -vlan_id2. Possible values range from 0 to 4095. The default value is 0. You can use this argument only when you specify -vlan_id2 and the -vlan_id_mode2 argument is set to increment.
-
-vlan_priority2
¶
Specifies the priority of the inner VLAN under the Ethernet header. Possible values range from 0 (highest) to 7 (lowest). The default value is 0. You can use this argument only when -vlan_id2 is specified.
-
-local_mac_addr
¶
Specifies the starting MAC address. You can use this argument when -encapsulation is set to ETHERNETII, THERNETII_LLC_SNAP, or ETHERNETII_VC_MUX. The values must be in MAC address format.
-
-local_mac_addr_step
¶
Specifies the increment for the MAC address. The default value is 00:00:00:00:00:01. You can use this argument when -encapsulation is set to ETHERNETII, ETHERNETII_LLC_SNAP, or ETHERNETII_VC_MUX.
-
-local_mac_addr_repeat
¶
Specifies the number of times a MAC address is to be repeated before the step is applied to the MAC address. The default value is 0. You can use this argument when -encapsulation is set to ETHERNETII, ETHERNETII_LLC_SNAP, or ETHERNETII_VC_MUX.
-
-local_ip_addr
¶
Specifies the starting IPv4 address. The values must be in IPv4 format. This argument is available when -transport_type is set to ipv4.
-
-local_ip_addr_step
¶
Specifies the IPv4 address step for increment. The values must be in IPv4 format. The default value is 0.0.0.1. This argument is available when -transport_type is set to ipv4.
-
-local_ip_addr_repeat
¶
Specifies the number of times an IPv4 address is to be repeated before the step specified by the -local_ip_addr_step argument is applied to the MAC address specified by -local_ip_addr. The default value is 0. This argument is available when -transport_type is set to ipv4.
-
-local_ip_prefix_len
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the prefix length on the emulated device. Possible values range from 0 to 32. The default value is 24. This argument is available when -transport_type is set to ipv4.
-
-local_ipv6_addr
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the starting IPv6 address. The values must be in IPv6 format. This argument is available when -transport_type is set to ipv6.
-
-local_ipv6_addr_step
¶
Spirent Extension (for Spirent HLTAPI only).
address step for increment. The values must be in IPv6. This argument is available when -transport_type is set to ipv6.
-
-local_ipv6_addr_repeat
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the number of times an IPv6 address is to be repeated before the step specified by the -local_ipv6_addr_step argument is applied to the MAC address specified by -local_ipv6_addr. The default value is 0. This argument is available when -transport_type is set to ipv6.
-
-local_ipv6_prefix_len
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the IPv6 prefix length on the emulated device. Possible values range from 0 to 128. The default value is 64.This argument is available when -transport_type is set to ipv6.
-
-remote_ip_addr
¶
Specifies the IPv4 address of the SUT. The values must be in IPv4 format. This argument is available when -transport_type is set to ipv4.
-
-remote_ip_addr_step
¶
Specifies the increment step for the SUT IPv4 address. The values must be in IPv4 format. The default is 0.0.0.0. This argument is available when -transport_type is set to ipv4.
-
-remote_ipv6_addr
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the IPv6 address of the SUT. The values must be in IPv6 format. This argument is available when -transport_type is set to ipv6.
-
-remote_ipv6_addr_step
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the increment step for the SUT IPv6 address. The values must be in IPv6 format. This argument is available when -transport_type is set to ipv6.
-
-ptp_session_mode
¶
Defines the type of the destination address. Possible values are describe below:
multicast - Sends multicast PTP messages to learnt or configured devices. This is the default. unicast - Sends unicast PTP messages to configured devices.
Note
The unicast is not supported by Spirent HLTAPI.
-
-ipv4_priority
¶
Specifies the service class of the Type of Service (TOS) field in an IPv4 header. You can configure different arguments when you choose different options for this argument. Possible values are:
tos - Type of service. TOS specifies a preference for how the datagram would be handled. This is the default. diff-serv - Differentiated services (DiffServ). Differentiated Services classify and manage network traffic and provide quality of service (QoS) guarantees on IP networks.
-
-ip_tos_field
¶
Configures the IPv4 header’s TOS bits. The values must be in hexadecimal format. Possible values range from 0x0 to 0xFF. The default value is 0x0. This argument is available when -ipv4_priority is set to tos. .. note:: When -tos_** and -ip_tos_field are configured at the same time, the priority of -ip_tos_field is higher.
-
-tos_precedence
¶
Configures the precedence of the IPv4 TOS field. It is an independent measurement of the datagram importance. Possible values are routine, priority, immediate, flash, flash-override, critic-ecp, internet-control, network-control, and internet-control. This argument is available when -ipv4_priority is set to tos. The default is internet-control.
-
-tos_delay
¶
Configures the delay of the IPv4 TOS field. This field indicates the importance of the prompt delivery for the datagram delivery. This argument is available when you specify -ipv4_priority tos. Possible values are described below:
normal - The importance of the prompt delivery is normal. This is the default. low - The importance of the prompt delivery is low.
-
-tos_throughput
¶
Configures the throughput of the IPv4 TOS field. This argument is available when you specify -ipv4_priority tos. This field indicates the importance of the high data rate for this datagram. Possible values are described below:
normal - The importance of high data rate is normal. This is the default. high - The importance of high data rate is high.
-
-tos_reliability
¶
Configures the reliability of the IPv4 TOS field. This field indicates the importance of a higher level effort to ensure delivery for this datagram. This argument is available when you specify -ipv4_priority tos. Possible values are described below:
normal - The importance of reliability is normal. This is the default. high - The importance of reliability is high.
-
-tos_monetary_cost
¶
Configures the monetary cost of the IPv4 TOS field. This argument is available when you specify -ipv4_priority tos. Possible values are described below:
normal - The importance is normal. This is the default. minimize - The importance is minimum.
-
-tos_unused
¶
Unused bits in the IPv4 TOS. This argument is available when you specify -ipv4_priority tos. The values must be in hexadecimal format. Possible values range from 0x0 to 0xF. The default value is 0x0.
-
-diff_default
¶
Defines the default value of the DiffServ bits. Possible values range from 0 to 255. This argument is available when you specify -ipv4_priority diff-serv. The values must be integers. When you specify the -diff_default argument and the -diff_* arguments at the same time, the -diff_* arguments will be ignored.
-
-diff_class
¶
Defines the diff-serviceclass type. Possible values range from 0 (class 0) to 7 (class 7). This argument is available when you specify -ipv4_priority diff-serv. This argument will be ignored when you specify -diff_assured_forwarding or -diff_explicit_forwarding.
-
-diff_assured_forwarding
¶
Defines the diff-service assured forwarding that gives the assurance of delivery under different conditions. Possible values are:
class1-low-drop, class1-medium-drop, class1-high-drop, class2-low-drop, class2-medium-drop, class2-high-drop, class3-low-drop, class3-medium-drop, class3-high-drop, class4-low-drop, class4-medium-drop, and class4-high-drop.
The assured forwarding defines the drop rate of three levels: low, medium, and high. “high drop” means higher drop rate. And the classes are used to define the measure of priority and proportional fairness. If congestion occurs between classes, the traffic in the higher class is given priority. This argument is available when you specify -ipv4_priority diff-serv. diff_ssured_forwarding and -diff_explicit_forwarding are mutually exclusive. You cannot specify the two arguments at the same time. When you specified -diff_assured_forwarding, diff_class will be ignored.
-
-diff_explicit_forwarding
¶
Defines the diff-service explicit forwarding behavior. Possible values range from 0 to 63. This argument is available when you specify -ipv4_priority diff-serv. You can refer to RFC 3246 for details. -diff_assured_forwarding and -diff_explicit_forwarding are mutually exclusive. You cannot specify the two arguments at the same time. When you specified -diff_explicit_forwarding, diff_class will be ignored.
-
-diff_ecn
¶
Defines the diff-service Explicit Congestion Notification (ECN). Possible values are described below:
ecn-capable-transport1 - The endpoints are ECN-capable. ecn-capable-transport0 - The endpoints are ECN-capable. non- ecn-capable-transport - packet is not using ECN. This is the default. congestion - Indicates there is congestion.
This argument is available when you specify -ipv4_priority diff-serv. You can refer to RFC 4774 for details.
-
-ptp_domain_number
¶
The number of PTP domains to use. The master and slave clocks must be in the same domain to be visible to each other for communication. Possible values range from 0 to 255. The default value is 0.
-
-ptp_port_number
¶
Defines the emulated Port Number. Possible values range from 0 to 65535. The default value is 1.
-
-ptp_clock_id
¶
Defines the clock identifier for the emulated clock. The maximum length for the clock ID is 16. The values of this argument must be hexadecimal or colon seperated value (ex: 00:00:00:01:02:03:11).
-
-ptp_clock_id_mode
¶
Identifies the way in which the clock IDs of the emulated clocks are generated. Possible values are described below:
increment - Indicates the clock IDs increments by the step specified in the ptp_clock_id_step.This is the default. list - Indicates the clock IDs are defines in a list. The clock IDs in the ist will be assigned to PTP devices in a round-robin fashion.
-
-ptp_clock_id_step
¶
Defines the value by which the clock IDs are to be incremented. The values of this argument must be hexadecimal or colon seperated value (ex: 00:00:00:01:02:03:11). The maximum length for the clock ID is 16. This argument is available when -ptp_clock_id_mode is set to increment.
-
-ptp_clock_id_repeat
¶
Specifies the number of times a clock ID is to be repeated before the step specified by the -ptp_clock_id_step argument is applied to the clock ID specified by -ptp_clock_id. The values must be integers. The default value is 0. This argument is available when ptp_clock_id_mode is set to increment.
-
-master_clock_class
¶
Defines the traceability of the time or the frequency distributed by the master clock. The values must be integers. Possible values range from 0 to 255. The default value is 248. This argument is only available when you specify -device_type ptpMaster.
-
-master_clock_priority1
¶
Sets the priority1 attribute of the master clock. The values must be integers. Possible values range from 0 to 255. The default value is 0. This argument is only available when you specify device_type ptpMaster.
-
-master_clock_priority2
¶
Sets the priority2 attribute of the master clock. The values must be integers. Possible values range from 0 to 255. The default value is 0. This argument is only available when you specify device_type ptpMaster.
-
-time_source
¶
Indicates the source of time used by the grandmaster clock. This argument is only available when you specify -device_type ptpMaster. The internal-oscillator is the default. Possible values are described below:
atomic-clock Indicates the device described below and the device that connected to such a device: The atomic-clock device is based on atomic resonance for frequency and calibrated against internal standards for frequency and time, if the PTP timescale is used. gps Indicates the device that synchronized to a satellite system that distribute time and frequency tied to international standards. terrestrial-radio Indicates the device that synchronized via any of the radio distribution systems that distribute time and frequency tied to international standards. ptp Indicates the device synchronized to a PTP-based source of time external to the domain. ntp Indicates the device synchronized via Network Time Protocol (NTP) or Simple Network Time Protocol (SNTP) to servers that distribute time and frequency tied to international standards. handset Indicates the device whose time has been set by means of a human interface based on observation of an international standards source of time to within the claimed clock accuracy. other Other source of time and/or frequency not covered by other values. internal-oscillator Defines the device whose frequency is not based on atomic resonance nor calibrated against international standards for frequency, and whose time is based on a free-running oscillator with epoch determined in an arbitrary or unknown manner. ptp-profile For use by alternate PTP profiles. reserved Reserved. This is not supported.
-
-announce_message_enable
¶
Enables or disables the transmission of Announce messages. Possible values are 0 (disable) and 1 (enable).The default value is 1. This argument is only available when you specify -device_type ptpMaster.
-
-log_announce_message_interval
¶
Indicates the log of the Announce message transmission interval, which is the mean time interval between the successive Announce messages. The values must be integers. Possible values range from -127 to 127. The default value is 0. You can use this argument when -device_type is set to ptpMaster and -announce_message_enable is set to 1.
Note
When you need to specify a negative value, you must encompass
the value by double quotation marks and braces, such as {“-5”} or “{-5}”. Other formats like “-5”, {-5} or -5 are not acceptable.
-
-announce_receipt_timeout
¶
The number of seconds that has to pass without receipt of an Announce message to time out. The values must be integers. Possible values range from 3 to 20. The default value is 3. You can use this argument when -device_type is set to ptpMaster and -announce_message_enable is set to 1.
-
-sync_enable
¶
Enables or disables the Sync message parameters.Possible values are 0 (disable) and 1 (enable). The default value is 1. You can use this argument when -device_type is set to ptpMaster.
-
-sync_two_step_flag
¶
Sets the behavior of Request_Response mechanism to two-step mode or one-step mode. Two-step mode provides time information using the combination of an Sync message and a subsequent Follow_up message. One-Step mode provides time information using a single Sync message. Possible values are described below:
on Turns on two-step synchronism mode. This is the default. auto This is not supported. off Turns on the one-step synchronism mode. This is not supported.
This argument is available when -device_type is set to ptpMaster and -sync_enable is set to 1.
-
-log_sync_message_interval
¶
Indicates the log of the Sync message transmission interval which is the mean time interval between the successive Sync messages. The values must be integers. Possible values range from -127 to 127. The default value is 0. You can use this argument when -device_type is set to ptpMaster and sync_enable is set to 1.
Note
When you need to specify a negative value, you must encompass
the value by double quotation marks and braces, such as {“-5”} or “{-5}”. Other formats like “-5”, {-5} or -5 are not acceptable.
-
-path_delay_mechanism
¶
Determines the path delay mechanism. Possible values are described below:
end-to-end - The port is configured to use the delay request-response mechanism. This is the default. peer-to-peer - Determines to use the peer delay mechanism.This is not supported.
-
-delay_request_enable
¶
Enables or disables the Delay_Req messages. Possible values are 0 (disable) and 1 (enable). The default value is 1. You can use this argument when you specify -path_delay_mechanism end-to-end and -device_type ptpSlave.
-
-log_minimum_delay_request_interval
¶
Enables or disables the log (base 2) of the interval between successive Delay_Req messages. Possible values range from -127 to 127. The default value is 0. You can use this argument when you specify -path_delay_mechanism end-to-end.
When you need to specify a negative value, you must encompass the value by double quotation marks and braces, such as {“-5”} or “{-5}”. Other formats like “-5”, {-5} or -5 are not acceptable.
-
-tx_crc_error_perc
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the percentage of frames to send with Cyclic Redundancy Check (CRC) errors. Possible values range from 0 to 100. The default value is 0.
-
-tx_time_stamp_error_perc
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the percentage of frames to send with time stamp errors. Possible values range from 0 to 100. The default value is 0.
-
-tx_delay_resp_dropped_perc
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the percentage of the Delay_Resp messages to drop. Possible values range from 0 to 100. The default value is 0.
-
-tx_followup_dropped_perc
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the percentage of the Follow_Up messages to drop. Possible values range from 0 to 100. The default value is 0.
-
-enable_correction
¶
Spirent Extension (for Spirent HLTAPI only).
Enables or disables the correction field. Possible values are 0 (disable) and 1 (enable). The default value is 0.
-
-sync_correction
¶
Spirent Extension (for Spirent HLTAPI only).
Configures values for the correction field for Sync messages. The default value is 0.
-
-followup_correction
¶
Spirent Extension (for Spirent HLTAPI only).
Configures values for the correction field for Follow_Up messages. The default value is 0.
-
-delay_request_correction
¶
Spirent Extension (for Spirent HLTAPI only).
Configures values for the correction field for Delay_Req messages. The default value is 0.
-
-ptp_scale_mode
¶
Specifies the performance level of the protocol. The default value is normal. Possible values are described below:
Value Description normal Normal performance, with all results gen_tx_no_results Improve scale performance by transmitting packets using the generator, and reducing results collected.
-
-clock_accuracy
¶
Specifies the accuracy of the clock using IEEE 1588 defined values. The default value is less_001_0us. Possible values are described below:
Value Description local_clock_accuracy 0 - Local clock accuracy less_025_0ns 0x20 - 25 nanoseconds less_100_0ns 0x21 - 100 nanoseconds less_250_0ns 0x22 - 250 nanoseconds less_001_0us 0x23 - 1 microsecond less_002_5us 0x24 - 2.5 microseconds less_010_0us 0x25 - 10 microseconds less_025_0us 0x26 - 25 microseconds less_100_0us 0x27 - 100 microseconds less_250_0us 0x28 - 250 microseconds less_001_0ms 0x29 - 1 millisecond less_002_5ms 0x2A - 2.5 milliseconds less_010_0ms 0x2B - 10 milliseconds less_025_0ms 0x2C - 25 milliseconds less_100_0ms 0x2D - 100 milliseconds less_250_0ms 0x2E - 250 milliseconds less_001_0s 0x2F - 1 second less_010_0s 0x30 - 10 seconds greater_010_0s 0x31 - More than 10 seconds
-
-custom_clock_accuracy
¶
Specifies the custom clock accuracy. Possible values range from 0-255. The default value is 35.
-
-enable_unicast_negotiation
¶
Determines whether to enable unicast negotiation. The default value is false.
-
-frequency_traceable
¶
Indicates the traceability of the frequency. The default value is false.
-
-leap_flag
¶
Specifies the value of leap flag. The default value is none. Possible values are described below:
Value Description leap59 The last minute of the current UTC day contains 59 seconds leap61 The last minute of the current UTC day contains 61 seconds none The last minute of the current UTC day contains 60 seconds
-
-master_clock_selection_method
¶
Specifies the method used for selecting master clock. Possible values are none and bmca. The default value is bmca.
-
-messaging_mode
¶
Specifies the type of messaging mode. The default value is multicast. Possible values are described below:
Value Description multicast All packets sent on Multicast address unicast All packets sent on Unicast address mixed Delay request and delay response sent on Unicast address, all other packets sent on multicast address
-
-multicast_mac
¶
Specifies the list of PTP multicast MAC addresses. The default value is default_mac. Possible values are described below:
Value Description default_mac Default MAC address as per IEEE spec primary_mac Primary MAC address pdelay_mac Pdelay MAC address
-
-offset_scaled_log_variance
¶
Specifies the variations of the clock from a linear time scale when it is not synchronized to another clock using the protocol. Possible values range from 1-65535. The default value is 65535.
-
-time_traceable
¶
Determines whether to indicate the traceability of time. The default value is false.
-
-ptp_ttl
¶
Specifies the time to live value for multicast packets. Possible values range from 1 to 255. The default value is 1.
-
-unicast_master_port_ipv4
¶
Specifies the list of IPv4 addresses for unicast master clocks. The default value is 192.0.1.0.
-
-unicast_master_port_ipv6
¶
Specifies the list of IPv6 addresses for unicast master clocks. The default value is 2000::1.
-
-use_custom_clock_accuracy
¶
Determines whether to use value of custom_clock_accuracy instead of clock_accuracy. The default value is false.
-
-use_partial_block_state
¶
Determines whether to use partial block state. The default value is false.
-
-utc_offset
¶
Specifies the difference from Coordinated Universal Time(UTC) in seconds. Possible values range from 1 to 255. The default value is 36.
-
-vci
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the VCI of the first ATM PVC pool. Possible values range from 0 to 65535. The default value is 32. This argument is available when you set -encapsulation to LLC_SNAP, VC_MUX, ETHERNETII_LLC_SNAP, and ETHERNETII_VC_MUX.
-
-vci_step
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the step size in which the VCI value is incremented. Possible values range from 0 to 65535. The default value is 0.
-
-vpi
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the VPI of the first ATM PVC pool (for an ATM connection). Possible values range from 0 to 255. The default value is 0. This argument is available when you set -encapsulation to LLC_SNAP, VC_MUX, ETHERNETII_LLC_SNAP, and ETHERNETII_VC_MUX.
-
-vpi_step
¶
Spirent Extension (for Spirent HLTAPI only).
Specifies the step size in which the VPI value is incremented. Possible values range from 0 to 255. The default value is 0.
-
-expand
¶
Spirent Extension (for Spirent HLTAPI only).
Determines whether to expand the specified PTP device parameters into emulated PTP device objects. It is used in
Scaling
test scenarios.When set to true, a list of emulated device handles (handle_list) with enabled PTP device configurations are created.
When set to false, only PTP parameters are configured with no handle returned.
-
-ptp_domain_number_step
¶
Specifies to increment the PTP Domain Number. Possible values range from 0 to 255. The default value is 0. Only applicable scale mode (-mode activate and -expand).
-
-encap
¶
Specifies to configure the encapsulation. Possible values are udp_ipv4, udp_ipv6 and ethernet. The default value is udp_ipv4. Only applicable scale mode (-mode activate and -expand).
-
-master_clock_priority1_step
¶
Specifies to increment the priority1 attribute value of the master clock. The values must be integers. Possible values range from 0 to 255. The default value is 0. Only applicable scale mode (-mode activate and -expand).
-
-master_clock_priority2_step
¶
Specifies to increment the priority2 attribute value of the master clock. The values must be integers. Possible values range from 0 to 255. The default value is 0. Only applicable for scale mode (-mode activate and -expand).
-
-ptp_profile
¶
Specifies to configure the PTP profile attribute type. Possible values are default, ieee1588v2_smpte, ieee1588v2_aes67 and ieee1588v2_enterprise. The default value is default.
-
-unicast_ipv4_addr_type
¶
Specifies the unicast IPv4 address type. Possible values are:
UNICAST_IP_LIST - Unicast IP type for both IPv4 and IPv6 master port address, list will be entered by the user UNICAST_IP_INCREMENT - Unicast IP type for both IPv4 and IPv6 master port address, list will be created based on start, step and count properties
The default value is UNICAST_IP_LIST. Only applicable scale mode (-mode activate and -expand).
-
-unicast_ipv6_addr_type
¶
Specifies the unicast IPv6 address type. Possible values are:
UNICAST_IP_LIST - Unicast IP type for both IPv4 and IPv6 master port address, list will be entered by the user UNICAST_IP_INCREMENT - Unicast IP type for both IPv4 and IPv6 master port address, list will be created based on start, step and count properties
The default value is UNICAST_IP_LIST. Only applicable scale mode (-mode activate and -expand).
-
-unicast_master_port_ipv4_addr_count
¶
Specifies to configure IPv4 address count, to generated unicast master port Ipv4 address list. The default value is 1. Only applicable scale mode (-mode activate and -expand).
-
-unicast_master_port_ipv4_port_step
¶
Specifies unicast Master Port IPv4 Address Port Step. If this is 0, devices on all the ports, will have same unicast IPv4 address list The default value is 0.0.0.0. Only applicable scale mode (-mode activate and -expand).
-
-unicast_master_port_ipv4_start
¶
Specifies IPv4 Starting Address, to generated unicast master port IPv4 address list. The default value is 192.0.1.0. Only applicable scale mode (-mode activate and -expand).
-
-unicast_master_port_ipv4_step
¶
Specifies IPv4 Address Step, to generated unicast master port IPv4 address list. The default value is 0.0.0.1. Only applicable scale mode (-mode activate and -expand).
-
-unicast_master_port_ipv6_addr_count
¶
Specifies IPv6 Address Count, to generated unicast master port IPv6 address list. The default value is 1. Only applicable scale mode (-mode activate and -expand).
-
-unicast_master_port_ipv6_port_step
¶
Specifies Unicast Master Port IPv6 Address Port Step. If this is 0, devices on all the ports, will have same unicast IPv6 address list. The default value is ::. Only applicable scale mode (-mode activate and -expand).
-
-unicast_master_port_ipv6_start
¶
Specifies IPv6 Starting Address, to generated unicast master port IPv6 address list The default value is 2000::1. Only applicable scale mode (-mode activate and -expand).
-
-unicast_master_port_ipv6_step
¶
Specifies IPv6 Address Step, to generated unicast master port IPv6 address list The default value is 2000::1. Only applicable scale mode (-mode activate and -expand).
Arguments Unsupported by Save as HLTAPI¶
The following Spirent HLTAPI arguments are currently not supported by the Save as HLTAPI function:
-diff_class
-diff_assured_forwarding
-diff_explicit_forwarding
-diff_ecn
-ptp_clock_id_repeat
-tos_precedence
-tos_delay
-tos_throughput
-tos_reliability
-tos_monetary_cost
-tos_unused
Note
-diff_default is supported by Save as HLTAPI and provides the same functionality as using the above differ_* arguments combined.
-ip_tos_field is supported by Save as HLTAPI and provides the same the same functionality as as using the above tos_* arguments combined.
Cisco-specific Arguments¶
The following arguments are specific to the Cisco HLTAPI but are not supported by Spirent HLTAPI:
-num_sessions
-remote_mac_addr
-remote_mac_addr_step
-remote_mac_addr_repeat
-remote_ip_addr_repeat
-gateway_enable
-gateway_ipv4_address
-gateway_ipv6_address
-ipv4_address_type
-ptp_session_mode
-unicast_negotiation_enable
-unicast_grant_duration
-peer_port_identity_ipv4_address
-peer_port_identity_port_number
-peer_port_identity_clock_id
-unicast_destination_count
-unicast_ipv4_address
-unicast_ipv4_address_mode
-unicast_ipv4_address_repeat
-unicast_ipv4_address_step
-unicast_ipv4_address_percentage_overlap
-unicast_clock_id
-unicast_clock_id_mode
-unicast_clock_id_step
-unicast_clock_id_repeat
-unicast_clock_id_percentage_overlap
-raw_priority
-udp_source_port
-udp_source_port_mode
-udp_source_port_step
-udp_source_port_repeat
-master_clock_accuracy
-master_clock_offset_scaled_log_variance
-alternate_master_enable
-steps_removed
-followup_enable
-followup_delay
-random_distribution_enable
-peer_delay_request_enable
-log_min_peer_delay_request_interval
-peer_delay_response_enable
-peer_delay_response_flag
-peer_delay_response_followup_enable
-peer_delay_response_followup_delay
-tx_calibration_factor
-rx_calibration_factor
-activity_trace_enable
-message_filter_enable
-filter_session_instance
Return Values¶
Depending on the specific language that HLTAPI uses, the function returns a keyed list/dictionary/hash (See Introduction for more information on return value formats) using the following keys (with corresponding data):
handle PTP device handle
status Success (1) or failure (0) of the operation.
log An error message (if the operation failed).
Description¶
The sth::emulation_ptp_config
function creates, enables, modifies, deletes
and performs other actions to the PTP device. Use the -port_handle to define
the port on which the PTP master or slave emulation will be created.
When in the create mode, one or a list of PTP devices will be created and the PTP device handle(s) will be returned. Except for the Mandatory -port_handle, these arguments are necessary or use their default values:
-encapsulation
-device_type
-transport_type
-ptp_clock_id
-ptp_clock_id_step
In the modify mode, you can change the configuration of the created PTP device except these arguments: -count, -encapsulation, and -transport_type.
In the delete mode, you can remove the created device. If the creation, configuration, or delete fails, Spirent HLTAPI returns an error message. For example, if the user tries to modify a non-existing session handle, an error message will be returned.
Examples¶
#### HLTAPI for Tcl ####
To create and configure 2 new PTP devices:
sth::emulation_ptp_config -mode "create" \
-port_handle $hltSourcePort \
-count 2 \
-encapsulation ETHERNETII \
-device_type ptpMaster \
-transport_type ipv4 \
-local_mac_addr 00:33:00:00:00:01 \
-local_ip_addr 10.0.0.5 \
-remote_ip_addr 10.0.0.1 \
-vlan_id1 100 \
-vlan_id2 200 \
-ptp_session_mode multicast \
-ptp_domain_number 10 \
-ptp_port_number 1 \
-ptp_clock_id 0xAAAA480000000000 \
-ptp_clock_id_step 0x0000000000000001 \
-master_clock_class 200 \
-master_clock_priority1 2 \
-master_clock_priority2 2 \
-time_source ptp-profile \
-sync_enable 1 \
-sync_two_step_flag on \
-log_sync_message_interval {"-5"} \
-path_delay_mechanism end-to-end
Sample Output:
{handle router1 router2} {status 1}
To modify the created PTP device:
sth::emulation_ptp_config -mode modify \
-handle $ptpHandle1 \
-ptp_session_mode multicast \
-ptp_domain_number 10 \
-ptp_port_number 1 \
-ptp_clock_id 0xAAAA480000000000 \
-master_clock_class 200 \
-master_clock_priority1 8 \
-master_clock_priority2 7
Sample Output:
{handle router1 router2} {status 1}
The following example uses the function in Scaling
mode (-mode activate)
with -expand:
set hnd [keylget int_ret0 param_handle]
# param_handle returned from sth::interface_config or sth::emulation_device_config
puts "Param List: $int_ret0"
set rtn [sth::emulation_ptp_config \
-mode activate\
-handle "$hnd"\
-ptp_profile default \
-encap udp_ipv4 \
-path_delay_mechanism end-to-end \
-messaging_mode mixed \
-sync_two_step_flag on \
-ptp_clock_id 0xACDE480000001200 \
-multicast_mac pdelay_mac \
-ptp_clock_id_step 2\
-master_clock_priority1 110 \
-master_clock_priority2 120 \
-master_clock_priority1_step 2 \
-master_clock_priority2_step 4 \
-ptp_domain_number_step 6 \
-ptp_domain_number 10 \
-log_announce_message_interval 1 \
-log_sync_message_interval 2 \
-log_minimum_delay_request_interval 3 \
-announce_receipt_timeout 6 \
-ptp_port_number 2 \
-device_type ptpSlave \
-enable_unicast_negotiation true\
-unicast_ipv4_addr_type unicast_ip_increment \
-unicast_master_port_ipv4_addr_count 3 \
-unicast_master_port_ipv4_start 2.3.4.5 \
-unicast_master_port_ipv4_port_step 0.0.0.2 \
-unicast_master_port_ipv4_step 0.0.0.2 \
-unicast_master_port_ipv4 4.5.6.7 \
-unicast_master_port_ipv6 4345::6 \
-expand true\
]
Sample Output:
{handle_list {emulateddevice1 emulateddevice2 emulateddevice3 emulateddevice4}}
{handle {}} {handles {emulateddevice1 emulateddevice2 emulateddevice3
emulateddevice4}} {status 1}
The following examples uses the function in Scaling
mode (-mode activate)
with -expand, -port_handle and -block_mode:
set rtn [sth::emulation_ptp_config \
-mode activate\
-port_handle $port1\
-block_mode MULTIPLE_DEVICE_PER_BLOCK\
-block_name_index 1\
-count_per_block 5\
-count_block_per_port 1\
-intf_ip_addr 192.85.1.2 \
-ip_version 4 \
-expand true\
]
Sample Output:
{param_handle emulateddevicegenparams1} {status 1} {handle_list {emulateddevice1}}
{handle {}} {handles {emulateddevice1}}
set device_ret0 [sth::emulation_ptp_config\
-mode activate \
-port_handle $port1\
-expand true \
-block_mode ONE_DEVICE_PER_BLOCK \
-block_name_index 2 \
-count 5 \
-name "PTP_1"\
-mac_addr 00:33:00:00:00:01 \
-mac_addr_step 00:00:00:00:00:01 \
-intf_prefix_len 24 \
-intf_ip_addr 100.100.10.1 \
-intf_ip_addr_step 0.0.0.1 \
-gateway_ip_addr 100.100.10.2 \
-gateway_ip_addr_step 0.0.0.1 \
-unicast_master_port_ipv4 4.5.6.7 \
-unicast_master_port_ipv6 4345::6 \
-ptp_profile default \
-encap udp_ipv4 \
-path_delay_mechanism end-to-end \
-messaging_mode mixed \
-sync_two_step_flag on \
-ptp_clock_id 0xACDE480000001200 \
-multicast_mac pdelay_mac \
-ptp_clock_id_step 2\
-master_clock_priority1 110 \
-master_clock_priority2 120 \
-master_clock_priority1_step 2 \
-master_clock_priority2_step 4 \
-ptp_domain_number_step 6 \
-ptp_domain_number 10 \
-log_announce_message_interval 1 \
-log_sync_message_interval 2 \
-log_minimum_delay_request_interval 3 \
-announce_receipt_timeout 6 \
-ptp_port_number 2 \
-device_type ptpSlave \
-enable_unicast_negotiation true\
-unicast_ipv4_addr_type unicast_ip_increment \
-unicast_master_port_ipv4_addr_count 3 \
-unicast_master_port_ipv4_start 2.3.4.5 \
-unicast_master_port_ipv4_port_step 0.0.0.2 \
-unicast_master_port_ipv4_step 0.0.0.2 \
]
Sample Output:
{param_handle emulateddevicegenparams1} {status 1} {handle_list {emulateddevice1 emulateddevice2
emulateddevice3 emulateddevice4 emulateddevice5}}{handle {}} {handles {emulateddevice1 emulateddevice2
emulateddevice3 emulateddevice4 emulateddevice5}}
#### HLTAPI for Python ####
To create and configure a new PTP device:
device_ret2 = sth.emulation_ptp_config (
mode = 'create',
name = 'Router_3',
encapsulation = 'ETHERNETII',
vlan_id_mode1 = 'increment',
vlan_id_mode2 = 'increment',
ip_tos_field = '0xc0',
port_handle = port_handle[1],
master_clock_priority1= '8',
master_clock_priority2= '2',
log_sync_message_interval= '{"0"}',
ptp_clock_id = '0xbcde480000000001',
path_delay_mechanism= 'end-to-end',
transport_type = 'ipv4',
time_source = 'internal-oscillator',
announce_receipt_timeout= '3',
device_type = 'ptpMaster',
log_minimum_delay_request_interval= '0',
log_announce_message_interval= '0',
ptp_port_number = '1',
tx_delay_resp_dropped_perc= '0',
ptp_session_mode = 'multicast',
enable_correction = '0',
sync_two_step_flag = 'on',
master_clock_class = '200',
tx_followup_dropped_perc= '0',
ptp_domain_number = '10',
vlan_ether_type1 = '0x8100',
vlan_id1 = '201',
vlan_id_step1 = '1',
vlan_id_repeat1 = '0',
vlan_priority1 = '7',
vlan_ether_type2 = '0x8100',
vlan_id2 = '101',
vlan_id_step2 = '1',
vlan_id_repeat2 = '0',
vlan_priority2 = '7',
local_mac_addr_step = '00:00:00:00:00:01',
local_mac_addr = '00:99:00:00:00:02',
local_mac_addr_repeat= '0',
remote_ip_addr = '10.0.0.5',
ipv4_priority = 'tos',
local_ip_prefix_len = '24',
local_ip_addr_step = '0.0.0.1',
remote_ip_addr_step = '0.0.0.0',
mac_address_resolution= 'arp_resolved',
local_ip_addr = '10.0.0.2',
local_ip_addr_repeat= '0');
Sample Output:
{‘status’: ‘1’, ‘handle’: ‘router1’, ‘port_handle’: ‘port1’}
#### HLTAPI for Perl ####
To create and configure a new PTP device:
my %device_ret0 = sth::emulation_ptp_config (
mode => 'create',
name => 'PTP_1',
encapsulation => 'ETHERNETII',
vlan_id_mode1 => 'increment',
vlan_id_mode2 => 'increment',
ip_tos_field => '0xc0',
port_handle => "$hport[1]",
master_clock_priority1=> '2',
master_clock_priority2=> '2',
log_sync_message_interval=> '{"-5"}',
ptp_clock_id => '0xaaaa480000000000',
path_delay_mechanism=> 'end-to-end',
transport_type => 'ipv4',
time_source => 'ptp-profile',
announce_receipt_timeout=> '3',
device_type => 'ptpMaster',
log_minimum_delay_request_interval=> '0',
log_announce_message_interval=> '0',
ptp_port_number => '1',
tx_delay_resp_dropped_perc=> '0',
ptp_session_mode => 'multicast',
enable_correction => '0',
sync_two_step_flag => 'on',
master_clock_class => '200',
tx_followup_dropped_perc=> '0',
ptp_domain_number => '10',
vlan_ether_type1 => '0x8100',
vlan_id1 => '200',
vlan_id_step1 => '1',
vlan_id_repeat1 => '0',
vlan_priority1 => '7',
vlan_ether_type2 => '0x8100',
vlan_id2 => '100',
vlan_id_step2 => '1',
vlan_id_repeat2 => '0',
vlan_priority2 => '7',
local_mac_addr_step => '00:00:00:00:00:01',
local_mac_addr => '00:33:00:00:00:01',
local_mac_addr_repeat=> '0',
remote_ip_addr => '10.0.0.1',
ipv4_priority => 'tos',
local_ip_prefix_len => '24',
local_ip_addr_step => '0.0.0.1',
remote_ip_addr_step => '0.0.0.0',
mac_address_resolution=> 'arp_resolved',
local_ip_addr => '10.0.0.5',
local_ip_addr_repeat=> '0');
Sample Output:
$VAR1 = 'handle';
$VAR2 = 'router1';
$VAR3 = 'port_handle';
$VAR4 = 'port1';
$VAR5 = 'status';
$VAR6 = '1'
End of Procedure Header
sth::emulation_ptp_control¶
Purpose¶
The sth::emulation_ptp_control
function starts or stops the
specified PTP device.
Synopsis¶
Note
M indicates that the argument is Mandatory .
sth::emulation_ptp_control [-action_control {start|stop} M] [-port_handle <port_handle_list>] [-handle <handle_list>] [-enable_iq_stats {true|false}]
Arguments¶
-
-port_handle
¶
Specifies a list of ports on which to the actions will be performed. You must specify either -handle or -port_handle, but not both.
-
-handle
¶
Specifies a list of PTP devices on which to perform the action. You must specify either -handle or -port_handle, but not both.
-
-action_control
¶
Performs a certain action on the specified port or to the specified PTP device. This argument is Mandatory .
-
-enable_iq_stats
¶
Specifies to enable PTP Spirent Testcenter IQ results on the specified port. This argument is Mandatory to retrieve Spirent Testcenter IQ results.
Cisco-specific Arguments¶
The following arguments are specific to the Cisco HLTAPI but are not supported by Spirent HLTAPI:
-action
-peer_count
-interval
-interval_unit
-job_handle
Return Values¶
Depending on the specific language that HLTAPI uses, the function returns a keyed list/dictionary/hash (See Introduction for more information on return value formats) using the following keys (with corresponding data):
status Success (1) or failure (0) of the operation.
log An error message (if the operation failed).
Description¶
The sth::emulation_ptp_control
function starts or stops the PTP devices. Use
the -action_control argument to specify the action to perform. (See the
-action_control argument description for information about the actions.)
Examples¶
#### HLTAPI for Tcl ####
To start the PTP device:
sth::emulation_ptp_control \
-action_control start \
-port_handle port1 \
Sample Output:
{status 1}
To enable Spirent Testcenter IQ results and start PTP device:
sth::emulation_ptp_control \
-action_control start \
-port_handle port1 \
-enable_iq_stats true\
Sample Output:
{status 1}
#### HLTAPI for Python ####
To start the specified PTP devices:
ctrl_ret1 = sth.emulation_ptp_control (
port_handle = [port_handle[0],port_handle[1]],
action_control = 'start');
Sample Output:
{'status': '1', 'port_handle': 'port1 port2'}
#### HLTAPI for Perl ####
To start the specified PTP devices:
my %ctrl_ret1 = sth::emulation_ptp_control (
port_handle => "$hport[1] $hport[2] ",
action_control => 'start');
Sample Output:
$VAR1 = 'port_handle';
$VAR2 = 'port1';
$VAR3 = 'status';
$VAR4 = '1';
End of Procedure Header
sth::emulation_ptp_stats¶
Purpose¶
sth::emulation_ptp_stats allows user to collect or clear statistics about the PTP device.
Synopsis¶
Note
M indicates that the argument is Mandatory .
sth::emulation_ptp_stats [-handle <ptp_emulation_handle>] [-port_handle <port_handle>] [-reset { 0| 1 }] [-mode device] [-result_type {ieee1588v2_clock_stats|ieee1588v2_clock_sync_stats| ieee1588v2_cum_clock_state_count| ieee1588v2_message_rate_stats|ieee1588v2_parent_clock_stats| ieee1588v2_time_properties_stats|ieee1588v2_unicast_negotiation| ieee1588v2_foreign_master_clock|ieee1588v2_traffic_start_time_stats| ieee1588v2_clock_sync_filtered_stats|}]
Arguments¶
-
-port_handle
¶
Specifies the port to retrieve statistics from. You must specify either -handle or -port_handle, but not both.
-
-handle
¶
Specifies the handle of the PTP master or slave device to retrieve statistics from. You must specify either -handle or -port_handle, but not both.
-
-reset
¶
Determines to reset the statistics or not on the specified port. Possible values are 0 and 1. When this argument is set to 1, the statistics will be reset. You must specify -port_handle when you use this argument.
-
-mode
¶
Specifies the statistics retrieval mode. The modes are described below:
device - Gets the statistics of the ptp device specified by -handle. This is the default. instance - Gets the statistics of the instance within the ptp device. This is not supported.
-
-result_type
¶
Specifies the type of IEEE 1588v2 results. This argument is Mandatory to retrieve Spirent Testcenter IQ results.
Dependency: -port_handle
Possible values are:
- ieee1588v2_clock_stats
- Returns IEEE 1588v2 clock statistics from Spirent TestCenter IQ.
- ieee1588v2_clock_sync_stats
- Returns IEEE 1588v2 clock sync statistics from Spirent TestCenter IQ.
- ieee1588v2_cum_clock_state_count
- Returns IEEE 1588v2 cumulative clock state count statistics from Spirent TestCenter IQ.
- ieee1588v2_message_rate_stats
- Returns IEEE 1588v2 message rate statistics from Spirent TestCenter IQ.
- ieee1588v2_parent_clock_stats
- Returns IEEE 1588v2 parent clock statistics from Spirent TestCenter IQ.
- ieee1588v2_time_properties_stats
- Returns IEEE 1588v2 time properties statistics from Spirent TestCenter IQ.
- ieee1588v2_unicast_negotiation
- Returns IEEE 1588v2 unicast negotiation statistics from Spirent TestCenter IQ.
- ieee1588v2_foreign_master_clock
- Returns IEEE 1588v2 foreign master clock statistics from Spirent TestCenter IQ.
- ieee1588v2_traffic_start_time_stats
- Returns IEEE 1588v2 traffic start time statistics from Spirent TestCenter IQ.
- ieee1588v2_clock_sync_filtered_stats
- Returns IEEE 1588v2 clock sync filtered statistics from Spirent TestCenter IQ.
Return Values¶
Depending on the specific language that HLTAPI uses, the function returns a keyed list/dictionary/hash (See Introduction for more information on return value formats) using the following keys (with corresponding data):
status Success (1) or failure (0) of the operation.
log An error message (if the operation failed).
These statistics are returned for all configured PTP devices:
clock_state Possible values are described below::
initializing - Initializing data sets, hardware, and communication
facilities.
faulty - Multiple Pdelay_Resp messages were received.
disabled - Does not implement the delay mechanism.
listening - Waiting for the announceReceiptTimeout to
expire or to receive an Announce message from a
master.
pre_master - No Announce message was received within the
required time. Allowing changes to propagate
from points in the system between the local clock
and possible masters visible from the port
before assuming the Master state.
master - Operating as the master clock.
passive - Not the master on the path. Not synchronizing to a
master.
uncalibrated - One or more master ports have been detected in
the domain.
slave - Synchronizing to the selected master port.
total_rx_announce The number of Announce messages received
total_rx_sync The number of Sync messages received
total_rx_sync_followup The number of Sync Followup messages received
total_rx_delay_req The number of Delay_Req messages received
total_rx_delay_resp The number of Delay_Resp messages received
total_tx_announce The number of Announce messages sent
total_tx_sync The number of Sync messages sent
total_tx_sync_followup The number of Sync Followup messages sent
total_tx_delay_req The number of Delay_Req messages sent
total_tx_delay_resp The number of Delay_Resp messages sent
peer_mean_path_delay An estimate of the current one-way propagation
delay on the link
clock_domain PTP clock domain
total_tx_signaling_count Number of Signaling messages sent
total_rx_signaling_count Number of Signaling messages received
These statistics can be retrieved when the ptp device is a “Slave” port:
-bmc_grandmaster_clock_id The grandmaster ID
-bmc_clock_class The grandmaster clock class
-bmc_clock_accuracy The grandmaster clock accuracy
-bmc_offset_scaled_log_variance The scaled log variance of the
grandmaster clock offset.
-bmc_priority1 The grandmaster priority1
-bmc_priority2 The grandmaster priority2
-bmc_steps_removed The number of communication paths
traversed between the local clock and
the grandmaster clock.
-bmc_time_source The grandmaster time source
-bmc_source_port_clock_id The clock identity.
-offset_from_master The value of the current Universal
Coordinated Time offset.
-mean_path_delay The mean propagation delay between two
ports.
-rx_log_min_delay_req_interval The minimum permitted mean time interval
between successive Pdelay_Req message.
Cisco-specific Arguments¶
The following arguments are specific to the Cisco HLTAPI but are not supported by Spirent HLTAPI:
-device_instance
***Common table**
-total_rx_msgs
-total_dropped_msgs
-total_rx_peerdelay_resp_followup
-total_rx_signalling
-total_rx_management
-total_rx_unicast
-total_rx_mcast
-total_tx_msgs
-total_tx_peerdelay_resp_followup
-total_tx_signalling
-total_tx_management
***Slave stat***
-bmc_source_addr
-bmc_last_change
-bmc_source_port_number
-min_sync_correction_factor_error
-avg_sync_correction_factor_error
-max_sync_correction_factor_error
-min_delay_req_correction_factor
-avg_delay_req_correction_factor
-max_delay_req_correction_factor
-min_sync_latency
-avg_sync_latency
-max_sync_latency
-min_delay_req_latency
-avg_delay_req_latency
-max_delay_req_latency
-min_latency_asymmetry
-avg_latency_asymmetry
-max_latency_asymmetry
-rx_log_announce_interval
-rx_log_sync_interval
-rx_log_min_peerdelay_request_interval
-unicast_granted_log_announce_period
-unicast_granted_log_sync_period
-unicast_granted_log_delay_resp_period
-unicast_granted_log_peerdelay_resp_period
-total_seq_number_errors
-total_misorder_sequence_errors
Description¶
The sth::emulation_ptp_stats
function provides information about the
specified PTP device.
This function returns the requested data and a status value (1 for success). If there is an error, the function returns the status value (0) and an error message. Function return values are formatted as a keyed list (supported by the Tcl extension software - TclX). Use the TclX function keylget to retrieve data from the keyed list. (See Return Values for a description of each key.)
Examples¶
#### HLTAPI for Tcl ####
Sample Input:
sth::emulation_ptp_stats -mode device \
-handle $ptpHandle1 \
Output for a master PTP device:
{router1 {{clock_state master} {total_rx_announce 3}
{total_tx_announce 5} {peer_mean_path_delay 0}
{total_rx_sync_followup 3} {total_rx_sync 3}
{total_tx_sync_followup 119} {total_rx_delay_req 10} {clock_domain 10}
{total_tx_sync 129} {total_tx_delay_req 0} {total_rx_delay_resp 0}
{total_tx_delay_resp 10} {bmc_clock_accuracy >10s}}} {status 1}
Output for a slave PTP device:
{router2 {{clock_state slave}
{bmc_grandmaster_clock_id 12297720897325760512}
{bmc_steps_removed 1} {total_rx_announce 23}
{total_tx_announce 1} {peer_mean_path_delay 0}
{rx_log_min_delay_req_interval 0}
{bmc_time_source PTP_PROFILE240} {total_rx_sync_followup 599}
{total_rx_sync 639} {bmc_clock_class 200} {total_tx_sync_followup 1}
{total_rx_delay_req 10} {mean_path_delay 0} {clock_domain 10}
{total_tx_sync 1} {bmc_priority1 2}
{bmc_offset_scaled_log_variance 65535} {total_tx_delay_req 9}
{total_rx_delay_resp 56} {offset_from_master 0}
{bmc_source_port_clock_id 13609394288797417472}
{bmc_priority2 2} {total_tx_delay_resp 0} {bmc_clock_accuracy 1s}}}
{status 1}
To get Spirent Testcenter IQ results for PTP devices:
set ctrl_ret1 [sth::emulation_ptp_control \
-port_handle "$port1 $port2 "\
-action_control start\
-enable_iq_stats true]
Sample Output::
{status 1}
set results_ret1 [sth::emulation_ptp_stats \
-port_handle "$port1 $port2 "\
-result_type ieee1588v2_clock_stats]
Sample Output::
{port1 {{ieee1588v2_clock_stats {{0 {{emulated_device_name Device_1}
{ieee1588v2_session_session_index 1} {clock_state IEEE1588_STATE_SLAVE}
{port_number 1} {clock_domain 0} {tx_announce_count 3} {rx_announce_count 18}
{tx_sync_count 3} {rx_sync_count 18} {tx_follow_up_count 3}
{rx_follow_up_count 18} {tx_delay_request_count 14} {rx_delay_request_count 0}
{tx_delay_response_count 0} {rx_delay_response_count 14}
{tx_management_msg_count 0} {rx_management_msg_count 0}}}}}}}
{port2 {{ieee1588v2_clock_stats {{1 {{emulated_device_name Device_2}
{ieee1588v2_session_session_index 1} {clock_state IEEE1588_STATE_MASTER}
{port_number 1} {clock_domain 0} {tx_announce_count 20} {rx_announce_count 3}
{tx_sync_count 20} {rx_sync_count 3} {tx_follow_up_count 20} {rx_follow_up_count 3}
{tx_delay_request_count 0} {rx_delay_request_count 16} {tx_delay_response_count 16}
{rx_delay_response_count 0} {tx_management_msg_count 0} {rx_management_msg_count 0}}}}}}}
{status 1}
#### HLTAPI for Python ####
Sample Input:
results_ret1 = sth.emulation_ptp_stats (
handle = device,
mode = 'device');
Sample Output:
{'status': '1', 'router1': {'total_rx_delay_req': '0', 'total_rx_announce': '0',
'total_rx_delay_resp': '0', 'total_tx_sync': '0', 'total_tx_delay_resp': '0',
'peer_mean_path_delay': '0', 'total_tx_sync_followup': '0', 'clock_state': 'none',
'total_tx_announce': '0', 'bmc_clock_accuracy': '35', 'clock_domain': '10',
'total_rx_sync_followup': '0', 'total_rx_sync': '0', 'total_tx_delay_req':'0'}}
#### HLTAPI for Perl ####
Sample Input:
my %results_ret1 = sth::emulation_ptp_stats (
handle => "$device",
mode => 'device');
Sample Output:
$VAR1 = 'router1';
$VAR2 = {
'total_rx_sync' => '0',
'clock_state' => 'none',
'total_tx_sync' => '0',
'peer_mean_path_delay' => '0',
'bmc_clock_accuracy' => '35',
'total_rx_delay_req' => '0',
'clock_domain' => '10',
'total_rx_sync_followup' => '0',
'total_tx_sync_followup' => '0',
'total_rx_announce' => '0',
'total_tx_delay_resp' => '0',
'total_tx_announce' => '0',
'total_tx_delay_req' => '0',
'total_rx_delay_resp' => '0'
};
$VAR3 = 'status';
$VAR4 = '1';