PPP Functions¶
ppp config¶
Execute Tester Command ${rt_handle} command=test_control <additional key=value arguments>
- Purpose:
Creates, brings up, or brings down an emulated IPover-Point-to-Point Protocolover-POS (PPP) session on a Spirent HLTAPI chassis.
Pointto-Point Protocol is a protocol in Data Link layer. This protocol specifies a standard method of encapsulating multiprotocol datagrams for transport over serial pointto-point links between hosts, switches, and routers. Pointto-Point Protocol includes the assignment and management of IP addresses, as well as a Link Control Protocol (LCP) and Network Control Protocols (NCPs). It has builtin security mechanisms, such as the Challenge Handshake Authentication Protocol (CHAP) and the Password Authentication Protocol (PAP).
Synopsis:
Note: M indicates the argument is `Mandatory`.
ppp config
action= { config|up|down } M
port_handle= <port_handle>
handle= <ppp_session_handle>
local_auth_mode= { none|pap|chap}
password= <1-32>
username= <1-32>
chap_req_timeout= <1-65535>
pap_max_req= <1-65535>
pap_req_timeout= <1-65535>
fsm_max_conf_req= <1-65535>
fsm_max_naks= <1-65535>
fsm_max_term_req= <1-65535>
fsm_req_timeout= <1-65535>
fcs_size= {16|32}
ipv6_cp= {0|1}
local_addr= <a.b.c.d>
local_addr_given= {0|1}
local_addr_override= {0|1}
local_intf_id= < aaaa:bbbb:cccc:dddd>
peer_addr= <a.b.c.d>
peer_addr_given= {0|1}
peer_addr_override= {0|1}
peer_intf_id= < aaaa:bbbb:cccc:dddd>
lcp_echo_interval= <0-65535>
lcp_local_mru= <128-65535>
local_fcs= { 0|1}
local_magic= {0|1}
local_mpls_cp= {0|1}
local_mru= {0|1}
local_osinl_cp= {0|1}
Arguments:
port_handle
Specifies the port on which PPP emulation is
configured.
The following example configures PPP emulation on
the specified port::
ppp config
port_handle port1
action config
local_auth_mode none
action
Specifies the action to be performed. This argument is
`Mandatory`. Possible values are described below::
config - When you specify action config and the
port_handle argument, Spirent HLTAPI will
create a PPP emulation on the specified port.
When you specify action config and -handle
argument, Spirent HLTAPI will modify the
the parameters of the PPP emulation specified
by the handle argument.
up - Brings the PPP session up.
down - Brings the PPP session down.
handle
Specifies the PPP emulation to modify. When you
specify action config and the -handle argument, you can
modify the specified PPP emulation. You can get
the handle value from the returned value of the
"ppp config port_handle=action config".
The following example modifies a created PPP emulation::
ppp config
handle pppHandle
action config
local_auth_mode chap
local_auth_mode
Specifies the local authentication protocol as one of the
following values::
none - Specifies no authentication protocol.
pap - Indicates the local authentication protocol to be
used is the Password Authentication Protocol. PAP
is a method of verifying and validating PPP
clients. PAP uses a twoway handshake to verify
the identity of a calling PPP client when the link
is established. Please refer to RFC 1334 for more
information.
chap - Indicates the local authentication protocol to be
used is the Challenge Handshake Authentication
Protocol. Like PAP, CHAP is an
authentication method of verifying and validating
PPP clients. CHAP verifies the identity of calling
PPP clients (both when the link is established and
periodically afterward) by using a threeway
handshake with challenge messages.
Please refer to RFC 1994 for more information.
The default value is none.
password
Specifies the zerobyte-terminated password used by the
optional Authentication Protocol. The maximum number
of characters is 32. This argument is applicable only
when you specify local_auth_mode pap or
local_auth_mode chap. The default is spirent.
username
Specifies the zerobyte-terminated user name used by the
optional Authentication Protocol. The maximum number
of characters is 32. This argument is applicable only
when you specify local_auth_mode pap or
local_auth_mode chap. The default is spirent.
chap_req_timeout
Specifies the timeout value in seconds for the
acknowledgment of a CHAP Challenge or Response
message. Possible values range from 1 to 65535.
The default value is 3 seconds.
pap_max_req
Specifies the maximum number of PAP Authentication
Requests that can be sent without acknowledgment.
Possible values range from 1 to 65535. The default value
is 10.
pap_req_timeout
Specifies the timeout value in seconds for retransmitting
a PAP Authentication Request message. Possible values
range from 1 to 65535. The default value is 3 seconds.
fsm_max_conf_req
Indicates the maximum number of ConfigureRequest
packets that can be sent, without acknowledgment,
before a session fails. Possible values range from 1 to
65535. The default value is 10.
fsm_max_naks
Indicates the maximum number of
NegativeAcknowledgment packets allowed during LCP
and NCP negotiation. Possible values range from
1 to 65535. The default value is 5.
fsm_max_term_req
Indicates the maximum number of TerminateRequest
packets that can be sent, without acknowledgment,
before a session fails. Possible values range from 1 to
65535. The default is 10.
fsm_req_timeout
Indicates the timeout value, measured in seconds, for
acknowledgment of a ConfigureRequest packet.
Possible values range from 1 to 65535. The default value
is 3 seconds.
fcs_size
Specifies the size of the frame check sequence (FCS)
field. A FCS refers to the extra checksum characters
added to a frame for error detection and correction.
Possible values are 16 and 32. The default value is
32. Use this argument only when local_fcs is enabled.
16 - Indicates the FCS field is 16 bits.
32 - Indicates the FCS field is 32 bits.
ipv6_cp
Determines whether to enable the IPv4 Control Protocol
(IPv4CP) negotiation or the IPv6 Control Protocol
(IPv6CP) negotiation in NCP phase. The IP Control
Protocol (IPCP) configures, enables, and disables the IP
protocol modules on both ends of the pointto-point link.
Possible values are 0 and 1. When it is set to 0,
IPv4CP negotiation is enabled. When it is set to 1,
IPv6CP negotiation is enabled. The default value is 0.
local_addr
Specifies the IPv4CP local address.
The value of the argument must be in IPv4 format.
When you set the address to 0.0.0.0, the peer will
provide its value. This argument is applicable only when
ipv6_cp is set to 0. The default value is 0.0.0.0.
local_addr_given
Determines whether the local address that is set by
local_addr or local_intf_id is to be negotiated.
Possible values are 0 (disable) and 1 (enable).
The default is 0. If this argument is set to 0, the
local address will not be negotiated and the local address
will be set by the peer.
local_addr_override
Determines whether to allow the peer to override the
local setting for the local IP address specified by
local_addr or local_intf_id. Possible values are 0 and
1. The default value is 0. If it is set to 1, it allows
the remote end to override the local IP address
compulsively. If it is set to 0, it does not allow the remote
end to override the local IP address.
When you specify local_addr 0.0.0.0 or local_intf_id
0:0:0:0, local_addr_override is automatically set to 1.
local_intf_id
Specifies the IPv6CP 64bit local interface identifier for
the IPv6 InterfaceIdentifier configuration option.
The value of this argument must be in hexadecimal
format of "aaaa:bbbb:cccc:dddd". The IPv6CP 64bit
local interface identifier specified by this argument is
the latter 64 bits of an IPv6 address. The first 64 bits
is "fe80::" that indicates the IPv6 address is a local link
address. Please refer to RFC 5072 for more information.
This argument is applicable only when you set
ipv6_cp to 1. The default value is 0:0:0:0.
peer_addr
Specifies the IPv4CP address of the remote end,
if negotiation about the remote IP address is required.
The value of this argument must be in IPv4 format.
The default value is 0.0.0.0.
See the description of the local_addr option for more
information.
peer_addr_given
Specifies whether the peer IP address specified by
peer_addr or peer_intf_id is to be negotiated.
Possible values are 0 and 1. The default value is 0.
When it is set to 1, the peer IP address is to
be negotiated. If this argument is set to 0, the peer
IP address will not be negotiated.
peer_addr_override
Determines whether Spirent HLTAPI allows the peer to
override the local setting for the peer IP address.
Possible values are 0 (disable) and 1 (enable). The default
value is 0. When it is set to 1, Spirent HLTAPI allows the
peer to override the local setting for the peer IP address
automatically.
When you specify peer_addr 0.0.0.0 or peer_intf_id
0:0:0:0, peer_addr_override is automatically set to 1.
peer_intf_id
Specifies the IPv6CP 64bit remote interface identifier
for the IPv6 InterfaceIdentifier configuration option.
The value of this argument must be in hexadecimal
format of "aaaa:bbbb:cccc:dddd". Please refer to
local_intf_id for more information.
This argument is applicable only when you set
ipv6_cp to 1. The default value is 0:0:0:0.
lcp_echo_interval
Specifies the time, measured in seconds, between Echo
Requests for link integrity. Possible values range from
0 to 65535. The default value is 0, which disables
the Echo Requests.
lcp_local_mru
Specifies the Maximum Receive Unit (MRU) size in
bytes for the local side. MRU is data sent to inform
remote systems of the local system's maximum receive
packet size. Possible values range from 128 to
65535. The default value is 4096. This parameter is valid
only if you set local_mru to 1.
local_fcs
Enables or disables the FCS for the
local interface. Possible values are 0 (disable) and 1
(enable). The default value is 0.
local_magic
Enables or disables the magic number option, which is
used to detect PPP loops. Possible values are 0 (disable)
and 1 (enable). The default is 0.
When this option is enabled, the local end
sends a LCP Configure Request packet with the magic
number option, which contains a randomly generated
number. When the Configure Request packet from
the peer is received, its magic number is compared
with the sent magic number. If the magic numbers match,
the path contains a loop. You must set this
parameter to 0 for successful loopbacked PPP.
local_mpls_cp
Enables or disables a control protocol for traffic going
through MPLS tunnels. The control protocol is used with
CRLDP and RSVP routing emulation. Possible values
are 0 (disable) and 1 (enable). When this argument is set
to 1, the MPLS control protocol is enabled. The default
value is 0.
local_mru
Enables or disables the MRU negotiation.
The MRU negotiation sets the size in bytes of the
maximum receive unit for the local PPP session.
Possible values are 0 and 1. When this option is
set to 1, the MRU is negotiated. The default value is 0.
local_osinl_cp
Enables or disables the Network Layer Control Protocol
(NLCP) required for OSI protocols. Possible values are 0
and 1. When it is set to 1, the OSINL control protocol is
enabled. The default value is 0.
Arguments Unsupported by Save as HLTAPI:
None
- Ciscospecific Arguments:
The following arguments are specific to the Cisco HLTAPI but are not supported by Spirent HLTAPI:
peer_auth_mode chap_auth_interval chap_max_challenge pap_peer_req_timeout holdoff timeout lcp_fcs_size lcp_peer_max_tolerance lcp_peer_mru lcp_accm local_accm peer_accm peer_fcs peer_mru vlan_outer_cfi vlan_outer_tpid vlan_outer_user_priority
- 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). handle A handle that identifies the PPP emulation created by the ppp config command.
- Description:
The
ppp config
function configures, brings up or brings down an emulated PPP session on a specified test port. Use the port_handle argument to specify the port for the PPP session. Use the action argument to specify the action to perform. (See the action argument description for information about the actions.)The ppp config command provides two ways to indicate the PPP address used on the local end of the Pointto-Point link.
You can configure the local IPv4 or IPv6 address directly by specifying the arguments below:
local_addr (local_intf_id) local_addr_given local_addr_override
In addition, when the local IPv4 address specified by local_addr is 0.0.0.0 or the local_intf_id argument is set to 0:0:0:0, you can get the local address by negotiating with the peer end. You must specify the following arguments for the peer end in this case:
peer_addr (peer_intf_id) peer_addr_given peer_addr_override
You can refer to the examples below for more information.
Examples:
The following example configures PPP settings on the existing port:
ppp config port_handle=port1 action= config local_auth_mode= chap username= ss1 password= ss1 ipv6_cp= 0 local_addr= 1.1.1.1 local_addr_given= 1 local_addr_override= 0 local_magic= 1 local_mru= 1Sample output for example shown above:
{handles host3} {status 1}The following example configures PPP settings for the local end which requires the peer to provide its local IPv4 address:
ppp config port_handle=port1 action= config local_auth_mode= none ipv6_cp= 0 local_addr= 0.0.0.0 local_addr_given= 1 local_addr_override= 1 local_magic= 1 local_mru= 1The following example configures PPP settings for the remote end which will provide the IPv4 address for the local end:
ppp config port_handle=port2 action= config local_auth_mode= none ipv6_cp= 0 local_addr= 2.2.2.2 local_addr_given= 1 local_addr_override= 0 peer_addr= 3.3.3.3 peer_addr_given= 1 peer_addr_override= 1 local_magic= 1 local_mru= 1The following example configures PPP IPv6CP settings on the existing port:
ppp config port_handle=port1 action= config local_auth_mode= none ipv6_cp= 1 local_intf_id= 1:2:3:4 local_addr_given= 1 local_addr_override= 0 local_magic= 1 local_mru= 1Sample output for the example shown above:
{handles host3} {status 1}The following example modifies the created PPP:
ppp config handle=pppHandle action= config chap_req_timeout= 8 pap_max_req= 8 pap_req_timeout= 10 fsm_max_conf_req= 13 fsm_max_naks= 13 fsm_max_term_req= 13 fsm_req_timeout= 13 fcs_size= 32Sample output for the example shown above:
{handles host3} {status 1}The following example starts PPP session on the specified port:
set returnedString [ppp config action= up port_handle= port1]Sample output for the example shown above:
{status 1}The following example stops PPP session on the specified port:
set returnedString [ppp config action= down port_handle= port1]Sample output for the example shown above:
{status 1}
ppp stats¶
Execute Tester Command ${rt_handle} command=test_control <additional key=value arguments>
- Purpose:
Spirent Extension (for Spirent HLTAPI only).
Returns the information about the PPP session.
Synopsis:
Note: M indicates the argument is `Mandatory`.
ppp stats
action= { collect | clear } M
port_handle= <port_handle>
Arguments:
action
Determines whether to collect statistics or clear statistics.
Possible values are collect and clear. This argument is
`Mandatory`.
collect - Collects the statistics.
clear - Clears the statistics.
port_handle
Specifies from which port to query statistics. This
argument is `Mandatory`.
- 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).
The statistics that will be returned are listed below:
*** POS interface statistics *** pos_port_state State of the PPP link Dead The PPP link is not up and is not ready to be established. Initialize The PPP link is initializing. Establish The port is trying to establish a link using the link control protocol. Authenticate The port is trying to authenticate itself with a peer using PAP or CHAP. Authentication is optional, so this state is not always displayed during link establishment. Network IPCP/IPv6CP negotiation was successful, and the PPP link is up. Disconnect PPP is terminating the link. lcp_or_ncp_state State of the link control protocol Initial The lower layer is unavailable, and no attempt has been made to open a link. Starting An attempt has been made to open a link, but the lower layer is unavailable. Closed The lower layer is available, but that there is no active attempt to open a link. Stopped The link is waiting for termination. Closing An attempt has been made to terminate the connection. A TerminateRequest packet has been sent, but a TerminateAck packet has not been received. Stopping A TerminateRequest packet has been sent, but a TerminateAck packet has not been received. Request Sent An attempt has been made to configure the connection. A ConfigureRequest packet has been sent, but a ConfigureAck packet has not been received nor sent. Ack Received A ConfigureRequest packet has been sent, and a ConfigureAck packet has been received. Ack Sent Both a ConfigureRequest packet and a ConfigureAck packet have been sent, but a ConfigureAck packet has not yet been received. Opened A ConfigureAck packet has been both sent and received. tx_mru_size Sent MRU size rx_mru_size Received MRU size pap_authentication_state State of CHAP authentication Initial The PPP link is down. Closed The link is not available and is not allowed to be opened. Pending An Authentication Request is being prepared. Opened PAP authentication passed and is up. Auth_failed Authentication was denied. Auth_req_sent An Authentication Request has been sent. chap_authentication_state State of PAP authentication Initial The CHAP authorization negotiation phase is not active. Started The client is waiting for a CHAP Challenge packet from the server. Pending The client received the challenge, sent a response, and is waiting for an acknowledgement from the server. Auth failed Authorization failed. Opened Authorization was successful. ipv4_cp_state State of the IP control protocol as it tries to bring up the IP layer on top of the PPP layer Initial The lower layer is unavailable, and no attempt has been made to open a link. Starting An attempt has been made to open a link, but the lower layer is unavailable. Closed The lower layer is available, but that there is no active attempt to open a link. Stopped The link is waiting for termination. Closing An attempt has been made to terminate the connection. A TerminateRequest packet has been sent, but a TerminateAck packet has not been received. Stopping This state indicates that a TerminateRequest packet has been sent, but a TerminateAck packet has not been received. Request Sent An attempt has been made to configure the connection. A ConfigureRequest packet has been sent, but a ConfigureAck packet has not been received nor sent. Ack Received A ConfigureRequest packet has been sent, and a ConfigureAck packet has been received. Ack Sent Both a ConfigureRequest packet and a ConfigureAck packet have been sent, but a ConfigureAck packet has not yet been received. Opened IPv4 is enabled on top of PPP. ipv4_local_address Local IPv4 address used for the interface ipv4_peer_address IPv4 address of the peer (PPP server) ipv6_cp_state State of the IPv6 control protocol as it tries to bring up the IP layer on top of the PPP layer. Initial The lower layer is unavailable, and no attempt has been made to open a link. Starting An attempt has been made to open a link, but the lower layer is unavailable. Closed The lower layer is available, but there is no active attempt to open a link. Stopped The link is waiting for termination. Closing An attempt has been made to terminate the connection. A TerminateRequest packet has been sent, but a TerminateAck packet has not been received. Stopping A TerminateRequest packet has been sent, but a TerminateAck packet has not been received. Request Sent An attempt has been made to configure the connection. A ConfigureRequest packet has been sent, but a ConfigureAck packet has not been received nor sent. Ack Received A ConfigureRequest packet has been sent, and a ConfigureAck packet has been received. Ack Sent Both a ConfigureRequest packet and a ConfigureAck packet have been sent, but a ConfigureAck packet has not yet been received. Opened IPv6 is enabled on top of PPP. ipv6_local_address Local IPv6 address used for the interface ipv6_peer_address IPv6 address of the peer (PPP server) pos_mpls_cp_state State of the MPLS control protocol (MPLSCP ) phase of the PPP connection Initial The lower layer is unavailable, and no attempt has been made to open a link. Starting An attempt has been made to open a link, but the lower layer is unavailable. Closed The lower layer is available, but there is no active attempt to open a link. Stopped The link is waiting for termination. Closing An attempt has been made to terminate the connection. A TerminateRequest packet has been sent, but a TerminateAck packet has not been received. Stopping A TerminateRequest packet has been sent, but a TerminateAck packet has not been received. Request Sent An attempt has been made to configure the connection. A ConfigureRequest packet has been sent, but a ConfigureAck packet has not been received nor sent. Ack Received A ConfigureRequest packet has been sent, and a ConfigureAck packet has been received. Ack Sent Both a ConfigureRequest packet and a ConfigureAck packet have been sent, but a ConfigureAck packet has not yet been received. Opened The MPLS protocol is enabled. pos_osi_nlcp_state State of the Network Layer Control Protocol required for OSI protocols (OSINLCP) phase of the PPP connection Initial The lower layer is unavailable, and no attempt has been made to open a link. Starting An attempt has been made to open a link, but the lower layer is unavailable. Closed This state indicates that the lower layer is available, but that there is no active attempt to open a link. Stopped This state indicates that the link is waiting for termination. Closing An attempt has been made to terminate the connection. A TerminateRequest packet has been sent, but a TerminateAck packet has not been received. Stopping A TerminateRequest packet has been sent, but a TerminateAck packet has not been received. Request Sent An attempt has been made to configure the connection. A ConfigureRequest packet has been sent, but a ConfigureAck packet has not been received nor sent. Ack Received A ConfigureRequest packet has been sent, and a ConfigureAck packet has been received. Ack Sent Both a ConfigureRequest packet and a ConfigureAck packet have been sent, but a ConfigureAck packet has not yet been received. Opened The OSI protocol is enabled.
- Description:
The
ppp stats
function collects or clears the statistics about the PPP session on the specified port.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). 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:
The following example collects statistics from port1:
ppp stats action= collect port_handle= port1Sample output for the example shown above:
{pos_osi_nlcp_state INITIAL} {tx_mru_size 1492} {ipv4_local_address 192.168.1.2} {chap_authentication_state INITIAL} {ipv6_local_address ::} {ipv4_cp_state OPENED} {pos_port_state NETWORK} {pos_mpls_cp_state INITIAL} {ipv6_cp_state INITIAL} {pap_authentication_state INITIAL} {ipv4_peer_address 192.168.1.6} {ipv6_peer_address ::} {rx_mru_size 1492} {lcp_or_ncp_state OPENED} {status 1}The following example clears the statistics about PPP session on port1:
ppp stats action= clear port_handle= port1Sample output for the example shown above:
{status 1}End of Procedure Header