Example: Configuring Service Chaining Using a Custom Bridge on NFX250 NextGen Devices
This example shows how to configure service chaining using a custom bridge.
Requirements
This example uses an NFX250 NextGen device running Junos OS Release 19.1R1.
Overview
The default system bridge is Open vSwitch (OVS). The OVS bridge is a VLAN-aware system bridge, which acts as the Network Functions Virtualization (NFV) backplane to which the VNFs and FPCs connect. However, you can choose to create a custom bridge based on your requirement. This example explains how to configure service chaining using a custom bridge.
Topology
This example uses the topology shown in Figure 1.
Configuration
- Configuring VLANs and Creating the Custom Bridge
- Configuring the Layer 2 Datapath
- Configuring the Layer 3 Datapath
- Configuring the VNF
Configuring VLANs and Creating the Custom Bridge
Step-by-Step Procedure
Configure VLANs for the LAN-side interfaces:
user@host# set vlans vlan100 vlan-id 100 user@host# set vlans vlan200 vlan-id 200
Create a custom bridge:
user@host# set vmhost vlans custom-br vlan-id none
Map the Layer 3 interface to the custom bridge:
user@host# set vmhost virtualization-options interfaces ge-1/0/2 mapping vlan custom-br
Configuring the Layer 2 Datapath
Step-by-Step Procedure
Configure the LAN-side front panel ports and add them to the LAN-side VLAN.
user@host# set interfaces ge-0/0/0 unit 0 family ethernet-switching interface-mode trunk user@host# set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members vlan100 user@host# set interfaces xe-0/0/12 unit 0 family ethernet-switching interface-mode trunk user@host# set interfaces xe-0/0/12 unit 0 family ethernet-switching vlan members vlan200
Configure the internal-facing interfaces as trunk ports and add them to the LAN-side VLAN. The internal-facing interfaces are typically trunk ports as they must support traffic from multiple front panel ports and VLANs.
user@host# set interfaces sxe-0/0/0 unit 0 family ethernet-switching interface-mode trunk user@host# set interfaces sxe-0/0/0 unit 0 family ethernet-switching vlan members vlan100 user@host# set interfaces sxe-0/0/1 unit 0 family ethernet-switching interface-mode trunk user@host# set interfaces sxe-0/0/1 unit 0 family ethernet-switching vlan members vlan200
Configuring the Layer 3 Datapath
Step-by-Step Procedure
Configure VLAN tagging on ge-1/0/0:
user@host# set interfaces ge-1/0/0 vlan-tagging user@host# set interfaces ge-1/0/0 unit 0 vlan-id 100 user@host# set interfaces ge-1/0/0 unit 0 family inet address 192.0.2.1/24
Configure VLAN tagging on ge-1/0/2:
user@host# set interfaces ge-1/0/2 vlan-tagging user@host# set interfaces ge-1/0/2 unit 0 vlan-id 200 user@host# set interfaces ge-1/0/2 unit 0 family inet address 203.0.113.2/24
Configuring the VNF
Step-by-Step Procedure
This example uses a Layer 2 VNF.
Launch the VNF:
user@host# set virtual-network-functions vnf-name image /var/public/centos-updated1.img user@host# set virtual-network-functions vnf-name image image-type raw
Specify the number of CPUs required for the VNF:
user@host# set virtual-network-functions vnf-name virtual-cpu count 1
Pin a virtual CPU to a physical CPU:
user@host# set virtual-network-functions vnf-name virtual-cpu 0 physical-cpu 2
Configure the vmhost instance:
user@host# set vmhost vlans vlan200 vlan-id 200
Create a VNF interface on the custom OVS bridge:
user@host# set virtual-network-functions vnf-name interfaces eth2 mapping vlan members custom-br
Create a VNF interface on the OVS bridge:
user@host# set virtual-network-functions vnf-name interfaces eth3 mapping vlan members vlan200
Specify the memory allocation for the VNF:
user@host# set virtual-network-functions vnf-name memory size 1048576
Note:When a VNF interface is mapped to a custom bridge, you should restart the VNF for the mapping to take effect.
Verifying the Configuration
Verify the Control Plane Configuration
Purpose
Verify the control plane configuration:
Action
Verify that the VLANs are configured:
user@host > show vlans Routing instance VLAN name Tag Interfaces default-switch default 1 default-switch vlan100 100 ge-0/0/0.0* sxe-0/0/0.0* default-switch vlan200 200 sxe-0/0/1.0* xe-0/0/12.0*
Verify the vmhost VLANs:
user@host> show vmhost vlans Routing instance VLAN name Tag Interfaces vmhost custom-br vnf-name_eth2.0 vmhost vlan200 200 vnf-name_eth3.0
Verify that the VNF is operational. The
State
field showsRunning
for VNFs that are up.user@host> show virtual-network-functions ID Name State Liveliness -------------------------------------------------------------------------------- 4 vnf-name Running alive 1 vjunos0 Running alive
The
Liveliness
field of the VNF indicates whether the internal management IP address of the VNF is reachable from the Junos Control Plane (JCP).To view more details of the VNF:
user@host> show virtual-network-functions vnf-name detail Virtual Network Function Information ------------------------------------ Id: 4 Name: vnf-name State: Running Liveliness: alive IP Address: 192.0.2.100 VCPUs: 1 Maximum Memory: 1048576 KiB Used Memory: 1048576 KiB Used 1G Hugepages: 0 Used 2M Hugepages: 0 Error: None
Verifying the Data Plane Configuration
Purpose
Verify the data plane configuration.
Action
Verify the status of the Layer 2 (ge-0/0/x) and Layer 3 (ge-1/0/x) interfaces.
user@host > show interfaces interface-name statistics
For example:
user@host > show interfaces ge-0/0/0 statistics Physical interface: ge-0/0/0, Enabled, Physical link is Up Interface index: 149, SNMP ifIndex: 517 Link-level type: Ethernet, MTU: 1514, LAN-PHY mode, Link-mode: Full-duplex, Speed: 1000mbps, Duplex: Full-Duplex, BPDU Error: None, Loop Detect PDU Error: None, Ethernet-Switching Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online, IEEE 802.3az Energy Efficient Ethernet: Disabled, Auto-MDIX: Enabled Device flags : Present Running Interface flags: SNMP-Traps Internal: 0x4000 Link flags : None CoS queues : 12 supported, 12 maximum usable queues Current address: 30:7c:5e:4c:78:03, Hardware address: 30:7c:5e:4c:78:03 Last flapped : 2018-11-26 11:03:32 UTC (04:25:39 ago) Input rate : 0 bps (0 pps) Output rate : 0 bps (0 pps) Active alarms : None Active defects : None PCS statistics Seconds Bit errors 0 Errored blocks 0 Ethernet FEC statistics Errors FEC Corrected Errors 0 FEC Uncorrected Errors 0 FEC Corrected Errors Rate 0 FEC Uncorrected Errors Rate 0 PRBS Statistics : Disabled Interface transmit statistics: Disabled Logical interface ge-0/0/0.0 (Index 330) (SNMP ifIndex 519) Flags: Up SNMP-Traps 0x24024000 Encapsulation: Ethernet-Bridge Input packets : 0 Output packets: 0 Protocol eth-switch, MTU: 1514 Flags: Trunk-Mode
Verify the status of the interfaces on the OVS and the custom bridge:
user@host > show vmhost network nfv-back-plane Network Name : custom-br Interface : custom-br Type : internal, Link type : Full-Duplex, MAC : 2e:8e:a3:e3:e5:40 MTU : [], Link State :down, Admin State : down IPV4 : None, Netmask : None IPV6 : None, IPV6 netmask : None Rx-packets : 0 Rx-drops : 0 Rx-errors : 0 Tx-packets : 0 Tx-drops : 0 Tx-errors : 0 Interface : vnf-name_eth2 Type : dpdkvhostuser, Link type : Full-Duplex, MAC : 00:00:00:00:00:00 MTU : 1500, Link State :down, Admin State : up IPV4 : None, Netmask : None IPV6 : None, IPV6 netmask : None Rx-packets : 0 Rx-drops : 0 Rx-errors : 0 Tx-packets : 0 Tx-drops : 0 Tx-errors : 0 Network Name : ovs-sys-br Interface : ovs-sys-br Type : internal, Link type : Full-Duplex, MAC : 66:9c:3f:25:04:40 MTU : [], Link State :down, Admin State : down IPV4 : None, Netmask : None IPV6 : None, IPV6 netmask : None Rx-packets : 0 Rx-drops : 0 Rx-errors : 0 Tx-packets : 0 Tx-drops : 0 Tx-errors : 0 Interface : dpdk0 Type : dpdk, Link type : Full-Duplex, MAC : 02:09:c0:1a:c6:ee MTU : [], Link State :up, Admin State : up IPV4 : None, Netmask : None IPV6 : None, IPV6 netmask : None Rx-packets : 0 Rx-drops : 0 Rx-errors : 0 Tx-packets : 0 Tx-drops : 0 Tx-errors : 0 Interface : dpdk1 Type : dpdk, Link type : Full-Duplex, MAC : 02:09:c0:7b:6c:47 MTU : [], Link State :up, Admin State : up IPV4 : None, Netmask : None IPV6 : None, IPV6 netmask : None Rx-packets : 0 Rx-drops : 0 Rx-errors : 0 Tx-packets : 0 Tx-drops : 0 Tx-errors : 0 Interface : l3_h_ge_1_0_0 Type : dpdkvhostuser, Link type : Full-Duplex, MAC : 00:00:00:00:00:00 MTU : [], Link State :down, Admin State : up IPV4 : None, Netmask : None IPV6 : None, IPV6 netmask : None Rx-packets : 0 Rx-drops : 0 Rx-errors : 0 Tx-packets : 0 Tx-drops : 0 Tx-errors : 0 Interface : l3_h_ge_1_0_1 Type : dpdkvhostuser, Link type : Full-Duplex, MAC : 00:00:00:00:00:00 MTU : [], Link State :down, Admin State : up IPV4 : None, Netmask : None IPV6 : None, IPV6 netmask : None Rx-packets : 0 Rx-drops : 0 Rx-errors : 0 Tx-packets : 0 Tx-drops : 0 Tx-errors : 0 Interface : l3_h_ge_1_0_2 Type : dpdkvhostuser, Link type : Full-Duplex, MAC : 00:00:00:00:00:00 MTU : [], Link State :down, Admin State : up IPV4 : None, Netmask : None IPV6 : None, IPV6 netmask : None Rx-packets : 0 Rx-drops : 0 Rx-errors : 0 Tx-packets : 0 Tx-drops : 0 Tx-errors : 0 Interface : vnf-name_eth3 Type : dpdkvhostuser, Link type : Full-Duplex, MAC : 00:00:00:00:00:00 MTU : 1500, Link State :down, Admin State : up IPV4 : None, Netmask : None IPV6 : None, IPV6 netmask : None Rx-packets : 0 Rx-drops : 0 Rx-errors : 0 Tx-packets : 0 Tx-drops : 0 Tx-errors : 0