Simple understanding of switch principle and configuration

One, the data link layer

1. Functions of the data link layer

Insert picture description here

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

2. The origin of Ethernet

Ethemet (Ethernet) was developed in 1973 by Palo Alto Research Center (PARC), a branch of Xerox. Xerox first invented a 2Mbps Ethernet, and later cooperated with Intel and DEC to develop a 10Mbps Ethernet, commonly known as (Ethernet II or Ethemet DIX). Later, IEEE standardized Ethernet as IEEE through the 802 Committee (802 Comitee). 802.3. It is very similar to Ethernetll.

In TCP/IP, the encapsulation format of Ethernet IP data message is defined by RFC 894, and the IP data message encapsulation of IEEE802.3 network is defined by RFC1042. The most commonly used packaging format today is the format defined by RFC894, usually called Ethernet II or Ethemet DIX.

3. Ethernet frame format

3.1MAC address

After each network card is produced, in addition to its basic functions, it has a globally unique number to identify itself. This address is the MAC address, that is, the physical address of the network card.

The MAC address is composed of 48-bit binary numbers, usually divided into six segments, expressed in hexadecimal.
The first 24 digits are the manufacturer number, and the last 24 digits are the serial number of the network interface card.

3.2 Ethernet frame format
Insert picture description here

  • Preamble: It contains eight bytes and is part of the physical package.
  • Destination address: It contains six bytes and identifies the MAC address of the destination station of the frame. It can be a unicast address, a multicast address, or a broadcast address.
  • Source address: It contains six bytes and identifies the MAC address of the station that sent the frame. The source address must be a unicast address (that is, the 8th bit is 0).
  • Type: Contains two bytes, used to identify the type of upper layer protocol, such as 0800H for IP protocol, 0806H for ARP protocol.
  • Data: Contains 46~1500 bytes.
  • Frame check sequence: contains four bytes.

Two, Ethernet switch

1. Introduction to switch equipment

Insert picture description here
There are many brands of switches, such as Cisco, Huawei, H3C, TP-Link, Digital China, Ruijie and other manufacturers have many different models of switches.

2. The working principle of the switch

2.1 The forwarding principle of the switch:

  • Initial state
  • Host A wants to communicate with host B, host A sends data frames to the switch
  • The switch learns the MAC address, records the MAC address of host A in the MAC address table, and corresponds the interface number
  • Broadcast flooding
  • Host B will respond to this broadcast and respond with a data frame
  • The switch associates the MAC address of host B with the interface number and adds it to the MAC address table
  • Host A and Host B realize unicast communication under the switch

3. Duplex mode of switch interface

3.1 Simplex
Simplex data transmission means that two data stations can only transmit data in a single direction.
Such as: between the microphone and the speaker.
Insert picture description here
3.2 Half
- duplex Half - duplex data transmission enables two-way data transmission between two data stations, but not at the same time.
Such as: the conversation between walkie-talkies.
Insert picture description here
3.3 Full-
duplex Full- duplex data transmission is a bidirectional and simultaneous data transmission mode between two data stations.
Such as: two people talk on the phone.
Insert picture description here

Three, the basic operation of the switch

Switch user view mode to system view mode [Huawei]
system-view

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

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

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

4. Enter the interface mode and view the information
sys
[Huawei]int e0/0/1
[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 information on the current configuration of the device
reset saved-configuration ###Erasing the information in the storage device Configuration file
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
undo terminal monitor

7, Eternal non-superior time
[Huawei] user-interface console 0
[Huawei-ui-console0] idle-timeout 0 0

8. Configure the duplex and speed command
sys
[Huawei]int g0/0/1
[SW1-Ethernet0/0/1]undo negotiation auto ###Turn off auto negotiation
[SW1-Ethernet0/0/1]speed 100 ### Adjust to speed 100M
[SW1-Ethernet0/0/1]duplex full ###Adjust to full duplex mode, explanation: full: Full-Duplex (full-duplex mode) half: Half-Duplex (half-duplex mode)

9. Save the configuration
save

10. Set the remote login password
[Huawei]user-interface vty 0 4 #0 is the initial value, 4 is the end value. Means that you can open 5 sessions at the same time to enter the switch to configure the command
[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

Use SecureCRT to link eNSP
●Double-click to open a device with [View] and [Configuration], open [Configuration] —window configuration: serial port number: 2000 ###This is the port number
●Open SecureCRT and click [link]—[Protocol] Telnet ----【Hostname】127.0.0.1----【Prot】2000
●The current terminal is opened—disconnected【disconnect】----session【session options】————Force one character at a time mode【 Force charater at atime mode]—Save【OK】
●Right click on the current terminal—link【reconnect】

Guess you like

Origin blog.csdn.net/weixin_55609819/article/details/114583277