Traditional Culture Encyclopedia - Traditional festivals - Difference between a traditional router and a switch?

Difference between a traditional router and a switch?

(By the way, I'll tell you about hubs)

To put it in simple terms, a HUB is a hub. For example, if you have a bus with a total bandwidth of 4M, and the hub has 4 sub-connectors, then each of the sub-connectors can only share 1M of the bandwidth

When you convert it to a switch, you'll be using 4M of bandwidth on each port

The functions of a router include those of a switch, plus additional routing functions

Can look at the following;

Computer networks tend to be connected to many different types of network interconnections, with the addition of routing functions.

The functions of a router include the functions of a switch, plus an additional routing function

Take a look at the following;

Computer networks are often made up of a number of interconnections between different types of networks. If several computer networks are only physically connected, and they cannot communicate with each other, then this "interconnection" has no real meaning. So usually when we talk about "interconnection", we already imply that these interconnected computers can communicate, that is, functionally and logically, these computer networks have formed a large computer network, or called the Internet, can also be referred to as the Internet, interconnection network.

Connecting networks to each other uses some intermediate equipment (or intermediate systems), which ISO terminology calls relay (relay) systems. According to the level of the relay system, there can be the following five kinds of relay system:

1. Physical layer (that is, often referred to as the first layer, layer L1) relay system, that is, the transponder (repeater).

2. Data link layer (that is, the second layer, layer L2), that is, the bridge or bridge (bridge).

3. Network layer (Layer 3, Layer L3) relay system, i.e., router.

4. A mixture of bridges and routers bridge (brouter) has both bridge and router functions.

5. Above the network layer of the trunking system, the gateway (gateway).

When the relay system is a transponder, it is generally not called a network interconnect because it simply expands a network, which is still a network. Higher-level gateways are less used today because they are more complex. Therefore the general discussion of network interconnection refers to networks that are interconnected with switches and routers. This article focuses on switches and routers and their differences.

2 Switches and Routers

"Switching" is the most frequent word in today's network, from bridging to routing to ATM until the phone system, no matter what the occasion can be applied, confused about what in the end is the real switching. In fact, the term "switching" first appeared in the telephone system, specifically refers to the realization of the exchange of voice signals between two different telephone sets, to complete the work of the equipment is the telephone exchange. So from the original meaning, switching is just a technical concept, that is, to complete the signal from the device entrance to the exit of the forwarding. Therefore, as long as and in line with the definition of all equipment can be called switching equipment. As you can see, "switching" is a broad term that actually refers to a bridging device when it is used to describe a device at the second layer of a data network, and to a routing device when it is used to describe a device at the third layer of a data network.

The Ethernet switch we often talk about is actually a multi-port Layer 2 network device based on bridge technology, which provides a low-latency, low-overhead path for forwarding data frames from one port to any other port.

It follows that there should be a switching matrix at the internal core of the switch to provide a path for communication between any two ports, or a fast switching bus to enable data frames received by any port to be sent out other ports. In actual devices, the function of the switching matrix is often performed by a specialized chip (ASIC). In addition, Ethernet switches are designed with the important assumption that the switching core is so fast that the usual high volume of data does not cause it to become congested; in other words, the capacity of the switching is infinite in relation to the amount of information being transmitted (in contrast to ATM switches, which are designed with the assumption that the capacity of the switching is limited in relation to the amount of information being transmitted).

Although Ethernet Layer 2 switches are based on multiport bridges, switching, after all, has a much richer set of features that make it not only the best way to get more bandwidth, but also makes the network easier to manage.

And the router is a packet-switching device (or network layer trunking device) in the network layer of the OSI protocol model. The basic function of a router is to deliver data (IP messages) to the correct network, including:

1. IP datagram forwarding, including datagram pathfinding and delivery;

2. Subnet isolation, suppressing broadcast storms;

3. Maintaining routing tables and exchanging routing information with other routers, which is the basis of IP message forwarding.

4. Error handling and simple congestion control for IP datagrams;

5. Implementing filtering and accounting for IP datagrams.

For networks of different sizes, the focus of the role of the router is different.

On a backbone network, the main role of the router is routing. Routers on the backbone must know the paths to all lower-layer networks. This requires maintaining large routing tables and reacting as quickly as possible to changes in connection status. Failure of a router will result in serious information transmission problems.

In a district network, the primary role of a router is network connectivity and routing, i.e., connecting the various lower-layer base network units - the campus network - as well as being responsible for forwarding data between the lower-layer networks.

Within a campus network, the main role of a router is to separate subnets. The early grassroots unit of the interconnection network was the local area network (LAN), in which all hosts were in the same logical network. As the network expanded, the LAN evolved into a campus network consisting of multiple subnets connected by high-speed backbones and routers. In this case, each subnet is logically independent, and the router is the only device that can separate them, which is responsible for message forwarding and broadcast isolation between subnets, and the router on the border is responsible for connecting to the upper layer network.

3 Differences Between Layer 2 Switches and Routers

Traditional switches evolved from bridges and belong to OSI Layer 2, which is the data link layer device. It addresses itself based on MAC addresses and selects routes through station tables, which are created and maintained automatically by the switch. Router belongs to OSI layer three that is the network layer device, it is addressed according to the IP address, through the routing table routing protocols are generated. The biggest benefit of the switch is fast, because the switch must only identify the MAC address in the frame, directly based on the MAC address to generate a selection of forwarding port algorithm is simple, easy to ASIC implementation, so the forwarding speed is extremely high. However, the working mechanism of the switch also brings some problems.

1. Loop: According to the switch address learning and station table building algorithms, no loops are allowed between switches. Once a loop exists, the spanning tree algorithm must be initiated to block the port that created the loop. The router routing protocol does not have this problem. There can be multiple paths between routers to balance the load and improve reliability.

2. Load centralization: There can only be one path between switches, which makes the information centralized on one communication link and cannot be dynamically distributed to balance the load. The router's routing protocol algorithm can avoid this, OSPF routing protocol algorithm not only generates multiple routes, but also for different network applications to choose their own different best routes.

3. Broadcast control: The switch can only narrow the conflict domain, but not the broadcast domain. The entire switched network is a large broadcast domain, broadcast messages scattered throughout the switched network. And the router can isolate the broadcast domain, broadcast messages can not continue to broadcast through the router.

4. Subnetting: switches can only recognize MAC addresses, which are physical addresses and use a flat address structure, so they can not be subnetted based on MAC addresses. The router recognizes the IP address, which is assigned by the network administrator, is a logical address and the IP address has a hierarchical structure, which is divided into network number and host number, and can be very conveniently used to divide the subnet, and the main function of the router is to be used to connect different networks.

5. Confidentiality: Although switches can also filter frames based on the source MAC address, destination MAC address, and other frame contents, routers filter messages based on the source IP address, destination IP address, TCP port address, and other contents of the message, which is more intuitive and convenient.

6. Media-related: switch as a bridge device can also complete the conversion between different link layers and the physical layer, but this conversion process is more complex, not suitable for ASIC implementation, is bound to reduce the forwarding speed of the switch. Therefore, the current switch is mainly to complete the same or similar physical media and link protocol network interconnection, and will not be used in the physical media and link layer protocols are very different between the network interconnection. Routers, on the other hand, are different in that they are mainly used to interconnect different networks and can therefore connect networks with different physical media, link layer protocols and network layer protocols. Routers have the advantage of functionality, but they are expensive and have low message forwarding speeds.

In recent years, many improvements have been made to switches to improve performance, the most prominent of which are virtual networking and Layer 3 switching.

Delineating subnets narrows the broadcast domain and reduces the impact of broadcast storms on the network. Each interface of a router is connected to a subnet, and broadcast messages cannot be broadcast out through the router. Subnets connected to different interfaces of a router belong to different subnets, and the scope of the subnet is physically divided by the router. For switches, each port corresponds to a network segment. Since subnets are composed of several network segments, subnets can be logically divided by combining switch ports. Broadcast messages can only be broadcast within a subnet and cannot spread to other subnets. The purpose of broadcast control is achieved by logically dividing the logical subnets. Since logical subnets are made up of any combination of switch ports with no physical correlation, they are called virtual subnets, or virtual networks. Virtual network technology does not use routers to solve the problem of isolation of broadcast messages, and the network segments within the virtual network have nothing to do with their physical location, that is, neighboring segments can belong to different virtual networks, while two segments far apart may belong to different virtual networks, while two segments far apart may belong to the same virtual network. Terminals within different virtual networks cannot communicate with each other, enhancing access control to data within the network.

Switches and routers are a contradiction in terms of performance and functionality. Switches are fast in switching but weak in control, and routers are strong in control but slow in message forwarding. The technology that solves this contradiction is Layer 3 switching, which has both the ability to forward messages at switch line speed and the good control function of a router.

4 Differences between Layer 3 switches and routers

Before the advent of Layer 3 switching technology, there was little need to differentiate between routing-capable devices and routers, which are exactly the same: Providing routing is being done by the router, however, Layer 3 switches are now fully capable of performing most of the functions of a traditional router. As devices that interconnect networks, Layer 3 switches have the following characteristics:

1. Forward service flows based on Layer 3 addresses;

2. Fully switchable;

3. Can perform special services such as message filtering or authentication;

4. Performs, or does not perform, routing processing.

Layer 3 switches have the following advantages over traditional routers:

1. Inter-subnet transmission bandwidth can be arbitrarily allocated: each interface of a traditional router is connected to a subnet, and the rate of subnet transmission through the router is limited by the interface's bandwidth. Layer 3 switch is different, it can define multiple ports as a virtual network, the virtual network composed of multiple ports as a virtual network interface, the virtual network information can be sent to the Layer 3 switch through the ports of the virtual network, because the number of ports can be arbitrarily specified, the transmission bandwidth between the subnets is not limited.

2. Reasonable allocation of information resources: Since there is no difference between the rate of access to resources in the subnet and the rate of access to resources in the global network, there is little point in setting up separate servers for subnets, and setting up a server group in the global network not only saves costs, but also allows for reasonable allocation of information resources.

3. Reduce costs: the usual network design using switches to form subnets, with routers for interconnecting subnets. At present, the use of Layer 3 switches for network design, both for any virtual subnet division, but also through the switch Layer 3 routing function to complete the inter-subnet communication, which saves the expensive router.

4. Flexible connection between switches: as a switch, they do not allow the existence of loops between them, as a router, and can have multiple paths to improve reliability and load balancing. Layer 3 switches use the spanning tree algorithm to block ports that cause loops, but when routing, the blocked path is still used as an optional path to participate in routing.

5 Conclusion

In summary, switches are generally used for LAN-WAN connectivity. Switches are categorized as bridges, which are data link layer devices, and some switches can also implement Layer 3 switching. Routers are used for WAN-WAN connections and can address 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 comparison, routers are more powerful than switches, but they are also relatively slow and expensive. Layer 3 switches have both the ability to forward packets at switch line speeds and the good control features of routers, which allows them to be used for broadcast applications