Data Link Layer Basics

The basics
of the data link layer 1. Introduction
to the data link layer 1. The location of the data link layer is between the
physical layer and the network layer
2. The functions of the data link layer
(1) The establishment, maintenance and removal of the data link
(2 ) Frame packing, frame transmission, frame synchronization
(3) Frame error recovery
(4) Flow control
2. Ethernet
1, what is Ethernet
MAC address (hardware address or physical address) length reaches 48 bits, IP address is 32 bits
The MAC address is globally unique (the first 24 digits are the supplier's identification, and the last 24 digits are the supplier's unique number for the network card) No configuration is required.
Binding MAC address can change the MAC address, but it does not make much sense. Usually, it is not necessary to change
a hexadecimal = Four binary
broadcast MAC addresses 48 1s or FF-FF-FF-FF-FF-FF
PDU Protocol data unit
2, Ethernet frame format 1 byte B = 8 bits b

3. Ethernet naming method
Broadband can transmit a variety of data
Baseband can only transmit one type of data
TX T twisted pair X shielded (UTP) or unshielded (STP)
FX F fiber
3. Sublayer of the data link layer (understand)
1. Media Access Control (MAC) sublayer
--- Encapsulate the data handed over from the upper layer into frames for transmission (reverse process when receiving, disassemble the frame)
--- Implement and maintain the medium access control protocol
--- Bit Error detection
--- The addressing of the MAC frame, that is, which station (source station) sends the MAC frame, and which station or which station (destination station) receives the MAC frame.
2. Logical Link Control (LLC) sublayer
--- establish and release the logical connection of the data link layer
--- provide the interface with the upper layer
--- add the sequence number to the frame
LAN 1KM wider area network
4. Ethernet Switch
1. What is a switch?
Switch: The switch is the main device that connects the local area network.
Functions: ① The switch can forward data intelligently according to the target address in the Ethernet frame, so the switch works at the data link layer;
② The switch divides the collision domain to realize full-duplex communication.
2. Huawei's switching product system
(1) Huawei S2700 series switches
Huawei 's Layer 2 100M access Ethernet switches
(2) Huawei S5700 series switches (6700/7700/9700
) Gigabit access and 10 Gigabit uplink ports
(3) Huawei S12700 series agile switches
--- Acumen switches designed and developed by Huawei for the core of next-generation campus networks
(4) CE12800 data center switch series switches (CE5800/6800/7800/8800)
--- Huawei's new products for data centers and high-end campus networks A generation of high-performance core switches
3. The working principle of the switch
(1) The forwarding principle of the switch
① Initial state
② MAC address learning Form the MAC address table
by learning the source MAC address of the data frame, and then find the MAC address of the destination address
③ Broadcast the unknown data frame
If there is a MAC address of the destination address in the MAC address table, the switch will send the data along the corresponding address in the
MAC address table; if there is no corresponding destination MAC address in the MAC address table, the switch will send the data to the data All ports other than the source port of the
frame broadcast the data frame
④ The receiver responds
that the non-target address device in the receiver ignores it, and the target address device responds after receiving the broadcast (broadcasting)
⑤ The switch realizes unicast communication
The switch receives the response from the destination address, learns it again, writes the MAC address of the destination address into its own MAC address table, and sends the corresponding data of the source address in the form of unicast through the path specified in the MAC address table. give the destination address.
⑥ Update
--- The aging time of the MAC address table of the switch is 300s
--- If it finds that the MAC address of the ingress port of a frame is different from all the ports of the source MAC address in the MAC address table, the switch will
re-learn the MAC address to the new port.
(2) View the MAC address
<Huawei> display mac-address
In the MAC address table, the same interface can correspond to multiple MAC addresses, but one MAC address cannot correspond to multiple interfaces
4. Collision domain and broadcast domain
1, simplex, half-duplex and full-duplex
(1) Simplex has only one channel , the transmission direction can only be one-way, such as pager
(2) half-duplex has only one channel, at the same time, it can only be one-way transmission, such as walkie-talkie
(3) full-duplex dual-channel, and can have two-way data transmission at the same time, Such as telephone
2, collision and collision domain
(1) If there are too many conflicts, the transmission efficiency will be reduced. In order to improve transmission efficiency, the collision domain must be divided
(2) The collision domain must be divided
(3) Switch backplane switching matrix structure
Each port of the switch When accessing another port, there will be a dedicated line, and there will be no conflict. The
switch defaults to full-duplex and does not use CSMA/CD. Only half-duplex uses CSMA/CD
. Five, broadcast domain
1, broadcast domain refers to the node that receives the same broadcast message 2. The
switch divides the collision domain, but does not divide the broadcast domain, that is, all ports of the switch belong to the same broadcast domain.
6. Internal switching mode of switch
1. Store and forward
---is the most widely used method in the field of computer network
---error detection of data packets entering the switch
---support conversion between ports of different speeds
---in data Slow switching and long delay during processing
2. Fast forwarding
---very small delay, very fast switching
---cannot provide error detection capability
---can not directly connect input/output ports with different rates due to no buffering , and easy to lose packets
3. Segmentation filtering

--- Check whether the length of the data packet is enough to 64 bytes, if it is less than 64 bytes, it will be discarded directly, and if it is larger than 64 bytes, it will be sent directly
.
7. Basic switch configuration
1. Check the MAC address table [ Hawei
]display mac-address
2. Check the switch address
<Huawei>display bridge mac-address
3. The LLDP link layer discovery protocol is used to check the neighbor device Information
[Huawei]lldp enable Enable link layer discovery protocol
<Huawei>display lldp neighbor information
<Huawei>display lldp neighbor brief brief information
4. View information about a specified port of the
neighbor <Huawei>display lldp neighbor interface Ethernet 0 /0/X
8. Configure the working mode of the interface
1. Configure the duplex mode in non-auto-negotiation mode
[Huawei-GigabitEthernet0/0/1]undo negotiation auto
[Huawei-GigabitEthernet0/0/1]duplex + mode (half or Full)
2. Configure the rate in non-auto-negotiation mode
[Huawei-GigabitEthernet0/0/1]undo negotiation auto
[Huawei-GigabitEthernet0/0/1]speed + number (10, 100, 1000, etc.)
9. Configure the management IP address
<Huawei>system-view
[Huawei]interface vlan1
[Huawei-vlanif1]ip address + IP address

      [Huawei-vlanif1]shutdown 接口关闭
      [Huawei-vlanif1]undo shutdown 接口开启

Guess you like

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