当前位置:网站首页>The difference between router and switch
The difference between router and switch
2022-07-28 06:14:00 【Ke Yulong】
You must be familiar with switches and routers , Do you know the difference between them ?
Today I'll show you the difference between routers and switches !
Here is my understanding of the difference between switches and routers , I hope I can help friends in need


The difference between switch and router
The main differences are reflected in the following aspects :
(1) In appearance :
In terms of appearance, we distinguish the two , Switches usually have many ports and look bulky , The ports of the router are much less and the volume is much smaller ( Figure 2 ), In fact, the following figure is not a real router, but integrates the functions of the router , In addition, there is the function of the switch (LAN The port is used as the port of the switch ,WAN Is the port used to connect the external network ), The two antennas are wireless AP Access point ( It is commonly referred to as wireless LAN wifi).
(2) Different levels of work :
The original switch worked in OSI Data link layer of open system interconnection model , That's the second floor , The router works in OSI The network layer of the model , It's the third floor . Because of this, the principle of the switch is relatively simple , Generally, hardware circuits are used to forward data frames , And routers work on the network layer , Shoulder the heavy responsibility of network interconnection , To implement more complex protocols , With more intelligent forwarding decision-making function , Usually run the operating system in the router , Implement complex routing algorithms , Prefer software to realize its function .
(3) Data forwarding depends on different objects
Switches use physical addresses or MAC Address to determine the destination address of the forwarded data . Routers use different networks ID Number ( namely IP Address ) To determine the address of data forwarding .IP Address is implemented in software , It describes the network where the device is located , Sometimes these layer 3 addresses are also called protocol addresses or network addresses .MAC The address usually comes with the hardware , Distributed by the network card manufacturer , And it has been solidified into the network card , Generally speaking, it can't be changed . and IP The address is usually assigned automatically by the network administrator or the system .
(4)” Division of labor “ Different
Switches are mainly used to set up local area networks , The router is responsible for connecting the host to the external network . Multiple hosts can be connected to the switch through network cable , At this time, the local area network is set up , You can send data to other hosts in the LAN , Like the flying autumn we use 、 LAN software such as polar electronic classroom forwards data to other hosts through switches , Of course, broadcasting software such as polar electronic classroom uses broadcasting technology to make all hosts receive data . However , The LAN built through the switch cannot access the external network ( That is Internet), At this time, we need a router for us ” Open the door to the wonderful world outside “, All hosts of LAN use private network IP, Therefore, it must be transformed into a public network through a router IP Then you can access the Internet .
(5) Conflict domain and broadcast domain
Switch partition conflict domain , But do not divide the broadcast domain , The router divides the broadcast domain . The network segment connected by the switch still belongs to the same broadcast domain , Broadcast packets are propagated across all network segments connected to the switch , In this case, it will lead to broadcast storm and security vulnerability problems . The network segment connected to the router will be assigned different broadcast domains , The router will not forward broadcast data . The only packet that needs to be sent to the host in the LAN is the unicast packet , Other hosts will not receive data , This is different from the original hub , The arrival time of data is determined by the forwarding rate of the switch , The exchange forwards broadcast data to all hosts in the LAN .
(6) The last thing to say is :
Routers generally have the function of firewall , It can selectively filter some network packets . Some routers now have the function of switch , Some switches have the function of routers , go by the name of 3 Layer switch , Widely used . By comparison , The function of router is more powerful than that of switch , But the speed is also slow , Expensive , The layer-3 switch has the ability to forward messages linearly , It also has the good routing function of router, so it is widely used .
边栏推荐
- 速查表之转MD5
- 小程序开发如何提高效率?
- Alpine, Debian replacement source
- Using neural network to predict the weather
- What is the process of building a small program?
- Invalid packaging for parent POM x, must be “pom“ but is “jar“ @
- transformer的理解
- Building neural network based on tensorflow
- Dataset类分批加载数据集
- Reinforcement learning - Multi-Agent Reinforcement Learning
猜你喜欢

How much does small program development cost? Analysis of two development methods!

深度学习(自监督:SimCLR)——A Simple Framework for Contrastive Learning of Visual Representations

The difference and connection between cookies, sessions and tokens

Tensorflow2.1 basic concepts and common functions

How much does it cost to make a small program mall? What are the general expenses?

深度学习(自监督:SimSiam)——Exploring Simple Siamese Representation Learning

How to do wechat group purchase applet? How much does it usually cost?

D2sc-gan: low resolution face recognition of classroom scenes based on dual depth and shallow channel generation confrontation network

Interviewer: let you design a set of image loading framework. How would you design it?

深度学习(自监督:MoCo V3):An Empirical Study of Training Self-Supervised Vision Transformers
随机推荐
What are the general wechat applet development languages?
How much is wechat applet development cost and production cost?
Basic usage of word2vec and Bert
小程序开发如何提高效率?
神经网络实现鸢尾花分类
Dataset class loads datasets in batches
强化学习——基础概念
What about the app store on wechat?
On low resolution face recognition in the wild:comparisons and new technologies
Protecting Against DNN Model Stealing Attacks 论文阅读心得
word2vec和bert的基本使用方法
四、模型优化器与推理引擎
How to choose an applet development enterprise
Alpine, Debian replacement source
3: MySQL master-slave replication setup
Ssh/scp breakpoint resume Rsync
tf.keras搭建神经网络功能扩展
Scenario solution of distributed cluster architecture: cluster clock synchronization
深度学习——Patches Are All You Need
EIGamal 密码体制描述