Wiki DE Start in the browser

Wiki › Protocols

VXLAN

Extending VLANs across a routed network: Ethernet frames in UDP 4789, VNI instead of VLAN number, VTEPs on layer 3 switches.

Layer
2 über 3 (UDP 4789)
Standard
RFC 7348
See an example
2 demos

The problem

In the data centre the switches route between each other (no loops, no spanning tree). Servers that need to be in the same network are connected to different switches, though. How does a VLAN cross a routed network?

The solution

VXLAN wraps the whole Ethernet frame in a UDP packet (port 4789) and sends it via IP to the switch on the other side. There it is unwrapped and put into the VLAN.

[ Ethernet | IP loopback→loopback | UDP 4789 | VXLAN VNI 10010 | Ethernet | IP | ICMP ]
  outside (underlay)                           inside (the original frame)
TermMeaning
VTEPVXLAN tunnel endpoint, usually a layer 3 switch (leaf)
VNI24-bit identifier of the segment (instead of the 12-bit VLAN ID, so up to 16 million)
Underlaythe routed network between the VTEPs, often with OSPF or BGP
Overlaythe layer 2 network created on top

Setting up

Switch(config)# vlan 10
Switch(config-vlan)# vn-segment 10010
Switch(config)# interface nve1
Switch(config-if)# source-interface loopback0
Switch(config-if)# member vni 10010 peer-ip 10.255.0.2
Switch# show nve peers

In leyoNET the other VTEPs are in a fixed list; the control protocol EVPN is not modelled.

How to do it in leyoNET

The same text as in the app’s help (F1 key).

VXLAN

VXLAN (RFC 7348) extends a VLAN across a routed network. A VTEP (here a layer-3 switch) wraps every frame of the VLAN including its MAC addresses in a UDP packet (port 4789) with the VNI, a 24-bit number for the segment, and sends it by IP to the other VTEPs.

  • Link VLAN and VNI: in the VLAN vn-segment 10010.
  • Tunnel source: usually a Loopback interfaces (interface nve1, source-interface loopback0), reachable in the underlay via OSPF or statically.
  • Enter the other VTEPs as a fixed list (ingress replication): member vni 10010 peer-ip 10.255.0.2. Broadcasts and unknown destinations go to all, learned MAC addresses only to their VTEP («flood and learn»).
  • Frames from VTEPs not in the list are dropped.

In the form: tab Switching, section VXLAN. Display: show nve vni, show nve peers, show mac address-table (entries «nve1»). EVPN (BGP distributes the MAC addresses) is not modelled.

See an example

  • Demo “VXLAN between two sites” in leyoNETDemo “VXLAN between two sites” in leyoNET
    VXLAN between two sites

    Two layer-3 switches extend VLAN 10 via VXLAN across a routed network (OSPF). The PCs in Zürich and Bern are in the same subnet.

    First the switches learn the loopbacks (10.255.0.1 and .2) via OSPF. Then the Zürich PC pings the Bern PC: ARP and ping run wrapped in UDP 4789 across the spine. Filter «vxlan».

    Watch live Project file

  • Demo “Data centre: leaf-spine with BGP and VXLAN” in leyoNETDemo “Data centre: leaf-spine with BGP and VXLAN” in leyoNET
    Data centre: leaf-spine with BGP and VXLAN

    A data centre like those of large providers: two spines, three leafs, every leaf connected to both spines. The underlay routes with eBGP (one AS per leaf), the overlay extends VLAN 10 (web) and VLAN 20 (database) over all leafs with VXLAN.

    First the switches set up their BGP sessions and learn the loopbacks. Then Web 1 pings Web 2 and DB 1 pings DB 2 – both within the same subnet, but across two routed hops. Filter “vxlan” or “bgp”.

    Watch live Project file

“Watch live” opens the network in leyoNET, the simulation runs in a loop. In the app you find it under File → Demo networks, with a step-by-step tour.

Practise

  • ★★★★★ Data centre: leaf-spine with BGP and VXLAN · 5 goals · Worksheet (German)

In leyoNET under Tools → Exercise catalogue. Every exercise checks itself.

What leyoNET simplifies

ProtocolLayerSimplification in the simulation
VXLAN2–4Inner Ethernet frame in UDP 4789 with VNI; VTEPs from a fixed list (ingress replication), MAC learning in the data path; no EVPN, no multicast groups

Standards

  • RFC 7348 – Virtual eXtensible Local Area Network (VXLAN): A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks

Read on

Found a mistake or have an idea? Source of this page on GitHub.