Switch principle and configuration

1. Data link layer

1. Functions of the data link layer

The data link layer is responsible for reliable data communication between adjacent nodes in the network and effective flow control. In a local area network, the data link layer uses frames to complete reliable transmission between host and peer layers.

The functions of the data link layer include the establishment, maintenance and teardown of data links, frame packaging, frame transmission, frame synchronization, frame error control and flow control.

2. Development of Ethernet

Ethernet works at the data link layer and is a computer LAN technology. The IEEE802.3 standard of the IEEE organization formulates the technical standards of Ethernet, which stipulates the contents including physical layer wiring, electronic signals and access layer protocols.

3. Ethernet MAC address

Used to identify a single device or a group of devices on an Ethernet network. The MAC address is composed of a 48-bit binary number, usually divided into six segments, expressed in hexadecimal, such as: 00-D0-09-A1- D7-B7. The first 24 digits are the manufacturer number applied by the manufacturer to IEEE, and the last 24 digits are the serial number of the network interface card.

When the 8th bit of the MAC address is 0, it means that the MAC address is a unicast address; when it is 1, it means that the MAC address is a multicast address. The address of a physical network card must be a unicast address, that is, the 8th bit must be 0. The multicast address is a logical address, used to represent a group of receivers, not one receiver.

4. Ethernet frame format

The data packet on the Ethernet link is called an Ethernet frame. The beginning of the Ethernet frame consists of a preamble and a frame start character, followed by an Ethernet header, which uses a MAC address to indicate the destination address and source address. The middle part of the frame is a data packet containing other protocol headers (such as IP protocol). Ethernet ends with a 32-bit redundancy check code, which is used to check whether the data transmission has been damaged.

Ethernet has many formats. The following is the most commonly used Ethernet II frame format, which includes the following fields.

Preamble: The encapsulation of the physical layer. This part depends on converting the data frame into a bit stream.

Frame start delimiter: Physical layer encapsulation. When the data sent exceeds the maximum byte, the data will be sent in batches (sent out of order), and then the batched data will be combined through the frame start locator. .

Destination address: destination MAC address

Source address: source MAC address

Type: encapsulated upper layer protocol type (network layer)

Data: encapsulated upper data

Frame check sequence: Check whether data is missing and whether the data sequence is normal.

2: Ethernet switch

1. Introduction to switch equipment

There are many switch brands, and manufacturers such as Cisco, Huawei, H3C, T0-Link, Shenzhou Digital, and Ruijie have produced many different models of switches.

2. Working principle of switch

The switch can forward data frames based on the MAC address. The MAC address table stored in the switch maps the MAC address to the switch's interface. Whenever the switch receives a data frame sent by the client, it will determine which direction to send based on the MAC address information. Interface forwarding.

Overview:

When the switch is powered on, the mac address table entry is empty.

When host A needs to communicate with host B, host A will send a data packet

Source mac: 11-11

Purpose mac: 22-22

When the data packet arrives at interface 1, the switch will automatically learn

Source mac address (11-11), forming interface No. 1 corresponding to 11-11

mac address entry

Then search for the 22-22 exit in the table entry. If it cannot find it, it will send a broadcast to find it.

Only 22-22 will reply at this time

Packet format

Source mac address: 22-22

Destination mac address: 11-11

When the data packet arrives at interface No. 2, the switch will actively learn the source mac address and associate interface No. 2 with mac address 22-22.

Then check the exit of 11-11 and find that the exit is interface 1, so go out through interface 1.

Since the table entries are complete next time, host A and host B can communicate directly.

3. Duplex mode of switch interface

① Simplex

Simplex transmission means that data can only be transmitted in one direction between two data accounts (television, radio)

②Half duplex

Half-duplex data transmission means that two-way data transmission can be achieved between two data stations, but it cannot be carried out at the same time, and the efficiency is low (walkie-talkie)

③Full duplex

Full-duplex data transmission is a mode in which data can be transmitted in both directions and simultaneously between two data stations (telephone communication)

3. Basic switch configuration

1. Physical connection before switch configuration

The console interface is located on the back panel of the switch. You can configure the switch by directly connecting it to the COM interface of the PC. The connecting cable is usually a dedicated console cable.

2. Software connection before switch configuration

Use Secyre CRT software to configure the switch and then connect it

3. Commonly used commands on switches

3.1 Common commands

User view mode<Huawei>

Switch to system view mode [Huawei]
<Huawei>system-view

1. History command query
[Huawei] display history-command

2. Configure the host name
<Huawei> system-view
[Huawei] sysname Router1

3. Status information query
<Huawei>display version ####View VRP version
<Huawei>display users ### #View user terminal information

4. Enter interface mode and view information
<Huawei>sys
[Huawei]int e0/0/1< a i=3> [Huawei-GigabitEthernet0/0/1]dis this ####View the configuration information in the current view

5. Configuration file management command
[Huawei]display saved-configuration ###View the information saved by the device
[Huawei]display current- configuration ###View the current configuration information of the device
<Huawei>reset saved-configuration ###Erase the configuration file in the storage device (initialization)
<Huawei>compare configuration ###Compare whether the current configuration information is consistent with the saved file in the storage device

6. Close Huawei’s information prompt center 
[Huawei]undo info-center enable`
or
<Huawei>undo terminal monitor

7、永不超时
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0

8. Configure duplex and rate commands
<Huawei>sys
[Huawei]int g0/0/1< a i=3> [SW1-Ethernet0/0/1]undo negotiation auto ###Turn off automatic negotiation [SW1-Ethernet0/0/1]speed 100 ###Adjust to speed 100M< /span> [SW1-Ethernet0/0/1]duplex full ### Adjust to full-duplex mode, explanation: full: Full-Duplex (full-duplex mode) half: Half-Duplex (half-duplex) working mode)


9, save key
<Huawei>save

3.2 Remote login settings

1. Set the remote login password

[Huawei]user-interface vty 0 4        
#0 is the initial value, 4 is the end value. Indicates that 5 sessions can be opened at the same time to enter the switch to configure commands
[Huawei-ui-vty0-4]authentication-mode password
[Huawei-ui-vty0- 4]set authentication password simple 222
[Huawei-ui-vty0-4]user privilege level 3
[Huawei-ui-vty0-4]dis this< /span> ●The current terminal is open - disconnect [disconnect]----session [session options]-----force one character at a time mode [Force charater at a time mode]-save [OK] ●Right-click the current terminal—Link [reconnect] ●The current terminal is open - disconnect [disconnect]----session [session options]-----force one character at a time mode [Force charater at a time mode ]—Save [OK] ●Open SecureCRT and click [Link]—[Protocol] Telnet----[Hostname] 127.0.0.1---- [Prot] 2000 2000 ###This is the port number ●Open SecureCRT and click [Link]—[Protocol] Telnet----[Hostname] 127.0.0.1----[Prot] 2000 ●Double-click a device to open [View] and [Configuration], open [Configuration]-Window Configuration: Serial port number: 2000 ###This is the port number

2. Use SecureCRT to link eNSP







 

Guess you like

Origin blog.csdn.net/qq_57093716/article/details/134858607