switch

The data link layer is located between the network layer and the physical layer. The function of this layer is to realize error-free transmission of data. The switch is the device at this layer

The LAN we usually use is Ethernet.

①If the intermediate line is shared, who will use this link at the same time? How to ensure that these lines use shared lines in an orderly manner without data conflict

Ethernet uses CSMA/CD (Carrier Sense Multiple Access with Collision Detection) to avoid signal conflict. The principle is to monitor whether the channel is idle before sending, and send data immediately if it is idle. When sending, continue to monitor while sending. If a conflict is detected, stop sending immediately, wait for a random event, and then try again

② If host A sends a packet to host B, how to identify them?

The Ethernet address is used to identify a single device or a group of devices on the Ethernet. The address is 48 bits, 24 bits are the vendor identification, and 24 bits are the vendor's unique number for the network card.

 

Ethernet naming method

N---Signal---Physical medium (N: data rate in megabytes, signal: baseband or broadband)

For example, 100BASE-TX data transmission rate 100M baseband using twisted pair, two pairs of unshielded twisted pair or two teams of Category 1 shielded twisted pair, distance 100 meters

What is Baseband Transmission Broadband Transmission?

In data communication, the digital data signal representing the computer binary bit sequence is a typical rectangular pulse signal. The overband of the signal is called the basic frequency band, or baseband for short, and the rectangular pulse signal is called the baseband signal. The method of transmitting baseband signals is called baseband transmission. The channel is divided into multiple sub-channels to transmit audio, video and digital signals respectively, which is called broadband transmission (Broadband).

 

The switch is the main device used to connect the local area network. The switch can only forward data according to the destination address in the Ethernet frame. The switch divides the collision domain to achieve full-duplex communication.

 

Switch data forwarding principle

Learning: The MAC address table is formed by the switch by learning the source MAC address in the received data frame

Broadcast: If the destination address does not exist in the MAC address table, the switch broadcasts the data frame to all ports except the port that received the data frame

Forwarding: The switch forwards data frames based on MAC address unicast

Update: The aging time of the switch's MAC address table is 300 seconds. If the switch finds a new frame and the source MAC address and port match does not match the record in the address table, it will re-learn a new port.

 

data forwarding process

First, the signal arrives at the network cable interface and is received by the PHY (MAU) module. Next, the PHY (MAU) module converts the signal in the network cable into a common format and then passes it to the MAC module. The MAC module converts the signal into digital information, and then checks the error through the FCS at the end of the packet, and stores it in the buffer if there is no problem. This part of the operation is basically the same as the network card. It can be considered that each network cable interface of the switch is followed by a network card. The network cable interface and the following circuit parts are added together to form a port. The difference from the network card is that the switch port does not check the receiver MAC. address, but directly accept all packets into the buffer, the switch port does not have a MAC address. Next, query the MAC address table, which mainly contains two pieces of information, one is the MAC address of the device, and the other is which port the device is connected to on the switch. Then it is sent to the corresponding port through the switching circuit

 

 

The switch divides the collision domain and does not divide the broadcast domain. The broadcast domain refers to the set of nodes that receive the same broadcast message.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326438178&siteId=291194637