当前位置:网站首页>Network connection (III) functions and similarities and differences of hubs, switches and routers, routing tables and tables in switches, why do you need address translation and packet filtering?
Network connection (III) functions and similarities and differences of hubs, switches and routers, routing tables and tables in switches, why do you need address translation and packet filtering?
2022-07-04 10:30:00 【Big bear loves to work】
Just keep holding on , The worst result is nothing more than late success
3.0 Preface
- This chapter mainly talks about after the network package leaves the network card It is transmitted to the hub through the network cable , Then the hub pairs the packets Broadcast , The network packet is then sent to the switch , Switch According to the MAC Address Conduct Forwarding of network packets , Then the data arrives at the router , Router According to the IP Address forwarding , Then forward and deliver in a circular way , And many knowledge points involved in this process

3.1 Reach the hub through the network cable
- The structure diagram of the hub is as follows :

The work of the hub can be put simply :
- The network packet signal passes RJ-45 Transfer to hub , In the hub Relay circuit The signal will be processed to a certain extent Shaping and error suppression , After that, the network signal will be radio broadcast All ports of the hub
Network cable passing " Twisted pair " To suppress noise

3.2 Through the switch
- The structure diagram of the switch is as follows :

- The work of the switch It can be put simply as :
- Packets arrive at the switch through the port , Switchboard Each port The structure of all similar a sheet No, MAC Address of the network card , It is the same as the network card ( See the last blog ) Send and receive data .
- After the switch receives the data , Query the address table inside the switch , See if it is in the network package MAC The record corresponding to the address , Find the output port
- Through the switching circuit The network packet is transferred to the corresponding output port , Then the output port forwards the data

- The address table inside the switch is the address table of the device MAC A record table of the address and which port the device is connected to is shown below :
- Generally, the automatic maintenance of the switch , No manual maintenance required

- Generally, the automatic maintenance of the switch , No manual maintenance required

3.3 Through the router
- The structure diagram of the router is shown below : It is divided into Forwarding module and Port module

- The working mode of the router is briefly described as :
- Receive the data packet through the port module , Then the forwarding module according to the IP The address is queried in the routing table , Further judge the next Forward destination address
- The forwarding module transfers the packet to the corresponding port ( The result of looking up the table )
- The port sends packets , Before sending the packet, it will first query according to the forwarding target address MAC Address , New use MAC Replace the old address MAC Address

- Structure of routing table



- The relationship between router and switch
- In essence , Router and switch are entrusted , The router entrusts the switch to forward the network packet to the next router
- Routers are based on IP Agreement work , Switches are Ethernet protocols that work

- The router address translation and Packet filtering function

3.4 The similarities and differences between switches and routers
| Item | Router | Switch |
|---|---|---|
| Forwarding basis | According to the... In the head IP Address | According to the... In the head MAC Address |
| Look up the table matching method | Ignore the host number , Only match records with the same network number (IP Address ) | Only match MAC A record with exactly the same address |
| " surface " Maintenance mode of | Packet forwarding and maintenance are independent of each other | The process of packet forwarding is automatically maintained , It is part of packet forwarding |
| When the packet does not know where to forward | Direct discarding / Forward to default route (0.0.0.0) | Broadcast to all ports |
边栏推荐
- Histogram equalization
- 【Day2】 convolutional-neural-networks
- Rhcsa12
- 用数据告诉你高考最难的省份是哪里!
- 如果不知道這4種緩存模式,敢說懂緩存嗎?
- 转载:等比数列的求和公式,及其推导过程
- PHP code audit 3 - system reload vulnerability
- 183 sets of free resume templates to help everyone find a good job
- What is an excellent architect in my heart?
- Exercise 8-10 output student grades (20 points)
猜你喜欢
随机推荐
Container cloud notes
Doris / Clickhouse / Hudi, a phased summary in June
Exercise 7-8 converting strings to decimal integers (15 points)
原生div具有编辑能力
Dynamic memory management
MySQL case
/*Write a function to open the file for input, read the contents of the file into the vector container of string class 8.9: type, and store each line as an element of the container object*/
PHP代码审计3—系统重装漏洞
Crawl Zhejiang industry and trade news page
Press the button wizard to learn how to fight monsters - identify the map, run the map, enter the gang and identify NPC
Read a piece of text into the vector object, and each word is stored as an element in the vector. Convert each word in the vector object to uppercase letters. Output the converted elements in the vect
Use the data to tell you where is the most difficult province for the college entrance examination!
Lavel document reading notes -how to use @auth and @guest directives in lavel
使用 C# 提取 PDF 文件中的所有文字(支持 .NET Core)
Reasons and solutions for the 8-hour difference in mongodb data date display
Huge number (C language)
【OpenCV 例程200篇】218. 多行倾斜文字水印
Introduction to extensible system architecture
Sword finger offer 05 (implemented in C language)
leetcode1-3









