Comparison of Layer 3 switches and routers

Comparison of Layer 3 switches and routers

In order to adapt to the challenges brought about by the deepening of network applications, the network is developing rapidly in both scale and speed. The speed of the local area network has been increased from the initial 10Mbit / s to 100Mbit / s. Currently, Gigabit Ethernet technology has been widely used.

In terms of network structure, it has also evolved from the early shared media LAN to the current switched LAN. Switched LAN technology makes the dedicated bandwidth exclusively for users, greatly improving the efficiency of LAN transmission. It can be said that in the technology of network system integration, the first-layer interface and the second-layer switching technology directly facing the user have obtained satisfactory answers. However, there is no qualitative breakthrough in the router technology, which is the core of the network and plays the role of interconnection between networks. In this case, a new routing technology came into being. This is the third layer switching technology: it is a router, because it can operate at the third layer of the network protocol, it is a routing understanding device and can start To the role of routing decisions; it is said to be a switch because it is extremely fast, almost reaching the speed of layer 2 switching. Which of the three technologies of Layer 2 switches, Layer 3 switches, and routers are superior and inferior, and in what environment are they applicable? To answer this question, we start with the working principles of these three technologies:

1. Layer 2 switching technology

The layer 2 switch is a device at the data link layer, which can read the MAC address information in the data packet and exchange according to the MAC address.

There is an address table inside the switch. This address table indicates the correspondence between the MAC address and the switch port. When the switch receives a packet from a port, it first reads the source MAC address in the packet header, so that it knows which port the machine with the source MAC address is connected to, and then it reads the destination MAC in the packet header Address, and look up the corresponding port in the address table, if there is a port corresponding to the destination MAC address in the table, copy the data packet directly to this port, if the corresponding port is not found in the table, the data packet Broadcast to all ports. When the destination machine responds to the source machine, the switch can learn which port the destination MAC address corresponds to. It will no longer need to broadcast all ports when transmitting data next time.

This is how Layer 2 switches establish and maintain their own address tables. Since Layer 2 switches generally have a wide switching bus bandwidth, data can be exchanged for many ports at the same time. If a Layer 2 switch has N ports, and the bandwidth of each port is M, and its switch bus bandwidth exceeds N × M, then the switch can achieve wire-speed switching. Layer 2 switches do not limit broadcast packets, and copy broadcast packets to all ports.

Layer 2 switches generally contain ASICs (ApplicaTIon specific

Integrated Circuit) chip, so the forwarding speed can be very fast.

2. Routing technology

The router operates in the third layer of the OSI seven-layer network model-the network layer.

There is a routing table inside the router, which indicates where to go if you want to go somewhere. The router receives a data packet from a certain port. It first removes the header of the link layer (unpacks), reads the destination IP address, and then looks up the routing table. If it can determine where to send it next, then add the link The header (packaging) of the road layer forwards the data packet; if the next address cannot be determined, a message is returned to the source address and the data packet is discarded.

Routing technology and Layer 2 switching look a bit similar. In fact, the main difference between routing and switching is that switching occurs at the second layer (data link layer) of the OSI reference model, while routing occurs at the third layer. This difference determines that routing and switching need to use different control information in the process of transmitting data, so the way in which the two implement their respective functions is different.

Routing technology is actually composed of two most basic activities, namely determining the optimal path and transmitting data packets. Among them, the transmission of data packets is relatively simple and direct, and the determination of routing is more complicated. The routing algorithm writes a variety of different information in the routing table. The router will select the best path according to the destination to which the data packet is to reach and send the data packet to the next router that can reach the destination. When the next router receives the data packet, it will also check its destination address and continue to transmit it to the subsequent router using an appropriate path. And so on, until the data packet reaches the final destination.

Routers can communicate with each other, and can maintain their own routing tables by transmitting different types of information. The routing update information is mainly such information, which is generally composed of part or all of the routing table. By analyzing the routing update information sent by other routers, the router can grasp the topology of the entire network. Link state broadcast is another type of information passed between routers, which can notify other routers of the sender's link state and progress.

3. Three-layer switching technology

A device with a layer 3 switching function is a layer 2 switch with a layer 3 routing function, but it is an organic combination of the two. It is not simply to superimpose the hardware and software of the router device on the LAN switch. on.

From the hardware point of view, the interface modules of the second-layer switch exchange data through a high-speed backplane / bus (the rate can be up to tens of Gbit / s). In the third-layer switch, the third-layer routing hardware related to the router The module is also plugged into the high-speed backplane / bus. This method allows the routing module to exchange data with other modules that need to be routed at high speed, thus breaking the speed limit of the traditional external router interface. In terms of software, Layer 3 switches also have major initiatives that define traditional software-based router software.

The practice is:

For the forwarding of data packets: such as the forwarding of IP / IPX packets, these regular processes can be realized at high speed through hardware.

For layer 3 routing software: functions such as routing information update, routing table maintenance, routing calculation, and routing determination are implemented with optimized and efficient software.

Assume that two machines using the IP protocol communicate through a layer 3 switch. When machine A starts sending, it knows the destination IP address, but it does not yet know the MAC address needed to send on the local area network. Address resolution (ARP) is used to determine the destination MAC address. Machine A compares its IP address with the destination IP address, and extracts the network address from the subnet mask configured in its software to determine whether the destination machine is on the same subnet as itself. If destination machine B and machine A are in the same subnet, A broadcasts an ARP request, B returns its MAC address, A gets the MAC address of destination machine B, caches this address, and uses this MAC address to forward the data. The Layer 2 switching module searches the MAC address table to determine to send the data packet to the destination port. If the two machines are not in the same subnet, if the sending machine A wants to communicate with the destination machine C, the sending machine A sends an ARP packet to the "default gateway", and the IP address of the "default gateway" has been set in the system software . This IP address actually corresponds to the layer 3 switching module of the layer 3 switch. Therefore, when the sending machine A broadcasts an ARP request to the IP address of the "default gateway", if the layer 3 switching module has obtained the MAC address of the destination machine C in the previous communication process, it will reply C to the sending machine A MAC address; otherwise, the layer 3 switching module broadcasts an ARP request to the destination machine based on the routing information. After receiving the ARP request, the destination machine C returns its MAC address to the layer 3 switching module. The layer 3 switching module saves this address and replies to Send machine A. Later, when data packets are forwarded between A and C, they are encapsulated with the MAC address of the final destination machine, and the data forwarding process is all handed over to the layer 2 switching process, and the information can be exchanged at high speed. The so-called one-time route selection, multiple exchanges.

Layer 3 switching has the following outstanding features:

Organic hardware combination accelerates data exchange;

Optimized routing software makes the routing process more efficient;

In addition to the necessary routing decision process, most of the data forwarding process is handled by the second layer exchange;

When multiple subnets are interconnected, they are only logically connected to the Layer 3 switching module. Unlike traditional external routers, ports need to be added to protect users' investment.

4. Comparison of the three technologies

It can be seen that layer 2 switches are mainly used in small local area networks, and the number of machines is less than two or thirty. Under such a network environment, broadcast packets have little effect. The fast switching function of layer two switches, multiple access ports and The low price provides a perfect solution for small network users. In this small network, there is no need to introduce routing functions to increase the difficulty and cost of management, so there is no need to use routers, and of course there is no need to use Layer 3 switches.

The layer 3 switch is designed for IP, the interface type is simple, and has strong layer 2 packet processing capabilities, so it is suitable for large LANs. In order to reduce the damage of broadcast storms, large LANs must be divided into one by function or region A small local area network, that is, a small network segment, which will inevitably lead to a large amount of mutual access between different network segments. Simply using a layer 2 switch can not achieve mutual access between networks. Simply using a router, due to the number of ports Limited, the routing speed is slow, and the size and access speed of the network are limited, so in this environment, a layer 3 switch that is an organic combination of layer 2 switching technology and routing technology is the most suitable.

There are many types of router ports, many Layer 3 protocols supported, and strong routing capabilities, so it is suitable for interconnection between large networks. Although many Layer 3 switches and even Layer 2 switches have interconnect ports for heterogeneous networks, they are generally There are not many interconnected ports in a large network, and the main function of interconnected devices is not to quickly exchange between ports, but to choose the best path, load sharing, link backup, and most importantly, route information with other networks. Switching, all these are functions that routing accomplishes.

In this case, it is naturally impossible to use a layer 2 switch, but whether to use a layer 3 switch depends on the specific situation. The influencing factors mainly include network traffic, response speed requirements and investment budget. The most important purpose of the layer 3 switch is to speed up the data exchange within the large local area network. The routing function incorporated into it also serves this purpose, so its routing function is not as strong as a professional router of the same grade. In the case of heavy network traffic, if the Layer 3 switch performs both intra-network switching and inter-network routing, it will inevitably increase its burden and affect the response speed. When the network traffic is heavy, but the response speed is very high, the three-layer switch is used for the intra-network switching, and the router is specifically responsible for the routing between the networks, so that the advantages of different devices can be fully utilized, which is a good Cooperate. Of course, if limited by the investment budget, it is also a good choice to use the three-layer switch as the network interconnection.

24V Power Supply

24v power supply, the current range is 2A-9.2A, the max power is 220w. We also can meet your specific requirement of the prodcuts.The material of this product is PC+ABS. All condition of our product is 100% brand new.

Our products built with input/output overvoltage protection, input/output overcurrent protection, over temperature protection, over power protection and short circuit protection. You can send more details of this product, so that we can offer best service to you!


24V Power Supply,24V Pc Power Supply,24V Dc Power Supply ,24V Power Supply For Pc

Shenzhen Waweis Technology Co., Ltd. , https://www.waweispowerasdapter.com