# Operation and maintenance Xiaobai's growth diary fifth day-# Basic network builds OSI seven-layer model - basic knowledge of data link layer

Operation and Maintenance Xiaobai's Growth Diary Day 5-

Basic network construction OSI seven-layer model - basic knowledge of data link layer

Xiaobai of network operation and maintenance and friends who want to join network operation and maintenance are worth a look~
Today is the fifth day of network operation and maintenance. I hope that like-minded friends can discuss and learn together, and I also hope that the great gods of network operation and maintenance can help guide me on the road of network operation and maintenance, and I can make more progress by giving more opinions.

Today, I will share with you the basic knowledge of the data link layer in the OSI seven-layer model.

Data link layer
1, Ethernet: The physical network we usually contact is Ethernet. A network that operates in the way CSMA/CD works.
2. Ethernet working principle: CSMA/CD, carrier sense multiple access/collision detection. Before sending data, first monitor whether the channel is idle, and send data if it is idle. If multiple nodes send data at the same time, there will be collisions. In the event of a collision, the node will stop sending for a short random period of time and then try again.
3. The initial network is a shared medium. A shared medium allows only one data signal to be sent at a certain point in time.
4. MAC address: 48-bit binary number (48bit), or 6 bytes. The first 24 digits are the identifier of the manufacturer, and the last 24 digits are customized by the manufacturer.
5. The IEEE (Institute of Electronics and Electrical Engineers) is responsible for assigning the first 24 bits of the MAC address.
6. Ethernet frame format:
6 bytes destination MAC+6 bytes source MAC address+2 word type/length+46-1500 bytes data+4 bytes frame check
7. Ethernet naming: N-signal-medium
100-BASE-TX
100: The maximum rate is 100Mb/s
BASE: Baseband transmission It corresponds to broadband BROAD
TX: Twisted pair
8, Ethernet two sublayers
(1) The upper layer is called LLC, and the logical link control
(2) The lower layer is called MAC, Media Access Control

Layer 2 main equipment: switch
1. It has intelligence and can identify the MAC address of data frames and forwards data frames according to the MAC address.
2. Manufacturers: Huawei, H3T, Cisco, Ruijie, Shenma, Datang, tplink, dlink, Front Fire, ZTE
3. Command ipconfig/all to check the MAC address
4. When the switch forwards data frames, check the MAC address table. The MAC address table records the host MAC address corresponding to each physical interface.
5. The switch MAC address table construction process
(1) Build a MAC address table according to the source MAC of the received data frame
(2) Check the destination MAC address of the data frame and decide how to forward it. If the MAC address is not in its own MAC address table, it is sent to all other ports.
(3) If the switch does not receive the data from the host within the specified time (usually 300 seconds), it will delete the host's MAC address from the address table.
(4) If the switch receives a broadcast message, it broadcasts to all other ports

6. Duplex mode: whether the interface function can only send, or can only receive, or can both receive and send
(1) Simplex: can only receive or can only send. Such as BP machine, radio.
(2) Half-duplex: can receive and send, but not at the same time. Such as walkie-talkie
(3) full duplex: send and receive at the same time. such as telephone

7. Conflict: On a shared medium, two nodes send data at the same time to cause conflict.
The hub HUB is a shared medium, and the switch implements a private network. Therefore, the network connected to the current switch has no conflict.
8. Hosts that share the media connection share the bandwidth (equally divide the bandwidth).
9. The area where any two hosts send data at the same time, which can cause conflict, is called the conflict domain.
10. No matter how many HUBs are connected to each other, they are all in a large conflict domain.
11. The larger the collision domain, the greater the possibility of conflict, and the smaller the bandwidth allocated to each host.
12. In order to solve the conflict problem, a switch is used to replace the HUB. A switch is a specialized medium.
13. The switch separates large conflict domains into small conflict domains, and each switch port is a conflict domain.
14. Broadcast: data sent by a host requires all hosts to receive it. The broadcast address is all 1s in binary.
15. Broadcast domain: After a host sends a broadcast, the area that can receive the broadcast is the broadcast domain.
16. No matter how many switches and HUBs are connected to each other, it is a large broadcast domain.

17. Internal switching mode of the switch
(1) Store and forward. The switch receives the entire frame, checks it, and discards the frame if it is damaged; if the frame is good, it checks the MAC address table and forwards the frame from a certain port. The most widely used method.
(2) Fast forwarding. After receiving the target MAC address, it starts to forward the data frame from the corresponding port. The switching speed is very good, the latency is low, but there is no error checking.
(3) Fragment filtering (fragment-free forwarding, Fragment-Free). The normal Ethernet frame size is between 64-1518 bytes. Less than 64 bytes are collision fragments (scratch frames). Fragment filtering checks whether the frame is greater than or equal to 64 bytes, and if it is less than 64 bytes, it is directly discarded, otherwise the target MAC address is checked for forwarding.
18. The HUB can only achieve half-duplex and can only divide the bandwidth equally. It is impossible for different ports to have different rates; switches can be half-duplex or full-duplex, and can achieve different rates for different ports.
19. The switch is directly connected to the host, and there will be no more conflicts.
20. A switch with the same function has appeared before, called Bridge, which has only two ports. A switch is a multi-port bridge.

Switch configuration
1. Check the MAC address table
[Huawei]display mac-address
2. Check the switch's own MAC address
<Huawei>display bridge mac-address
3. Check the neighbor information
(1) Enable the lldp protocol
[Huawei]lldp enable
(2) View neighbor brief information
[Huawei]display lldp neighbor brief
Local Intf Neighbor Dev Neighbor Intf Exptime
Eth0/0/3 ntd1803-sw2 Eth0/0/1
Local Intf: Neighbor Dev neighbor device on the local interface

4. Switch speed and duplex mode configuration
(1) Manually specify the mode and speed, and auto-negotiation must be disabled
[mysw1]interface Ethernet 0/0/2
[mysw1-Ethernet0/0/2]undo negotiation auto
(2) Specify duplex The mode is full duplex
[mysw1-Ethernet0/0/2]duplex full
(3) The specified rate is 100Mb/s
[mysw1-Ethernet0/0/2]speed 100

5. Configure the management IP address
(1) If the switch is in the computer room, and you don't want to go to the computer room to configure it, what should you do? Configure an IP for the switch and control it remotely.
(2) Configure the management IP
[mysw1]interface vlan1
[mysw1-Vlanif1]ip address 192.168.1.1 255.255.255.0
[mysw1-Vlanif1]undo shutdown to activate the port
(3) Save the configuration
<mysw1>save

Wireless channel: 1-11 (there are also devices with the last channel being 13), adjacent channels have interference, 1, 6, 11 do not overlap.

Guess you like

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