A method and system for configuring a two-layer network in a fully interconnected network
By configuring broadcast rules and enabling Mac learning functions in the entire Internet network, the problem of forwarding loops in the entire Internet network is solved, efficient utilization of link resources is achieved, and a fast-responsive layer two-layer networking solution is provided.
Patent Information
- Application Number
- CN202510488226.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-04-18
AI Technical Summary
There is a forwarding loop in the layer 2 network in the entire Internet network, and the existing technology requires the introduction of STP protocol to lead to link waste.
By configuring the first to fourth broadcast rules in the forwarding device, combining Mac learning functions and SDN broadcast rules, the broadcast range of broadcast, multicast and unknown unicast messages is restricted, loop generation is avoided, and links are fully utilized.
It effectively reduces the forwarding loop in the second layer network in the entire Internet network, improves link utilization, provides fast and sensitive network response capabilities, and is suitable for high bandwidth and low latency network environments.
Smart Images

Figure CN120017503B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer networks, and particularly to a method and system for configuring a two-layer network in a full-mesh network. Background Art
[0002] A full-mesh network refers to a network topology in which all forwarding devices in the network are directly interconnected with each other in pairs. The full-mesh network has an extremely high link density and an extremely short network radius, can meet the requirements of high bandwidth and low latency, and generally has a small network scale. For a full-mesh network, currently, mainly three-layer networking technology is adopted, which can meet the network interconnection requirements and can make relatively full use of high-density links. However, the three-layer networking technology is relatively complex, and due to the shortcomings of the three-layer network, the applications and services that can be supported are limited.
[0003] Compared with the three-layer networking technology, the implementation of the two-layer networking technology is simpler. The two-layer networking based on the two-layer forwarding table and the Mac learning mechanism can meet the network interconnection requirements, but the two-layer forwarding table and the Mac learning mechanism do not provide an anti-loop function, and there cannot be loops in the network topology. It is necessary to introduce the STP protocol (Spanning Tree Protocol) to eliminate loops before it can be applied to the full-mesh network, which will cause a great waste of links.
[0004] Therefore, how to effectively reduce the generation of forwarding loops in the two-layer networking of a full-mesh network and make full use of its high-density links is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0005] To solve the above technical problems, the present application provides a method for configuring a two-layer network in a full-mesh network, which can effectively reduce the generation of forwarding loops in the two-layer networking of a full-mesh network and make full use of its high-density links. The present application also provides a system for configuring a two-layer network in a full-mesh network, which has the same technical effect.
[0006] The first object of the present application is to provide a method for configuring a two-layer network in a full-mesh network.
[0007] The above object of the present application is achieved through the following technical solutions:
[0008] A method for configuring a two-layer network in a full-mesh network, which is applied to a forwarding chip and includes:
[0009] Issuing a first broadcast rule, where the first broadcast rule is configured in the forwarding devices of the full-mesh network, and for broadcast packets, multicast packets, and unknown unicast packets, the default broadcast mechanism is executed;
[0010] Send the second broadcast rule, where the second broadcast rule is configured to, for each interconnected port in the forwarding device, match the broadcast packets and multicast packets received by the interconnected port, and broadcast the matched packets to all access ports of the forwarding device. The interconnected port is the port through which the forwarding device is interconnected with other forwarding devices, and the access port is the port through which the forwarding device is connected to an access terminal. The priority of the second broadcast rule is higher than that of the first broadcast rule;
[0011] Send the third broadcast rule, where the third broadcast rule is configured to, for each of the interconnected ports in the forwarding device, match the unicast packets received by the interconnected port and for which no corresponding entry is found in the layer-2 forwarding table, and broadcast the matched packets to the access ports of the forwarding device. The priority of the third broadcast rule is higher than that of the first broadcast rule.
[0012] Preferably, the method for configuring the layer-2 network of the fully interconnected network further includes:
[0013] In the forwarding device, enable the Mac learning function and do not enable the STP protocol.
[0014] Preferably, the method for configuring the layer-2 network of the fully interconnected network further includes:
[0015] Send the fourth broadcast rule, where the fourth broadcast rule is configured to, for each of the interconnected ports in the forwarding device, match the unicast packets received by the interconnected port and for which the entry value found in the layer-2 forwarding table is the interconnected port, and discard the matched packets. The priority of the fourth broadcast rule is higher than the forwarding process of the layer-2 forwarding table for known unicast packets.
[0016] Preferably, in the method for configuring the layer-2 network of the fully interconnected network, the second broadcast rule, the third broadcast rule, and the fourth broadcast rule adopt SDN broadcast rules.
[0017] The second object of the present application is to provide a system for configuring the layer-2 network of a fully interconnected network.
[0018] The above object two of the present application is achieved through the following technical solutions:
[0019] A system for configuring the layer-2 network of a fully interconnected network, applied to a forwarding chip, includes:
[0020] A first configuration unit, configured to send the first broadcast rule, where the first broadcast rule is configured in the forwarding device of the fully interconnected network to execute a default broadcast mechanism for broadcast packets, multicast packets, and unknown unicast packets;
[0021] A second configuration unit for issuing a second broadcast rule, where the second broadcast rule is configured to, for each interconnection port in the forwarding device, match the broadcast packets and multicast packets received by the interconnection port, and broadcast the matched packets to all access ports of the forwarding device. The interconnection port is the port through which the forwarding device is interconnected with other forwarding devices, and the access port is the port through which the forwarding device is connected to an access terminal. The priority of the second broadcast rule is higher than that of the first broadcast rule;
[0022] A third configuration unit for issuing a third broadcast rule, where the third broadcast rule is configured to, for each of the interconnection ports in the forwarding device, match the unicast packets received by the interconnection port for which no corresponding entry is found in the layer-2 forwarding table, and broadcast the matched packets to the access ports of the forwarding device. The priority of the third broadcast rule is higher than that of the first broadcast rule.
[0023] Preferably, the layer-2 networking configuration system of the full-interconnection network further includes:
[0024] A fourth configuration unit for enabling the Mac learning function in the forwarding device and not enabling the STP protocol.
[0025] Preferably, the layer-2 networking configuration system of the full-interconnection network further includes:
[0026] A fifth configuration unit for issuing a fourth broadcast rule, where the fourth broadcast rule is configured to, for each of the interconnection ports in the forwarding device, match the unicast packets received by the interconnection port for which the entry value found in the layer-2 forwarding table is the interconnection port, and discard the matched packets. The priority of the fourth broadcast rule is higher than the forwarding process of the layer-2 forwarding table for known unicast packets.
[0027] Preferably, in the layer-2 networking configuration system of the full-interconnection network, the second broadcast rule, the third broadcast rule, and the fourth broadcast rule adopt SDN broadcast rules.
[0028] The above technical solution utilizes the default broadcast mechanism and the layer-2 forwarding table that are commonly present in forwarding chips to provide fast and sensitive network response capabilities. Through the above configuration, when broadcast packets, multicast packets, and unknown unicast packets enter the first-hop forwarding device, the default broadcast mechanism is executed by matching the first broadcast rule. When broadcast packets and multicast packets enter the second-hop forwarding device, a second broadcast rule with a higher priority will be matched and executed to broadcast the broadcast packets and multicast packets to the access ports of the second-hop forwarding device, which can prevent the broadcast packets and multicast packets from being sent to other forwarding devices, ensure that the broadcast packets and multicast packets can be broadcast to all access terminals, and avoid the generation of loops during the packet forwarding process. When a unicast packet enters the second-hop forwarding device, if the lookup in the layer-2 forwarding table fails, a third broadcast rule with a higher priority will be matched and executed to broadcast the unknown unicast packet to the access ports of the second-hop forwarding device, which can prevent the unknown unicast packet from being sent to other forwarding devices, ensure that the unknown unicast packet can be broadcast to all access terminals, and avoid the generation of loops during the packet forwarding process. In summary, the above technical solution utilizes the characteristics of a fully connected network to limit the broadcast scope of broadcast packets, multicast packets, and unknown unicast packets, can implement the layer-2 networking of a fully connected network, utilize each link in the fully connected network, and effectively reduce the generation of forwarding loops in the layer-2 networking of a fully connected network. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0030] Figure 1 It is a schematic flowchart of a method for configuring layer-2 networking of a fully connected network in an embodiment of the present application;
[0031] Figure 2 It is a schematic diagram of the topology structure of a fully connected network in an embodiment of the present application;
[0032] Figure 3 It is a schematic flowchart of the forwarding process of broadcast packets and multicast packets in an embodiment of the present application;
[0033] Figure 4 It is a schematic flowchart of the forwarding process of unicast packets in an embodiment of the present application;
[0034] Figure 5 It is a schematic diagram of the structure of a system for configuring layer-2 networking of a fully connected network in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below. Apparently, the described embodiments are only a part of the embodiments of this application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0036] In the embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described below are only illustrative. For example, the division of units and modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or modules can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed with each other can be through some interfaces, indirect coupling or communication connection of devices or modules, and can be electrical, mechanical, or other forms.
[0037] In addition, in each embodiment of this application, each functional unit can be fully integrated in a processor, or each unit can be separately used as a device, or two or more units can be integrated in a device; each functional unit in each embodiment of this application can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.
[0038] Those of ordinary skill in the art can understand that all or part of the steps of implementing the following method embodiments can be completed through program instructions and related hardware. The foregoing program instructions can be stored in a computer-readable storage medium. When the program instructions are executed, they perform the steps including the following method embodiments; and the foregoing storage medium includes: various media such as removable storage devices, read-only memory (ROM), magnetic disks, or optical discs that can store program codes.
[0039] It should be understood that in this application, if "system", "device", "unit" and / or "module" are used, they are only a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, that word can be replaced by other expressions.
[0040] In addition, the terms "first" and "second" are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of this application, the meaning of "a plurality of" and "several" is two or more, unless otherwise specifically defined.
[0041] If a flowchart is used in this application, the flowchart is used to illustrate the operations performed by the system according to the embodiments of this application. It should be understood that the operations before or after do not necessarily need to be executed precisely in sequence. On the contrary, the steps can be processed in reverse order or simultaneously. At the same time, other operations can also be added to these processes, or one or more steps can be removed from these processes.
[0042] It should also be noted that in this article, terms such as "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that an article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such an article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the article or device including the above elements.
[0043] The embodiments of this application are written in a progressive manner.
[0044] The two-layer networking uses the destination Mac address of the packet to determine how to forward the packet, and the network formed is called a two-layer network. The main technologies for implementing two-layer networking include: default broadcast mechanism, two-layer forwarding table, Mac learning, and STP protocol.
[0045] (1)Network forwarding packet types and default broadcast mechanism: From the perspective of a network device forwarding packets, packets can be classified into four types: broadcast packets, multicast packets, known unicast packets, and unknown unicast packets. In a layer-2 network: A broadcast packet refers to a packet with a destination Mac address of all 1s, that is, a packet with a destination Mac address of ff:ff:ff:ff:ff:ff. A multicast packet refers to a non-broadcast packet with the lowest bit of the high byte of the destination Mac address being 1. Packets other than broadcast packets and multicast packets are unicast packets, and their destination Mac addresses are called unicast Mac addresses. When a unicast packet arrives at a forwarding device, if the layer-2 forwarding table contains an entry corresponding to the destination Mac address of the packet, the packet is called a known unicast packet; if the layer-2 forwarding table does not contain an entry corresponding to the destination Mac address of the packet, the packet is called an unknown unicast packet. If the layer-2 forwarding table of the forwarding device is empty or there is no layer-2 forwarding table, all unicast packets are unknown unicast packets. For broadcast packets, multicast packets, and unknown unicast packets, the forwarding device uses the default broadcast mechanism to forward the packets. The processing method is to send each received packet out from all ports other than the incoming port (broadcast it). The forwarding device can complete the layer-2 network only by using the default broadcast mechanism, but there will be a large number of broadcast packets in the network, the network communication efficiency is low, and there cannot be loops in the network topology.
[0046] (2) Layer 2 forwarding table and MAC learning mechanism: The Layer 2 forwarding table consists of multiple entries, and each entry contains a MAC address and an output port number. Among them, the MAC address is the key of the entry, used to find this entry; the output port number is the value of the entry, which is the result to be found and is used to determine the output port for packet forwarding. To make the Layer 2 forwarding table work, a method for filling Layer 2 forwarding table entries is also needed. Currently, the most important method is the MAC learning mechanism. The MAC learning mechanism is a technology in which the forwarding device uses the received packet and its input port information to fill the Layer 2 forwarding table entries. After receiving a packet, the device first extracts the source MAC address, destination MAC address, and input port number of the packet. Among them, the extracted source MAC address of the packet is the port MAC address of the terminal device that sent the packet, and it must be a unicast MAC address. Then, the forwarding device enters the learning stage, uses the extracted source MAC address of the packet as the MAC address of the Layer 2 forwarding table entry, and uses the extracted input port number as the output port number of the Layer 2 forwarding table entry to add a Layer 2 forwarding table entry. Finally, during the packet forwarding stage of the forwarding device, the destination MAC address of the packet is extracted, and the packet type is judged. If it is a unicast packet, the corresponding entry is found in the Layer 2 forwarding table using the extracted destination MAC address of the packet, and the packet is forwarded from which port is determined according to the output port number in the entry. Introducing the Layer 2 forwarding table and MAC learning mechanism in the forwarding device can greatly reduce the broadcast of unicast packets in the network and greatly improve network efficiency. The principles of the Layer 2 forwarding table and MAC learning mechanism are simple and easy to implement in hardware. They are implemented in current mainstream forwarding devices (switches) and are implemented in hardware. However, the Layer 2 forwarding table and MAC learning mechanism do not provide a loop prevention function either, and there still cannot be loops in the network topology.
[0047] (3) STP protocol: The STP protocol checks for loops in the network and blocks the ports of redundant links, thereby blocking the redundant links that cause loops and converting the network topology with loops into a loop-free network during operation. When there are few redundant links and low link density in the network, the STP protocol is very practical and effective. It can avoid network failures caused by loops connected wrongly and can allow redundant links to be connected as backups. When the link density in the network is very high, the STP protocol will block all redundant links, resulting in a large number of links being wasted, seriously reducing the link utilization rate and leading to low network communication efficiency.
[0048] The three-layer network deployment uses the three-layer routing protocol to detect the network topology and network status, calculate the network path, and then issue the three-layer forwarding table. The forwarding device finds the three-layer forwarding table entry according to the destination IP address and determines the forwarding direction of the packet. The network constructed in this way is called a three-layer network.
[0049] A three-layer network is generally composed of multiple two-layer networks. The destination Mac address is used within the two-layer network to forward the message to the designated terminal or forwarding device, and the message content remains unchanged during the forwarding process. The destination IP address is used between two-layer networks to forward the message to the designated terminal or forwarding device. During the forwarding process, the forwarding device will modify the source Mac address of the message to the Mac address of the current device and the destination Mac address to the Mac address of the next-hop device. The three-layer network uses the routing protocol to obtain global information and calculate the path mechanism, which can well avoid forwarding loops. The longest IP match mechanism can support a very large network scale. However, the routing protocol mechanism is complex and needs to run in the CPU. The forwarding table configuration path is longer. In a small-scale network, it is not as fast and sensitive as the pure hardware Mac learning in the two-layer network. In addition, it is difficult to achieve IP address drift in a three-layer network, that is, if the terminal device is originally connected to a forwarding device in a three-layer network, and then changes to another forwarding device at another location in the three-layer network, it will not be able to use the original IP address, but needs to be replaced with another IP address that matches the new location and the new forwarding device. In addition, the messages forwarded in the three-layer network must have an IP address, and the Mac address in the message will be modified during the forwarding process, which is not suitable for some applications that tend to be at the bottom layer of the network.
[0050] SDN (Software-Defined Networking) networking: It can not only determine the packet forwarding outlet by matching IP addresses and Mac addresses, but also match more information such as packet type and inbound port at the same time. In addition to forwarding to a specific port, SDN can also perform more actions on matched packets, such as discarding, forwarding to multiple specified interfaces, and modifying specific content in the packet. The above characteristics of SDN are called the Match-Action mechanism: Add flow entries to the flow table, including matching requirements and forwarding actions. The matching requirements include the characteristics of the message to be processed by the current flow entry, such as requiring the destination Mac of the message to be 0:1:0:3:4:5 and requiring the inbound port number to be 5. The forwarding action includes the processing to be performed on the message, such as changing the destination Mac of the message to 0:1:0:3:4:6 and sending it from port 7. When the forwarding device forwards data, it searches for the flow entry that satisfies its matching requirements, selects the flow entry with the highest priority, and executes the forwarding action specified in the flow entry. SDN generally uses topology discovery protocols to obtain network-wide topology information and uses centralized controllers to issue flow table entries. SDN has extremely high flexibility and programmability and can be used to implement a variety of complex and specific networking requirements. However, SDN networking control is more complex than the three-layer routing protocol, and the control response path is longer. It generally requires the deployment of a dedicated controller outside the forwarding device, and is prone to single point failure problems.
[0051] A fully connected network refers to a network topology in which all forwarding devices in the network are directly interconnected with each other in pairs. The fully connected network has an extremely high link density and an extremely short network radius, can meet the requirements of high bandwidth and low latency, and generally has a small network scale. For a fully connected network, currently, a three-layer networking technology is mainly adopted, which can meet the network interconnection requirements and can make relatively full use of high-density links. However, the three-layer networking technology is relatively complex and is restricted by the disadvantages of the three-layer network, and the applications and services that can be supported are limited.
[0052] Compared with the three-layer networking technology, the implementation of the two-layer networking technology is simpler. The two-layer networking based on the two-layer forwarding table and the Mac learning mechanism can meet the network interconnection requirements. However, the two-layer forwarding table and the Mac learning mechanism do not provide a loop prevention function, and there cannot be loops in the network topology. It is necessary to introduce the STP protocol to eliminate loops before it can be applied to the fully connected network, which will cause a great waste of links.
[0053] As Figure 1 shown, an embodiment of the present application provides a two-layer networking configuration method for a fully connected network, which is applied to a forwarding chip and includes:
[0054] S101. Send down a first broadcast rule, where the first broadcast rule is configured in the forwarding device of the fully connected network, and the default broadcast mechanism is executed for broadcast packets, multicast packets, and unknown unicast packets;
[0055] In S101, specifically, taking the fully connected network topology shown in Figure 2 as an example, this fully connected network includes a total of 3 forwarding devices s1, s2, and s3. Each forwarding device includes 4 ports p1, p2, p3, and p4. The forwarding devices are interconnected in pairs, and the pairwise interconnection links occupy 2 ports p1 and p2 of each forwarding device. The ports used for the interconnection of the forwarding device with other forwarding devices are called interconnection ports. Each forwarding device is connected to 2 access terminals, occupying 2 ports p3 and p4. The ports used for the connection of the forwarding device with the access terminals are called access ports.
[0056] Among them, a first broadcast rule is sent to the forwarding chip. Specifically, the number of rule entries can be fixed at 1. The first broadcast rule is configured in the forwarding devices of the full-mesh network. For broadcast packets, multicast packets, and unknown unicast packets, the default broadcast mechanism is executed, that is, they are broadcast to all other ports except the ingress port. Through the first broadcast rule, broadcast packets, multicast packets, and unknown unicast packets sent by any access terminal can be broadcast from the first-hop forwarding device connected to the access terminal to all other forwarding devices, that is, each second-hop forwarding device, and broadcast to all access terminals connected to the first-hop forwarding device; then they are broadcast to all access terminals connected to it in each second-hop forwarding device; finally, after passing through two-hop forwarding devices, broadcast packets, multicast packets, and unknown unicast packets are broadcast to all access terminals in the whole network except the ingress port. The first broadcast rule cannot avoid the packets from continuing to be sent to other forwarding devices after reaching the second-hop forwarding device, and cannot avoid the generation of forwarding loops. The configuration of the first broadcast rule is consistent with that of current mainstream devices.
[0057] S102. Send a second broadcast rule. Among them, the second broadcast rule is configured to match the broadcast packets and multicast packets received by each interconnection port in the forwarding device, and broadcast the matching packets to all access ports of the forwarding device. The interconnection port is the port through which the forwarding device is interconnected with other forwarding devices, and the access port is the port through which the forwarding device is connected to the access terminal. The priority of the second broadcast rule is higher than that of the first broadcast rule;
[0058] In S102, specifically, in the forwarding devices of the full-mesh network, record the port used for the interconnection between the forwarding device and other forwarding devices as the interconnection port, and record the port used for the connection between the forwarding device and the access terminal as the access port; the second broadcast rule is configured to match all broadcast packets and multicast packets received by each interconnection port in the forwarding device, and perform a broadcast action on the matching packets, broadcasting them to all access ports of the forwarding device. The priority of the second broadcast rule is higher than that of the first broadcast rule. If a packet matches both the second broadcast rule and the first broadcast rule after entering the forwarding device, only the second broadcast rule needs to be executed.
[0059] For Figure 2Taking the fully interconnected network topology shown as an example, for each port p in all interconnected ports {p1, p2}, a configuration is issued. For packets that match the incoming port as p, the destination Mac address as 01:00:00:00:00:00:00, and the mask as 01:00:00:00:00:00:00, the following action is performed: forward to all access ports {p3, p4}. Among them, the mask of 01:00:00:00:00:00:00 means that only the lowest bit of the high byte of the destination Mac address is matched, and the remaining bits are ignored. Among them, the specific number of rule entries of the second broadcast rule is equal to the number of interconnected ports, which is 2 in this example. After broadcast packets and multicast packets enter the first-hop forwarding device, since they do not meet the condition of being received by the interconnected port and do not match the second broadcast rule, the first broadcast rule is adopted instead, and the default broadcast mechanism is executed; after broadcast packets and multicast packets enter the second-hop forwarding device, they match both the second broadcast rule and the first broadcast rule. At this time, the broadcast action is performed according to the second broadcast rule with higher priority, and the broadcast packets and multicast packets are broadcast to all access ports {p3, p4} of the second-hop forwarding device, that is, broadcast to all access terminals connected to the second-hop forwarding device, which can effectively prevent broadcast packets and multicast packets from being sent to other forwarding devices. In this step, by introducing the second broadcast rule, it can be ensured that broadcast packets and multicast packets can be broadcast to all access terminals in the whole network, and loops are avoided during the packet forwarding process.
[0060] S103. Issue the third broadcast rule, where the third broadcast rule is configured to, for each interconnected port in the forwarding device, match unicast packets received by the interconnected port and not found in the corresponding entry in the layer-2 forwarding table, and broadcast the matching packets to the access ports of the forwarding device. The priority of the third broadcast rule is higher than that of the first broadcast rule.
[0061] In S103, specifically, the third broadcast rule is configured to, for each interconnected port in the forwarding device, match unicast packets received by the interconnected port and not found in the corresponding entry in the layer-2 forwarding table, that is, match unicast packets received by the interconnected port and not found in the layer-2 forwarding table of the forwarding device where the interconnected port is located for the table entry corresponding to the destination Mac address of the packet, and perform a broadcast action on the matching packets and broadcast them to all access ports of the forwarding device. The priority of the third broadcast rule is higher than that of the first broadcast rule. If a packet matches both the third broadcast rule and the first broadcast rule after entering the forwarding device, only the third broadcast rule needs to be executed.
[0062] Taking Figure 2Taking the fully-connected network topology shown as an example, for each port p in all interconnected ports {p1, p2}, a configuration is issued. For packets that match the incoming port p, the second-layer forwarding table lookup fails, and the destination Mac address is 00:00:00:00:00:00:00 with a mask of 01:00:00:00:00:00:00, the action is executed: forward to the two ports {p3, p4}. Among them, the mask of 01:00:00:00:00:00:00 means that only the lowest bit of the high byte of the destination Mac address is matched, and the rest are ignored. Among them, the specific number of rule entries of the third broadcast rule is equal to the number of interconnected ports, which is 2 in this example. The priority of the third broadcast rule is higher than that of the first broadcast rule. Similar to the second broadcast rule, when a certain unicast packet is an unknown unicast packet for all forwarding devices, the third broadcast rule does not affect the broadcast of the packet by the first broadcast rule in the first-hop forwarding device, but replaces the first broadcast rule in the second-hop forwarding device, and broadcasts the unknown unicast packet to all access terminals connected to the second-hop forwarding device, avoiding the unknown unicast packet from continuing to be sent to other forwarding devices, so as to ensure that the unknown unicast packet can be broadcast to all access terminals in the whole network and avoid the generation of loops during the forwarding process of the packet. After the configuration in this step is completed, the second-layer networking of the fully-connected network can be realized, all the links in the fully-connected network can be utilized, and the generation of forwarding loops can be effectively reduced.
[0063] In the above embodiments, by using the default broadcast mechanism and the second-layer forwarding table that are commonly present in forwarding chips, a fast and sensitive network response ability is provided; through the above configuration, after broadcast packets, multicast packets, and unknown unicast packets enter the first-hop forwarding device, they match the first broadcast rule and execute the default broadcast mechanism; when broadcast packets and multicast packets enter the second-hop forwarding device, they will match and execute the second broadcast rule with a higher priority to broadcast the broadcast packets and multicast packets to the access ports of the second-hop forwarding device, which can avoid the broadcast packets and multicast packets from continuing to be sent to other forwarding devices, ensure that the broadcast packets and multicast packets can be broadcast to all access terminals and avoid the generation of loops during the forwarding process of the packets; when a unicast packet enters the second-hop forwarding device, if the second-layer forwarding table lookup fails, it will match and execute the third broadcast rule with a higher priority to broadcast the unknown unicast packet to the access ports of the second-hop forwarding device, which can avoid the unknown unicast packet from continuing to be sent to other forwarding devices, ensure that the unknown unicast packet can be broadcast to all access terminals and avoid the generation of loops during the forwarding process of the packet. To sum up, in the above embodiments, by using the characteristics of the fully-connected network, the broadcast ranges of broadcast packets, multicast packets, and unknown unicast packets are restricted, the second-layer networking of the fully-connected network can be realized, all the links in the fully-connected network can be utilized, and the generation of forwarding loops in the second-layer networking of the fully-connected network can be effectively reduced.
[0064] In view of the above embodiments, all unicast packets will be regarded as unknown unicast packets by the forwarding device and broadcast to all ports outside the ingress port, resulting in a large number of unnecessary packet broadcasts in the network link, wasting link bandwidth and having low network communication efficiency.
[0065] In other embodiments of the present application, in the above method for configuring a two-layer network in a fully-connected network, it further includes:
[0066] S201. In the forwarding device, enable the Mac learning function and do not enable the STP protocol;
[0067] In S201, specifically, the Mac learning function is the Mac learning mechanism described above; in each forwarding device in the fully-connected network, enable the Mac learning function and do not enable the STP protocol. The difference between this step and the traditional two-layer network configuration is that in a traditional two-layer network (with loops) in a fully-connected network, when enabling the Mac learning function, the STP protocol must be enabled. After this step is configured, by using the two-layer forwarding table and the Mac learning function, the broadcast of unicast packets in the network can be significantly reduced, but in special cases, a unicast packet forwarding loop may be caused.
[0068] S202. Issue a fourth broadcast rule, where the fourth broadcast rule is configured to, for each interconnected port in the forwarding device, match a unicast packet received by the interconnected port and whose entry value found in the two-layer forwarding table is the interconnected port, and discard the matched packet. The priority of the fourth broadcast rule is higher than the forwarding process of the two-layer forwarding table for known unicast packets.
[0069] In S202, specifically, the fourth broadcast rule is configured to, for each interconnected port in the forwarding device, match a unicast packet received by the interconnected port and whose entry value found in the two-layer forwarding table is the interconnected port, that is, match a unicast packet received by the interconnected port and whose entry value (egress port) found in the two-layer forwarding table of the forwarding device where the interconnected port is located is the interconnected port, and perform a discard action on the matched packet. The priority of the fourth broadcast rule is higher than the forwarding process of the two-layer forwarding table for known unicast packets.
[0070] With Figure 2Taking the fully connected network topology shown as an example, for each port p in all interconnected ports {p1, p2}, a configuration is issued for each port q in other interconnected ports. For a packet with the ingress port p and the lookup result value (egress port) of the Layer 2 forwarding table being q, the action is executed: discard. Among them, the specific number of rule entries of the fourth broadcast rule is equal to the number of interconnected ports × (the number of interconnected ports - 1). In this example, it is 2×(2 - 1)=2 entries. The priority of the fourth broadcast rule is higher than the packet forwarding of the Layer 2 forwarding table. When a unicast packet is forwarded as an unknown unicast packet to other forwarding devices (the second hop) in the first-hop forwarding device, if it hits the Layer 2 forwarding table in the second-hop forwarding device and the found egress port is an interconnected port (i.e., the third hop is a forwarding device), the fourth broadcast rule takes effect and discards the packet to avoid the packet from continuing to be sent to the third-hop forwarding device and avoid loop generation. The correct second-hop forwarding device will correctly deliver the packet to the access port and finally reach the destination access terminal. Through this step, the loophole of unicast packet forwarding loop that may appear in the configurations of the previous steps is filled, and the generation of forwarding loops in the Layer 2 networking of the fully connected network can be further reduced.
[0071] Among them, the second broadcast rule, the third broadcast rule, and the fourth broadcast rule adopt the SDN broadcast rule, which can be specifically implemented based on the flexible match-action mechanism of SDN.
[0072] In the above embodiment, for the Layer 2 networking of the fully connected network, the default broadcast mechanism, the Layer 2 forwarding table, and the Mac learning mechanism commonly existing in forwarding chips are used to provide a fast and sensitive network response ability. Using the characteristics of the fully connected network and the flexible match-action mechanism of SDN to limit the broadcast scope of broadcast, multicast, and unknown unicast packets can not only effectively avoid the generation of forwarding loops, but also make full use of a large number of links in the fully connected network to avoid link waste. Moreover, no additional centralized controller is required, the networking is simple, and a unified Layer 2 network can be provided to meet the needs of various special applications.
[0073] In a specific embodiment, taking Figure 2 the fully connected network topology shown as an example, assuming that the Layer 2 networking configuration of the above fully connected network has been completed, the access terminal h11 sends out broadcast packets and multicast packets, as Figure 3 shown, the forwarding processing flow of the broadcast packet and the multicast packet specifically includes:
[0074] S31. The packet is sent out from the access terminal h11;
[0075] In S31, specifically, the packet is a broadcast packet and a multicast packet sent out by the access terminal h11. After the packet is sent out, it will reach the forwarding device S1, and the ingress port is p3.
[0076] S32. The forwarding device S1 receives a packet, matches the first broadcast rule, and sends the packet to all ports outside the ingress port;
[0077] In S32, specifically, after the p3 port of the forwarding device S1 receives the packet sent by the access terminal h11, it matches the first broadcast rule and performs the forwarding action of the default broadcast mechanism: sending it to all ports outside the ingress port. Specifically, the packet is divided into 3 packets and sent out from the ports p1, p4, and p2 of the forwarding device S1 respectively. The packet forwarding process is divided into 3 parallel sub-processes S321, S322, and S323.
[0078] S321. The forwarding device S3 receives a packet, matches the second broadcast rule, and sends the packet to the access port;
[0079] In S321, specifically, the p2 port (interconnection port) of the forwarding device S3 receives the packet sent by the p1 port of the forwarding device S1. At this time, it matches the second broadcast rule and performs the action: sending it to all access ports. Specifically, the packet is divided into 2 packets and sent out from the ports p3 and p4 of the forwarding device S3 respectively. The forwarded packet forwarding process is divided into 2 parallel sub-processes S3211 and S3212.
[0080] S3211. The access terminal h31 receives the packet;
[0081] In S3211, specifically, after the access terminal h31 receives the packet sent by the p3 port of the forwarding device S3, it ends.
[0082] S3212. The access terminal h32 receives the packet;
[0083] In S3212, specifically, after the access terminal h32 receives the packet sent by the p4 port of the forwarding device S3, it ends.
[0084] S322. The access terminal h12 receives the packet;
[0085] In S322, specifically, after the access terminal h12 receives the packet sent by the p4 port of the forwarding device S1, it ends.
[0086] S323. The forwarding device S2 receives a packet, matches the second broadcast rule, and sends the packet to the access port;
[0087] In S323, specifically, the p1 port (interconnection port) of the forwarding device S2 receives the packet sent by the p2 port of the forwarding device S1, matches the second broadcast rule, and performs the action: sending it to all access ports. Specifically, the packet is divided into 2 packets and sent out from the ports p3 and p4 of the forwarding device S2 respectively. The packet forwarding process is divided into 2 parallel sub-processes S3231 and S3232.
[0088] S3231. The access terminal h21 receives a message;
[0089] In S3231, specifically, after the access terminal h21 receives the message sent from port p3 of the forwarding device S2, it ends.
[0090] S3232. The access terminal h22 receives a message.
[0091] In S3231, specifically, after the access terminal h22 receives the message sent from port p4 of the forwarding device S2, it ends.
[0092] Through the above specific embodiments, it can be seen that when the broadcast message and the multicast message enter the second-hop forwarding device, the second broadcast rule with a higher priority will be matched and executed to broadcast the broadcast message and the multicast message to the access ports of the second-hop forwarding device, which can prevent the broadcast message and the multicast message from being sent to other forwarding devices, ensure that the broadcast message and the multicast message can be broadcast to all access terminals, and avoid generating loops during the forwarding process of the message.
[0093] In another specific embodiment, taking Figure 2 the fully connected network topology shown as an example, assuming that the layer-2 network configuration of the above fully connected network has been completed, the access terminal h11 wants to send a unicast message to the access terminal h22, and the Mac address of the access terminal h22 is Mac22. As Figure 4 shown, the unicast message forwarding processing flow specifically includes:
[0094] S41. The message is sent from the access terminal h11;
[0095] In S41, specifically, the message is a unicast message that the access terminal h11 wants to send to the access terminal h22. After the message is sent, it will reach the forwarding device S1, and the ingress port is p3.
[0096] S42. The forwarding device S1 receives the message and determines whether it hits the layer-2 forwarding table. If it does not hit, it goes to S43; if it hits, it goes to S433;
[0097] In S42, specifically, in the layer-2 forwarding table of the forwarding device S1, if the entry corresponding to the destination Mac address of the message cannot be found, it goes to S43, otherwise, it goes to S433.
[0098] S43. Match the first broadcast rule, and the forwarding device S1 sends the message to all ports outside the ingress port;
[0099] In S43, specifically, the unicast packet misses the Layer 2 forwarding table. As an unknown unicast packet, it matches the first broadcast rule and performs the forwarding action of the default broadcast mechanism: sending it to all ports outside the ingress port. Specifically, the packet is divided into 3 packets and sent out from ports p1, p4, and p2 of the forwarding device S1 respectively. The packet forwarding process is divided into 3 parallel sub-processes S431, S432, and S433.
[0100] S431. The forwarding device S3 receives the packet and determines whether it hits the Layer 2 forwarding table. If it hits, go to S4311; if it misses, go to S4312;
[0101] In S431, specifically, in the Layer 2 forwarding table of the forwarding device S3, if an entry corresponding to the destination Mac address of the packet is found, go to S4311; otherwise, go to S4312.
[0102] S4311. Match the fourth broadcast rule and discard the packet;
[0103] In S4311, the unicast packet hits the Layer 2 forwarding table. At this time, the ingress port is p2 (interconnection port), and the egress port is p1 (another interconnection port). It matches the fourth broadcast rule, whose priority is higher than the forwarding process of the Layer 2 forwarding table for known unicast packets, and performs the forwarding action of the fourth broadcast rule: discard the packet and end.
[0104] S4312. Match the third broadcast rule and send the packet to the access port;
[0105] In S4312, specifically, the unicast packet misses the Layer 2 forwarding table, the ingress port is p2 (interconnection port), it matches the third broadcast rule, and performs the forwarding action of the third broadcast rule: send it to all access ports. Specifically, the packet is divided into 2 packets and sent out from ports p3 and p4 of the forwarding device S3 respectively. The packet forwarding process is divided into 2 parallel sub-processes S43121 and S43122.
[0106] S43121. The access terminal h31 receives the packet;
[0107] In S43121, specifically, after the access terminal h31 receives the packet sent from port p3 of the forwarding device S3, it ends.
[0108] S43122. The access terminal h32 receives the packet;
[0109] In S43122, specifically, after the access terminal h32 receives the packet sent from port p4 of the forwarding device S3, it ends.
[0110] S432. The access terminal h12 receives the packet;
[0111] In S432, specifically, after the access terminal h12 receives the packet sent from port p4 of the forwarding device S1, it ends.
[0112] S433. The forwarding device S2 receives the packet and determines whether it hits the layer 2 forwarding table. If it does not hit, it goes to S4331; if it hits, it goes to S43312;
[0113] In S433, specifically, in the layer 2 forwarding table of the forwarding device S2, if the entry corresponding to the destination Mac address of the packet is found, it goes to S43312; otherwise, it goes to S4331.
[0114] S4331. Match the third broadcast rule and send the packet to the access port;
[0115] In S4331, specifically, the unicast packet does not hit the layer 2 forwarding table, the input port is p1 (interconnection port), match the third broadcast rule, and execute the forwarding action of the third broadcast rule: send it to all access ports. Specifically, the packet is divided into 2 packets and sent from ports p3 and p4 of the forwarding device S2 respectively. The packet forwarding process is divided into 2 parallel sub-processes S43311 and S43312.
[0116] S43311. The access terminal h21 receives the packet;
[0117] In S43311, specifically, after the access terminal h21 receives the packet sent from port p3 of the forwarding device S2, it ends.
[0118] S43312. The access terminal h22 receives the packet;
[0119] In S43312, specifically, after the access terminal h22 receives the packet sent from port p4 of the forwarding device S2, it ends.
[0120] Through the above specific embodiments, it can be seen that when a unicast packet enters the second-hop forwarding device, if the lookup in the layer 2 forwarding table fails, the third broadcast rule with higher priority will be matched and executed to broadcast the unknown unicast packet to the access ports of the second-hop forwarding device, which can prevent the unknown unicast packet from continuing to be sent to other forwarding devices and ensure that the unknown unicast packet can be broadcast to all access terminals and avoid loops in the packet forwarding process. When a unicast packet is forwarded as an unknown unicast packet to other forwarding devices (the second hop) in the first-hop forwarding device, if it hits the layer 2 forwarding table of the second-hop forwarding device and the found output port is the interconnection port (i.e., the third hop is a forwarding device), the fourth broadcast rule takes effect and the packet is discarded, which can prevent the packet from continuing to be sent to the third-hop forwarding device and avoid loop generation.
[0121] Such as Figure 5As shown in the figure, in another embodiment of the present application, a two-layer networking configuration system for a fully interconnected network is provided, which is applied to a forwarding chip and includes:
[0122] A first configuration unit 10 for issuing a first broadcast rule, where the first broadcast rule is configured in the forwarding devices of the fully interconnected network to execute a default broadcast mechanism for broadcast packets, multicast packets, and unknown unicast packets;
[0123] A second configuration unit 11 for issuing a second broadcast rule, where the second broadcast rule is configured to match, for each interconnected port in the forwarding device, the broadcast packets and multicast packets received by the interconnected port and broadcast the matching packets to all access ports of the forwarding device. The interconnected port is the port through which the forwarding device is interconnected with other forwarding devices, and the access port is the port through which the forwarding device is connected to the access terminal. The priority of the second broadcast rule is higher than that of the first broadcast rule;
[0124] A third configuration unit 12 for issuing a third broadcast rule, where the third broadcast rule is configured to match, for each interconnected port in the forwarding device, the unicast packets received by the interconnected port and not found in the two-layer forwarding table and broadcast the matching packets to the access ports of the forwarding device. The priority of the third broadcast rule is higher than that of the first broadcast rule.
[0125] In other embodiments of the present application, in the above two-layer networking configuration system for a fully interconnected network, it further includes:
[0126] A fourth configuration unit for enabling the Mac learning function in the forwarding device and not enabling the STP protocol.
[0127] In other embodiments of the present application, in the above two-layer networking configuration system for a fully interconnected network, it further includes:
[0128] A fifth configuration unit for issuing a fourth broadcast rule, where the fourth broadcast rule is configured to match, for each interconnected port in the forwarding device, the unicast packets received by the interconnected port and with the table entry value found in the two-layer forwarding table being the interconnected port and discard the matching packets. The priority of the fourth broadcast rule is higher than the forwarding processing of known unicast packets by the two-layer forwarding table.
[0129] In other embodiments of the present application, in the above two-layer networking configuration system for a fully interconnected network, the second broadcast rule, the third broadcast rule, and the fourth broadcast rule adopt SDN broadcast rules.
[0130] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for configuring a two-layer network in a fully interconnected network, characterized in that, Applied to a forwarding chip, including: Issuing a first broadcast rule, where the first broadcast rule is configured in a forwarding device of a full-mesh network to execute a default broadcast mechanism for broadcast packets, multicast packets, and unknown unicast packets; Issuing a second broadcast rule, where the second broadcast rule is configured to, for each interconnected port in the forwarding device, match the broadcast packets and multicast packets received by the interconnected port and broadcast the matched packets to all access ports of the forwarding device. The interconnected port is the port through which the forwarding device is interconnected with other forwarding devices, and the access port is the port through which the forwarding device is connected to an access terminal. The priority of the second broadcast rule is higher than that of the first broadcast rule; Issuing a third broadcast rule, where the third broadcast rule is configured to, for each interconnected port in the forwarding device, match the unicast packets received by the interconnected port and not found in the corresponding entry in the layer-2 forwarding table and broadcast the matched packets to the access ports of the forwarding device. The priority of the third broadcast rule is higher than that of the first broadcast rule; Issuing a fourth broadcast rule, where the fourth broadcast rule is configured to, for each interconnected port in the forwarding device, match the unicast packets received by the interconnected port and with the entry value found in the layer-2 forwarding table being the interconnected port and discard the matched packets. The priority of the fourth broadcast rule is higher than the forwarding process of the layer-2 forwarding table for known unicast packets.
2. The method according to claim 1, characterized in that, Further including: In the forwarding device, enabling the Mac learning function and not enabling the STP protocol.
3. The method according to claim 1, characterized in that, The second broadcast rule, the third broadcast rule, and the fourth broadcast rule adopt SDN broadcast rules.
4. A two-layer networking configuration system for a fully interconnected network, characterized in that Applied to a forwarding chip, including: A first configuration unit for issuing a first broadcast rule, where the first broadcast rule is configured in a forwarding device of a full-mesh network to execute a default broadcast mechanism for broadcast packets, multicast packets, and unknown unicast packets; A second configuration unit for issuing a second broadcast rule, where the second broadcast rule is configured to, for each interconnected port in the forwarding device, match the broadcast packets and multicast packets received by the interconnected port and broadcast the matched packets to all access ports of the forwarding device. The interconnected port is the port through which the forwarding device is interconnected with other forwarding devices, and the access port is the port through which the forwarding device is connected to an access terminal. The priority of the second broadcast rule is higher than that of the first broadcast rule; A third configuration unit for issuing a third broadcast rule, where the third broadcast rule is configured to, for each interconnected port in the forwarding device, match the unicast packets received by the interconnected port and not found in the corresponding entry in the layer-2 forwarding table and broadcast the matched packets to the access ports of the forwarding device. The priority of the third broadcast rule is higher than that of the first broadcast rule; A fifth configuration unit for sending down a fourth broadcast rule, wherein the fourth broadcast rule is configured to, for each of the interconnection ports in the forwarding device, match unicast packets received by the interconnection port and having a table entry value found in the layer 2 forwarding table as the interconnection port, and discard the matched packets, and the priority of the fourth broadcast rule is higher than the forwarding processing of known unicast packets by the layer 2 forwarding table.
5. The system according to claim 4, characterized in that, It further includes: A fourth configuration unit for enabling the Mac learning function in the forwarding device and not enabling the STP protocol.
6. The system according to claim 4, characterized in that, The second broadcast rule, the third broadcast rule, and the fourth broadcast rule adopt SDN broadcast rules.
Citation Information
Patent Citations
Unknown single broadcast message forwarding method and routing bridge
CN103346962A
Method and device for implementing broadcast and multicast in software defined network, storage medium
CN108880968A