[Computer Network] Chapter 3 Data Link Layer (Virtual Machine and LAN)




insert image description here

3.9 Process of Ethernet switch self-learning and frame forwarding

The process of self-learning and forwarding data frames of the Ethernet switch is as follows:

Self-learning (Learning):

When the switch receives a frame, it examines the source MAC address in the frame and associates it with the receiving port.
The switch stores the mapping information of the source MAC address and the receiving port in a so-called MAC address table (also called CAM table or forwarding table).

Forwarding:

When the switch receives a data frame from the target host, it will look up the corresponding port of the target MAC address in the MAC address table.

If the mapping information of the target MAC address is found in the MAC address table, the switch only forwards the data frame to the corresponding port.

If no mapping information of the destination MAC address is found in the MAC address table, the switch broadcasts the data frame to all other ports (except the receiving port).

During the broadcast process, other connected switches will also learn the mapping information between the source MAC address and the corresponding port, and update their respective MAC address tables.

Updating:

The switch will periodically check the entries in the MAC address table and update them according to the actual network traffic conditions.
If a data frame of a certain MAC address has not been received for a long time, the entry may be deleted to free up storage space.
Through the process of self-learning and forwarding, the Ethernet switch can realize accurate data frame forwarding according to the MAC address, improving the transmission efficiency and security of the network.


The switch works at the data link layer (including the physical layer).
The switch works at the data link layer (including the physical layer). After receiving the frame, it searches the frame exchange table for the interface number corresponding to the destination MAC address of the frame. The frame is then forwarded through this interface.

insert image description here


insert image description here

Exercise 2

3.10 Spanning Tree Protocol STP for Ethernet Switches

Ethernet switches use Spanning Tree Protocol STP to increase redundant links to improve network reliability while avoiding various problems caused by network loops.

  • Regardless of the physical connection between the switches, the switch can automatically calculate and build a logically loop-free network , and its logical expansion structure must be tree-shaped (no logical loop).
  • The final tree-type logical expansion should ensure the connection of the entire network .
  • When the switch is connected for the first time or the network physical configuration changes (possibly due to man-made changes or failures), the switch will recalculate the spanning tree .

3.11 Virtual Local Area Network

3.11.1 Overview of Virtual Local Area Network (VLAN)

A huge broadcast domain composed of many switches will bring disadvantages including broadcast storms.
Broadcast information frequently appears in the network:

  • Many protocols in the TCP/IP stack use broadcasts:
    • Address Resolution Protocol ARP (known IP address, find out its corresponding MAC address)
    • Routing Information Protocol RIP (a small interior routing protocol)
    • Dynamic Host Configuration Protocol DHCP (for automatic configuration of IP addresses)

SO, splitting the broadcast domain becomes especially important:

  • Broadcast domains can be isolated by using routers (routers work at the network layer), but the cost of routers is high
  • Virtual local area network (VLAN) technology is born out of operation

Virtual Local Area Network VLAN (Virtual Local Area Network) is a technology that divides devices in a local area network into logical groups that have nothing to do with physical locations. These logical groups have certain common requirements . The same VLAN can broadcast communication, but different VLANs cannot broadcast communication.

3.11.2 Implementation Mechanism of Virtual Local Area Network (VLAN)

It is implemented on the switch, which requires the switch to implement two functions:

  • Can handle VLAN-tagged frames (IEEE 802.1Q frames)
  • Switch ports can support different port types

There are three port types of the switch: (Access Trunk Hybrid)

Access Port: Access ports are used to connect terminal devices, such as computers and printers. Each access port usually allows only one VLAN to be used, and forwards the received data frame according to the VLAN it belongs to.

Channel group port (Trunk Port): The channel group port is used to connect the link between two switches or between a switch and a router. It can transmit data frames of multiple VLANs, and use specific protocols (such as VLAN Trunking Protocol, VTP) to identify and transfer data between different VLANs.

Mirrored Port: A mirrored port is a special port type used for network monitoring and analysis. It can copy and send all data frames in and out of the switch to a specific monitoring device for traffic analysis, troubleshooting, etc.

These different types of ports play different roles in the switch. Select the appropriate port type according to the actual needs to meet the network configuration and requirements.



insert image description here

Guess you like

Origin blog.csdn.net/m0_60915009/article/details/131651869