vlan是data link layer中比较重要的一个协议?
VLAN (Virtual Local Area Network) is a logical grouping of devices on a network based on their functions, project teams, or applications. It enables network administrators to partition a physical LAN into multiple logical networks, each with its own broadcast domain.
At the data link layer, VLANs are implemented by adding a VLAN tag to each Ethernet frame as it passes through the network. This tag identifies which VLAN the frame belongs to and helps to keep the frames from different VLANs separate. VLAN tags are added and removed by network switches as they forward the frames between different VLANs.
Layer 3 switches, also known as multilayer switches, combine the functions of a traditional layer 2 switch with those of a layer 3 router. In addition to switching frames based on their MAC addresses at layer 2, they can also perform routing based on their IP addresses at layer 3. This allows layer 3 switches to provide inter-VLAN routing, which enables communication between VLANs that are connected to the same switch.
Layer 3 switches can also support other advanced features, such as Quality of Service (QoS), access control lists (ACLs), and multicast routing, which make them suitable for use in large enterprise networks.
When a switch receives a frame, it checks the destination MAC address of the frame and looks up the MAC address in its MAC address table to determine the outgoing interface for the frame. If the MAC address is not found in the table, the switch will flood the frame out all interfaces except for the interface it was received on. This is because the switch doesn't know which interface is connected to the destination device and needs to send the frame to all interfaces in the same VLAN.
When the destination device receives the frame, it sends an acknowledgement back to the source device, allowing the switch to learn the MAC address of the destination device and update its MAC address table accordingly. If the switch already knows the MAC address of the destination device, it forwards the frame directly to the appropriate interface without flooding.
Overall, the switch forwards frames within the same VLAN and filters frames between different VLANs based on the configured VLAN membership and VLAN interfaces. This helps to reduce unnecessary traffic and optimize network performance.
There are three types of forwarding methods used by switches:
-
Store-and-Forward存储转发: In this method, the switch stores the entire incoming frame in its buffer and checks for errors before forwarding it to the outgoing port. If the frame contains errors, it is discarded. This method provides the highest level of error checking and is therefore the slowest method of forwarding frames.
-
Cut-Through快速转发: In this method, the switch forwards the frame as soon as it has read the destination MAC address. This method provides lower latency but provides no error checking and can potentially forward corrupted frames.
-
Fragment-Free碎片隔离(分段过滤): This method is similar to cut-through, but the switch reads the first 64 bytes of the frame to check for collisions before forwarding. This provides a compromise between speed and error checking, as it only checks for errors in the first 64 bytes of the frame where most collisions occur.
网络层次模型
In a hierarchical network design, there are typically three layers of network, which are the core, distribution, and access layers.
-
Access Layer: This layer is the first layer that connects end-user devices to the network. It is responsible for providing access to the network and controlling the flow of traffic between end devices and the network. The access layer is also where VLANs are usually implemented to group devices into logical networks.
-
Distribution Layer: This layer is responsible for routing and filtering traffic between different access layer switches and also connects them to the core layer. The distribution layer typically implements policies for network traffic, such as Quality of Service (QoS) policies, access control lists (ACLs), and policy-based routing (PBR).
-
Core Layer: This layer is the backbone of the network and is responsible for the high-speed and reliable transport of data between different distribution layer switches. The core layer does not perform any packet manipulation or filtering and is designed for maximum uptime and high-speed data transport. Redundancy and load-balancing are typically implemented at the core layer to ensure network availability and performance.
标签:layer,network,22,连网,frame,VLAN,MAC,switch,04 From: https://www.cnblogs.com/chucklu/p/17350480.html