Detailed explanation of Layer 2/Layer 3/Large Layer 2 networks: basic concepts, related technologies, and the relationship between the three
In this issue, we will share with you basic network troubleshooting knowledge.
1. Core concepts
(1) Layer 2 network
Layer: OSI data link layer (Layer 2).
Communication basis: Based on MAC address, relying on broadcast/flooding mechanism, typical equipment is Layer 2 switch.
Core capabilities: MAC address learning, VLAN division, spanning tree protocol (STP) anti-loop.
Limitations: Limited broadcast domain, suitable for small local area networks.
(2) Layer 3 network
Layer: OSI network layer (Layer 3).
Communication basis: Based on IP address, cross-subnet communication is achieved through routing tables (static/dynamic routing protocols such as OSPF, BGP), and typical equipment is a Layer 3 switch/router.
Core capabilities: IP routing, ACL policy control, subnet division to reduce broadcast domain.
Advantages: Supports wide area interconnection and is suitable for large enterprise networks.
(3) Large Layer 2 network
Positioning: Layer 2 extension technology, building a virtual Layer 2 tunnel on a physical Layer 3 network.
Core technologies: VXLAN (MAC in UDP encapsulation), EVPN (MAC address distribution), NVGRE, etc.
Goal: Break through the limitations of the traditional two-layer broadcast domain (support 16 million logical networks) and support hot migration of virtual machines.
2. Comparison of technical principles
3. Application scenarios
(1) Layer 2 network
Simple topology scenarios such as small office networks and campus networks.
Localized equipment interconnection (such as printers, IP cameras).
(2) Layer 3 network
Enterprise-level campus networks with multiple branches (such as hospitals and universities).
Complex environments that require QoS and ACL policy control.
Inter-regional wide area network interconnection (such as branch office communications).
(3) Large Layer 2 Network
Data center virtualization: supports hot migration of virtual machines (keeping IP/MAC unchanged).
Ultra-large-scale campus network: supports logical isolation of tens of thousands of terminals (such as Super VLAN).
Cloud service architecture: virtual networks across physical servers (such as OpenStack Neutron).
4. Relationship among the three
(1) Pyramid-like hierarchical dependency
① Layer 2 network: the “foundation” of network communication
Responsible for direct communication between devices in the same subnet (such as computer access in an office), and is the underlying communication unit of all upper-layer networks.
Limitations: Cannot cross subnets (e.g. VLAN 10 and VLAN 20 require Layer 3 devices to interconnect), and the size of the broadcast domain is limited.
② Layer 3 network: the "pillar" of network expansion
Based on the Layer 2 network construction, different subnets are connected through IP routing (e.g. connecting corporate headquarters and branches) to solve cross-domain communication problems.
Key role: Provide underlying physical connections for large Layer 2 networks (e.g. Layer 3 IP accessibility between data centers).
③ Large Layer 2 network: "Sky bridge" at the logical layer
Relying on the IP connectivity of the Layer 3 network, a virtual Layer 2 channel is built on the Layer 3 "pillar" through tunnel technology (such as VXLAN) to achieve Layer 2 communication across physical boundaries (such as keeping the MAC/IP unchanged when a virtual machine migrates between different data centers).
(2) Technology Evolution
Layer 2 → Layer 3: Breaking through broadcast domain limitations and supporting larger-scale networks.
Layer 3 → Large Layer 2: Driven by cloud computing needs, solving the problem of virtual machine migration across physical machines.