In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
One: the function of the data link layer 1.1 data link layer establishment, maintenance and removal of 1.2 frame packaging, frame transmission, frame synchronization 1.3 frame error recovery
1.3.1 the method of retransmission is used.
1.4 flow control
1.4.1 ensure the stability of the intermediate transmission equipment and the matching of transmission rates between the transceiver and the sender.
Two: Ethernet frame format 2.1Ethernet MAC address
Used to identify a single device or group of devices on an Ethernet network.
Because MAC addresses are made up of 48-bit binary numbers, they are usually divided into six segments. The first 24 digits are the serial numbers of the manufacturers who want to apply for IEEE, and the last 24 digits are the serial numbers of the network interface cards. When the eighth bit of a MAC address is 0, it indicates that the MAC address is a unicast address, and if it is 1, the MAC address is a multicast address.
2.2 Ethernet frame format
Ethernet has a variety of frame formats, here is the most commonly used frame format of Ethernet II, which contains a total of six domains.
The preamble contains an eight-character knot and a layer of frame start delimiters. In Ethernet, the preamble is considered part of the physical layer encapsulation, not the data link layer encapsulation.
The destination address contains six bytes that identify the MAC address of the destination site of the frame. The destination address can be a unicast address (a single destination), a multicast address (group destination), or a broadcast address.
The source address contains six bytes, and the source address identifies the MAC address of the sending frame site. The source address must be a unicast. (the eighth place is 0)
The type field contains two bytes to indicate the type of upper layer protocol, such as 0800H for IP protocol.
The data field contains 46-1500 bytes. The data domain encapsulates the high-level protocol information transmitted over Ethernet. Type fields and data fields can be understood as packets
The frame check sequence contains four bytes and is the check from the destination address to the end of the data field.
Third: the forwarding principle of the switch. Environment: switches in the initial state, three PCs with known MAC addresses connected to the switch by twisted-pair cables.
3.2 process:
Host A wants to send data frames to host B.
Principle: 1. MAC address learning
Because the switch is in the initial state, there is no MAC address table in the switch. at this time, if host A wants to send a data frame to host B, it must enter the switch through interface 1. At this time, the switch will add the source address of host A to the interface number of the data frame (interface 1) and add it to the MAC address table of the switch.
two。 Broadcast unknown data frames
The switch knows that host A will send information to host B, but at present, the switch only knows the MAC address of host A, so the switch cannot find the MAC address of host B in the MAC address table. Therefore, the switch uses broadcast, and all interfaces except interface 1 will forward this data frame, so both host B and host C will receive this data frame.
3. The recipient responds to the message
After both host B and host C receive the data frame, the host C looks at the data frame and finds that it has nothing to do with it, so it does not respond. Host B finds that the other party's data frame is officially sent to itself, so host B responds to the broadcast and responds to a data frame (the source address of host B is 22. Destination address 11.), at this point, the data frame passes through the switch through interface 2, and the switch will add the source address of the data frame to the MAC address table by matching the source address of the data frame with the interface number (interface 2).
4. Switch realizes unicast communication
At this point, the communication between host An and host B does not need to be broadcast because their entries have been recorded in the switch MAC address table. So now host An and host B communicate, and the switch sends data directly to each other through the corresponding interface.
Four: the command line configuration of the switch
4.1 user mode
When the switch starts and presses the enter key, the first thing to enter is the user mode. In this mode, users are greatly restricted and can only view some statistical information.
4.2 privileged mode
Enter the enable (abbreviated as "en") command in user mode to enter privileged mode, which allows you to view and modify the configuration of the Cisco device.
4.3 Global configuration mode
Enter the config terminal (abbreviated as "conf t") command in privileged mode to enter the global configuration mode, in which the user can modify the global configuration of the switch.
4.4 Interface Mod
In global configuration mode, enter the interface fastetherent 0Uniplet1 command (which can be abbreviated as "int f0gam1") to enter interface mode. Unlike the global mode, the configuration made by the user in this mode is set for the interface f0max 1.
4.5 View MAC address tabl
The privileged mode input command: show mac-address-table [dynamic], "dynamic" is an optional parameter that allows the switch to display only the MAC addresses that the switch has learned dynamically.
4.6 configure the duplex mode and rate of the interface 4.1.1 configure the communication rate of the specified interface
The command line is as follows: Switch (config-if) # speed [10/100/1000/auto]
Speed: keyword for configuring interface rate
10ax 100pm 1000: configure a specific rate value for the excuse. We usually set it to 100 now.
Auto: the communication rate is automatically negotiated between the interface and the peer.
4.1.2 specify the duplex mode of the interface
The command line is as follows: switch (config-if) # duplex [full / half / auto]
Duplex: keyword for configuring duplex mode
Full: specifies the duplex mode of the interface as full-duplex
Half: specifies the duplex mode of the interface as half-duplex
Auto: specifies the duplex mode of the interface as autonegotiation
The duplex mode of the two switches is generally full-duplex. Duplex full
4.1.3 View the duplex mode and communication rate of the interface
Command: show interface F1 Compact 0, just in privileged mode.
It can be seen from the display results that after the link is established, the duplex mode negotiation is full-duplex and the rate mode negotiation is 100M/S communication rate.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.