docs: refresh & structure overhaul
[nfvbench.git] / docs / user / mpls.rst
1 .. Copyright 2016 - 2023, Cisco Systems, Inc. and the NFVbench project contributors
2 .. SPDX-License-Identifier: CC-BY-4.0
3
4 ==========================
5 MPLS encapsulation feature
6 ==========================
7
8 This feature allows to generate packets with standard MPLS L2VPN double stack MPLS labels, where the outer label is transport and the inner label is VPN.
9 The top layer of a packets encapsulated inside MPLS L2VPN seems to be an Ethernet layer with the rest of the IP stack inside.
10 Please refer to RFC-3031 for more details.
11 The whole MPLS packet structure looks like the following:
12
13 ###[ Ethernet ]###
14   dst       = ['00:8a:96:bb:14:28']
15   src       = 3c:fd:fe:a3:48:7c
16   type      = 0x8847
17 ###[ MPLS ]### <-------------- Outer Label
18      label     = 16303
19      cos       = 1
20      s         = 0
21      ttl       = 255
22 ###[ MPLS ]### <-------------- Inner Label
23         label     = 5010
24         cos       = 1
25         s         = 1
26         ttl       = 255
27 ###[ Ethernet ]###
28            dst       = fa:16:3e:bd:02:b5
29            src       = 3c:fd:fe:a3:48:7c
30            type      = 0x800
31 ###[ IP ]###
32               version   = 4
33               ihl       = None
34               tos       = 0x0
35               len       = None
36               id        = 1
37               flags     =
38               frag      = 0
39               ttl       = 64
40               proto     = udp
41               chksum    = None
42               src       = 16.0.0.1
43               dst       = 48.0.0.1
44               \options   \
45 ###[ UDP ]###
46                  sport     = 53
47                  dport     = 53
48                  len       = None
49                  chksum    = None
50
51 Example: nfvbench generates mpls traffic port A ----> port B. This example assumes openstack is at the other end of the mpls tunnels.
52 Packets generated and sent to port B are delivered to the MPLS domain infrastructure which will transport that packet to the other end
53 of the MPLS transport tunnel using the outer label. At that point, the outer label is decapsulated and the inner label is used to
54 select the destination openstack network. After decapsulation of the inner label, the resulting L2 frame is then forwarded to the
55 destination VM corresponding to the destination MAC. When the VM receives the packet, it is sent back to far end port of the traffic
56 generator (port B) using either L2 forwarding or L3 routing though the peer virtual interface. The return packet is then encapsulated
57 with the inner label first then outer label to reach nfvbench on port B.
58
59 Only 2 MPLS labels stack is supported. If more than two labels stack is required then these operations should be handled by MPLS transport
60 domain where nfvbench is attached next-hop mpls router and rest of the mpls domain should be configured accordingly to be able
61 pop/swap/push labels and deliver packet to the proper destination based on an initial transport label injected by nfvbench, VPN label
62 should stay unchanged until its delivered to PE (compute node).
63 Set nfvbench 'mpls' parameter to 'true' to enable MPLS encapsulation.
64 When this option is enabled internal networks 'network type' parameter value should be 'mpls'
65 MPLS and VxLAN encapsulations are mutual exclusive features if 'mpls' is 'true' then 'vxlan' should be set to 'false' and vise versa.
66 no_flow_stats, no_latency_stats, no_latency_streams parameters should be set to 'true' because these features are not supported at the moment.
67 In future when these features will be supported they will require special NIC hardware.
68
69 Example of 1-chain MPLS configuration:
70  internal_networks:
71     left:
72         network_type: mpls
73         segmentation_id: 5010
74         mpls_transport_labels: 16303
75         physical_network: phys_sriov0
76     right:
77         network_type: mpls
78         segmentation_id: 5011
79         mpls_transport_labels: 16303
80         physical_network: phys_sriov1
81
82 Example of 2-chain MPLS configuration:
83  internal_networks:
84     left:
85         network_type: mpls
86         segmentation_id: [5010, 5020]
87         mpls_transport_labels: [16303, 16304]
88         physical_network: phys_sriov0
89     right:
90         network_type: mpls
91         segmentation_id: [5011, 5021]
92         mpls_transport_labels: [16303, 16304]
93         physical_network: phys_sriov1
94
95 Example of how to run:
96 nfvbench --rate 50000pps --duration 30 --mpls