VLan Some Basic Concepts PDF
VLan Some Basic Concepts PDF
You might have physical hosts and Virtual Machines distributed across the entire
network, which you might want to get into the same network segment.
Stretching your VLANs could be a solution, as it can help you span your layer 2
across the physical network.
But the problem is that the number of VLANs runs out quickly and the solution is
VxLAN.
With this technology, you can layer 2 networks on top of your existing layer 3
network.
In this article, we'll provide an overview of VXLAN and you'll learn what it is, how it
works, and where to use it.
1. What is VxLAN?
VxLAN (Virtual extensible Local Area Network) is an industry-standard overlay
network virtualization technology.
It was initially designed to address the issues related to scalability in large-scale
network deployments such as ISPs or cloud providers.
As the name implies, VxLAN virtually extends a layer 2 segment across the layer 3
network infrastructure. VxLAN encapsulates the layer 2 Ethernet frames inside a
VXLAN packet that includes an IP address.
VxLAN segments are identified by a 24-bit VNID (VxLAN IDentification) field which
can scale to 16 million segments.
The main difference is that VLAN uses the tag on the layer 2 frame for encapsulation
and can scale up to 4000 VLANs.
VXLAN, on the other hand, encapsulates the MAC in UDP and is capable of scaling
up to 16 million VxLAN segments.
It uses the underlay IP network and builds a flexible layer 2 overlay logical network
on it.
With the overlay, any layer 2 connection can span across layer 3 network.
The overlay and the underlay networks are totally independent, so if there is a
change in the underlay network topology, the overlay network will not be affected
(design-wise).
The overlay network can be re-designed without needing to add, remove, or update
network devices.
Of course, physical problems that affect performance or uptime of the underlay will
be reflected on the overlay.
For example, if there are not enough devices to provide enough bandwidth, the
overlay will also be affected.
How does the overlay VxLAN avoid being affected by underlay changes?
Spine: The spine layer switches are only used to pass traffic through leaf
switches. They are not aware of VxLAN.
Leaf: The Leaf layer of switches interconnect the spine and the end points. The
leaf layer switches create the VxLAN tunnels, encapsulation, and maps VLANs to
VNI. The leaf switches that perform VxLAN functions are known as VTPEs
(VxLAN Tunnel Endpoints
All the leaf switches have a link to every spine switch. Every link between leaf and
switch is routed through an IP address by an IGP routing protocol such as BGP or
OSPF.
Leaf-and-switch may also use ECMP (Equal Cost Multi-Pathing) to recover when a
spine switch or link fails or to balance the traffic loads.
3. VXLAN Encapsulation
We know so far that VxLAN stretches the layer 2 subnets across the layer 3 network
limits. It builds a logical overlay network on top of a switching fabric like the Spine-
and-Leaf.
Outer MAC header: This is the header that contains information for next-hop
transport. It includes the destination and the source MAC address of the VxLAN
endpoints, a VLAN ID (16 bits), and Type. The size of the outer MAC header is 14
bytes.
Outer IP header: This header allows transport across the IP network. It includes
the destination and the source IP address of the VxLAN endpoints. The size of the
outer IP header is 20 bytes.
Outer UDP header: This header identifies the packet as VxLAN. It contains the
UDP source port, VxLAN port, and UDP length. The size of the UDP header is 8
bytes.
A VxLAN header. This header is also referred to as the VxLAN Network Identifier
(VNI). The VNID is used to identify the VxLAN segment. It is similar to the VLAN
ID tag (16 bits) found on the MAC header but with a size of 24 bits, which allows
up to 16 million different segments.
4. VxLAN Tunnel Endpoints (VTEPs)
Any endpoint like a host, switch, or router that supports VxLAN can be referred to as
a VTPE (VxLAN Tunnel Endpoint).
As the name implies, the job of VTEPs is to create and terminate tunnels between
each other. In other words, they encapsulate and decapsulate VxLAN traffic.
When a layer 2 frame with the same VNI arrives at the ingress VTEP, it
encapsulates the frame with a VxLAN and UDP/IP headers.
Then sends it over using the underlay IP network transport towards the egress VTPE
for decapsulation.
The egress VTPE removes the IP and UDP headers and delivers the original layer 2
frame.
A VTEP can be either a virtual or a physical switch port and is usually configured on
leaf switches.
A bud node is a switching device with two roles, a VTEP to perform VxLAN related
tasks and an IP transit device to forward VxLAN traffic.
In order to deliver traffic to other VTEPs, the bud node should be in the same
multicast group used by the VxLAN VNIs.
The below screenshot shows an example of the bud node. Let’s say that host 1
wants to communicate with host 3.
The VTEP-2 and VTEP-3 belong to a multicast group used for VXLAN VNIs. The
VTEP-2 checks the VxLAN ID from the packet and forwards it based on IP.
But if Host-1 wants to communicate with host-2, VTEP-2 can also decapsulate the
VxLAN packet.
Not all platforms can be a bud node. Running two roles at the same time requires
powerful processing power.
Platforms that run VxLAN on ASIC, such as the Cisco Nexus 9000 series, are
adequate for this type of topology.
Two leaf VTEPs gateways can act as one through peer-link and keep-alive links.
You can accomplish this with a Cisco-based feature, called the vPC (Virtual Port-
Channel).
vPC is a layer 2 feature found on the Cisco Nexus switches, which allows you to
connect a host to two switches at the same time.
The pair of virtual vPC switches can provide redundancy to the attached hosts.
5. Deploying VxLAN
VxLAN is a standard-based technology, so it is not limited to a specific vendor and
can be supported by hardware or software.
You can deploy the technology through a VxLAN host or VxLAN gateway. You can
limit the deployment to one method or use a combination of both.
a. Host-based VxLAN
VxLAN doesn’t need to be deployed on a switch; it can also run on any host, as long
as it natively supports VxLAN.
An example is a hypervisor, which can be configured to run VxLAN on all of its virtual
machines.
The vSwitch running the functions of the VTEP, encapsulates traffic coming from the
VMs before they go out to physical switches.
Since the VxLAN encapsulation is happening at the host, the rest of the network
infrastructure only sees IP traffic.
The advantage of a host-based deployment is that the entire physical network can
be simplified.
Other examples of hosts that may support VxLAN are servers, firewalls, load
balancers, etc.
b. Gateway-based VxLAN
When hosts do not support VxLAN, the best way to deploy it is directly on a switch or
router.
The VxLAN gateway creates the tunnel to the destination VTEP (either host or
gateway), so the hosts and IP infrastructure are not aware of the existence of
VxLAN.
Running VxLAN right from the ASIC, rather than from software, can increase
performance dramatically.
c. Hybrid Deployment
You can also use a combination of both. A hybrid deployment is when you are using
VxLAN with some devices behind a VxLAN Gateway and also have some hosts
running native VxLAN.