What is the difference between a switch and a router?[Details]

With the development of society, many families have two or several computers. In order to realize the common Internet access of computers, routers and switches are slowly becoming more recognized by people, but because home routers and switches look like from the outside. Many people only know that both are used to connect to the Internet, but they rarely know the difference between them, and their respective functions. Let’s analyze the difference between switches and routers.

Difference between a switch and a router

First of all, the role of the switch (also known as switching hub) can be simply understood as connecting some machines to form a LAN. The router and the switch have obvious differences. Its role is to connect different network segments and find the most suitable path for data transmission in the network. It can be said that under normal circumstances, the personal user needs are not large. The router is generated after the switch, just like the switch is generated after the hub, so the router has a certain connection with the switch, not two completely independent devices. The router mainly overcomes the shortcomings that the switch cannot route and forward data packets.

Computer networks are often interconnected by many different types of networks. If several computer networks are only physically connected and cannot communicate with each other, then this “interconnection” has no practical meaning. So when it comes to “interconnecting”, it is already implied that these interconnected computers can communicate, that is, functionally and logically, these computer networks have formed a large computer network, or Known as the Internet, it can also be referred to as the Internet.

Connecting the networks to each other uses some intermediate devices (or intermediate systems), which is called the relay system. According to the level of the relay system, there are five types of relay systems:

  1. Physical layer (that is, the first layer, layer L1 is often said) relay system, that is, a repeater.

  2. Data link layer (ie, layer 2, layer L2), ie bridge or bridge.

  3. Network layer (layer 3, layer L3) relay system, that is, router.

  4. The bridge and router hybrid bridge (brouter) has the functions of a bridge and a router.

  5. A relay system above the network layer, ie a gateway.

When the relay system is a repeater, it is generally not called a network interconnection, because this merely expands a network, and this is still a network. High-level gateways are currently used less because of their complexity. Therefore, the general discussion of network interconnection refers to the network interconnected by switches and routers. This article focuses on switches and routers and their differences.

Router, switch

A switch (Switch) is a network device that is based on MAC (hardware address of the network card) and can complete the function of encapsulating and forwarding data packets. The switch can “learn” the MAC address and store it in the internal address table. By establishing a temporary switching path between the originator and the target receiver of the data frame, the data frame can be directly sent from the source address to the destination address. Today’s switches are divided into two layers: Layer 2 switches, Layer 3 switches, or higher layer switches. Layer 3 switches can also have routing capabilities and are faster than the low-end routers. Its main features are: one route, multiple forwarding.

Routers, also known as path selectors, are devices that are interconnected at the network layer. It is more complex and more flexible than a bridge. Routers have stronger heterogeneous network interconnection capabilities, and connectivity objects include local area networks and wide area networks. In the past, routers were mostly used in wide area networks. In recent years, routers have been used more and more in LAN interconnections due to the greatly improved router performance and the price drop to close to the bridge. A router is a network device that connects multiple networks or network segments. It can “translate” data information between different networks or network segments so that they can “read” each other’s data to form a new one. Big network. The router has two typical functions, namely data channel function and control function. Data channel functions include forwarding decisions, backplane forwarding, and output link scheduling, which are generally performed by specific hardware; control functions are generally implemented in software, including information exchange with neighboring routers, system configuration, system management, etc. .

As far as routers and switches are concerned, the main differences are reflected in the following aspects: lets know few Difference between a switch and a router

(1) Different levels of work

The original switch was at the data link layer of the OSI/RM open architecture, the second layer, and the router was designed to work at the network layer of the OSI model. Since the switch works in the second layer (data link layer) of OSI, its working principle is relatively simple, and the router works in the third layer (network layer) of OSI, which can get more protocol information, and the router can make Smarter forwarding decisions.

(2) The data is based on different objects

The switch uses the physical address or MAC address to determine the destination address for forwarding data. The router uses the ID number (ie IP address) of the different network to determine the address for data forwarding. The IP address is implemented in software and describes the network where the device is located. Sometimes the addresses of these Layer 3 are also called protocol addresses or network addresses. The MAC address is usually provided by the hardware, distributed by the network card manufacturer, and has been solidified into the network card, which is generally unchangeable. IP addresses are usually assigned automatically by the network administrator or the system.

(3) The traditional switch can only divide the collision domain and cannot divide the broadcast domain; the router can split the broadcast domain.

The network segments connected by the switch still belong to the same broadcast domain. Broadcast packets are transmitted on all network segments connected to the switch. In some cases, communication congestion and security holes are caused. The network segments connected to the router are assigned to different broadcast domains, and the broadcast data does not pass through the router. Although the switch above the third layer has the VLAN function, the broadcast domain can also be divided, but the sub-broadcast domains cannot communicate with each other, and communication between them still requires a router.

(4) The router provides a firewall service

The router only forwards packets of a specific address, does not transmit packet transmissions that do not support routing protocols, and transmits unknown unknown network packets, thereby preventing broadcast storms.

Switches are generally used for LAN-WAN connections. Switches are attributed to bridges and are data link layer devices. Some switches can also implement Layer 3 switching. The router is used for the connection between the WAN and the WAN, and can solve the forwarding packet between the heterosexual networks and act on the network layer. They simply accept the incoming packet from one line and then forward it to the other. These two lines may belong to different networks and use different protocols. In comparison, the function of the router is stronger than that of the switch, but the speed is relatively slow and expensive. The Layer 3 switch has the ability to forward packets at the line speed and has good control functions of the router, so it can be widely used.

Hope you know few main Difference between a switch and a router ,if you know few more then you can add in comment.

Leave a Comment