An identifier is used to distinguish different VXLANs, similar to the VLAN ID for VLANs. Virtual machines on different VXLANs cannot communicate with each other over Layer 2.
What are VTEPs and VNIs in VXLAN?
Next, let's learn about the VXLAN network model and common concepts.

Two servers communicate through a VXLAN network
A tunnel is established between two top-of-rack (TOR) switches to encapsulate the original data frames sent by the source server into VXLAN packets so that the original data frames can be transmitted on the bearer network (such as an IP network). When the VXLAN packets arrive at the TOR switch connected to the destination server, the TOR switch decapsulates these packets into the original data frames and forwards the frames to the destination server.
What is a VTEP?
VXLAN tunnel endpoints (VTEPs) are edge devices on a VXLAN network and are the start point and endpoint of a VXLAN tunnel. VXLAN encapsulates and decapsulates original user data frames on the VTEP.
A VTEP can be a network device (for example, Huawei CloudEngine series switches) or a virtual switch in a server. The original data frames sent by the source server are encapsulated into VXLAN packets on the VTEP, transmitted to another VTEP on the IP network, decapsulated, restored, and forwarded to the destination server.
If VMs connected to different VTEPs need to communicate with each other at Layer 2, a VXLAN tunnel needs to be established between the two VTEPs.
What is a VNI?
A VNI is a user identifier similar to a VLAN ID. A VNI represents a tenant. VMs belonging to different VNIs cannot directly communicate with each other at Layer 2. When VXLAN packets are encapsulated, a length of 24 bits is allocated to the VNI to support the isolation of a large number of tenants.
VNIs can be classified into Layer 2 VNIs and Layer 3 VNIs, which have different functions:
Layer 2 VNIs are common VNIs and are mapped to BDs in 1:1 mode to forward VXLAN packets in the same subnet;
Layer 3 VNIs are associated with VPN instances to forward VXLAN packets across subnets;
VXLAN Packet Encapsulation Format;
A VXLAN header is added to the original packet and then encapsulated in the UDP header. The IP and MAC addresses of the bearer network are used as the outer headers for encapsulation.

Understand VXLAN in one sentence: move the original data link layer communication to the network layer.


