Looped network bridge topology implementation method based on double XDP network cards

By adopting a ring network bridge topology and eBPF program based on dual XDP network cards in avionics equipment, the problems of high power consumption and complex design of switching chips in avionics equipment are solved, and the effect of ring network interconnection and reducing hardware burden is achieved.

CN119496753APending Publication Date: 2025-02-21CHINA ELECTRONICS TECHNOLOGY AVIONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411622923.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

In the prior art, switching bridges of avionics equipment generally rely on switching chips with high power consumption and complex designs, especially when three-layer switching functions are required, the cost, volume and power consumption are unbearable.

Method used

The ring network bridge topology implementation method based on dual XDP network cards is adopted. By introducing eBPF programs and libbpf libraries in the Linux kernel, combining XDP technology to realize the switching function carried by hardware, avoiding the use of switching chips.

Benefits of technology

The ring interconnection between avionics equipment is realized without using switching chips, reducing hardware design complexity and power consumption, while avoiding excessive burden on CPU resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119496753A_ABST
    Figure CN119496753A_ABST
Patent Text Reader

Abstract

The invention discloses a looped network bridge topology implementation method based on double XDP network cards, which relates to the technical field of airborne communication, and is characterized in that equipment is provided with at least two XDP network cards, an uplink and a downlink are respectively connected with one XDP network card, and the uplink and the downlink are connected through a circuit breaker; the construction of an eBPF program in a CO-RE form is supported by introducing a libbpf into a construction project, the eBPF program comprises an eBPFvm running in a Linux kernel BPF virtual machine and an eBPF app working in a Linux user mode, and data interaction is carried out between the eBPFvm and the eBPF app through a bpf framework registration interface. The method can be used for avionics equipment to realize network topology, and ring network interconnection is realized under the condition that a switching chip is not used.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of airborne communication technology, and more specifically, to a method for realizing a ring network bridge topology based on a dual XDP network card. Background Art

[0002] With the development of the civil aviation industry, the interconnection of aviation airborne equipment is increasingly dependent on Ethernet networks. The most common topologies of civil aviation airborne Ethernet are ring networks and daisy chains, both of which are based on switching bridges. Switching bridges can be divided into software-based and hardware-based. Software-based switching bridges rely on the TCP / IP protocol stack of the operating system, which is very powerful but consumes a lot of CPU resources. In order to achieve security, reliability, and real-time performance in the aviation industry and reduce the load on equipment, hardware-based bridges must be used.

[0003] At present, the switching bridge of avionics equipment uses switching chips to implement hardware load, such as Figure 1 As shown, the switching chip means more power consumption and more complex design. Especially when the three-layer switching function is required, the three-layer switching chip often has many ports. Its cost, volume and power consumption make many avionics equipment unable to bear it. With the development of technology, the network card that supports the XDP protocol also has the hardware carrying capacity. If a chip integrates two or more XDP network cards, the switching bridge based on XDP technology to realize hardware carrying has the potential to replace the switching chip. With the maturity of eBPF technology in the Linux environment, the technology of eBPF software definition + XDP hardware carrying has been put into practice and verified in many fields. After the emergence of eBPF CO-RE technology, the compiled user space program can be directly encapsulated with eBPF, and the embedded environment that does not carry its own compiler can also run eBPF programs.

[0004] Therefore, how to study and design a ring network bridge topology implementation method based on dual XDP network cards is an issue that we urgently need to solve. Summary of the invention

[0005] In order to solve the deficiencies in the prior art, the purpose of the present invention is to provide a method for realizing a ring network bridge topology based on a dual XDP network card, and to realize a hardware-borne switching bridge based on XDP, which can be used for avionics equipment to realize network topology and realize ring network interconnection without using a switching chip.

[0006] The above technical objectives of the present invention are achieved through the following technical solutions: A method for implementing a ring network bridge topology based on a dual XDP network card comprises the following steps:

[0007] The device is configured with at least two XDP network cards, the uplink and downlink are connected to one XDP network card respectively, and the uplink and downlink are connected through a circuit breaker;

[0008] By introducing libbpf in the build project, the construction of eBPF programs in CO-RE form is supported. The eBPF program includes eBPFvm running in the Linux kernel BPF virtual machine and eBPF app working in Linux user mode. Data is exchanged between eBPFvm and eBPFapp through the bpf framework registration interface.

[0009] Furthermore, the method also includes:

[0010] When the Linux kernel successfully starts to initialize the PHY of the XDP network card, the circuit breaker between the uplink and downlink is disconnected through GPIO control;

[0011] If a network connection failure is detected, the circuit breaker between the uplink and downlink is closed through GPIO control to restore the connection.

[0012] Furthermore, the method also includes:

[0013] When the Linux kernel boots up, start the eBPF program before starting the Linux soft bridge containing two XDP network cards;

[0014] When the eBPF app starts running, inject the eBPFvm into the two XDP network cards and then start the bridge.

[0015] Furthermore, the method also includes:

[0016] When the bridge is started, the spanning tree process is started.

[0017] Furthermore, the method also includes:

[0018] When eBPFvm discovers a new network packet, it first checks whether it is a BPDU packet of the spanning tree protocol; if it is a BPDU packet of the spanning tree protocol, XDP_PASS is used to pass it.

[0019] Furthermore, the method also includes:

[0020] The eBPF app monitors the state of the spanning tree of the port and passes it to the eBPFvm through variables;

[0021] eBPFvm makes judgments based on the variables and discards all packets forwarded to the closed port using XDP_DROP.

[0022] Furthermore, the method also includes:

[0023] If the packet forwarded to the closed port is a BPDU packet of the spanning tree protocol, it will not be discarded.

[0024] Further, the eBPF program maintains an IP / port mapping table and a MAC / port mapping table;

[0025] When a new network packet arrives, the destination IP address is obtained through the IP / port mapping table, and the destination MAC address is obtained through the MAC / port mapping table.

[0026] Furthermore, when a new network packet arrives, the process of obtaining the destination IP address through the IP / port mapping table and the destination MAC address through the MAC / port mapping table is specifically as follows:

[0027] First check whether there is a mapping rule for the destination MAC in the MAC / port mapping table:

[0028] If so, forward it to the outbound port;

[0029] If not, check whether there is a mapping rule for the destination IP in the IP / port mapping table: if so, forward it to the egress port via XDP_REDIRECT if the port is not closed by the spanning tree.

[0030] Further, if the IP / port mapping table and the MAC / port mapping table do not detect the corresponding mapping rules, they are forwarded to the Linux soft bridge through XDP_REDIRECT, and the network protocol stack of the Linux kernel completes the learning of the address forwarding table;

[0031] When the eBPF app monitors that the Linux soft bridge has learned a new address forwarding table entry, it adds an entry corresponding to the address forwarding table entry to the MAC / port mapping table to update the MAC / port mapping table;

[0032] Furthermore, when the eBPF app detects that an address forwarding table entry is deleted or aged, the entry corresponding to the address forwarding table entry is deleted from the MAC / port mapping table to update the MAC / port mapping table.

[0033] Compared with the prior art, the present invention has the following beneficial effects:

[0034] 1. The ring network bridge topology implementation method based on dual XDP network cards provided by the present invention replaces the hardware bearer bridge based on the switching chip in the onboard cabin network, reducing the hardware design complexity and power consumption;

[0035] 2. The present invention bypasses the complex TCP / IP protocol stack of the Linux network and directly converts the generated forwarding table into the port mapping table in eBPF, which will not impose an excessive burden on the CPU even if the number of packets is large. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:

[0037] Figure 1 It is an architectural diagram of a hardware-bearing bridge in the prior art;

[0038] Figure 2 It is a schematic diagram of a hardware bearer bridge in an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0040] It should be noted that when a component is referred to as being "fixed to" or "disposed on" another component, it can be directly on the other component or indirectly on the other component. When a component is referred to as being "connected to" another component, it can be directly or indirectly connected to the other component.

[0041] It should be understood that the orientation or position relationship indicated by terms such as "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0042] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0043] Embodiment: A method for implementing a ring network bridge topology based on dual XDP network cards.

[0044] With the development of technology, network cards that support the XDP protocol also have the hardware carrying capacity. If a chip integrates two or more XDP network cards, the switching bridge based on XDP technology to achieve hardware carrying has the potential to replace the switching chip. With the maturity of eBPF technology in the Linux environment, the technology of eBPF software definition + XDP hardware carrying has been put into practice and verified in many fields. After the emergence of eBPF CO-RE technology, compiled user space programs can be directly encapsulated with eBPF, and embedded environments that do not carry their own compilers can also run eBPF programs.

[0045] On this basis, the present invention realizes a switching bridge that is software-defined based on eBPF technology and hardware-borne based on XDP, which can be used for avionics equipment to realize ring network interconnection without using a switching chip.

[0046] Step 1: If Figure 2 As shown, the device is configured with at least two XDP network cards, the uplink and the downlink are respectively connected to one XDP network card, and the uplink and the downlink are connected through a circuit breaker.

[0047] It should be noted that, when there are multiple XDP network cards, two XDP network cards can be connected to the uplink and the downlink respectively as needed.

[0048] Step 2: Introduce libbpf into the build project to support the construction of eBPF programs in CO-RE format. The eBPF program includes eBPFvm running in the Linux kernel BPF virtual machine and eBPF app working in Linux user mode. eBPFvm and eBPF app exchange data through the bpf framework registration interface.

[0049] It should be noted that for Linux projects with kernel version no less than 5.10, the kernel must enable support for the BPF virtual machine.

[0050] The present invention mainly uses variables and mapping tables to realize data interaction.

[0051] In this embodiment, when the Linux kernel successfully starts to initialize the PHY of the XDP network card, the circuit breaker between the uplink and the downlink is disconnected through GPIO control; if a network connection failure is detected, the circuit breaker between the uplink and the downlink is closed through GPIO control to restore the connection.

[0052] When the Linux kernel is started, the eBPF program is started before starting the Linux soft bridge containing two XDP network cards; when the eBPF app starts running, the eBPFvm is injected into the two XDP network cards respectively before starting the bridge; when the bridge is started, the spanning tree program is started.

[0053] In this embodiment, when eBPFvm finds a new network packet, it first checks whether it is a BPDU packet of the spanning tree protocol; if it is a BPDU packet of the spanning tree protocol, XDP_PASS is used to pass it.

[0054] The eBPF app monitors the status of the spanning tree of the port and passes it to the eBPFvm through variables; eBPFvm makes judgments based on the variables and discards all packets forwarded to the closed port with XDP_DROP, but if the packet forwarded to the closed port is a BPDU packet of the spanning tree protocol, it will not be discarded.

[0055] The eBPF program maintains an IP / port mapping table and a MAC / port mapping table; when a new network packet arrives, the destination IP address is obtained through the IP / port mapping table, and the destination MAC address is obtained through the MAC / port mapping table.

[0056] Specifically, when a new network packet arrives, the process of obtaining the destination IP address through the IP / port mapping table and the destination MAC address through the MAC / port mapping table is as follows: first check whether there is a mapping rule for the destination MAC in the MAC / port mapping table: if so, forward it to the egress port; if not, check whether there is a mapping rule for the destination IP in the IP / port mapping table: if so, forward it to the egress port through XDP_REDIRECT if the port is not closed by the spanning tree.

[0057] If neither the IP / port mapping table nor the MAC / port mapping table detects the corresponding mapping rules, XDP_PASS is forwarded to the slow path, that is, the Linux soft bridge; when the eBPF app monitors that the Linux soft bridge has learned a new address forwarding table entry, an entry corresponding to the address forwarding table entry is added to the MAC / port mapping table to update the MAC / port mapping table; and, when the eBPF app monitors that the address forwarding table entry is deleted or aged, the entry corresponding to the address forwarding table entry is deleted from the MAC / port mapping table to update the MAC / port mapping table.

[0058] In this way, the device realizes the three functions of static IP layer 3 bridge, layer 2 learning bridge, and spanning tree. Multiple such devices are enough to build a ring network topology. At this time, if packets are sent from the upstream port to the downstream port, tcpdump cannot be observed on the device, but ethtool can see that the number of packets is increasing. The device connected to the downstream port can receive the packets using tcpdump.

[0059] For example, a certain type of equipment used in the IFE system of a large passenger aircraft has a ring network topology, that is, the equipment is connected to other devices through uplink and downlink interfaces to form a ring network. The current structure is i.MX6QP FEC network card + layer 2 switching chip, while the present invention utilizes the dual XDP network card of i.MX8MP. This solution can achieve the same function and can also expand more complex functions such as layer 3 switching.

[0060] Working principle: The ring network bridge topology implementation method based on dual XDP network cards provided by the present invention replaces the hardware-based bridge based on switching chips in the onboard cabin network, reducing the complexity of hardware design and power consumption; at the same time, the present invention bypasses the complex TCP / IP protocol stack of the Linux network and directly converts the generated forwarding table into a port mapping table in eBPF, which will not impose an excessive burden on the CPU even if the number of packets is large.

[0061] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0062] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0063] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0064] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0065] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for implementing a ring network bridge topology based on dual XDP network cards, characterized in that: The following steps are involved: The device is configured with at least two XDP network cards, the uplink and downlink are connected to one XDP network card respectively, and the uplink and downlink are connected through a circuit breaker; By introducing libbpf in the build project, the construction of eBPF programs in CO-RE form is supported. The eBPF program includes eBPFvm running in the Linux kernel BPF virtual machine and eBPF app working in Linux user mode. Data is exchanged between eBPFvm and eBPF app through the bpf framework registration interface.

2. The method for realizing a ring network bridge topology based on dual XDP network cards according to claim 1, characterized in that: The method further includes: When the Linux kernel successfully starts to initialize the PHY of the XDP network card, the circuit breaker between the uplink and downlink is disconnected through GPIO control; If a network connection failure is detected, the circuit breaker between the uplink and downlink is closed through GPIO control to restore the connection.

3. The method for realizing a ring network bridge topology based on dual XDP network cards according to claim 1, characterized in that: The method further includes: When the Linux kernel boots up, start the eBPF program before starting the Linux soft bridge containing two XDP network cards; When the eBPF app starts running, inject the eBPFvm into the two XDP network cards and then start the bridge.

4. The method for realizing a ring network bridge topology based on dual XDP network cards according to claim 3 is characterized in that: The method further includes: When the bridge is started, the spanning tree process is started.

5. The method for realizing a ring network bridge topology based on dual XDP network cards according to claim 1, characterized in that: The method further includes: When eBPFvm discovers a new network packet, it first checks whether it is a BPDU packet of the spanning tree protocol; if it is a BPDU packet of the spanning tree protocol, XDP_PASS is used to pass it.

6. The method for realizing a ring network bridge topology based on dual XDP network cards according to claim 1, characterized in that: The method further includes: The eBPF app monitors the state of the spanning tree of the port and passes it to the eBPFvm through variables; eBPFvm makes judgments based on the variables and discards all packets forwarded to the closed port using XDP_DROP.

7. The method for realizing a ring network bridge topology based on dual XDP network cards according to claim 6, characterized in that: The method further includes: If the packet forwarded to the closed port is a BPDU packet of the spanning tree protocol, it will not be discarded.

8. The method for realizing a ring network bridge topology based on dual XDP network cards according to claim 1, characterized in that: The eBPF program maintains an IP / port mapping table and a MAC / port mapping table; When a new network packet arrives, the destination IP address is obtained through the IP / port mapping table, and the destination MAC address is obtained through the MAC / port mapping table.

9. The method for realizing a ring network bridge topology based on dual XDP network cards according to claim 8, characterized in that: When a new network packet arrives, the process of obtaining the destination IP address through the IP / port mapping table and the destination MAC address through the MAC / port mapping table is as follows: First check whether there is a mapping rule for the destination MAC in the MAC / port mapping table: If so, forward it to the outbound port; If not, check whether there is a mapping rule for the destination IP in the IP / port mapping table: if so, forward it to the egress port via XDP_REDIRECT if the port is not closed by the spanning tree.

10. The method for realizing a ring network bridge topology based on dual XDP network cards according to claim 9, characterized in that: If the IP / port mapping table and the MAC / port mapping table do not detect the corresponding mapping rules, they are forwarded to the Linux soft bridge through XDP_REDIRECT, and the network protocol stack of the Linux kernel completes the learning of the address translation table; When the eBPF app monitors that the Linux soft bridge has learned a new address forwarding table entry, it adds an entry corresponding to the address forwarding table entry to the MAC / port mapping table to update the MAC / port mapping table; Furthermore, when the eBPF app detects that an address forwarding table entry is deleted or aged, the entry corresponding to the address forwarding table entry is deleted from the MAC / port mapping table to update the MAC / port mapping table.