VXLAN Configuration Guide
NOTES:
The switch platforms which use this feature are:
Trident2
Trident2+
Tomahawk
Tomahawk+
Trident3
Maverick
Trident4-X9
Trident4-X11
Tomahawk 2 switches only support VXLAN L2-VNI, not L3-VNI.
If VXLAN is deployed in an MLAG domain, it behaves a little differently. For details, see MLAG Configuration.
Enable the IP routing function before using this feature. For details, refer to Configuring IP Routing.
Overview
Virtual Extensible LAN (VXLAN) is an overlay network virtualization technology. An overlay network is a virtual network that is built on top of existing network Layer 2 and Layer 3 technologies to support elastic compute architectures. VXLAN makes it easier for network engineers to scale out a cloud computing environment while logically isolating cloud apps and tenants.
VXLAN uses UDP-based encapsulation to tunnel Ethernet frames and transfers original data packets as tunnel payloads. With the outer UDP tunnel, inner payload data can be quickly transferred on the layer 2 and layer 3 networks. To provide the capability of broadcast domain addressing, the VXLAN technology uses layer 3 IP multicast to replace the Ethernet broadcast. Therefore, the broadcast, unknown unicast, and multicast (BUM) packets can be transferred on virtual networks through broadcasting. For more VXLAN details, please read RFC7348.
VXLAN Packets
Figure 1. VXLAN Packets
As shown in Figure 1, a VXLAN packet consists of the outer encapsulation and the inner payloads.
Flags (8 bits): The flag I must be set to 1 for a valid VXLAN Network Identifier (VNI). The other 7 bits (labeled as R) are reserved fields and must be set to 0 on transmit and ignored on receive.
VXLAN segment ID or VXLAN VNI: This parameter contains 24 bits and is used to designate the individual VXLAN overlay network on which the VMs are located.
Reserved fields (24 bits and 8 bits): This parameter must be set to 0 on transmit and ignored on receive.
The destination port number assigned to the outer tunnel is 4789, which is dedicated.
MTU Value
The new addition of VXLAN message encapsulation introduces a problem with the setting of the MTU value. In general, the default MTU of a VM or host is 1500 bytes, that is, the maximum original Ethernet message is 1500 bytes.
The VXLAN message will be encapsulated with a new message header of 50 bytes (VXLAN header 8 bytes, UDP header 8 bytes, external IP header 20 bytes, and external MAC header 14 bytes) when it is encapsulated with the VXLAN header and goes through the VTEP. After the encapsulation, the packet size becomes 1550 bytes.
VXLAN packets are not allowed to be fragmented and put back together. It is therefore necessary that all intermediate devices have at least the same MTU if not higher than the originating VXLAN encapsulated packet.
If the original packet of 1500 bytes is encapsulated with VXLAN header, the resulting packet size becomes 1550. If the MTU value of the intermediate device is not convenient to change, then setting the MTU value of the virtual machine to 1450 can also solve this problem temporarily.
VXLAN Inner 802.1Q
NOTE:
For the Trident4-X9 and Trident4-X11 platforms, the only supported encapsulation mode and decapsulation mode are none. You don’t need to change the default mode.
Encapsulation Mode
Encapsulation means the flow from access ports to network ports. Use one of the following options to specify actions about 802.1Q tag during encapsulation.
none: No changes are made, untagged packets remain untagged, and tagged packets remain tagged.
service-vlan-add: Add an 802.1Q tag to untagged packets, and tagged packets remain unchanged. Encapsulation VLAN is required.
service-vlan-add-delete: Add an 802.1Q tag to untagged packets, and delete the tag from tagged packets. Encapsulation VLAN is required.
service-vlan-add-replace: Add an 802.1Q tag to untagged packets, and replace the tag on tagged packets. Encapsulation VLAN is required.
service-vlan-delete: Delete the 802.1Q tag from tagged packets, and untagged packets remain unchanged. This is the default value according to RFC 7348.
service-vlan-replace: Replace the VLAN ID of the 802.1Q tag on tagged packets, and untagged packets remain unchanged. Encapsulation VLAN is required.
Decapsulation Mode
Decapsulation means the flow from network ports to access ports.
none: No changes are made, untagged packets remain untagged, and tagged packets remain tagged.
service-vlan-add: From network ports to access ports, add an 802.1Q tag to both untagged/tagged packets. If the access port is matched by port and VLAN, the VLAN ID of the tag being added is that VLAN, otherwise, it is PVID of that port.
service-vlan-add-delete: From network ports to access ports, add an 802.1Q tag to both untagged/tagged packets. If the access port is matched by port and VLAN, the VLAN ID of the tag being added is that VLAN, otherwise, it is PVID of that port. From access to access, delete the tag from tagged packets.
service-vlan-add-replace: From network ports to access ports, add an 802.1Q tag to both untagged/tagged packets. If the access port is matched by port and VLAN, the VLAN ID of the tag being added is that VLAN, otherwise, it is PVID of that port. From access to access, replace tag on tagged packets. This is the default value.
service-vlan-delete: From access to access, delete the tag from tagged packets.
service-vlan-replace: From access to access, replace the tag on tagged packets.
service-vlan-per-port: The decapsulated packet can be tagged or untagged dynamically based on the setting on the output port.
The table below shows the traffic changes in the case that VLANs in the access side are bound with a VXLAN in the network side.
Table 1. Traffic Changes for Access-Side VLAN Binding with Network-Side VXLAN
Mode | Access→Access (configure with decapsulation mode) | Access→Network (configure with encapsulation mode) | Network→Access (configure with decapsulation mode) |
|---|---|---|---|
none | untag-->tag(PVID) tag-->remain tag | untag-->tag(PVID) tag->remain tag | untag-->untag tag-->remain tag |
service-vlan-add | untag-->tag(PVID) tag->remain tag | untag-->tag(PVID) tag->remain tag | untag-->tag(add VXLAN-VLAN) tag-->double tag(outer layer add VXLAN-VLAN) |
service-vlan-add-delete | untag-->untag tag-->untag | untag-->untag tag->untag(been deleted) | untag-->tag(add VXLAN-VLAN) tag-->double tag(outer layer add VXLAN-VLAN) |
service-vlan-add-replace | untag-->tag(PVID) tag-->remain tag | untag→tag(configured VLAN) tag->tag(configured VLAN) | untag-->tag(add VXLAN-VLAN) tag-->double tag(outer layer add VXLAN-VLAN) |
service-vlan-delete | untag-->untag tag-->untag | untag-->untag tag->untag | untag-->untag tag-->remain tag |
service-vlan-replace | untag-->tag(PVID) tag-->remain tag | untag→tag(configured VLAN) tag->tag(changed to encapsulation VLAN) | untag-->untag tag-->remain tag |
service-vlan-per-port | The decapsulated packet can be tagged or untagged dynamically based on the setting on the output port. | ||
VXLAN ECMP
In L2/L3, VXLAN ECMP is supported. PICOS supports up to 32-way ECMP.
The VXLAN ECMP does not need special configuration. It entirely depends on the routing ECMP. The route ECMP configure link: ECMP (Equal-Cost Multipath Routing) Configuration
PicOS uses info from VXLAN header for hash calculation to ensure better performance.
VXLAN MAC Learning
The VTEP performs source MAC learning on the VNI as a Layer 2 switch.
The switch receives traffic from the local VTEP to the remote VTEP, and the VTEP learns the source MAC address on the access port.
The switch receives traffic from the remote VTEP to the local VTEP, and the VTEP learns the source MAC address on the network port.
A VNI MAC address table includes the following types of MAC address entries:
Access port--Dynamic MAC address entries learned from the local VTEP. VXLAN does not support locally configured static MAC addresses.
Network port--Includes static and dynamic MAC entries.
Static MAC: Manually configured static MAC address entries on VXLAN tunnel interfaces.
Dynamic MAC: The MAC address entries learned from incoming traffic on VXLAN tunnels. The learned MAC addresses are contained in the inner Ethernet header source MAC.
On the network port, the configured static MAC entry has a higher priority than dynamic MAC entries.
VXLAN Traffic Forwarding
Unicast Traffic
The switch receives traffic from the access port. The VTEP encapsulates the original Ethernet frame with an outer MAC header, outer IP header, and a VXLAN header. The source IP address is the source VTEP's VXLAN tunnel source IP address.
The local VTEP forwards the encapsulated packets through the VXLAN tunnel to a destination IP address.
The remote VTEP decapsulates the packet and forwards the frame to an access port.
Broadcast, Unknown Traffic, and Multicast (BUM) Traffic
The switch receives traffic from the access port. The VTEP encapsulates the original Ethernet frame with an outer MAC header, outer IP header and a VXLAN header. The source IP address is the source VTEP's VXLAN tunnel source IP address.
The local VTEP floods the encapsulated packets to all remote VTEPs that belong to the same VNI (using head‑end replication) via the VXLAN tunnel.
Each remote VTEPs decapsulates the packet and floods the original frame to all access ports in that VNI.
VXLAN Gateway
A VXLAN gateway enables communication between VXLANs with different VNIs and between VXLANs and non-VXLAN networks.
A VXLAN gateway can be a Layer 2 or Layer 3 gateway. Layer 3 VXLAN gateways can be deployed in centralized or distributed mode.
Centralized mode: In this mode, Layer 3 gateway functionality is centralized on spines. As shown in Figure 2, all cross-subnet traffic is forwarded via this gateway, achieving centralized traffic management.
Figure 2. Topology of Centralized Gateway
Distributed mode: Layer 3 VXLAN gateways are configured on leaf nodes, which are used as VTEPs to establish VXLAN tunnels. Spine nodes are unaware of the VXLAN tunnels and only forward VXLAN packets between different leaf nodes.
Figure 3. Topology of Distributed Gateway
Configuring Static VXLAN
VXLAN is supported on PICOS L2/L3 switch. For configuration steps, please see below.
Step 1 Configure a VXLAN source interface.
admin@PICOS# set l3-interface loopback loopback address 10.10.10.25 prefix-length 32
admin@PICOS# set vxlans source-interface loopback address 10.10.10.25
admin@PICOS# commit
Commit OK.
Save done.Step 2 Create a VXLAN VNI.
admin@PICOS# set vxlans vni 10010
admin@PICOS# commit
Commit OK.
Save done.Step 3 Configure a VTEP address for the VXLAN VNI.
admin@PICOS# set vxlans vni 10010 flood vtep 10.10.10.12
admin@PICOS# commit
Commit OK.
Save done.Step 4 Add a VLAN into the VXLAN VNI.
admin@PICOS# set vxlans vni 10010 vlan 100
admin@PICOS# commit
Commit OK.
Save done.Application Scenario Limitation
In L2 GRE or VXLAN networks, only one next hop is allowed for the same egress interface. As shown in Figure 2, the same egress interface on Switch1 has two tunnels, that is, two next hops, which is not allowed.
Figure 2. Unsupported Configuration Example
However, multiple L2 GRE or VXLAN tunnels can exist from the same egress port on Switch1 if connected via the IP router, ensuring that one egress interface has only one next hop, as shown in Figure 3.
Figure 3. Supported Configuration Example