当前位置:网站首页>What is the difference between hubs, switches and routers?

What is the difference between hubs, switches and routers?

2022-06-11 00:52:00 Wenxiaowu

notes : The purpose of this article is to briefly describe the hub 、 The difference between a switch and a router , So many details are ignored . The actual development process and working principle of the three are not as simple as what is written in the article . If you read this article, you can probably understand the similarities and differences between the three , The purpose of this paper is to achieve . As for more specific technical issues , Welcome to discuss in the message .

Here is the main body :

I believe we all played a special fire game : Age of Empires . When I was a child, I wanted to play the age of Empire , You need to go to the software city to buy pirated CDs to install ( Probably 3 It looks like a piece of money , At that time, I thought it was very cheap , Who would have thought that the Internet would be free ). After downloading, you can only perform stand-alone mode .

Small A Is a great God of the imperial era , He got through all the levels of the game , You can fight alone 8 A crazy computer . Gradually he felt bored , Want to find a little partner PK.

But how to realize the interconnection of two devices ? Small A Very clever , He invented a device similar to USB The same port that can transmit data , He named it Wangkou . Small A Connect your computer to a small computer through a network cable B Connected to the network port of , Realize the interconnection between the two computers .

The two little friends are very happy , Play online , At this time, a passing little C I saw it , Small C Join in . But we know that , Each computer has only one network port , The interconnection of three computers cannot be realized , What should I do ?

It's small at this time B Came up with an idea : Let's find another computer , Design a few more ports for him , Each of us is connected to the Internet port of this computer , Haven't we realized the interconnection between our brothers .

Do as you say , So they designed a Microcomputer , He has multiple network ports , Specially realize the interconnection of multiple computers , This microcomputer is the hub (HUB). seeing the name of a thing one thinks of its function , The hub plays a role in assembling network cables , Realize the most elementary network interworking . The hub transmits data directly through the network cable , We say he works in The physical layer .

With a hub , More and more small partners join the game , Small D、 Small E People are attracted by the name . However, the hub has a problem , Because it is connected to each device , He couldn't tell who the specific information was sent to , It can only be broadcast widely .

Such as small A I wanted to ask Xiao C: Have you eaten? ? The result is small B, Small D And small E When all users connected to the hub receive this message , And because they are on the same network , Small A No one else can speak while talking , Otherwise, there will be collision between messages , Cause errors , We call each device in the same conflict domain .

Such devices have a very poor user experience , So the partners discussed improvement measures together . At this time, the clever little D I spoke. : Let's add an instruction to this device , So that it can automatically address and transmit data according to the network port name .

For example, I put the little A The network port is named macA, Will be small C The named macC, At this time, if you are small A Want to transfer data to small C, Then, the device will be based on the network port name macA and macC Automatically transfer data from A Send your computer to C In my computer , And don't let the little B、 Small D And small E received .

in other words , This device solves the problem of conflict , Realize the interconnection between any two computers , It greatly improves the transmission speed between networks , We call it a switch . Because the switch transmits information according to the network port address , It is one more step than the direct transmission of network cable , We also say that the switch works in Data link layer .

This time, my friends are happy , They played happily . Little by little , They became famous locally , Attracted more and more small partners to join their team . Until one day , A guy from an outside village suddenly came to the door , Hope to connect with them , Realize Cross Village network war .

Small A Say yes , So they found a super long network cable to connect the switches of the two villages . I found a strange thing : The two villages can't communicate with each other . What's going on , It turns out that the computers over there and they don't use the same operating system , This leads to a mismatch in the form of transmission between messages . in the meantime , There are people from other villages who have also come to Xiao A, But small A Find out , The operating system used in each village is different .

What can I do ? Can we only play in our own villages in the future ? To solve this problem , The village partners sat together and organized a meeting , Finally, a set of solutions : Use the same form of information transmission ( Like Qin Shihuang unified weights and measures ).

How to achieve it ? The partners stipulate , Between different villages First, add a set of the same protocol to their respective operating systems . When communicating in different villages , The information is processed into a unified form by agreement , Then it is transmitted through a special device . This device is called a router . The router goes through IP Address addressing , We say it works on the computer The network layer .

such , Through such a series of modifications , Small A Finally led the villagers to realize the communication of the whole Township . As more and more city people join the small A The agreement , Small A Led the villagers to gradually realize the 、 Communications across the country and around the world . This set of agreements is TCP/IP Protocol cluster , The Internet was formed in this way .

However , Even now the whole network has spread all over the world , In small A When I fought with my little friends in the village in the era of Empire , Still using switches . Routers are only used when communicating with the outside world .

summary : The switch is suitable for LAN interconnection , The router realizes the interconnection of the whole network segment .

原网站

版权声明
本文为[Wenxiaowu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206102327576273.html