Traditional Culture Encyclopedia - Traditional stories - ptn what is the difference between a router and a switch

ptn what is the difference between a router and a switch

Difference between a router and a switch

A router is the main node device of the Internet. Routers decide the forwarding of data through routing. The forwarding strategy is called routing, which is where the router gets its name (router, forwarder). As a hub for interconnecting different networks, the router system forms the main vein of the Internet, an international interconnected network based on TCP/IP, or it can be said that the router forms the skeleton of the Internet. Its processing speed is one of the main bottlenecks in network communication, and its reliability directly affects the quality of network interconnection.

The switch is a network device based on MAC address recognition, which can complete the function of encapsulating and forwarding packets. The switch can "learn" the MAC address and store it in its internal address table, and by establishing a temporary switching path between the originator and the destination receiver of a data frame, the data frame can reach the destination address directly from the source address.

What is the difference between a router and a switch? Specifically, it is divided into the following four parts:

1, the two work at different levels

The original switch is working in the OSI/RM open architecture of the data link layer, that is, the second layer, while the router was designed to work in the beginning of the OSI model of the network layer. Because the switch works at the second (data link) layer of OSI, it is simpler, whereas the router works at the third (network) layer of OSI, where more information about the protocol is available and the router can make smarter forwarding decisions.

2, the two according to the forwarding of the object based on different

The switch is to use the physical address or MAC address to determine the destination address of the forwarded data. Routers, on the other hand, use the ID numbers of different networks (i.e., IP addresses) to determine the address to which data is forwarded.IP addresses are implemented in software, describing the network on which the device is located, and are sometimes referred to as Layer 3 addresses, or network addresses.MAC addresses are usually proprietary to the hardware and are assigned by the manufacturer of the network card, and have been hardened into the card, and are generally unchangeable.

2. MAC addresses are usually assigned by the manufacturer of the network card and are built into the card and generally cannot be changed. IP addresses, on the other hand, are usually assigned automatically by the network administrator or the system.

3. Traditional switches can only split conflict domains, not broadcast domains; routers can split broadcast domains

Network segments connected to a switch still belong to the same broadcast domain, and broadcast packets are propagated across all network segments connected to the switch, which can lead to traffic congestion and security breaches in some cases. Network segments connected to a router are assigned to a different broadcast domain, and broadcast data does not pass through the router. Although Layer 3+ switches have VLAN capabilities and can also segment broadcast domains, the sub-broadcast domains are not able to communicate with each other, and a router is still required for communication between them.

4. Routers provide firewall services, while switches do not

Routers only forward address-specific packets, do not transmit packets that do not support routing protocols to transmit and unknown target network packets to transmit, thus preventing broadcast storms.

In summary, switches are generally used for LAN-WAN connections, switches are categorized as bridges, which are data link layer devices, and some switches can also realize layer 3 switching. Routers are used for WAN-WAN connections, and can solve the problem of forwarding packets between heterogeneous networks, acting at the network layer. They simply accept incoming packets from one line and forward them to the other. These two lines may belong to different networks and use different protocols. In contrast, routers are more powerful than switches, but relatively slow and expensive. Layer 3 switches have both the ability to forward messages at switch line speed and the good control features of routers, so they are widely used.