A collection of principles of router, hsrp, switch, arp, vtp, etc.

1. The working principle of the router: the principle of
routing: forwarding data packets according to the routing table, leaving if there is not, then still!
 A collection of principles of router, hsrp, switch, arp, vtp, etc.

Data transmission process:
1. pc1 sends data packets to pc2, the source ip is the address of pc1, the destination ip is the address of pc2; the
source mac is the mac address of pc1, the destination mac is the mac address of the E0 port of router A;
2. the router A receives the data packet and finds that the mac address is his own, so he takes off the frame header and looks at the ip (found to be the address of pc2), checks the routing table to know how to go, and
forwards the data to its own E1 port, and the E1 port encapsulates the data again: The source ip and destination ip remain unchanged, the source mac is the mac of the route A/E1 port, and the destination mac is the mac of the route B/E1 port;
3. Router B receives the data packet and finds that the mac address is its own, so it removes the frame header Look at the ip (found that it is the address of pc2), check the routing table to know how to go,
forward the data to its own E0 port, and the E0 port will re-encapsulate the data: the source ip and destination ip remain unchanged, and the source mac is routed to port B/E0 mac, the destination mac is the mac of PC2;
so far, Pc2 has received the data packet.
Summary: We can find that the source IP and the destination IP have not changed. The only thing that has changed is the source mac and the destination mac, which are converted every time a device passes!
 
 
2. The working principle of the switch:
1. The switch can intelligently forward the data frame according to the MAC address;
2. The source address is learned into the MAC address record table;
3. The destination address knows how to forward the data frame, and if there is one in the table, it will be forwarded directly. If not, flood.
Assigning ip to the switch means assigning vlan1, and the gateway command to the switch: IP default-gateway (referring to the gateway address).
 
3. The principle of ARP*** and spoofing: It is
mainly realized by sending false response packets.
4. VLAN technology:
It is possible to logically divide a large network into several small virtual local area networks to solve the problems of broadcast storm and security in the flat network.
Improved transmission efficiency and increased security.
Fifth, the role of Trunk is to allow the same VLAN to communicate on different switches.
Sixth, HSRP principle: Let multiple physical gateways become a common virtual gateway.
 
 
Spanning Tree Protocol
1. Spanning Tree Protocol (STP) is
used to prevent the Layer 2 loop from
logically disconnecting the loop and prevent broadcast storms.
When the line fails, the blocking interface is activated
. 2. The working principle of
spanning tree is the algorithm of spanning tree, Three steps:
(1) Select the root bridge (switch)
(2) Select the root port
(3) Select the designated port
3. The bridge ID (BID)
bridge is the only
choice for the switch with the smallest bridge ID in the switching network. Root bridges
select the order of root bridges: the
smaller the bridge ID, the more preferred (the value range is 0-65535, the default value is 32768, the smaller the priority)
(1) Priority
(2) The smaller the bridge’s MAC address, the better
The order of preferential selection of root ports:
(1) The lowest root path cost to the root bridge (the wider the bandwidth, the shorter the time)
(2) The directly connected bridge ID is the smallest (the other party’s bridge ID)
(3) Port ID The smallest (the port of the other party corresponding to your own port) is 128 by default, and the
designated port sequence is selected: (select on non-root bridges, select a designated port on each network segment)
(1) The root path cost is lower (the wider the bandwidth, the more time Smaller)
(2) The bridge ID value of the switch where it is located is small (own)
(3) The port ID value is small (own)
 
 
 
A collection of principles of router, hsrp, switch, arp, vtp, etc.

Guess you like

Origin blog.51cto.com/11001541/2575810