当前位置:网站首页>[network planning] (I) hub, bridge, switch, router and other concepts
[network planning] (I) hub, bridge, switch, router and other concepts
2022-07-01 06:52:00 【Flying man 01_ 01】
This article will introduce some basic concepts in computer network , And some common equipment in our life ( Switch 、 Router, etc ) The role of .
Catalog
The concept of the Internet
Internet , Wide area network 、 An international computer network composed of a local area network and a single computer according to a certain communication protocol . The Internet refers to two or more computer terminals 、 client 、 The result that the server connects with each other by means of computer information technology . The Internet can be divided into LAN (LAN, Local Area Network)、 Metropolitan area network (MAN, Metropolitan)、 Wide area network (WAN, Wide Area Network).
You think the network connection diagram is like this ?
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-126LGaLX-1656237846412)(image/image-20220625142907710.png)]](/img/25/e696001a3d87ac0529654b2032b0a6.png)
The actual network connection diagram is like this :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-SGRAcfzL-1656237846414)(image/image-20220625143131854.png)]](/img/3e/5b6c4539ea9a11205e9173bf90e513.png)
Connection of the whole network , There are many devices interspersed in the middle , For example, routers are common 、 Switches and so on .
What is network protocol
agreement (Protocol) The concept of , Very common in life , For example, the labor contract signed when looking for a job 、 Rental contracts and so on , Can be called an agreement . Corresponding to the computer network , The effect of the agreement is the same , It's all about restraint . In different scenarios , Use different protocols .
Baidu Encyclopedia definition : Network protocol refers to the set of rules that must be obeyed when exchanging information between peers in computer network .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-V0ILj9iA-1656237846415)(image/image-20220625143933103.png)]](/img/f7/b2eb7799cb474d95d0063c479f2891.png)
In the interview , Perhaps the most important thing to master is HTTP、HTTPS、TCP、UDP、IP、NET、DNS Such agreement .
The concept of client and server !
client : It refers to the end that needs services , Mobile phone, for example 、 Computer, etc. .
The server : It refers to the end that can provide services , For example, cloud servers .
The client sends data to the server , be called request ; The server sends data to the client , be called Respond to .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-URl0uths-1656237846415)(image/image-20220625145323694.png)]](/img/a4/298c339542dc9838f0534c4c26beab.png)
Network interconnection model
In order to better promote the research and development of Internet , International Organization for Standardization (ISO, International Standardination Organization) stay 1985 The network interconnection model was formulated in :OSI Reference model (Open System Interconnect Reference Model, Open Systems Interconnection Reference Model ), The details are as follows 7 The layer structure .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-dKfcmjYb-1656237846418)(image/image-20220625150454676.png)]](/img/7b/fcef37496517c854ac1dbfb35fa3f4.png)
Pictured above , except OSI Referring to the model 7 Outside the layer structure , also TCP/IP Protocol cluster 4 Layer structure and common in textbooks 5 The layer structure .
OSI Reference model , It is based on theory , It is not so detailed in practical application , Later in the design , It's still used TCP/IP Four layer structure in the protocol .
Network transmission , Data encapsulation process :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-aSxHD6Bk-1656237846418)(image/image-20220625151941834.png)]](/img/55/d82fcea4dba98361ea5d86e107b646.png)
Each layer has network protocols and data transmission units :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-v9jSWUY7-1656237846419)(image/image-20220625153617243.png)]](/img/95/97fba87cbcc2d84b133b98fb8d2052.png)
How computers communicate with each other
You want to communicate between two computers , Then you need to connect to the Internet , So how to identify one of the many computers ? This involves IP The concept of address . If this wants to communicate with other computers , Just You have to know about other computers first IP Address . But I only know IP The address is not enough , Because the data sent out , It is sent to other computers network card On , So we need to network address , That is to say MAC Address .
But in life , We don't seem to need to know MAC Address , Can also communicate . The reason lies in , Yes ARP(Address Resolution Protocol) Address resolution protocol , When we first visited a strange IP Address time , First it will pass radio broadcast Send a ARP package , This package contains the purpose IP Address , Received from the server ARP Packet time , Find out ARP Bag Destination address Same as this machine , It will return to the local computer through broadcasting MAC Address .
Here is the Cisco simulator , Simulated communication process :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-yqPMIw3j-1656237846420)(image/ARP.gif)]](https://img-blog.csdnimg.cn/cd0a32a042ec4bdfa31a61453b9c98e6.gif)
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-wBtxkYKf-1656237846421)(image/image-20220625161408441.png)]](/img/85/ef611d86f268c334d1a035e784eee1.png)
Bear in mind ,ARP The agreement is through radio broadcast Forward , The broadcast address is all 1, The network address is all 0.
Network cable direct connection
Between two computers , You can use it directly Twisted pair ( Ethernet cable ) communicate , Of course, you need to use Cross line , instead of Through line .( Cross lines are used between the same equipment , Through lines are used between different equipment ).
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-SaKFRui7-1656237846422)(image/image-20220625162443697.png)]](/img/8f/593f77cd5b6399224283c3d627874e.png)
Coaxial cable (Coaxial)
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-c37KlQKj-1656237846423)(image/image-20220625162649009.png)]](/img/15/dd95edf9b7ff3a2a0e45a4529875e1.png)
- Half duplex communication : Between two computers , At the same time , Only one computer can send data , Another computer receives data , Both cannot send data at the same time . The counterpart is Full duplex communication , The corresponding is at the same time , Data can be sent between two computers at the same time .
- Easy to conflict : The reason is that it is half duplex communication , At the same time , Only one computer can send data .
- unsafe : It's not safe here , It refers to the process of data transmission , Easy to be caught , Leading to data leakage . Because when two computers communicate , Data sent by one of them , Will send data to every computer in this line , Just after arriving at the computer network card When , The network card finds that this data is not for this computer , Will discard this data .
A hub (Hub)
In order to solve some problems of the coaxial cable , Later, there was a hub , The problem to be solved is that the line connecting a computer to the hub is broken , It will not affect the whole network .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-yHpQkQ3s-1656237846424)(image/image-20220625163926865.png)]](/img/72/59ec3a33148c2546bdefb4cafd5e0f.png)
But there is still a problem , such as : Suppose a hub is connected to hundreds of computers at the same time , Now the computer 1 And computers 2 Need to communicate , As mentioned above , Communicating with a strange computer for the first time , Need to get another computer's MAC Address , Here's the picture :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-q5MUxmvR-1656237846424)(image/ARP2.gif)]](https://img-blog.csdnimg.cn/f9ad09b622f142c9a175aee6c136318f.gif)
Pictured above , You can see... Very clearly , The original intention is to make Computer 4 and Computer 3 signal communication , As a result, both of them occupy the bandwidth of the whole network , That doesn't make sense . Take a closer look. , In addition to these two computers , Other computers will receive a packet Red x, The reason is that the network card finds that this package is not for this computer , And then they abandoned it , That is to say, this package is for this machine , No dice , It also takes up bandwidth .
Conclusion : The hub has no other functions , The only function is to make the whole network Star topology , It does not have a cache MAC Address function . And it will forward each received packet to all computers ( Except source host ).
bridge (Bridge)
bridge Appearance , To make up for the shortcomings of the hub above , The hub mentioned above does not have a cache MAC Address function , So here comes the bridge .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-QQQBPjrR-1656237846425)(image/image-20220625170522967.png)]](/img/ef/21093500458353ece1469e4141b896.png)
Upper figure , You will find that there are only two bridges RJ-45 The interface of , in other words , It is used as follows :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-RdAEkRrS-1656237846426)(image/image-20220625171109940.png)]](/img/f7/e5bcf61fab18c0789eb516689a05e0.png)
It can be seen that , The bridge is placed between two hubs , The specific functions are shown in the following two dynamic diagrams :
Mission :1、 First, let Computer 1 And Computer 4 signal communication ;2、 let Computer 2 And Computer 4 signal communication ;
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-PizDT6lq-1656237846427)(image/ARP3.gif)]](https://img-blog.csdnimg.cn/15e6a9531407444999f2af3e3e15da2c.gif)
After the above communication , bridge Will record the computer 1 And computers 4 Of MAC Address . And you will find this correspondence , Computer 1 Emitted ARP package , Will be forwarded to Hub on the right side of the bridge .
Suppose the data table recorded inside the bridge is as follows :
Left side area : Computer 1 Of MAC Address :xxxxxx; Computer 4 Of MAC Address :xxxxxxx;
Right side area : nothing .
Look again. Computer 2 And Computer 4 Communication process :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-CXWVXDfD-1656237846428)(image/ARP4.gif)]](https://img-blog.csdnimg.cn/eb9e049ac3844788b7b263edc42920c6.gif)
Can be seen clearly , Last time Computer 1 and Computer 4 After communication , Of these two computers MAC Address Stored in the bridge . here Computer 2 And again Computer 4 signal communication , When the data comes to the bridge , The bridge will find this data Destination address , Not in the right area of the bridge , Therefore, the data will not be forwarded to the right area .
Conclusion :
- The bridge can automatically save the MAC Address .
- So as to isolate the conflict area .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-4y9lR4Tb-1656237846429)(image/image-20220625173831424.png)]](/img/57/d59ef218cecb4779f8e99abed5e7a5.png)
Pictured above , It can isolate the left and right areas , In the left and right areas , Can make it communicate at the same time . give an example : Left side area Computer 1 And computers 2 When communication , On the right side Regional PC8 and PC7 Can also communicate at the same time .
Switch (Switch)
There are two types of switches : Two-layer switch 、 Three layer switch . Only layer-2 switches are introduced here . Layer 3 switches are a little more advanced , It has routing function .
The layer-2 switch is equivalent to a hub + A comprehensive version of the bridge .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-Ub8wVWHO-1656237846429)(image/image-20220625174905048.png)]](/img/1e/1c698b664c6b3543562dbc14b9b62b.png)
The working process after the computer is connected to the switch :![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-jnjQ4oTE-1656237846430)(image/ARP5-16561510815986.gif)]](https://img-blog.csdnimg.cn/eb08345c64a347df807b70578098ba4a.gif)
It can be clearly seen from the above figure , When computers 1 And computers 2 First communication , I don't know the computer at this time 2 Of MAC Address , So it will be broadcast first ARP package , Ask the computer 2 Of MAC Address , This result will be recorded by the switch . That's why Send later ICMP package ( The purple bag above ) When , The switch will not send to all computers , But only to Destination address The computer .
The characteristics of the switch :
- It's equivalent to a bridge with more interfaces .
- Full duplex communication : As mentioned above , It means at the same time , Between two computers , Can send data at the same time .
- Safer than hubs : Because the subsequent data will only be sent to Destination address The computer , It will not be forwarded to other computers , Reduce the probability of data leakage .
The network cable mentioned above is directly connected 、 A hub 、 bridge 、 Switch , Are used in Same segment Network for communication . If you want to be in Different segments Communicate with each other , Then you need a router , Next, let's look at the router .
Router (Router)
Router (Router) It's a hardware device that connects two or more networks , Start from the Internet gateway The role of , It's a dedicated intelligent network device that reads the address in each packet and decides how to transmit it .
As we mentioned above, the network cable is directly connected 、 A hub 、 bridge 、 Switches are all applied in the same network segment , They can broadcast between them , The router has two functions :1、 Forward data between different network segments ;2、 to be isolated Broadcast area .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-GG0QYv5a-1656237846432)(image/image-20220626174017531.png)]](/img/37/d31ed4653e1484a6777946a1fcc4af.png)
As shown in the figure above , On both sides of the router are LANs of different network segments . If the computer on the left LAN wants to communicate with the computer on the right LAN , It must be forwarded through the router .
The figure above mentions gateway , In a nutshell , gateway Is similar to the Uncle security .
Here's the picture , The causes of the epidemic in recent years , Some places are sealed , A block by block blockade is formed , That different area wants to communicate , But people can't leave the blockade , It is stipulated at this time , Only by Uncle security ( gateway ) To transfer data , Let security uncle communicate with the outside world , People in the blockade area want to communicate with the outside world , Only let the security uncle ( gateway ) Transit .
Know what role the router plays in the network , Now you can take a look at , How computers communicate between two different network segments .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-7nIVFvs7-1656237846434)(image/router1.gif)]](https://img-blog.csdnimg.cn/7822955087dc4684b3a05b5cd76dc633.gif)
As shown in the figure above ,PC0 and PC3 When communicating ,PC0 You will find that I want to communicate with computers in another network segment , Then I just need to give the data to ** Router ( gateway )** that will do , Let the router forward the data . So first ,PC0 You still need to know the gateway first MAC Address , So it will be broadcast first ARP package , Get gateway address , The next step is to send the data to the gateway . Here's the picture ![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-oBLzcvSz-1656237846434)(image/router2.gif)]](https://img-blog.csdnimg.cn/60ff26c55cd34b35be7f0f9de0a1e6cd.gif)
stay PC0 After sending the data to the router , The router goes to find the next transit point . Before the gateway on the right sends data to the outside , I will find out that there is no PC3 Of MAC Address , So first of all, it will be sent ARP package , obtain PC3 Of MAC After the address , Before forwarding other data .
Here's the picture , That is, each device records the corresponding MAC After the address , Transmission process :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-iajAB75F-1656237846435)(image/router3.gif)]](https://img-blog.csdnimg.cn/edd66d1cacb84c8888262e88e76b6f13.gif)
All right. , All of the above is the content of this article , Let's see you next time !!!!
边栏推荐
- Problem solving: officeexception: failed to start and connect (I)
- 产品学习(三)——需求列表
- 问题:OfficeException: failed to start and connect(二)
- 软件工程领域的名词描述
- ESP32 ESP-IDF GPIO按键中断响应
- 如何进入互联网行业,成为产品经理?没有项目经验如何转行当上产品经理?
- Is fixed investment fund a high-risk product?
- PAT (Advanced Level) Practice 1057 Stack
- 问题:OfficeException: failed to start and connect(三)
- RestTemplate使用
猜你喜欢

Dirty reading, unreal reading and unrepeatable reading

ctfshow-web354(SSRF)
![[wechat applet] how to build a building block development?](/img/69/edb02c88b52b474a797307b96de369.jpg)
[wechat applet] how to build a building block development?

【计网】(一) 集线器、网桥、交换机、路由器等概念
![[lingo] find the minimum connection diagram of seven cities to minimize the price of natural gas pipelines](/img/34/d2efae5b283cdc130d55f52cdff76d.png)
[lingo] find the minimum connection diagram of seven cities to minimize the price of natural gas pipelines
![[lingo] find the shortest path problem of undirected graph](/img/14/1ccae0f33f5857b546d7fd0aa74c35.png)
[lingo] find the shortest path problem of undirected graph

【电气介数】电气介数及考虑HVDC和FACTS元件的电气介数计算

K8S搭建Redis集群

EasyNVS云管理平台功能重构:支持新增用户、修改信息等

产品学习(二)——竞品分析
随机推荐
Software engineering review
如何通过cdn方式使用阿里巴巴矢量图字体文件
Spark入门(一篇就够了)
Find the original array for the inverse logarithm
@Propagation property of transactional requires_ New in-depth understanding
How to use SCI hub
On whether variables are thread safe
Servlet 和 JSP 中的分页
Esp32 monitors the battery voltage with ULP when the battery is powered
SQL statement
[FPGA frame difference] FPGA implementation of frame difference target tracking based on vmodcam camera
为什么这么多人转行产品经理?产品经理发展前景如何?
问题解决:OfficeException: failed to start and connect(一)
Esp32 esp-idf ADC monitors battery voltage (with correction)
概率论学习笔记
AI视频智能平台EasyCVR设备录像出现无法播放现象的问题修复
记一次线上接口慢查询问题排查
[lingo] find the shortest path problem of undirected graph
如何进入互联网行业,成为产品经理?没有项目经验如何转行当上产品经理?
三说 拷贝构造之禁用
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-CZA2HsDQ-1656237846433)(image/image-20220626173129746.png)]](/img/c3/dfcd071a14f61bd35a82b1585455be.png)