A packet processing method and device for multi-network card aggregation binding based on IPv6

The method of detecting and sending NDP packets on all slave interfaces and periodically sending NS packets addresses the issue of switch ports not learning address tables in IPv6 multi-network card aggregation, ensuring reliable communication and reducing operational risks and costs in de-stacked switch environments.

CN119728603BActive Publication Date: 2025-07-15KYLIN CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510206187.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-07-15
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

In IPv6 multi-network card aggregation binding mode, the switch de-stacking scheme causes the switch to be unable to learn port address table entries and the port address table aging is automatically deleted, resulting in communication failure.

Method used

Modify the bonding driver of the server network card, add message type detection and parallel sending functions, and periodically send NS messages to ensure that the switch learns address table entries.

Benefits of technology

It realizes normal communication in a de-stack switch environment, reduces operation and maintenance costs and risks, and simplifies switch configuration management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728603B_ABST
    Figure CN119728603B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for processing packets based on multi-network card aggregation binding in IPv6, including: modifying the network card binding bonding driver of the server to detect each type of packet to be sent through the aggregated port; if it is an NDP type packet, it is sent from all slave sub-interfaces; if not, a certain slave sub-interface is selected for sending. It also includes adding a periodically executed task in the network card binding bonding driver of the server to actively send NS packets containing the aggregated port address of the server end to the switch regularly at all slave sub-interfaces according to the specified period time. The present invention can effectively solve the problems that the switch cannot learn the port address table and the port address table is automatically deleted due to aging in the application scenario of multi-network cards in the link aggregation mode and accessing the stackless switch, and realize the normal communication of the aggregated network in the stackless switch scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information technology, and particularly relates to a method and device for processing packets based on multi-network card aggregation binding of IPv6. Background Art

[0002] Large data centers have begun to gradually support IPv6 addresses to cope with the challenge of IPv4 address exhaustion. Moreover, to meet the requirements of high reliability and high availability of network communication, servers usually adopt the method of multi-network card binding to access the switch network, and different binding modes can be configured. Among them, the aggregation mode (mode = 4, 802.3ad dynamic link aggregation) aggregates multiple physical network interfaces into one interface through the LACP protocol (Link Aggregation Control Protocol), providing higher transmission bandwidth, supporting load balancing and fault redundancy, and is widely used in actual application scenarios.

[0003] At the same time, for better fault tolerance of the system, traditional networking solutions usually connect the server network interfaces to different switches, and these switches are then connected together through stacking aggregation. These stacked switches can synchronize configurations and port information, but the stacking solution reduces the reliability of the system, and there is coupling between switch devices. Currently, the "de-stacking" solution of switches is gradually adopted, that is, no additional links are required between switches, saving interconnection costs, decoupling the control plane, and reducing operation and maintenance risks.

[0004] However, this switch de-stacking solution also brings another problem, that is, when multi-network card aggregation binding accesses different switches, port address table entries cannot be synchronized between switches. In the IPv6 protocol, NDP (Neighbor Discovery Protocol) is used to replace ARP of IPv4 to implement device address resolution and neighbor discovery. When sending NDP packets on the aggregation port of the server, only one physical network interface is selected for sending, resulting in switches corresponding to other network interfaces being unable to learn the corresponding port address table. If the peer server sends the replied packet to this switch, since this switch cannot find the port corresponding to the target address, the packet forwarding cannot be completed, causing a communication failure. In addition, due to the port address table aging mechanism of the switch, that is, if there are no packets containing this address entering or leaving the port within a certain period of time, the address table entry will be deleted, which will also cause subsequent packets to be unable to find the corresponding port and cannot communicate.

[0005] Currently, in the existing packet processing solutions for multi-network card aggregation binding network systems, there is no solution that can solve the problems of the switch being unable to learn the address table entries of the aggregation port and the automatic deletion of the port address table due to aging when in the multi-network card aggregation binding mode based on IPv6 and the switch adopts the de-stacking solution. Summary of the Invention

[0006] The object of the present invention is to provide a method and device for processing packets based on IPv6 multi-network card aggregation binding, which can effectively solve the problems that in the application scenario where multiple network cards are in link aggregation mode and are connected to a de-stacked switch, the switch cannot learn the port address table and the port address table is automatically deleted due to aging, and realize the normal communication of the aggregated network in the de-stacked switch scenario.

[0007] In order to achieve the above object, the technical solution of the present invention is as follows:

[0008] A method for processing packets based on IPv6 multi-network card aggregation binding includes: modifying the bonding driver of the network card of the server, and detecting each type of packet to be sent through the aggregated port; if it is an NDP type packet, it is sent from all slave sub-interfaces; if not, a certain slave sub-interface is selected for sending.

[0009] Further, the method for modifying the bonding driver of the network card of the server includes:

[0010] S10: Add an interface parameter one corresponding to enabling the concurrent function of NDP packets in the sysfs interface parameters registered in the bonding driver;

[0011] S11: Modify the function for sending packets through the aggregated interface in the bonding driver, add the processing logic for detecting the packet type and sending, and when detecting an NDP type packet, implement parallel sending of all slave sub-interfaces through the interface parameter one.

[0012] Further, it further includes: adding a periodically executed task in the bonding driver of the network card of the server, and actively sending NS packets containing the aggregated port address of the server end to the switch regularly on all slave sub-interfaces according to the specified periodic time.

[0013] Furthermore, the method for adding a periodically executed task includes:

[0014] S20: Add a periodically executed task queue when creating the aggregated port;

[0015] S21: Add an interface parameter two corresponding to enabling the function of periodically sending NS packets and an interface parameter three corresponding to the time of periodically sending NS packets in the sysfs interface parameters registered in the bonding driver;

[0016] S22: Compose an NS packet with the source address being the IPv6 address used by the current aggregated port.

[0017] On the other hand, the present invention also proposes a packet processing device for multi-network card aggregation binding based on IPv6, including:

[0018] The first configuration module: Modify the network card bonding driver of the server;

[0019] The packet type detection module: Detect the type of each packet to be sent through the aggregation port;

[0020] The packet sending module: If it is an NDP type packet, send it from all slave sub-interfaces; if not, select a certain slave sub-interface to send it out.

[0021] Further, the first configuration module includes:

[0022] The first parameter unit: Add an interface parameter one corresponding to enabling the NDP packet concurrent function in the sysfs interface parameters registered in the bonding driver;

[0023] The function modification unit: Modify the function for sending packets by the aggregation interface in the bonding driver, add the processing logic for packet type detection and sending, and when detecting an NDP type packet, implement parallel sending of all slave sub-interfaces through the interface parameter one.

[0024] Further, it further includes:

[0025] The second configuration module: Add a periodically executed task in the network card bonding driver of the server;

[0026] The packet periodic sending module: Actively send NS packets containing the server aggregation port address to the switch regularly on all slave sub-interfaces according to the specified periodic time.

[0027] Furthermore, the second configuration module includes:

[0028] The task queue unit: Add a periodically executed task queue when creating the aggregation port;

[0029] The second and third parameter units: Add an interface parameter two corresponding to enabling the function of periodically sending NS packets and an interface parameter three corresponding to the time of periodically sending NS packets in the sysfs interface parameters registered in the bonding driver;

[0030] The packet unit: Assemble an NS packet with the source address being the IPv6 address used by the current aggregation port.

[0031] On the other hand, the present invention also provides a computer-readable storage medium storing a computer program for executing the above-mentioned packet processing method based on IPv6 multi-network card aggregation binding.

[0032] On the other hand, the present invention also provides a computer program product including a computer program which, when executed by a processor, implements the above-mentioned packet processing method based on IPv6 multi-network card aggregation binding.

[0033] Compared with the prior art, the beneficial effects and advantages of the present invention are as follows:

[0034] (1) The packet processing method and device based on IPv6 multi-network card aggregation binding proposed by the present invention are designed and implemented independently, with complete autonomy and controllability.

[0035] (2) The present invention detects the type of packets to be sent in the link aggregation mode of multi-network card binding. For NDP packets, a strategy of parallel sending on each slave sub-interface is adopted, which can effectively solve the problem that the switch cannot learn the port address table in the application scenario where multi-network cards are in the link aggregation mode and are connected to a stacked switch.

[0036] (3) The present invention adds a periodic execution task to periodically send NS packets externally on each slave sub-interface, avoiding the switch from automatically deleting the address table entries due to timeout, thereby realizing normal communication of the aggregation network in the scenario of a stacked switch, saving the cost of switch interconnection, simplifying the configuration and management of the switch, and reducing the operation and maintenance risks. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a flowchart of the packet processing based on IPv6 multi-network card aggregation binding according to Embodiment 1 of the present invention.

[0038] Figure 2 It is a flowchart of the concurrent NDP packet method based on IPv6 multi-network card aggregation binding according to Embodiment 1 of the present invention.

[0039] Figure 3 It is a flowchart of the periodic NS packet sending method based on IPv6 multi-network card aggregation binding according to Embodiment 1 of the present invention.

[0040] Figure 4 It is a schematic structural diagram of the device according to Embodiment 2 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0041] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other.

[0042] The main design of the present invention is described as follows.

[0043] In the present invention, aiming at the problem that when the multi-network card aggregation binding mode is adopted and the access switch adopts the de-stacking scheme, the switch cannot learn the address table entry of the aggregation port, a message type detection function is added to the bonding driver to detect the message type of each message to be sent through the aggregation port. If it is an NDP type message, it is sent out from all slave sub-interfaces to ensure that each connected switch can learn the address of the corresponding port through this NDP message. Otherwise, it follows the normal sending path and is sent out by selecting a certain slave sub-interface through the hash algorithm.

[0044] Furthermore, aiming at the aging mechanism of the switch that automatically deletes the address table entry when it times out, a periodically executed task is added to the bonding driver of the server to actively send NS messages according to the specified cycle time. The switch can regularly receive NS messages containing the address of the server aggregation port, thus avoiding the timeout deletion of the corresponding port address table entry.

[0045] For the convenience of configuration and management, parameter configuration is provided in the bonding driver by registering the sysfs interface, and it can be manually configured whether to enable the concurrent function of ND messages or the function of periodically sending NS messages, as well as the time parameter of periodic sending.

[0046] The following specifically describes the solution of the present invention in combination with specific embodiments and drawings.

[0047] Embodiment 1:

[0048] Figure 1 It is the message processing flow chart of multi-network card aggregation binding based on IPv6 provided in this embodiment.

[0049] As Figure 1 shown, in this embodiment, the server is configured with multiple network cards, and two of them (slave1 and slave2) are bound in the link aggregation mode and are respectively connected to two de-stacked switches (that is, there is no interconnection between the switches), and network communication is carried out based on the IPv6 address. When sending a message through the aggregation interface, the message type of the message to be sent is first detected. For NDP type messages, concurrent processing is performed, and the messages are sent out from the two network cards of slave1 and slave2 respectively. For non-NDP type messages, hash processing is performed, and one of the two network cards of slave1 and slave2 is selected to send out. In addition, a task of periodically sending NS messages is added to actively send NS messages containing the local address externally periodically.

[0050] Figure 2It is the flowchart of the method for concurrent NDP packets based on IPv6 multi-network card aggregation and binding provided by this embodiment.

[0051] As Figure 2 shown, the process of NDP packet concurrency specifically includes the following:

[0052] 1) Configure the sysfs interface parameters to enable the NDP packet concurrency function;

[0053] 2) Detect whether the type of the packet to be sent is an NDP packet;

[0054] 3) Send the NDP packets out from each slave sub-interface;

[0055] 4) Select a certain slave sub-interface through the hash algorithm to send out non-NDP packets.

[0056] Add an interface parameter "ndp_broadcast" to the sysfs interface parameters registered in the bonding driver. Configure this parameter "ndp_broadcast" to enable the NDP packet concurrency function correspondingly.

[0057] For the processing of sending packets on the aggregated interface, the corresponding function in the bonding driver is "bond_3ad_xor_xmit". Therefore, the packet detection type is implemented by adding the corresponding processing logic in the "bond_3ad_xor_xmit" function. Specifically, first, determine whether the network protocol type of the packet to be sent conforms to IPv6, and if the transport layer protocol type in the IPv6 packet header is ICMPV6, then parse the icmp_v6 packet header from the packet, and then determine whether the icmp_type field in the packet header conforms to the packet of the NDP protocol type.

[0058] For the detected NDP type packets, perform concurrent processing, traverse each physical network interface bound in the aggregated port, that is, the slave sub-interface, and send this packet out for each physical network interface. For non-NDP type packets, perform hash processing and select a certain network interface from all the bound physical network interfaces through the hash algorithm to send this packet out.

[0059] Figure 3 It is the flowchart of the method for periodically sending NS packets based on IPv6 multi-network card aggregation and binding provided by the embodiment of the present invention.

[0060] As Figure 3 shown, the process of periodically and actively sending NS packets specifically includes:

[0061] 1) Add a periodic execution task queue;

[0062] 2) Configure the sysfs interface parameters, enable the NS packet periodic sending function, and specify the periodic parameters;

[0063] 3) Assemble the NS packets to be sent, including the address of the server aggregation port;

[0064] 4) Periodically send them out from each slave sub-interface.

[0065] When creating the aggregation port, add a periodically executed task queue to periodically send NS packets, and add interface parameters ns_active and ns_period to the sysfs interface parameters registered in the bonding driver. Configure the interface parameter ns_active to enable the periodic sending function of NS packets, and configure the interface ns_period for the time of periodically sending NS packets.

[0066] Assemble the NS packets according to the format of the NS packets, where the source address is the IPv6 address used by the current aggregation port, and the destination address can be set to the IPv6 address of the gateway of the current system. Subsequently, use the parameter ns_period as the period to periodically send NS packets on each slave sub-interface.

[0067] In this embodiment, when detecting the type of packets to be sent in the link aggregation mode of multi-network card binding, and adopting the strategy of parallel sending of NDP packets on each slave sub-interface, it can effectively solve the problem that the switch cannot learn the port address table in the application scenario of multi-network cards in the link aggregation mode and accessing the stackless switch.

[0068] In this embodiment, a periodically executed task is added to periodically send NS packets externally on each slave sub-interface, avoiding the switch from automatically deleting the address table entries due to timeout, thus realizing the normal communication of the aggregation network in the stackless switch scenario, saving the cost of switch interconnection, simplifying the configuration and management of the switch, and reducing the operation and maintenance risks.

[0069] Embodiment 2:

[0070] This embodiment proposes a packet processing device for multi-network card aggregation binding based on IPv6, and the structure is as Figure 4 shown, including:

[0071] The first configuration module: Modify the network card binding bonding driver of the server;

[0072] The packet type detection module: Detect the type of each packet to be sent through the aggregation port;

[0073] Message sending module: If it is an NDP type message, it is sent from all slave sub-interfaces; if not, a certain slave sub-interface is selected for sending.

[0074] Second configuration module: Add a periodically executed task in the bonding driver of the server's network card binding;

[0075] Message periodic sending module: Actively send NS messages containing the server aggregation port address to the switch regularly according to the specified periodic time on all slave sub-interfaces.

[0076] Among them, the first configuration module includes:

[0077] Parameter one unit: Add an interface parameter one corresponding to enabling the NDP message concurrency function in the sysfs interface parameters registered in the bonding driver;

[0078] Function modification unit: Modify the function of sending messages on the aggregation interface in the bonding driver, add the processing logic of message type detection and sending, and when detecting an NDP type message, implement parallel sending of all slave sub-interfaces through the interface parameter one.

[0079] The second configuration module includes:

[0080] Task queue unit: Add a periodically executed task queue when creating an aggregation port;

[0081] Parameter two and three unit: Add an interface parameter two corresponding to enabling the function of periodically sending NS messages and an interface parameter three corresponding to the time of periodically sending NS messages in the sysfs interface parameters registered in the bonding driver;

[0082] Message unit: Compose an NS message with the source address being the IPv6 address used by the current aggregation port.

[0083] The message processing device based on IPv6 multi-network card aggregation binding proposed in this embodiment can implement the message processing method based on IPv6 multi-network card aggregation binding proposed in Embodiment 1, and has the same beneficial technical effects as Embodiment 1.

[0084] The above embodiments are only the preferred embodiments of the present invention, and are only used to help understand the method and its core idea of the present application. The protection scope of the present invention is not limited to the above embodiments. All technical solutions falling within the idea of the present invention belong to the protection scope of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. A packet processing method for multi-network card aggregation binding based on IPv6, characterized in that, Including: Modify the bonding driver of the server's network card, and detect the type of each packet to be sent through the aggregated port; If it is a packet of NDP type, send it from all slave sub-interfaces; If not, select a slave sub-interface to send it out; The method of modifying the bonding driver of the server's network card includes: S10. Add an interface parameter one corresponding to enabling the concurrent function of NDP packets in the sysfs interface parameters registered in the bonding driver; S11. Modify the function of sending packets through the aggregated interface in the bonding driver, add the processing logic for packet type detection and sending. When detecting a packet of NDP type, implement parallel sending of all slave sub-interfaces through the interface parameter one; It also includes: Add a periodically executed task in the bonding driver of the server's network card, and actively send NS packets containing the server-side aggregated port address to the switch regularly on all slave sub-interfaces according to the specified periodic time.

2. The packet processing method based on multi-network card aggregation binding of IPv6 according to claim 1, wherein The method of adding a periodically executed task includes: S20. Add a periodically executed task queue when creating the aggregated port; S21. Add an interface parameter two corresponding to enabling the function of periodically sending NS packets and an interface parameter three corresponding to the time of periodically sending NS packets in the sysfs interface parameters registered in the bonding driver; S22. Assemble an NS packet with the source address being the IPv6 address used by the current aggregated port.

3. A packet processing device for aggregating and binding multiple network cards based on IPv6, characterized in that, Including: The first configuration module: Modify the bonding driver of the server's network card; The packet type detection module: Detect the type of each packet to be sent through the aggregated port; The packet sending module: If it is a packet of NDP type, send it from all slave sub-interfaces; if not, select a slave sub-interface to send it out; The first configuration module includes: The parameter one unit: Add an interface parameter one corresponding to enabling the concurrent function of NDP packets in the sysfs interface parameters registered in the bonding driver; The function modification unit: Modify the function of sending packets through the aggregated interface in the bonding driver, add the processing logic for packet type detection and sending. When detecting a packet of NDP type, implement parallel sending of all slave sub-interfaces through the interface parameter one; It also includes: The second configuration module: Add a periodically executed task in the bonding driver of the server's network card; The packet periodic sending module: Actively send NS packets containing the server-side aggregated port address to the switch regularly on all slave sub-interfaces according to the specified periodic time.

4. The packet processing device for aggregating and binding multiple network cards based on IPv6 according to claim 3, wherein The second configuration module includes: The task queue unit: Add a periodically executed task queue when creating the aggregated port; The parameter two and three unit: Add an interface parameter two corresponding to enabling the function of periodically sending NS packets and an interface parameter three corresponding to the time of periodically sending NS packets in the sysfs interface parameters registered in the bonding driver; Message unit: Assemble an NS message with the source address being the IPv6 address used by the current aggregated port.

5. A computer-readable storage medium storing a computer program, characterized in that, The computer program is used to execute the message processing method for IPv6-based multi-network card aggregation binding according to any one of claims 1-2.

6. A computer program product, characterized in that, It includes a computer program, which, when executed by a processor, implements the message processing method for IPv6-based multi-network card aggregation binding according to any one of claims 1-2.

Citation Information

Patent Citations

  • Host routing address storage method and device, electronic equipment and storage medium

    CN115412528A

  • Adaptation method for data processing unit, computer device and medium

    CN117978758A