CN112333099B - Routing method, device and storage medium of local multipath message - Google Patents

Routing method, device and storage medium of local multipath message Download PDF

Info

Publication number
CN112333099B
CN112333099B CN202110000712.3A CN202110000712A CN112333099B CN 112333099 B CN112333099 B CN 112333099B CN 202110000712 A CN202110000712 A CN 202110000712A CN 112333099 B CN112333099 B CN 112333099B
Authority
CN
China
Prior art keywords
local
cache
message
routing
application system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110000712.3A
Other languages
Chinese (zh)
Other versions
CN112333099A (en
Inventor
印朝晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Taiyi Xingchen Information Technology Co ltd
Original Assignee
Beijing Taiyi Xingchen Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Taiyi Xingchen Information Technology Co ltd filed Critical Beijing Taiyi Xingchen Information Technology Co ltd
Priority to CN202110000712.3A priority Critical patent/CN112333099B/en
Publication of CN112333099A publication Critical patent/CN112333099A/en
Application granted granted Critical
Publication of CN112333099B publication Critical patent/CN112333099B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/7453Address table lookup; Address filtering using hashing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A method, an apparatus and a storage medium for routing a local multi-path packet are disclosed. The routing method of the local multipath message is applied to a DPDK frame and comprises the following steps: searching a corresponding cache table entry from a cache pool according to the flow information of the local outflow message; using the searched cache table item as a matching factor to execute a routing algorithm, and selecting an outflow path which is consistent with an inflow time interface of a local inflow message corresponding to the local outflow message; the local outgoing message is a return message processed by the local application system according to the local incoming message; the cache pool is located between the kernel protocol stack and the local application system.

Description

Routing method, device and storage medium of local multipath message
Technical Field
The present disclosure relates to, but not limited to, the field of network communications, and in particular, to a method, an apparatus, and a storage medium for routing a local multipath packet in a network communication system based on a DPDK architecture.
Background
At present, in a multi-path scenario, a problem of routing is usually encountered in an existing network device, for example, a plurality of outgoing interfaces correspond to a plurality of operators respectively, and then when traffic in a same-incoming direction of a routing result is not the same operator, a problem of slow access or no access is caused.
To address this problem, most network devices typically take the approach of configuring static policy routing through IP commands. However, this approach faces two problems: firstly, a corresponding policy routing table entry needs to be configured according to flow information, and the operation of a configuration layer is relatively complex; another is that if there is new traffic coming in the network, the configuration must be changed to ensure the round-trip path of the new traffic is consistent, and therefore, the traffic cannot be predicted in advance, and therefore, the flexibility is not good. Many network device vendors do not actually support round-trip path consistency for local traffic at present.
Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
The embodiment of the disclosure provides a routing method, a device and a storage medium for local multipath messages, which are used in a communication system under a DPDK framework of a data plane development suite and can achieve the purpose of consistent and complete functions of local round-trip paths covering all protocols.
The embodiment of the present disclosure provides a routing method for a local multipath packet, where the method is applied in a DPDK framework of a data plane development kit, and the method includes:
searching a corresponding cache table entry from a cache pool according to the flow information of the local outflow message; the cache table item is established or updated according to the local inflow message;
using the searched cache table item as a matching factor to execute a routing algorithm, and selecting an outflow path which is consistent with an inflow time interface of a local inflow message corresponding to the local outflow message;
the local outgoing message is a return message processed by the local application system according to the local incoming message; the cache pool is located between the kernel protocol stack and the local application system.
In some exemplary embodiments, the cache entry is established according to the following:
when a local inflow message is received, a cache table entry is generated according to the flow information of the local inflow message and the multipath characteristics of the corresponding local outflow message, and the cache table entry is added into the cache pool.
In some exemplary embodiments, the cache entry includes the following: the source address, the destination address, the protocol number, the source port, the destination port and an interface when the local inflow message enters the local application system;
the flow information of the message comprises the following contents: source address, destination address, protocol number, source port, destination port.
In some exemplary embodiments, the method further comprises updating the cache pool when at least one of the following cache pool update conditions is met:
the state of the interface of the local application system changes;
the IP address of the local application system changes;
and the routing information of the host to which the local application system belongs is changed.
In some exemplary embodiments, the cache pool is a hash structure of a cache that performs memory management based on a slab algorithm.
In some exemplary embodiments, the method further includes, when a preset cache recycling condition is satisfied, performing cache recycling on the cache pool;
wherein the cache eviction condition comprises at least one of:
the total memory space occupied by the cache pool reaches a preset capacity threshold or a preset proportion threshold;
the preset recovery interval time is up.
In some exemplary embodiments, the performing cache reclamation on the cache pool includes at least one of:
deleting cache entries with the survival time exceeding a preset timeout duration in the cache pool;
deleting the first N cache table entries with the longest survival time in the cache pool, wherein N is an integer greater than 1.
The embodiment of the present disclosure further provides a routing method for local multipath packets, where the method is applied in a DPDK framework of a data plane development kit, and the method includes:
searching a corresponding cache table item from a cache pool according to the flow information of a locally sent message; the cache table item is established or updated according to a local sent message;
executing a routing algorithm by using the searched cache table item as a matching factor, and selecting an outgoing path consistent with an interface in the searched cache table item;
the local sending message is a message actively sent by a local application system; the cache pool is located between the kernel protocol stack and the local application system.
In some exemplary embodiments, when a matching cache entry is not found, the method further includes:
searching a local routing table according to the destination address of the locally sent message;
if the routing result is a plurality of output interfaces, selecting one output interface from the plurality of output interfaces according to a preset interface selection rule;
and creating a cache table entry according to the selected outgoing interface and the flow information of the local outgoing message, and sending the local outgoing message from the selected outgoing interface.
The embodiment of the present disclosure further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program for performing local multipath message routing, and the processor is configured to read and run the computer program for performing local multipath message routing to execute any one of the above described local multipath message routing methods.
The embodiment of the present disclosure also provides a storage medium, where a computer program is stored in the storage medium, where the computer program is configured to execute any one of the above routing methods for a local multipath packet when running.
Other aspects will be apparent upon reading and understanding the attached drawings and detailed description.
Drawings
FIG. 1 is a schematic diagram of a logical location of a communication system in which a local round-trip path consistent device is located in an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a method for creating a cache entry according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a routing method for a multipath message according to an embodiment of the present disclosure;
fig. 4 is a structural diagram of a routing device for multipath messages according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a method for routing a multi-path message according to another embodiment of the disclosure;
fig. 6 is a flowchart of a method for routing a multi-path message according to another embodiment of the disclosure;
FIG. 7 is a flowchart illustrating a method for routing a multi-path message according to another embodiment of the disclosure;
FIG. 8 is a flowchart illustrating a method for routing multi-path messages according to another embodiment of the present disclosure;
fig. 9 is a block diagram of a multipath message routing device according to another embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The following step numbers do not limit a specific execution order, and the execution order of some steps can be adjusted according to specific embodiments.
At present, more and more commercial systems adopt a DPDK-based architecture design, the DPDK bypasses a Linux kernel protocol stack, the processing of data is accelerated, and a user can customize the protocol stack in a user space to meet the application requirements of the user. Many high-performance network frameworks based on DPDK are present, such as OVS and VPP which are commonly used data plane frameworks, and mTCP and f-stack which are commonly used user mode protocol stacks. The lightweight user-mode protocol stack has the main advantages that forwarding traffic can be processed with high performance, and a function of consistent round-trip paths can be realized by configuring a policy route, but the lightweight protocol stack cannot process the local message on the path of receiving and sending, so that most local application traffic still needs to be handed to a complete Linux protocol stack to complete.
However, in the existing Linux protocol stack, the next hop selection of the multipath can only depend on the destination address of the message, so that in an environment with multiple output interface paths, the next hop selection may not necessarily meet the expectation.
For the implementation of the prior art, in a standard Linux protocol stack, a socket structure for storing protocol information has a field, which can be used to record information of an incoming interface, and if the information of the incoming interface is recorded to the field, the information will participate in route selection during route selection, thereby satisfying a local round-trip path consistency function of a part of protocols. However, experiments prove that the method is only effective for the TCP protocol, and because the sockets for recording the TCP protocol in the Linux protocol stack are different in different stages, one socket is created at the beginning of the TCP protocol connection, and a new socket is created after the three-way handshake is successful to record the subsequent flow, the socket of the TCP protocol is determined to be unique after the three-way handshake. For the UDP protocol, the method is not suitable because the sockets of the UDP protocol in the Linux protocol stack can be multiplexed, one socket can correspond to multiple connections, and the same socket is hit by the messages received by different interfaces, which stream is the same stream cannot be distinguished. Since the socket in the UDP protocol is a many-to-one correspondence relationship, even if an ingress interface is recorded on the socket structure, the function of consistency of local round-trip paths of the UDP protocol cannot be realized.
The round-trip of local traffic is essentially two paths, incoming and back-off of local traffic. The local traffic entering is well understood, that is, the destination is local traffic (i.e., incoming messages that need to be processed by the local application system and return a response), and the response of the local traffic refers to the response of the application program/system on the network device according to the incoming traffic; during this period, the incoming traffic is handed over to the local application program \ system through the local protocol stack, and the return traffic (i.e., the local outgoing message) generated by the application program \ system is returned to the local protocol stack. Therefore, on the return path, for the standard protocol stack, the new flow path belongs to a new flow path, and the new flow naturally cannot record the forward flow information, so that the return flow in the system is a completely new logic for finding the interface, if there are a plurality of exit paths, the return flow may not select the corresponding entry of the forward flow according to the original routing algorithm, and finally the inconsistency of the paths is caused, thereby affecting the functions of the local application program \ system.
In order to solve the problem, the invention provides a local multipath message routing method to realize the consistency of the paths of the local back-and-forth messages of the network equipment, not only can self-adapt to the network flow, but also can cover all network protocols, simultaneously improves the searching efficiency of the local flow in a Linux kernel, and improves the processing performance of the system.
Example one
The embodiment of the disclosure provides a message routing method, which is applied to a DPDK framework of a data plane development suite to achieve path consistency of local round-trip traffic (messages). The module or device for executing the method is positioned in the kernel space between the kernel protocol stack and the local application program \ system. In some exemplary embodiments, as shown in fig. 1, the main body performing the method is a local round trip path consistent device (module).
In some exemplary embodiments, before routing a local outgoing packet, a method for establishing a cache entry is further provided, a flow of which is shown in fig. 2, and includes:
step 201, receiving a local incoming message, and extracting flow information (quintuple information) of the incoming message;
step 202, judging whether the flow information is a first packet or not according to the flow information, and if so, executing step 203;
step 203, judging whether a plurality of outgoing interfaces of the reverse outgoing message of the incoming message are available; if yes, go to step 204;
and step 204, newly adding a cache table entry and storing the cache table entry into the cache pool.
Wherein, the flow information of the message includes: the source address, the destination address, the protocol number, the source port, the destination port, and five-tuple information, also called a packet, are marked as { srcip, dstip, protocol, srcport, dstport }; each cache table entry comprises: source address, destination address, protocol number, source port, destination port, and interface when the local ingress packet enters the local application system. For incoming messages, the destination address in the traffic information is the host address of the home device of the local application system. The cache table entry is newly added according to the reverse flow information of the incoming message, and the source address, the destination address, the protocol number, the source port and the destination port in the cache table entry correspond to the reverse information of the incoming message, that is, the source address, the destination address, the protocol number, the source port and the destination port in the cache table entry correspond to the destination address, the source address, the protocol number, the destination port and the source port of the incoming message.
It can be seen that when the reverse outgoing packet corresponding to the incoming packet corresponds to only one outgoing interface (i.e. the incoming packet only comes from one interface of the incoming local application system), the corresponding cache table entry is not newly added.
In some exemplary embodiments, in step 204, when a cache entry is newly added, a source address, a destination address, a protocol number, a source port, and a destination port in the cache entry may also be newly added according to the forward traffic information of the incoming packet, where the source address, the destination address, the protocol number, the source port, and the destination port in the cache entry correspond to the source address, the destination address, the protocol number, the source port, and the destination port of the incoming packet. Correspondingly, the use of the information fields in other subsequent steps can be correspondingly adjusted, and the consistency of actual reference can be kept.
In some exemplary embodiments, step 201 further includes, after receiving the local incoming packet, determining whether the local traffic consistency processing switch is turned on, and if so, determining whether the local traffic consistency processing switch is a first packet; if not, the local incoming message is processed according to the prior technical scheme, namely, the subsequent step of adding the related cache table entry is not executed.
In some exemplary embodiments, the determining whether the packet is the first packet according to the traffic information in step 202 includes:
and searching for a matched cache table item according to the flow information, if the matched information is not inquired, judging that the local inflow message is a first packet, and if the matched information is inquired, judging that the local inflow message is not the first packet.
Wherein, the matching corresponding relationship of each item of the quintuple in query corresponds to the information of the table entry added when the cache table entry is newly added in step 204. That is, when a new entry is added in step 204 according to the reverse information of the local incoming packet, in step 202, the reverse information of the flow information of the local incoming packet is also used for matching; when a new entry is added in step 204 according to the forward information of the local incoming packet, in step 202, matching is also performed with the forward information of the traffic information of the local incoming packet.
The embodiment of the present disclosure further provides a routing method for local multipath packets, where the flow of the routing method is shown in fig. 3, and the method includes:
step 301, receiving a local outgoing message, and searching a cache table entry according to flow information of the local outgoing message;
step 302, using the searched cache table entry as a matching factor, executing a routing algorithm.
The flow information of the outgoing message (reverse response message of the local application program \ system) includes quintuple information: source address, destination address, protocol number, source port, destination port; for an outgoing message, the source address in the traffic information is the host address of the home device of the local application system.
Step 301 comprises: and searching the corresponding cache table entry by taking the quintuple information of the outgoing message as a matching factor. That is, the source address, the destination address, the protocol number, the source port, and the destination port in the matched cache entry are respectively equal to the source address, the destination address, the protocol number, the source port, and the destination port of the outgoing packet.
In some exemplary embodiments, the cache entry in step 204 is added according to the forward traffic information of the incoming packet, and the source address, the destination address, the protocol number, the source port, and the destination port in the cache entry correspond to the traffic information of the incoming packet, that is, the source address, the destination address, the protocol number, the source port, and the destination port in the cache entry correspond to the source address, the destination address, the protocol number, the source port, and the destination port of the incoming packet. Accordingly, step 301 comprises: the source address and the source port of the outgoing message are used as the source address and the source port of the outgoing message, the destination address and the destination port of the outgoing message are used as the source address and the source port of the cache table item, and the source address and the source port of the outgoing message and the protocol number in the outgoing message are used as matching factors (query conditions) to search the corresponding cache table item. That is, the source address, the destination address, the protocol number, the source port, and the destination port in the matched cache entry are respectively equal to the destination address, the source address, the protocol number, the destination port, and the source port of the outgoing packet.
In some exemplary embodiments, the cache entry further comprises: a key value; and the key value is calculated by adopting a preset Hash algorithm according to the source address, the destination address, the protocol number, the source port and the destination port in the cache table entry.
In some exemplary embodiments, step 301 includes calculating a key value by using the preset hash algorithm according to a flow information five-tuple (a source address, a destination address, a protocol number, a source port, and a destination port) of the outgoing packet, and matching the key value in the cache entry according to the calculated key value.
In some exemplary embodiments, when the cache entry is added according to the forward traffic information of the incoming packet in step 204, the source address, the destination address, the protocol number, the source port, and the destination port in the cache entry correspond to the traffic information of the incoming packet, that is, the source address, the destination address, the protocol number, the source port, and the destination port in the cache entry correspond to the source address, the destination address, the protocol number, the source port, and the destination port of the incoming packet. Correspondingly, the key value is calculated according to the source address, the destination address, the protocol number, the source port and the destination port in the cache table entry; step 301 includes calculating a key value by using the preset hash algorithm according to the reverse information (destination address, source address, protocol number, destination port, and source port) of the flow information quintuple of the outgoing packet, and matching the key value in the cache entry according to the calculated key value. That is, the same preset hash algorithm is used for calculating key values to be added to the cache table entry for the same element, and key value matching is performed, and those skilled in the art may perform equivalent transformation according to the method described in the embodiment of the present invention, and is not limited to the above specific method.
In some exemplary embodiments, step 302 includes: and executing a routing algorithm by taking the target address, the target port, the protocol number and the interface when the local inflow message enters the local application system in the searched matching list item as matching factors, and selecting an outflow path consistent with the interface when the local inflow message flows in.
In some exemplary embodiments, when the cache entry is added with the forward traffic information of the incoming packet in step 204, step 302 includes: and executing a routing algorithm by taking the source address, the source port, the protocol number and the interface when the local inflow message enters the local application system in the searched matching list item as matching factors, and selecting an outflow path which is consistent with the interface when the local inflow message flows in.
In some exemplary embodiments, the message routing method further includes:
when no matching cache entry is found in step 301, step 303 is executed: and executing a routing algorithm according to the flow information of the outgoing message. That is, when the local incoming packet only comes from one incoming interface, or the return outgoing packet corresponding to the local incoming packet only corresponds to one return outgoing interface, the routing algorithm is executed without considering the interface when the local incoming packet enters the local application system.
In some exemplary embodiments, step 301 further includes, before determining whether the local flow consistency handling switch is turned on, and if so, executing step 301; if not, step 303 is performed.
In some exemplary embodiments, a person skilled in the art can perform routing according to a relevant routing algorithm, and the embodiments provided in the present disclosure do not limit a specific routing algorithm. Step 302 of the embodiment provided by the present disclosure adopts the cache table entry obtained by searching as a matching factor to execute the relevant routing algorithm.
In some exemplary embodiments, there is also provided a method for updating a cache entry, including:
updating cache table entries in the cache pool when at least one of the following cache pool update conditions is met:
the state of the interface of the local application system changes;
the IP address of the local application system changes;
and the routing information of the host to which the local application system belongs is changed.
In some exemplary embodiments, there is also provided a method for reclaiming a cache pool space, including:
synchronous reclamation or asynchronous reclamation.
The synchronous recovery is that when the cache pool reaches a preset occupation proportion or a preset storage capacity is yes, a recovery interface is called immediately to release the memory; asynchronous recovery refers to timing recovery processing, each cache table entry can set an overtime, and when the survival time of the cache table entry reaches the overtime, the asynchronous recovery interface is triggered to release the memory.
In some exemplary embodiments, if the number of entries to be cleaned currently is too many, a batch processing manner is adopted, so that the cpu is prevented from being excessively occupied by the cleaning function.
In some exemplary embodiments, there is also provided a method for reclaiming a cache pool space, including:
when a preset cache recovery condition is met, performing cache recovery on the cache pool;
wherein the cache eviction condition comprises at least one of:
the total memory space occupied by the cache pool reaches a preset capacity threshold or a preset proportion threshold;
the preset recovery interval time is up.
In some exemplary embodiments, the cache entry further comprises: the creation time.
In some exemplary embodiments, the cache entry further comprises: creation time and timeout duration.
In some exemplary embodiments, performing cache reclamation on the cache pool includes at least one of:
deleting cache entries with the survival time exceeding a preset timeout duration in the cache pool;
deleting the first N cache table entries with the longest survival time in the cache pool, wherein N is an integer greater than 1.
Wherein, the survival time of one cache table entry is equal to the current time-creation time.
In some exemplary embodiments, the cache pool is a hash structure of a cache that performs memory management based on a slab algorithm. The conventional memory management mechanism generates a large amount of memory fragments in the process of applying for and releasing the memory, and the cache mechanism designed by the scheme of the embodiment adopts a hash structure of a cache for performing memory management based on a slab algorithm, so that the memory utilization rate can be improved, and the generation of the memory fragments can be reduced.
Example two
The embodiment of the present disclosure further provides a routing method for a local multipath packet, as shown in fig. 5, including:
step 511, searching a cache table entry according to quintuple information (flow information) of a locally sent message, and judging whether a matched table entry is searched; if the cache table entry is matched, executing step 512; if not, go to step 513;
and step 512, executing a routing algorithm according to the searched cache table entry as a matching factor, and sending the locally sent message.
Step 513, performing local routing table lookup according to the destination address of the locally sent message, and if the routing result is multiple outgoing interfaces, performing step 514;
step 514, selecting one output interface from the plurality of output interfaces according to a preset interface selection rule;
step 515, creating a cache table entry according to the selected outgoing interface and the forward flow information (quintuple) of the local outgoing message;
step 516, the local outgoing message is sent out from the selected outgoing interface.
The local sending message is a message sent by a local application program \ system actively.
That is, in step 515, the source address, the destination address, the protocol number, the source port, the destination port, and the selected outgoing interface of the local outgoing packet are used as a new cache entry and stored in the cache pool.
It can be seen that, when the newly added cache table entry is valid (not cleared/recovered) in the cache pool, the subsequent local outgoing messages with the same five-tuple information will be routed by using the information of the cache table entry as a matching factor, so that the subsequent local outgoing messages select the same outgoing interface to send the message.
In some exemplary embodiments, as shown in fig. 6, step 511 further includes, before:
step 501, judging whether a source address and a source port of a local sent message are determined, and if not, executing step 502; when the determination is made, step 511 is executed;
step 502, according to the destination address of the local sending message, inquiring a local routing table, and judging whether the destination address can be reached; if yes, go to step 503;
step 503, selecting an output interface from the route query result according to a preset interface selection rule;
step 504, determining locally sent message traffic information, comprising: and according to the ip address corresponding to the output interface selected in the step 503, selecting an available port of the device where the current local application program \ system is located as a source port, and forming a flow information quintuple of the local sent message together with the destination address, the destination port and the protocol number of the local sent message.
In some exemplary embodiments, when a local application program \ system locally issues a message, for a first locally issued message with the same destination address, a source address and a source port in the quintuple information of the first locally issued message are not determined and set to be null. After step 504 is performed, the determined source address and source port are used as the source address and source port of the subsequent local outgoing message.
EXAMPLE III
The embodiment of the present disclosure further provides a routing device for local multipath packets, which is applied under a DPDK framework of a data plane development kit, where the routing device is located in a kernel space, between a kernel protocol stack and a local application \ system, and its structure is shown in fig. 4, and includes:
a cache pool 401 and a routing algorithm module 402;
wherein, the cache pool 401 is configured to store cache table entries; the cache table entry includes: source address, destination address, protocol number, source port, destination port, and interface when the local ingress packet enters the local application system.
The routing algorithm module 402 is configured to search a cache table entry matched with the local outgoing packet from the cache pool according to the traffic information of the local outgoing packet; and executing a routing algorithm by taking the searched cache table item as a matching factor.
In some exemplary embodiments, the apparatus further comprises: a buffer table item adding module 403;
the cache table item adding module 403 is configured to add a corresponding cache table item according to a local incoming packet, and store the cache table item in the cache pool 401.
In some exemplary embodiments, the apparatus further comprises: a cache entry update module 404;
the cache entry update module 404 is configured to update the cache entries in the cache pool when at least one of the following cache pool update conditions is met:
the state of the interface of the local application system changes;
the IP address of the local application system changes;
and the routing information of the host to which the local application system belongs is changed.
In some exemplary embodiments, the apparatus further comprises: a cache reclaim module 405;
the cache recycling module 405 is configured to perform cache recycling on the cache pool when a preset cache recycling condition is met;
wherein the cache eviction condition comprises at least one of:
the total memory space occupied by the cache pool reaches a preset capacity threshold or a preset proportion threshold;
the preset recovery interval time is up.
Wherein, the cache recycling of the cache pool at least comprises one of the following steps:
deleting cache entries with the survival time exceeding a preset timeout duration in the cache pool;
deleting the first N cache table entries with the longest survival time in the cache pool, wherein N is an integer greater than 1.
Example four
The embodiment of the present disclosure further provides a routing method for local multipath packets, where the method is applied in a DPDK framework of a data plane development kit, and a flow of the method is shown in fig. 7, where the method includes:
step 701, searching a corresponding cache table entry from a cache pool according to the flow information of the local outgoing message; the cache table item is established or updated according to the local inflow message;
step 702, using the searched cache table entry as a matching factor to execute a routing algorithm, and selecting an outgoing path with a consistent interface when the local incoming message corresponding to the local outgoing message flows in;
the local outgoing message is a return message processed by the local application system according to the local incoming message; the cache pool is located between the kernel protocol stack and the local application system.
In some exemplary embodiments, the cache entry is established according to the following:
when a local inflow message is received, a cache table entry is generated according to the flow information of the local inflow message and the multipath characteristics of the corresponding local outflow message, and the cache table entry is added into the cache pool.
In some exemplary embodiments, the cache entry includes the following: the source address, the destination address, the protocol number, the source port, the destination port and an interface when the local inflow message enters the local application system;
the flow information of the message comprises the following contents: source address, destination address, protocol number, source port, destination port.
In some exemplary embodiments, the method further comprises updating the cache pool when at least one of the following cache pool update conditions is met:
the state of the interface of the local application system changes;
the IP address of the local application system changes;
and the routing information of the host to which the local application system belongs is changed.
In some exemplary embodiments, the cache pool is a hash structure of a cache that performs memory management based on a slab algorithm.
In some exemplary embodiments, the method further includes, when a preset cache recycling condition is satisfied, performing cache recycling on the cache pool;
wherein the cache eviction condition comprises at least one of:
the total memory space occupied by the cache pool reaches a preset capacity threshold or a preset proportion threshold;
the preset recovery interval time is up.
In some exemplary embodiments, the performing cache reclamation on the cache pool includes at least one of:
deleting cache entries with the survival time exceeding a preset timeout duration in the cache pool;
deleting the first N cache table entries with the longest survival time in the cache pool, wherein N is an integer greater than 1.
EXAMPLE five
The embodiment of the present disclosure further provides a routing method for local multipath packets, where the method is applied in a DPDK framework of a data plane development kit, and includes:
step 801, searching a corresponding cache table item from a cache pool according to flow information of a locally sent message; the cache table item is established or updated according to a local sent message;
step 802, using the searched cache table item as a matching factor to execute a routing algorithm, and selecting an outgoing path consistent with an interface in the searched cache table item;
the local sending message is a message actively sent by a local application system; the cache pool is located between the kernel protocol stack and the local application system.
In some exemplary embodiments, when a matching cache entry is not found, the method further includes:
searching a local routing table according to the destination address of the locally sent message;
if the routing result is a plurality of output interfaces, selecting one output interface from the plurality of output interfaces according to a preset interface selection rule;
and creating a cache table entry according to the selected outgoing interface and the flow information of the local outgoing message, and sending the local outgoing message from the selected outgoing interface.
EXAMPLE six
The embodiment of the present disclosure further provides a routing device for local multipath packets, which is applied under a DPDK framework of a data plane development kit, where the routing device is located in a kernel space between a kernel protocol stack and a local application \ system, as shown in fig. 9, and includes:
the searching module 901 is configured to search a corresponding cache table entry from the cache pool according to the flow information of the local outgoing packet; the cache table item is established or updated according to the local inflow message;
a routing module 902 configured to execute a routing algorithm by using the searched cache entry as a matching factor, and select an outgoing path having a consistent interface when the local incoming packet corresponding to the local outgoing packet flows in;
the local outgoing message is a return message processed by the local application system according to the local incoming message; the cache pool is located between the kernel protocol stack and the local application system.
In some exemplary embodiments, the apparatus further includes a cache entry adding module 903 configured to establish a cache entry according to the following manner:
when a local inflow message is received, a cache table entry is generated according to the flow information of the local inflow message and the multipath characteristics of the corresponding local outflow message, and the cache table entry is added into the cache pool.
In some exemplary embodiments, the cache entry includes the following: the source address, the destination address, the protocol number, the source port, the destination port and an interface when the local inflow message enters the local application system;
the flow information of the message comprises the following contents: source address, destination address, protocol number, source port, destination port.
In some exemplary embodiments, the apparatus further includes a cache entry update module 904 configured to update the cache pool when at least one of the following cache pool update conditions is met:
the state of the interface of the local application system changes;
the IP address of the local application system changes;
and the routing information of the host to which the local application system belongs is changed.
In some exemplary embodiments, the cache pool is a hash structure of a cache that performs memory management based on a slab algorithm.
In some exemplary embodiments, the apparatus further includes a cache recycling module 905 configured to perform cache recycling on the cache pool when a preset cache recycling condition is met;
wherein the cache eviction condition comprises at least one of:
the total memory space occupied by the cache pool reaches a preset capacity threshold or a preset proportion threshold;
the preset recovery interval time is up.
In some exemplary embodiments, the cache recycling module 905 performs cache recycling on the cache pool, where the cache recycling includes at least one of:
deleting cache entries with the survival time exceeding a preset timeout duration in the cache pool;
deleting the first N cache table entries with the longest survival time in the cache pool, wherein N is an integer greater than 1.
EXAMPLE seven
The embodiment of the present disclosure further provides a routing device for local multipath packets, which is applied under a DPDK framework of a data plane development kit, where the routing device is located in a kernel space between a kernel protocol stack and a local application \ system, as shown in fig. 9, and includes:
the searching module 1001 is configured to search a corresponding cache table entry from the cache pool according to the flow information of the locally sent message; the cache table item is established or updated according to a local sent message;
the routing module 1002 is configured to execute a routing algorithm by using the searched cache entry as a matching factor, and select an outgoing path consistent with an interface in the searched cache entry;
the local sending message is a message actively sent by a local application system; the cache pool is located between the kernel protocol stack and the local application system.
In some exemplary embodiments, the apparatus further includes a cache entry adding module 1003 configured to, when a matching cache entry is not found, perform local routing table lookup according to a destination address of the locally-sent message;
if the routing result is a plurality of output interfaces, selecting one output interface from the plurality of output interfaces according to a preset interface selection rule;
and creating a cache table entry according to the selected outgoing interface and the flow information of the local outgoing message, and sending the local outgoing message from the selected outgoing interface.
The embodiment of the present disclosure further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program for performing local multipath message routing, and the processor is configured to read and run the computer program for performing local multipath message routing to execute the local multipath message routing method in any of the above embodiments.
A storage medium having a computer program stored therein, wherein the computer program is configured to perform the method for routing a local multi-path message as described in any of the above embodiments when the computer program is run.
In some exemplary embodiments, the solutions provided in the embodiments of the present disclosure are also applicable to modification of common user mode protocol stacks based on mTCP and f-stack in the DPDK framework. The person skilled in the art can determine the corresponding modification scheme according to the description of the above embodiments.
It can be seen that, compared with the prior art solutions, the solution of the embodiment of the present disclosure has the following advantages:
1. the scheme provided by the disclosure completes the function that the local protocol stack can not realize the consistency of the round-trip path in a cache learning mode, and compared with the prior art of the Linux kernel, the method covers all protocol types and improves the local protocol processing capacity of the Linux kernel;
2. according to the scheme, the cache data and the Hash search are combined in a weak matching factor mode, so that the route matching precision of the route query is higher than that of a Linux kernel protocol stack, and the correctness of local application data communication transmission is guaranteed.
3. According to the scheme provided by the disclosure, the intelligent cache data is created during the first packet, and the subsequent messages can be directly matched, so that the processing efficiency of the subsequent local flow in the system is greatly improved.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.

Claims (10)

1. A routing method of a local multipath message is applied to a DPDK framework of a data plane development suite, and comprises the following steps:
searching a corresponding cache table entry from a cache pool according to the flow information of the local outflow message; the cache table item is established or updated according to the local inflow message;
using the searched cache table item as a matching factor to execute a routing algorithm, and selecting an outflow path which is consistent with an inflow time interface of a local inflow message corresponding to the local outflow message;
the local outgoing message is a return message processed by the local application system according to the local incoming message; the cache pool is positioned between a kernel protocol stack and the local application system;
the cache entry includes the following: source address, destination address, protocol number, source port, destination port, and interface when the local ingress packet enters the local application system.
2. The method of claim 1,
the cache table entry is established according to the following modes:
when a local inflow message is received, a cache table entry is generated according to the flow information of the local inflow message and the multipath characteristics of the corresponding local outflow message, and the cache table entry is added into the cache pool.
3. The method according to claim 1 or 2,
the flow information of the message comprises the following contents: source address, destination address, protocol number, source port, destination port.
4. The method according to claim 1 or 2,
the method further comprises updating the cache pool when at least one of the following cache pool update conditions is met:
the state of the interface of the local application system changes;
the IP address of the local application system changes;
and the routing information of the host to which the local application system belongs is changed.
5. The method according to claim 1 or 2,
the cache pool is a hash structure of a cache for performing memory management based on a slab algorithm.
6. The method according to claim 1 or 2,
the method further comprises the step of carrying out cache recovery on the cache pool when a preset cache recovery condition is met;
wherein the cache eviction condition comprises at least one of:
the total memory space occupied by the cache pool reaches a preset capacity threshold or a preset proportion threshold;
the preset recovery interval time is up.
7. The method of claim 6,
the cache recycling of the cache pool at least includes one of the following:
deleting cache entries with the survival time exceeding a preset timeout duration in the cache pool;
deleting the first N cache table entries with the longest survival time in the cache pool, wherein N is an integer greater than 1.
8. A routing method of a local multipath message is applied to a DPDK framework of a data plane development suite, and comprises the following steps:
searching a corresponding cache table item from a cache pool according to the flow information of a locally sent message; the cache table item is established or updated according to a local sent message;
executing a routing algorithm by using the searched cache table item as a matching factor, and selecting an outgoing path consistent with an interface in the searched cache table item;
the local sending message is a message actively sent by a local application system; the cache pool is positioned between a kernel protocol stack and the local application system;
when the matched cache table entry is not found, the method further comprises the following steps:
searching a local routing table according to the destination address of the locally sent message;
if the routing result is a plurality of output interfaces, selecting one output interface from the plurality of output interfaces according to a preset interface selection rule;
and creating a cache table entry according to the selected outgoing interface and the flow information of the local outgoing message, and sending the local outgoing message from the selected outgoing interface.
9. An electronic device comprising a memory in which a computer program for local multi-path message routing is stored and a processor arranged to read and run the computer program for local multi-path message routing to perform the method of any of claims 1 to 7 or 8.
10. A storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the method of any of claims 1 to 7 or 8 when executed.
CN202110000712.3A 2021-01-04 2021-01-04 Routing method, device and storage medium of local multipath message Active CN112333099B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110000712.3A CN112333099B (en) 2021-01-04 2021-01-04 Routing method, device and storage medium of local multipath message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110000712.3A CN112333099B (en) 2021-01-04 2021-01-04 Routing method, device and storage medium of local multipath message

Publications (2)

Publication Number Publication Date
CN112333099A CN112333099A (en) 2021-02-05
CN112333099B true CN112333099B (en) 2021-04-13

Family

ID=74302499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110000712.3A Active CN112333099B (en) 2021-01-04 2021-01-04 Routing method, device and storage medium of local multipath message

Country Status (1)

Country Link
CN (1) CN112333099B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113542156B (en) * 2021-07-26 2024-03-12 中移(杭州)信息技术有限公司 Message transmission method, device, terminal equipment and storage medium
CN113765785B (en) * 2021-08-19 2022-07-05 东北大学 DPDK-based multipath transmission method
CN117640503B (en) * 2024-01-22 2024-04-30 北京天维信通科技股份有限公司 Flow optimization method and device integrating BRouter technology and intelligent path technology

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102055672A (en) * 2010-12-27 2011-05-11 北京星网锐捷网络技术有限公司 Control method for data flow transmission route, device and route equipment
CN108111422A (en) * 2017-12-29 2018-06-01 北京明朝万达科技股份有限公司 A kind of data high-speed multichannel retransmission method and device based on DPDK
CN110224929A (en) * 2019-04-17 2019-09-10 西安交大捷普网络科技有限公司 The data packet forwarding method of link aggregation interface based on DPDK

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8488616B2 (en) * 2005-04-05 2013-07-16 Cisco Technology, Inc. Building multipoint-to-multipoint label switch paths

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102055672A (en) * 2010-12-27 2011-05-11 北京星网锐捷网络技术有限公司 Control method for data flow transmission route, device and route equipment
CN108111422A (en) * 2017-12-29 2018-06-01 北京明朝万达科技股份有限公司 A kind of data high-speed multichannel retransmission method and device based on DPDK
CN110224929A (en) * 2019-04-17 2019-09-10 西安交大捷普网络科技有限公司 The data packet forwarding method of link aggregation interface based on DPDK

Also Published As

Publication number Publication date
CN112333099A (en) 2021-02-05

Similar Documents

Publication Publication Date Title
CN112333099B (en) Routing method, device and storage medium of local multipath message
US20210266259A1 (en) Extensible Control Plane for Network Management in a Virtual Infrastructure Environment
US9148360B2 (en) Managing MAC moves with secure port groups
CN108616431B (en) Message processing method, device, equipment and machine readable storage medium
RU2523917C2 (en) Communication control system and communication control method
EP2696537B1 (en) Network system, switch, and connection terminal detection method
US6674769B1 (en) Simultaneous searching of layer 3 policy filter and policy cache in a network switch port
US8799507B2 (en) Longest prefix match searches with variable numbers of prefixes
US8059658B1 (en) Method and system for automatic expansion and contraction of IP host forwarding database
CN115486046B (en) Data packet processing method and equipment based on open virtual soft switch (OVS)
US10938679B2 (en) Packet monitoring
CN101789905A (en) Method and equipment for preventing unknown multicast from attacking CPU (Central Processing Unit)
CN104734964A (en) Message processing method, node and system
CN104734955A (en) Network function virtualization implementation method, wide-band network gateway and control device
CN111542075B (en) Method for maintaining associated data of signaling plane and user plane in 4G network environment
US20190207783A1 (en) Data forwarding method and apparatus based on operating system kernel bridge
CN106878106B (en) Reachability detection method and device
CN112565045B (en) Method, device, equipment and storage medium for forwarding message in EVPN
CN116074247B (en) Hardware flow table aging method, software flow table aging method, device and electronic equipment
US9137158B2 (en) Communication apparatus and communication method
CN111131048A (en) Network traffic forwarding method and device, electronic equipment and machine-readable storage medium
CN116032837A (en) Flow table unloading method and device
CN111107142B (en) Service access method and device
US10862801B1 (en) Selective media access control (MAC) learning and purging to reduce flooding and replication in a network
US11895005B1 (en) Network devices with hardware accelerated table updates

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant