Among many network products, switches play a vital role in building high-performance networks, and their technical development is also remarkable. Now, the word "layer 3 switching" has become more popular in the industry. In large and medium-sized networks, there are many networks with Gigabit layer 3 switches as the core. With the rapid development of enterprise network, campus network and broadband network, layer 3 switch has become a new market growth point. Its application has penetrated from the backbone layer and aggregation layer of the initial network center to the access layer at the edge of the network.

Ⅰ. The development of the switching technology

The combination of computer technology and communication technology has promoted the rapid development of LAN. From the emergence of the Aloha network in the late 1960s to the appearance of Gigabit switched Ethernet in the late 1990s, it has experienced from simplex to duplex, from sharing to switching, from low speed to high speed, from simple to complex, from expensive to popular A leap from layer 2 switching to multi-layer switching.

1. Layer 2 switching

At the beginning of the establishment of LAN, it was mainly limited to host connection, file, and print sharing. These requirements can be met by sharing 10Mbps bandwidth among multiple users. With the increasing expansion of the network scale, the previous network system is no longer competent, because, in the LAN, the earliest network interconnection device is the hub, which is the first layer (physical layer) device. In this network based on CSMA / CD physical layer protocol, user data conflict often occurs, which leads to the retransmission of data, which greatly reduces the efficiency of transmission. At that time, the second layer (data link layer) equipment bridge was adopted, which can refine the network segment and reduce the conflict domain, to optimize the performance of the LAN. However, the bridge is a device transparent to the high-level (above the third layer) protocol, which can not effectively prevent the broadcast storm, so it is necessary to use a router. Routers play a key role in inter-subnet interconnection, security control, and broadcast storm limitation, but complex algorithms and low data throughput make them the bottleneck of the network. In order to solve the above problems, the industry has improved the bridge and manufactured a LAN switch to replace the hub to improve the performance of the network.

LAN switch is a layer 2 network device. It continuously collects and establishes its own MAC address table during operation, and refreshes it regularly. Its introduction makes every network station has its own exclusive bandwidth, eliminates unnecessary conflict detection and error retransmission, improves transmission efficiency. Since the transmission of user data is point-to-point, it is invisible to other nodes. However, layer 2 switching also has its weaknesses, including the inability to effectively solve the problems of the broadcast storm, heterogeneous network interconnection, and security control. Therefore, VLAN (virtual local area network) technology on the switch is introduced.

2. Layer 3 switching
The second layer switch works on the second layer of the OSI reference model-data link layer. Its main functions include physical addressing, network topological structure, error checking, frame sequence, flow control, and so on. In order to improve the performance of the switch, the layer 3 switch is introduced. On the premise of retaining all the functions of the layer 2 computer, it adds many new functions, such as support for VLAN, link support for aggregation, and even firewall function. In short, the so-called layer 3 switch adds routing function in protocol-based VLAN division.
Layer 3 switch is the key of the Intranet application. It organically and intelligently combines the advantages of layer 2 switch and layer 3 routers into a flexible solution, which can provide line speed performance at all levels. This integrated structure also introduces the attribute of policy management, which not only connects the second layer and the third layer but also provides traffic priority processing, security access mechanism, and other functions.
The third layer switch is divided into three parts: interface layer, switching layer, and routing layer. The interface layer includes all important LAN interfaces, such as 10 / 100Mbps Ethernet, Gigabit Ethernet, FDDI, ATM, and so on; The switch layer integrates a variety of LAN interfaces, supplemented by policy management, and also provides link aggregation, VLAN, and labeling mechanisms; The routing layer provides the main LAN routing protocols, including IP, IPX and AppleTalk and so on, and provides the layer 3 forwarding technology of traditional routing or direct through policy management. The combination of policy management and administrative management enables network administrators to adjust the network according to the specific needs of enterprises.

Generally speaking, layer 3 switching products adopt programmable and extensible ASIC chip technology, which can provide the following rich features:
(1) Non-blocking line speed switching and routing for all network interfaces and protocols at all ports;
(2) With extremely high throughput, the forwarding speed of data packets (i.e. forwarding packets / second, PPS) is usually 10 ~ 100 times faster than that of medium and high-end routers;
(3) Routing of multiple protocols can be chosen, such as IP (RIPv1 / V2, OSPF), IP Multicast (DVMRP, PIM), and IPX;
(4) Support the division of multiple VLANs, which can be divided according to port / MAC address, protocol, IP subnet, IEEE 802.1Q or Cisco ISL, and so on;
(5) Traffic priority processing with Resource ReSerVation Protocol (RSVP) and Category of Service(CoS) and quality of service (QoS), supporting IEEE 802.1p and Differentiated Service(DifferServ);
(6) It can set the filtering rules of access list control or the security policy based on the firewall;
(7) Support the Point-to-Point Protocol Over Ethernet (PPPoE), support secure user authentication, cooperate with user billing, and enhance user management characteristics;
(8) Support the incremental allocation service of Ethernet bandwidth unit;
(9) The programmability of ASIC, support technologies such as IPv6, and other future technologies to protect user investment.

Ⅱ. Comparison between layer 3 switching and router

In the past, most of the data in the network followed the "80 / 20" rule, that is, only about 20% of the data packets in the network communicate with the central server or other parts of the enterprise network through the backbone router, while 80% of the network traffic was still concentrated in different departmental subnets. Now, however, the situation has fundamentally changed, so the "20 / 80" rule has been formed. In order to cope with the increasing data traffic, shared media networks have been replaced by switching networks. This change has a direct impact on the traditional router originally used for network segmentation. Since most of the data traffic crosses the IP subnet, the router has actually become the bottleneck of network transmission.

The main function of the traditional router is to realize routing and network interconnection, that is, to obtain the topology information of the subnet and the network characteristics of each physical line in a certain way, obtain the best path to each subnet through a certain routing algorithm, and establish the corresponding routing table, so as to transmit each IP packet to the destination; Second, it must deal with different link protocols. When IP packets pass through each router, they need to go through software processing links such as queuing, protocol processing, and addressing routing, resulting in increased delay. At the same time, the router adopts the shared bus model, and the total throughput is limited. When the number of users increases, the access rate of each user decreases. Routers pay more attention to supporting a variety of media types and transmission speeds. At present, data buffering and conversion capabilities are more important than line speed throughput and low delay. Although the performance of the router has also been improved recently, about 1mpps, the cost of using this router is also surprisingly high.

Compared with routing technology, switching technology has the advantage of fast speed. When the network scale is large, a high-speed and high-capacity router is very necessary. On the other hand, because most modern communication networks use optical fiber technology, the main bottleneck of the data network is the node router. The current layer 3 switching, routing switching, or other terms are the result of this idea. Although layer 3 switching was originally designed for LAN, and it uses the destination IP address for switching, now this technology has also been used in Wan.

Layer 3 switching plays a more and more important role in current network construction. It does not need to spread broadcast packets, but directly uses dynamically established MAC addresses to communicate, such as IP address and ARP, and so on. It has the functions of multi-channel broadcasting and routing between virtual networks based on IP and IPX protocols and so on. The smooth realization of this function mainly depends on application-specific integrated circuits (ASIC). The instructions processed by the traditional routing software are changed into the embedded instructions of ASIC chip, which speeds up the packet forwarding and filtering, and ensures the linear routing and quality of service are great when at high speed.

Ⅲ. Application of the layer 3 switching

The application of the layer 3 switch is actually very simple. Its main purpose is to replace the traditional router as the core of the network. Therefore, where there is no WAN connection required and a router is needed, the layer 3 switch can be used instead.

In the enterprise network and campus network, the layer 3 switch is generally used in the core layer of the network, and the Gigabit port or 100 megabytes port on the layer 3 switches is used to connect different subnets or VLANs. In this way, the network structure is relatively simple and the number of nodes is relatively small; In addition, it does not need more control functions, and the cost is low.

In the current popular broadband network construction, layer 3 switches are generally placed in the center of the community and the convergence layer of multiple communities. The emergence of layer 3 switches has challenged the position of enterprise routers. Just as routers dominate Wan, it has become an indisputable fact that layer 3 switches will dominate LAN in the future.

From the current domestic situation, the development momentum of the layer 3 switches is good. Fortunately, many domestic manufacturers have launched layer 3 Ethernet switches with good performance. The layer 3 switch has the following characteristics in the application.

1. Act as a backbone switch
Layer 3 switches are generally used for backbone switches and server group switches of the network, and can also be used as network node switches. In the network, when used together with other Ethernet switches, the network administrator can construct a seamless 10 / 100 / 1000Mbps Ethernet switching system to provide unified network services for the whole information system. Such a network system has a simple structure, scalability, and policy-based QoS services. Layer 3 switches provide QoS services for the network, including priority management, bandwidth management, VLAN switching, etc. Policy-based QoS enables network administrators to allocate bandwidth according to priority for various types of network traffic, including TCP / UDP sessions, without any loss of switching performance.

Due to the application requirements, most of the backbone switches are Gigabit switches. At present, most of the layer 3 switches are Gigabit switches, which can provide 10 / 100Mbps adaptive ports and Gigabit ports. They can connect copper wires or optical fibers, and provide high-performance backplane channels. This kind of switch are either cabinet type or stacked type, which can be selected according to different situations.

2. Support Trunk protocol

In applications, there are often Ethernet switches connected with each other or Ethernet switches interconnected with servers, in which a single connection for interconnection often becomes the bottleneck of the network. Using Trunk technology, several Ethernet connecting lines of the same source switch and destination switch can be logically regarded as one connecting line. This not only ensures that there will be no loop in the LAN but also effectively increases the connection bandwidth. Layer 3 switches with good performance fully support Trunk protocol, and some can support 8 groups of Trunk, which can effectively solve the problem of connection bandwidth in enterprise LAN.

3. Realize multicast and self-study
In addition to supporting dynamic routing protocols RIP and OSPF, some layer 3 switches can also implement standard-based multicast routing protocol, such as distance vector multicast routing protocol (DVMRP).

The layer 3 switches can also support the self-learning function. It can automatically find the corresponding relationship between the host's IP address and the connection port without using any routing protocol. Once the switch is connected to the network, it learns the IP address and subnet mask information of all connected hosts by constantly listening to ARP, RIP, and ICMP packets. Based on the information learned, the switch will establish and maintain the routing information in the routing table, and automatically provide routing services for all IP packets.

4. Improve safety
In the network, for the sake of security, the transmitted data packets need to be filtered according to many rules to ensure that only the qualified data packets can pass through the layer 3 switches. The layer 3 switch supports filters with internal hardware, which can filter all data packets without reducing the system performance and can filter data packets according to any content from layer 2 to layer 7.