MPLS VPN Functions

emulation mpls l2vpn pe config

Execute Tester Command ${rt_handle} command=test_control <additional key=value arguments>

Purpose:

Enables or disables a ProviderEdge Router in an Multiprotocol Label Switching (MPLS) Layer2 Virtual Private Network (VPN) network topology on a Spirent HLTAPI chassis.

MPLS Layer2 VPN network is a set of sites that are allowed to communicate with each other privately over the MPLSbased public infrastructure or Internet. The sites within the VPN are distinguished using Layer2 Encapsulation of their packets by the network devices.

MPLS Layer2 VPN network uses extended Virtual Circuit (VC) Label Switched Path (LSP) of Label Distribution Protocol (LDP) or BGP signaling in MPLS architecture to exchange Layer2 switching information of VPN sites among service provider network.

The different parts of MPLS L2 VPN are described as:

Provider (P) router
Router in the core of the provider network. P routers run MPLS switching, and do not attach VPN labels (assigned by PE routers) to routed packets between VPN sites.
ProviderEdge (PE) router
Edge router of the MPLS network that attaches the VPN label to the incoming packets based on the interface or subinterface on which they are received. A PE router directly attaches to a Customer Edge (CE) device. VPN labels are used to direct data packets to the correct egress router of MLPS network.
Customer Edge (CE) device
Edge device on the network of VPN site that connects to the PE router on the ISP network. A CE must interface with a PE router.

Spirent HLTAPI supports different types of MPLS L2 VPN below: :

Ethernet over MPLS (EoMPLS or Martini Traffic)
Pointto-Point connection of Ethernet VPN over MPLS network.
LDPVirtual Private LAN Services (VPLS)
LDP signaled multipointto-multipoint Ethernet VPN over MPLS network.
BGP- Virtual Private LAN Services(VPLS)
BGP signaled multipointto-multipoint Ethernet VPN over MPLS network.

Spirent HLTAPI also supports MPLS over GRE for MPLS Layer2 VPN.

Synopsis:

Note: M indicates the argument is `Mandatory`.

      emulation mpls l2vpn pe config
              mode=  {enable|disable} M
              enable_p_router=   {1|0}
              handle= { pe_handle }
              igp_session_handle= <igp_session_handle>
              mpls_session_handle= <mpls_session_handle>
              pe_count= < integer>
              port_handle=   <port_handle>
              targeted_ldp_session_handle= <targeted_ldp_session_handle>
              tunnel_handle= <gre_tunnel_handle>
              vpls_bgp_session_handle= <bgp_signal_session_handle>
              vpn_type= { martini_pwe | ldp_vpls | bgp_vpls }

Arguments:

mode
                Specifies the action to perform. Possible values are
                enable and disable. This argument is `Mandatory`. The
                modes are described below::


                 enable - Enables one or more PE routers. You must
                         also specify some of the switches below: :


                          vpn_type
                          port_handle
                          igp_session_handle
                          targeted_ldp_session_handle
                          vpls_bgp_session_handle
                          mpls_session_handle
                          tunnel_handle

                         The selections you make in the vpn_type option
                         determine which arguments you must specify..

                 disable - Disables one or more PE routers. You must
                          specify the handle argument.

                This switch has no default value.

enable_p_router
                Specifies whether the Provider router, which the
                configured PE attaches to, is emulated or not. Possible
                values are 0 (disable) and 1 (enable). When it is set to
                0, no P router would be emulated. When it is set to 1,
                depending on the attendance of tunnel, different
                processes would be done:

                * When the tunnel_handle argument is specified: as in
                  this case, mpls_session_handle would be ignored, the
                  igp_session_handle would be treated as working
                  on P router, and GRE tunnel interface tunnel_handle
                  would be treated on P router too.

                * When the tunnel_handle argument is not specified: the
                  igp_session_handle and -mpls_session_handle are
                  both treated working on P router.

                * When you enable multiple PEs by using this command
                  once, only one P router will be emulated and all
                  enabled PEs will attach to the P router.
                  The default value is 0.

handle
                Specifies the PE handle enabled by this command. This
                is required by mode disable. This switch has no default
                value.

igp_session_handle
                Specifies the IGP Protocol session connecting to the
                SUT to advertise routing information of the emulated
                PE. Input handle value is created and returned by
                relevant protocol commands of Spirent HLTAPI.

                When you enable multiple PE routers, input IGP
                session handle number based on the value of
                enable_p_router. If enable_p_router is set to 0, input
                IGP session handle number must equal to pe_count. If
                enable_p_router set to 1, only one IGP session handle
                is required to emulated IGP protocol session on one P
                router.

                The IGP session should be controlled (started or
                stopped) and fetched information from by using
                relevant protocol's Spirent HLTAPI commands. For
                example, if the IGP session is OSPF, it can be created,
                modified and deleted by the  emulation ospf config command,
                and  can be controlled by the emulation ospf control command,
                can be fetched information from when you use   the
                emulation ospf info command.
                This switch has no default value.

mpls_session_handle
                Specifies the MPLS session of the MPLS core network
                connecting to the SUT. The inputted handle is created
                and returned by relevant MPLS protocol commands in
                Spirent HLTAPI. If tunnel_handle is specified, this
                switch will be ignored, and MPLS over GRE topology
                will be emulated. This switch is available, when the
                tunnel_handle option is not specified, each input pair
                of MPLS session and IGP session should be created on
                the same emulated device.

                When you enable multiple PEs by using this command
                once, the number of input MPLS session handles
                depends on the value of enable_p_router.

                * If enable_p_router is set to 0, input MPLS session
                  handle number must equal to the value of pe_count.
                * If enable_p_router is set to 1, only one MPLS session
                  handle is needed to emulate IGP protocol session on
                  one P router.

                The input MPLS session should be controlled (started
                or stopped) and fetched information from by using
                relevant protocol's Spirent HLTAPI commands. For
                example, if the MPLS session is LDP, it can be created,
                modified and deleted by the
                ``emulation ldp config`` function, can be controlled
                by the ``emulation ldp control`` function, can be
                fetched information from using the
                emulation ldp info command.
                This switch has no default value.

pe_count
                Specifies the number of PEs to be enabled at one time.
                The default value is 1. Possible values range from 0 to
                <max_int>.

port_handle
                Specifies the handle of the port on which the
                PE router is enabled. This argument is required only by
                the enable mode.

targeted_ldp_session_handle
                Specifies the Targeted LDP session connecting to the
                peer PE, which establishes the VC (or Pseudo Wire)
                LSP and assigns VPN labels. The inputted
                handle is created and returned by
                emulation ldp config, the LDP command of
                Spirent HLTAPI. When     you enable multiple PEs at
                once, the number of inputted handles must be equal to
                the value of   the pe_handle option.

                When the tunnel_handle switch is specified to emulate
                the MPLS over GRE topology, each pair of IGP session
                and Targeted LDP session (or BGP session for VPN)
                emulating one PE router should be created on the same
                emulated devices.

                The MPLS session should be configured to advertise
                LDP prefix LSP with implicit null label when
                emulating MPLS over GRE topology.

                The specified Targeted LDP session should be
                controlled (started or stopped) and be fetched
                information from by using LDP protocol's Spirent
                HLTAPI commands. For example, it can be created,
                modified and deleted if you specify the
                ``emulation ldp config`` function, can be controlled
                by the emulation ldp control command, and can
                be fetched information from if you use the
                emulation ldp info command.

                This switch is required when vpn_type set to
                martini_pwe or ldp_vpls.
                This switch has no default value.

tunnel_handle
                Specifies the GRE tunnel interface connecting to the
                noneMPLS provider network of the SUT. The inputted
                handle is created and returned by
                emulation gre config that is a relevant GRE
                command of Spirent HLTAPI. When this switch is
                attended, MPLS over GRE topology will be emulated,
                and the mpls_session_handle option is ignored.
                When this switch is specified, each inputted pair of IGP
                session and Targeted LDP session (or BGP session for
                VPN) emulating the same PE router should be created
                on same emulated devices.

vpls_bgp_session_handle
                Specifies the BGP session connecting to the peer PE,
                which establishes VPN LSP and assigns VPN labels.
                The inputted handle is created and returned by
                emulation bgp config that is a BGP protocol
                command of Spirent HLTAPI. When you enable
                multiple PEs at one time, the number of input handles
                must be equal to the value of the pe_handle argument.

                When the tunnel_handle switch is specified to emulate
                MPLS over GRE topology, each inputted pair of IGP
                session and Targeted LDP session (or BGP session for
                VPN) emulating one PE router should be created on
                the same emulated devices.

                The specified BGP session should be controlled (started
                or stopped) and be fetched information from by using
                BGP protocol's Spirent HLTAPI commands. For
                example, it can be created, modified and deleted using
                the ``emulation bgp config`` function, can be
                controlled by using the emulation bgp control
                command, and can be fetched information from by
                using the emulation bgp info command.
                This argument must be specified when vpn_type is set to
                bgp_vpls.

vpn_type
                Specifies the type of L2 VPN network topology, in
                which the PE router works. Possible values are::


                 martini_pwe - Indicates the PseudoWire Emulation
                     Edgeto-Edge (PWE3) network or the Ethernet
                     over MPLS VPN, both of which use Martini
                     style network topologies.

                 ldp_vpls - Indicates the type of L2 VPN network
                     topology is LDP signaled Virtual Private LAN
                     Services (VPLS) network that uses the LDP
                     protocol to assign VPN labels.

                 bgp_vpls - Indicates that the type of L2 VPN network
                     topology is BGP signaled Virtual Private LAN
                     Services (VPLS) network that uses the BGP
                     protocol to assign VPN labels.

Arguments Unsupported by Save as HLTAPI:

The following Spirent HLTAPI arguments are currently not supported by the Save as
HLTAPI function::


    tunnel_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):

handle         The handle that identifies the PE handle enabled by the
                 ``emulation mpls l2vpn pe config`` function.
status          Success (1) or failure (0) of the operation.
log            An error message (if the operation failed).
Description:

The emulation mpls l2vpn pe config function enables, disables the specified MPLS L2VPN PE router. Use the mode argument to specify the action to perform. (See the mode argument description for information about the actions.)

To enable a PE router, you must specify mode enable and the port_handle argument of the emulation mpls l2vpn pe config function. The specified port_handle argument indicate the Spirent HLTAPI port that the emulation will use. (The port handle value is contained in the keyed list returned by the connect function.)

Examples:

The following example enables an L2VPN PE on a port:

#There must already exist a port with the handle of port_handle1, a targeted
#LDP session with the handle of ldp_handle1, and an OSPF session with
#the handle of ospf_handle1 and a GRE handle gre_handle1.

emulation mpls l2vpn pe config
      mode= enable
      port_handle= port_handle1
      vpn_type= martini_pwe
      targeted_ldp_session_handle= ldp_handle1
      igp_session_handle= ospf_handle1
      tunnel_handle= greTunnel1
      pe_count= 1

The following example disables an L2VPN PE on a port:

emulation mpls l2vpn pe config
      mode= disable
      handle= $peHandle1

Sample Output:

Success: {status 1} {handle pe_handle1}

Failure: {status 0} {log XXX}

emulation mpls l2vpn site config

Execute Tester Command ${rt_handle} command=test_control <additional key=value arguments>

Purpose:
Creates, modifies or deletes a Customer Site of an MPLS Layer2 VPN network topology on a Spirent HLTAPI chassis. The configured Customer Site may attach to the SUT (through CE device or not) or attach to an emulated PE router enabled by the emulation mpls l2vpn pe config command.

Synopsis:

Note: M indicates the argument is `Mandatory`.

     emulation mpls l2vpn site config
        mode= {create|modify|delete} M
        port_handle= <port_handle>
        handle= <site_handle>
        mac_addr= <aa:bb:cc:dd:ee:ff >
        mac_addr_step= <aa:bb:cc:dd:ee:ff >
        mac_addr_count=    < integer>
        pe_handle= <pe_handle>
        pe_loopback_ip_addr= <a.b.c.d>
        pe_loopback_ip_step= <a.b.c.d>
        pe_loopback_ip_prefix= <0 - 32 >
        rd_start= <admin:assigned>
        rd_step= <admin:assigned>
        site_count= <integer >
        vc_type= { 4 | 5 | b}
        vc_id= <0 - 4294967295 >
        vc_id_step=   <0 - 4294967295 >
        vc_id_count= <0 - 4294967295 >
        ve_id= <0 - 4294967295 >
        ve_id_step=   <0 - 4294967295 >
        vpn_block_count= <1 - 4294967295 >
        ldp_fec_type= {FEC_128|FEC_129}
        attachment_group_id= <string>
        attachment_group_id_incr= <string>
        src_attachment_individual_id= <a.b.c.d>
        src_attachment_individual_id_incr= <a.b.c.d>
        pw_count= <integer>
        vpn_id= <1 - 4294967295>
        vpn_id_step= < 1 - 4294967295 >
        vlan_id= <1 - 4095>
        vlan_id_step= <0 - 4095>
        vlan_id_count= <1 - 4095>
        vlan_id_outer= <1 - 4095>
        vlan_id_outer_step= <0 - 4095>
        vlan_id_outer_count= <1 - 4095>
        vpn_type= { martini_pwe | ldp_vpls | bgp_vpls }

Arguments:

mode
                Specifies the action to perform. Possible values are
                create, modify, and delete. This argument is `Mandatory`.
                The modes are described below::


                 create - Creates one or more VPN customer site(s).You
                          must specify port_handle. Besides, when you set
                          the vpn_type argument to a type, you must
                          specify the options required by the certain VPN
                          type.

                 modify - Modifies the configuration of one VPN
                          customer site. You must specify the handle
                          argument when you set the mode option to
                          modify.

                 delete - Deletes one or more VPN customer site(s). You
                          must input handle when you set the -mode
                          argument to delete.

port_handle
                Specifies the handle of the port on which to create the
                VPN customer site. This argument is `Mandatory` only
                for the create mode.

handle
                Specifies the VPN customer site handle created by this
                command. This is required by mode modify and
                delete.

mac_addr
                Specifies the starting MAC address in the address pool
                of VPN sites. This switch has no default value.
                If this argument is not specified, Spirent HLTAPI will
                automatically configure a MAC Address using the
                template of 00:94:01:xx:xx:xx. The value of this
                argument should be in MAC address format.

mac_addr_step
                Specifies the step value of MAC address when you use
                multiple MAC address with in one VPN site or creating
                multiple VPN site one time. The default value is
                00:00:00:00:00:01.

mac_addr_count
                Specifies the number of MAC addresses in the address
                pool within each VPN site. Possible values range from
                1 to <max_int>. The default value is 1.

pe_handle
                Specifies the PE router handle which the configured
                VPN customer sites attach to. The specified handle is
                enabled and returned by the
                ``emulation mpls l2vpn pe config`` function. If
                you specify this switch, the configured VPN sites will
                be treated as the sites attach to the emulated PE router
                specified by the handle argument on Spirent HLTAPI
                test port; If not, the configured VPN sites will be
                treated as those directly attach to the SUT which works
                as the PE for the VPN site.

pe_loopback_ip_addr
                Specifies the loopback IP address of the PE router that
                the configured VPN sites attach to. This option must
                be specified when the pe_handle argument is not
                attended. The default value is 10.1.1.1. The value of
                this argument must be in the IPv4 format.

pe_loopback_ip_prefix
                Specifies the loopback IP address prefix length of the
                PE router that the configured VPN sites attach to.
                Possible values range from 0 to 32.The default value is
                32.

pe_loopback_ip_step
                Specifies the step value of loopback IP address of the
                PE router that the configured VPN sites attach to when
                creating multiple VPN sites. The default value is
                0.0.0.0. The value of this argument must be in the
                format of IPv4.

rd_start
                Specifies the Route Distinguisher of VPN route for the
                VPN site. There are two types of Route Distinguisher
                (RD) value, as described below: :


                If you use Type 0: The administrator subfield is a 2
                byte AS number and the assigned subfield is a 4
                byte number assigned by the service provider.
                The format must be "n:n (admin:assigned)"

                If you use Type 1: The administrator subfield is a
                4byte IPv4 address and assigned sub-field is a 2
                byte number assigned by the service provider.
                The format must be "n.n.n.n:n (admin:assigned)".

                This switch is available when the vpn_type switch is
                set to bgp_vpls. The default value is 0:0.

rd_step
                Specifies the step value of Route Distinguisher of VPN
                route for the VPN site. The format must be
                "admin:assigned". This switch is applicable only when
                the vpn_type switch is set to bgp_vpls. The default
                value is 0:0.

site_count
                Specifies the number of VPN sites to create one time.
                The default value is 1. Possible values range from 0 to
                <max_int>.

vc_type
                Specifies the type of the Virtual Circuit (VC) LSP that
                the VPN site uses in the provider network for VPN
                packer routing. This switch is applicable only when the
                value of the vpn_type argument is set to martini_pwe
                or ldp_vpls. The default value is 5. Possible values are::


                 4- Remote sites are connected through Ethernet VLAN
                     VC.
                 5- Remote sites are connected through Ethernet VC.
                 B- Remote sites are connected through Ethernet VPLS
                     VC.

vc_id
                Specifies the starting ID of the VC LSP that the VPN
                site used in provider network for VPN packer routing.
                This switch is available when the value of the
                vpn_type option is set to martini_pwe or ldp_vpls.
                Possible values range from 0 to 4294967295. The
                default value is 1.

vc_id_step
                Specifies the step value of the ID of VC LSP that the
                VPN site uses in the provider network
                for VPN packer routing, when one VPN site uses
                multiple VC or multiple VPN sites are created at one
                time. This switch is available when the value of the
                vpn_type option is martini_pwe or ldp_vpls. Possible
                values range from 0 to 4294967295. The default value
                is 1.

vc_id_count
                Specifies the number of the VC LSPs that the VPN site
                uses in the provider network for VPN packer routing,
                when one VPN site uses multiple VC. This switch is
                available when the value of vpn_type is set to
                martini_pwe or ldp_vpls. Possible values range from 1
                to 4294967295. The default value is 1.

ve_id
                Specifies the starting value of VPLS Edge (VE )
                Identifier for the local PE or represented uPE(s). In
                Spirent HLTAPI the VE identifier represents an
                emulated endpoint (can be either a PE or a uPE) that is
                being advertised by the BGP speaker (DUT). This
                switch is available when the vpn_type switch is set to
                bgp_vpls. Possible values range from 0 to 65535. The
                default value is 1.

ve_id_step
                Specifies the step value of the VE Identifier for the
                local PE or represented uPE(s). In Spirent HLTAPI the
                VE identifier represents an emulated endpoint (can be
                either a PE or a uPE) that is being advertised by the
                BGP speaker (DUT). Possible values range from 0 to
                65535. This switch is available when the vpn_type
                switch is set to bgp_vpls. The default value is 1.

vlan_id
                Specifies the starting value of the VLAN ID for the
                VPN site. Possible values range from 1 to 4095. This
                switch has no default value. If it is specified, Spirent
                HLTAPI will add VLAN interface to configured VPN
                site; if not, no VLAN interface will be on the VPN site.

vlan_id_step
                Specifies the step value of VLAN ID for the VPN site
                when you create multiple VPN sites or there are
                multiple VLAN interfaces within one VPN site.
                Possible values range from 0 to 4095. The default value
                is 0. This switch is available when vlan_id is inputted.

vlan_id_count
                Specifies the number of VLAN interfaces for the VPN
                site within one VPN site. Possible values range from 1
                to 4095. The default value is 1. This switch is available
                when vlan_id is inputted.

vlan_id_outer
                Specifies the first value of the outer VLAN interface
                IDs for the VPN site, when you use Qin-Q
                encapsulation on VPN site. Possible values range from
                0 to 4095. This switch has no default value. If it is
                specified, Spirent HLTAPI will add Qin-Q VLAN
                interface to configured VPN site; If not, no Qin-Q
                VLAN interface will be on the VPN site.

vlan_id_outer_step
                Specifies the step value of the outer VLAN ID for the
                VPN site when you create multiple VPN sites with
                Qin-Q encapsulation or there are multiple Qin-Q
                VLAN interfaces within one VPN site. Possible values
                range from 0 to 4095. The default value is 0. This
                switch is available when vlan_id_outer is specified.

vlan_id_outer_count
                Specifies the number of outer VLAN interfaces within
                one VPN site. Possible values range from 1 to 4095.
                The default value is 1. This switch is applicable only
                when vlan_id_outer is attended.

vpn_block_count
                Specifies the number of VPLS blocks to configure of
                the VPN site in the BGP signaled VPLS network. This
                switch is applicable when the vpn_type switch is set to
                bgp_vpls. Possible values range from 1 to 4294967295.
                The default value is 1.

vpn_id
                Specifies the VPN ID of the VPN site. VPN ID is a
                global identifier of VPN in Spirent HLTAPI. Emulated
                customer site with the same VPN ID would be treated
                as those in the same VPN. Possible values range from
                1 to 4294967295. The default value is 1.

vpn_id_step
                Specifies the step value of VPN ID, when you create
                multiple VPN sites at one time. VPN ID is a global
                identifier of VPN in Spirent HLTAPI. The emulated
                customer site with the same VPN ID would be treated
                as those in the same VPN. Possible values range from
                1 to 4294967295. The default value is 1.

vpn_type
                Specifies the topology technology of the VPN network
                where the created VPN site is. Specifies the type of L2 VPN
                network topology, in which the PE router works.
                Possible values are described below::


                 martini_pwe - Indicates the PseudoWire Emulation
                     Edgeto-Edge (PWE3) network or the Ethernet
                     over MPLS VPN, both of which use Martini
                     style network topologies.

                 ldp_vpls - Indicates the type of L2 VPN network
                     topology is LDP signaled VPLS network that
                     uses the LDP protocol to assign VPN labels.
                     This is the default value.

                 bgp_vpls - Indicates that the type of L2 VPN network
                     topology is BGP signaled VPLS network that
                     uses the BGP protocol to assign VPN labels.

ldp_fec_type
                Specifies LDP FEC type.
                Possible values are FEC_128 and FEC_129.
                The default is FEC_128.

attachment_group_id
                Specifies the attachment group identifier.
                This argument is only available when you set vpn_type to ldp_vpls
                and ldp_fec_type to FEC_129.
                The default is 100:1.

attachment_group_id_incr
                Specifies the attachment group identifier increment.
                This argument is only available when you set vpn_type to ldp_vpls
                and ldp_fec_type to FEC_129.
                The default is 0:1.

src_attachment_individual_id
                Specifies the source attachment individual identifier.
                This argument is only available when you set vpn_type to ldp_vpls
                and ldp_fec_type to FEC_129.
                The default is 192.0.0.1.

src_attachment_individual_id_incr
                Specifies the attachment group identifier increment.
                This argument is only available when you set vpn_type to ldp_vpls
                and ldp_fec_type to FEC_129.
                The default is 0.0.0.1.

pw_count
                Specifies the PW count.
                This argument is only available when you set vpn_type to ldp_vpls
                and ldp_fec_type to FEC_129.
                The default is 1.

Arguments Unsupported by Save as HLTAPI:

The following Spirent HLTAPI arguments are currently not supported by the Save as
HLTAPI function::


   vpn_id_step
   vc_type
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    The handle that identifies the VPN site handle created by the
          ``emulation mpls l2vpn site config`` function.
status    Success (1) or failure (0) of the operation.
log       An error message (if the operation failed).
Description:

The emulation mpls l2vpn site config function creates, modifies, and deletes the specified MPLS L2VPN Customer sites. Use the mode argument to specify the action to perform. (See the mode argument description for information about the actions.)

To create a VPN site, you can use create mode of the function emulation mpls l2vpn site config port_handle=to specify the Spirent HLTAPI port that the emulation will use. (The port handle value is contained in the keyed list returned by the connect function.)

In addition to specifying the port, you must also provide one or more of the following pieces of information when you create a VPN site:

vpn_type
pe_handle
pe_loopback_ip_addr
pe_loopback_ip_prefix

Examples:

The following example enables an L2 VPN site on a port:

emulation mpls l2vpn site config mode=create
     port_handle= port_handle1
     pe_handle= pe_handle1
     pe_loopback_ip_prefix= 32
     site_count= 5
     vpn_type= martini_pwe
     vc_id= $vc_id
     vc_id_step= $vc_step
     vpn_id= $vpn_id
     vpn_id_step= $vpn_step
     mac_addr= $site_mac_addr
     mac_addr_count= 100
     mac_addr_step= $site_mac_step
     vlan_id= $vlan_id
     vlan_id_step 1pe_count= 5
Note: There must already exist a port with the handle of port_handle1 and a PE
router session with the handle of pe_handle1.

The following example modifies an L2 VPN site:

emulation mpls l2vpn site config mode=modify
      handle= $vpnSiteHandle1
      pe_loopback_ip_addr= "1.10.1.2"
      pe_loopback_ip_prefix= 32
      vpn_type= martini_pwe
      vc_id= 1501
      vpn_id= 101
      mac_addr= 12:22:33:44:55:66
      vlan_id= 1700

The following example deletes two L2VPN sites:

emulation mpls l2vpn site config
     mode= delete
     handle= "$vpnSiteHandle1 $vpnSiteHandle2"

Sample Output:

Success  {status 1} {handle pe_handle1}

Failure  {status 0} {log XXX}

emulation mpls l3vpn pe config

Execute Tester Command ${rt_handle} command=test_control <additional key=value arguments>

Purpose:

Enables or disables a ProviderEdge Router in an MPLS Layer3 VPN network topology on a Spirent HLTAPI chassis.

MPLS Layer3 VPN (Virtual Private Network) network is a set of sites that are allowed to communicate with each other privately over the MPLSbased public infrastructure or Internet. The sites within the VPN are distinguished using Layer3 Encapsulation of their packets by the network devices. Spirent HLTAPI support a topology of MPLS Layer3 VPN defined in RFC 2547.

MPLS Layer3 VPN network uses BGP signaling in MPLS architecture to exchange Layer3 switching information of VPN sites among service provider network.

The different parts of the MPLS VPN are described as follows:

Provider (P) router
Router in the core of the provider network. P routers run MPLS switching, and do not attach VPN labels (MPLS label in each route assigned by the PE router) to routed packets. VPN labels are used to direct data packets to the correct egress router.
PE router
Router that attaches the VPN label to incoming packets based on the interface or subinterface on which they are received. A PE router attaches directly to a CE router.
Customer (C) router
A router in the ISP or enterprise network.
Customer edge (CE) router
Edge router on the network of the ISP that connects to the PE router on the network. A CE router must interface with a PE router.

Spirent HLTAPI also supports MPLS over GRE for MPLS Layer3 VPN.

Synopsis:

Note: M indicates the argument is `Mandatory`.

     emulation mpls l3vpn pe config
        mode= {enable|disable} M
        bgp_session_handle= <bgp_signal_session_handle>
        enable_p_router=   {1 | 0 }
        handle= { pe_handle }
        igp_session_handle= <igp_session_handle>
        mpls_session_handle= <mpls_session_handle>
        pe_count= < integer>
        port_handle= <port_handle>
        tunnel_handle= <gre_tunnel_handle>

Arguments:

mode
                Specifies the action to perform. Possible values are
                enable and disable. This argument is `Mandatory`. The
                modes are described below::


                 enable - Enables one or more PE routers. You must
                          input port_handle, -igp_session_handle,
                          bgp_session_handle, and mpls_session_handle
                          or tunnel_handle, depending on whether you
                          want to use MPLS over GRE.

                 disable - Disables one or more PE routers. You must
                          specify the handle argument.

bgp_session_handle
                Specifies the BGP session connecting to the peer PE,
                which establishes VPN LSP and assigns VPN labels.

                The handle you specified is created and returned by the
                BGP protocol command (emulation bgp config)
                of Spirent HLTAPI. When you enable multiple PEs at
                one time, the number of handles must be equal to
                the value of the PE number (pe_handle).

                When the tunnel_handle switch is defined to emulate
                MPLS over GRE topology, each pair of IGP session
                and BGP session that emulates one PE router for
                a VPN should be created on the same emulated devices.

                The BGP session should be controlled (started or
                stopped) and be fetched information from by using
                Spirent HLTAPI commands of BGP protocol. For
                example, it can be created, modified, and deleted
                by the ``emulation bgp config`` function; it can be
                controlled by the ``emulation bgp control`` function;
                it can be fetched information from by the
                ``emulation bgp info`` function.

enable_p_router
                Specifies whether the Provider router, which the
                configured PE attaches to, is emulated or not. Possible
                values are 0 (disable) and 1 (enable). When it is set to
                0, no P router would be emulated. When it is set to 1,
                which process would be done depends on whether
                the tunnel_handle argument is specified.

                If tunnel_handle is specified (as in this case,
                mpls_session_handle would be ignored), the inputted
                igp_session_handle would be treated as working on P
                router, and GRE tunnel interface (tunnel_handle)
                would be treated on P router too.

                If tunnel_handle is absent: The IGP session
                (igp_session_handle) and the MPLS session
                (mpls_session_handle) you specified are
                both treated like sessions working on P router.

                When you enable multiple PEs at once, only one P
                router is emulated and all enabled PEs will attach to
                that router.
                The default value is 0.

handle
                Specifies the PE handle enabled by this command. This
                is required by disable mode.

igp_session_handle
                Specifies the IGP Protocol session connecting to the
                SUT to advertise routing information of the emulated
                PE. The inputted handle value is created and
                returned by relevant protocol commands of Spirent
                HLTAPI. When you enable multiple PE routers, input
                IGP session handle number according to the value of
                the enable_p_router option. If the enable_p_router
                switch is set to 0, the number of IGP sessions must be
                equal to the PE number (pe_count). If the
                enable_p_router option is set to 1, only one IGP
                session handle is required to emulate IGP protocol
                session on one P router.

                The IGP session should be controlled (started or
                stopped) and be fetched information from by using
                relevant protocols of Spirent HLTAPI commands. For
                example, if the IGP session is OSPF, it can be created,
                modified, and deleted by the
                ``emulation ospf config`` function; it can be
                controlled by using the emulation ospf control
                function; and it can be fetched information from by
                using the emulation ospf info command.

mpls_session_handle
                Specifies the MPLS session of the MPLS core network
                connecting to the SUT. The Input handle is created and
                returned by relevant MPLS protocol commands of
                Spirent HLTAPI. If the tunnel_handle is attendant, this
                switch will be ignored and MPLS over GRE topology will be
                emulated. When the tunnel_handle option is absent,
                you can specify this switch. Each pair of MPLS session
                and IGP session should be created on the same
                emulated device.

                When you enable multiple PEs at once, the number of
                MPLS session handles will be determined by the value
                of the enable_p_router argument:

                If the enable_p_router option is set to 0, IGP session
                handle number must be equal to the PE number which
                is defined by the pe_count option.

                If the enable_p_router argument is set to 1, only one
                IGP session handle is needed to emulated IGP protocol
                session on one P router.

                The MPLS session should be controlled (started or
                stopped) and be fetched information from by using the
                Spirent HLTAPI commands of other relevant protocols.

                For example, if the MPLS session is LDP, it can be
                created, modified, and deleted by using the
                ``emulation ldp config`` function; it can be controlled
                by specifying the ``emulation ldp control`` function;
                it can be fetched information from by using the
                emulation ldp info command.

pe_count
                Specifies the number of PEs to be enabled at one time.
                Possible values range from 0 to <max_int>. The default
                value is 1.

port_handle
                Specifies the handle of the port on which the PE router
                is enabled. This argument is required only by the
                enable modes.


tunnel_handle
                Specifies the GRE tunnel interface connecting to the
                noneMPLS provider network of the SUT. The handle
                you specified by this argument is created and returned
                by the relevant GRE commands of Spirent HLTAPI
                (such as emulation gre config.). When this switch is defined,
                MPLS over GRE topology will be emulated, and the
                mpls_session_handle option is ignored.
                When this switch is specified, each pair of IGP session
                and BGP session for VPN that emulates one PE router
                must be created on the same emulated devices.

Arguments Unsupported by Save as HLTAPI:

The following Spirent HLTAPI arguments are currently not supported by the Save as
HLTAPI function::


  tunnel_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):

handle         The handle that identifies the PE handle enabled by the
               ``emulation mpls l3vpn pe config`` function.
status         Success (1) or failure (0) of the operation.
log            An error message (if the operation failed).
Description:

The emulation mpls l3vpn pe config function enables and disables the specified MPLS Layer3 VPN PE router. Use the mode argument to specify the action to perform. (See the mode argument description for information about the actions.)

To enable a PE router, you can use enable mode of the function emulation mpls l3vpn pe config function along with the port_handle argument to specify the Spirent HLTAPI port that the emulation will use. (The port handle value is contained in the keyed list returned by the connect function.)

Examples:

The following example enables an Layer3 VPN PE on a port:

emulation mpls l3vpn pe config
     mode= enable
     port_handle= port_handle1
     bgp_session_handle= bgp_handle1
     igp_session_handle= ospf_handle1
     tunnel_handle= greTunnel1
     pe_count= 1
Note: There must be an existed port with the handle of port_handle1, a BGP
session handle that is bgp_handle1, an OSPF session handle that is ospf_handle1 and a GRE handle that is gre_handle1.

The following example disables an Layer3 VPN PE on a port:

emulation mpls l3vpn pe config
     mode= disable
     handle= $peHandle1

Sample Output:

# Success
   {status 1} {handle pe_handle1}

# Failure
   {status 0} {log XXX}

emulation mpls l3vpn site config

Execute Tester Command ${rt_handle} command=test_control <additional key=value arguments>

Purpose:
Enables or disables a Customer Site in an MPLS Layer3 VPN network topology on a Spirent HLTAPI chassis.

Synopsis:

Note: M indicates the argument is `Mandatory`.
     emulation mpls l3vpn site config
        mode= {create|modify|delete} M
        port_handle= <port_handle>
        handle= <site_handle>
        ce_session_handle= <ce_session_handle>
        device_count= < integer>
        interface_ip_addr= < a.b.c.d >
        interface_ip_step= < a.b.c.d >
        interface_ip_prefix= < 0 - 32 >
        pe_handle=    < pe_handle >
        pe_loopback_ip_addr= < a.b.c.d >
        pe_loopback_ip_step= < a.b.c.d >
        pe_loopback_ip_prefix= < 0 - 32 >
        rd_start= <admin:assigned>
        rd_step= <admin:assigned>
        site_count= <0max_int>
        vpn_id= < 1 - 4294967295 >
        vpn_id_step= < 1 - 4294967295>
        vlan_id= < 1 - 4095>
        vlan_id_step= < 0 - 4095>

Arguments:

mode
                Specifies the action to perform. Possible values are
                create, modify, and delete. This argument is `Mandatory`.
                The modes are described below::


                 create - Creates one or multiple VPN customer sites.
                        You must input port_handle and other switches
                        which depends on the value of the vpn_type
                        option.

                 modify - Modifies the configuration of one VPN
                         customer site. You must specify the handle
                         argument.

                 delete - Deletes one or more VPN customer site. You
                          must specify the handle argument.

port_handle
                Specifies the handle of the port on which to create the
                VPN customer site. This argument is required only by
                create modes. This switch has no default value.

handle
                Specifies the VPN customer site handle created by this
                command. You must specify this argument when the
                mode argument is set to modify or delete.

ce_session_handle
                Specifies the IGP of BGP protocol session worked on
                and emulated a CE device, interacting with the DUT to
                exchange VPN routes. The handle is created or returned
                by Spirent HLTAPI commands of relevant IGP or BGP
                protocol.

                The session should also be controlled (started or stopped) and be
                fetched information from by using Spirent HLTAPI commands of
                relevant protocol. For example, if the IGP session is OSPF, it
                can be created, modified, and deleted by the
                ``emulation ospf config`` function; it can be controlled by
                using the ``emulation ospf control`` function, can be fetched
                information from by using the emulation ospf info command.

device_count
                Specifies the number of hosts to be emulated within
                one VPN site. The default value is 1.

interface_ip_addr
                Specifies the first IP address of the address pool with in
                the VPN sites. The default value is 192.85.1.1.

interface_ip_step
                Specifies the step value of IP address of the VPN site
                when you create multiple hosts within one VPN site or
                create multiple VPN sites at once. The default value is
                0.0.1.0.

interface_ip_prefix
                Specifies the prefix length of IP address of the address
                pool with in the VPN sites. Possible values range from
                0 to 32. The default value is 32.

pe_handle
                Specifies the handle of the PE router which the
                configured VPN customer sites attach to. The handle is
                enabled and returned by
                the ``emulation mpls l2vpn pe config`` function. If
                this switch is specified, the configured VPN sites will
                be treated as those attaching to the emulated PE router
                specified by this option. If you don't define this
                argument, the configured VPN sites will be treated
                as that directly attaches to the SUT which works as the
                PE for the VPN site.

pe_loopback_ip_addr
                Specifies the loopback IP address of the PE router that
                the configured VPN sites attach to. You must specify
                this option when you don't define the pe_handle
                argument. The default value is 10.1.1.1. The value of
                this argument must be in IPv4 format.

pe_loopback_ip_prefix
                Specifies the loopback IP address prefix length of the
                PE router that the configured VPN sites attach to.
                Possible values range from 0 to 32.The default value is
                32.

pe_loopback_ip_step
                Specifies the step value of the loopback IP address of
                the PE router that the configured VPN sites attach to
                when you create multiple
                VPN sites at one time. The default value is 0.0.0.0. The
                value of this argument must be in IPv4 format.

rd_start
                Specifies the first RD of VPN route for the VPN site.
                There are two types of RD value::


                 type 0 - The administrator subfield is a 2 byte AS
                     number and the assigned subfield is a 4 byte
                     number assigned by the service provider. The
                     format should be like "n:n (admin:assigned)"

                 type 1 - The administrator subfield is a 4-byte IPv4
                     address and assigned subfield is a 2 byte number
                     assigned by the service provider. The format
                     should be like "n.n.n.n:n (admin:assigned)".

                This switch is applicable when the vpn_type
                switch is set to bgp_vpls. The default value is
                0:0.

rd_step
                Specifies the step value of the RD of the VPN  Route
                for the VPN site. This switch is available when the
                vpn_type switch is set to bgp_vpls. The default value
                is 0:0.

site_count
                Specifies the number of VPN sites to create at once.
                The default value is 1. Possible values range from 0 to
                <maxint>

vlan_id
                Specifies the first VLAN ID for the VPN site. Possible
                values range from 1 to 4095. If you specify this option,
                Spirent HLTAPI will add VLAN interface to
                configured VPN site; if not, no VLAN interface will be
                on the VPN site.

vlan_id_step
                Specifies the step value of the VLAN ID for the VPN
                site when you create multiple VPN sites or there are
                multiple VLAN interfaces within one VPN site.
                Possible values range from 0 to 4095. The default value
                is 0. This switch is applicable when the vlan_id option
                is defined.

vpn_id
                Specifies the VPN ID of the VPN site. VPN ID is a
                global identifier of VPN in Spirent HLTAPI. The
                emulated customer site with the same VPN ID would
                be treated as in same VPN. Possible values range from
                1 to 4294967295.The default value is 1.

vpn_id_step
                Specifies the step value of the VPN ID of the VPN site,
                when you create multiple VPN sites at one time. The
                VPN ID is the global identifier of a VPN in Spirent
                HLTAPI. Emulated customer site with same VPN ID
                would be treated as in same VPN. Possible values range from
                1 to 4294967295. The default value is 1.

Arguments Unsupported by Save as HLTAPI:

The following Spirent HLTAPI arguments are currently not supported by the Save as
HLTAPI function::


  vpn_id_step
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         The handle that identifies the VPN site handle created
               by the ``emulation mpls l3vpn site config`` function.
status         Success (1) or failure (0) of the operation.
log            An error message (if the operation failed).
Description:

The emulation mpls l3vpn pe config function creates, modifies, and deletes the specified MPLS L3VPN Customer sites. Use the mode argument to specify the action to perform. (See the mode argument description for information about the actions.)

To create a VPN site, use create mode of the function emulation mpls l2vpn site config port_handle=to specify the Spirent HLTAPI port that the emulation will use. (The port handle value is contained in the keyed list returned by the connect function.)

In addition to specifying the port, you must also specify one or more of the following arguments when you create a VPN site:

vpn_type
pe_handle
pe_loopback_ip_addr
pe_loopback_ip_prefix

Examples:

The following example enables an Layer3 VPN site on a port:

#There must already exist a port with handle port_handle1 and a CE router
#session handle pe_handle1.
  emulation mpls l3vpn site config mode=create
     port_handle= port_handle1
     pe_handle= pe_handle1
     pe_loopback_ip_prefix= 32
     site_count= 5
     vpn_type= martini_pwe
     vc_id= $vc_id
     vc_id_step= $vc_step
     vpn_id= $vpn_id
     vpn_id_step= $vpn_step
     mac_addr= $site_mac_addr
     mac_addr_count= 100
     mac_addr_step= $site_mac_step
     vlan_id= $vlan_id
     vlan_id_step 1pe_count= 5

The following example modifies an Layer3 VPN site:

#There must already exist a VPN site vpnSiteHandle1
 emulation mpls l3vpn site config mode=modify
      handle= $vpnSiteHandle1
      pe_loopback_ip_addr= "1.10.1.2"
      pe_loopback_ip_prefix= 32
      vpn_type= martini_pwe
      vc_id= 1501
      vpn_id= 101
      mac_addr= 12:22:33:44:55:66
      vlan_id= 1700

The following example deletes two L3VPN sites:

emulation mpls l3vpn site config
     mode= delete
     handle= "$vpnSiteHandle1 $vpnSiteHandle2"

Sample Output:

Success: {status 1} {handle pe_handle1}

Failure: {status 0} {log XXX}

End of Procedure Header