CN111245728A - Data message forwarding method and system with multi-network card computing device - Google Patents

Data message forwarding method and system with multi-network card computing device Download PDF

Info

Publication number
CN111245728A
CN111245728A CN202010025310.4A CN202010025310A CN111245728A CN 111245728 A CN111245728 A CN 111245728A CN 202010025310 A CN202010025310 A CN 202010025310A CN 111245728 A CN111245728 A CN 111245728A
Authority
CN
China
Prior art keywords
route
computing device
forwarding
cache
network
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.)
Pending
Application number
CN202010025310.4A
Other languages
Chinese (zh)
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.)
Huayun Data Co Ltd
Original Assignee
Huayun Data 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 Huayun Data Co Ltd filed Critical Huayun Data Co Ltd
Priority to CN202010025310.4A priority Critical patent/CN111245728A/en
Publication of CN111245728A publication Critical patent/CN111245728A/en
Pending legal-status Critical Current

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/742Route cache; Operation thereof

Landscapes

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

Abstract

The invention provides a data message forwarding method and a system with a multi-network card computing device, wherein the method comprises the following steps: acquiring configuration information of a network card of a computing device, and storing a known destination address route to a router memory to form a route cache; receiving a new routing request initiated by a computing device, and filtering out a route which is not stored in a route cache and corresponds to the new routing request; and testing the forwarding path of the data message which is not stored in the route cache and corresponds to the route corresponding to the new route request, and adding the route which successfully establishes the forwarding path to the route cache. By the method and the device, the data message is efficiently forwarded in the environment of configuring a plurality of network cards to connect a public network and a private network, the computing device does not need to restart the network or manual intervention of an administrator, and the burden and the computing overhead of a DHCP client of the computing device are remarkably reduced.

Description

Data message forwarding method and system with multi-network card computing device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data packet forwarding method and system with a multi-network card computing device.
Background
In an internet protocol network, a host may have one or more network cards that access one or more networks. Each network may be connected to a different router. Routers are responsible for forwarding data packets sent by hosts of one network to other hosts of another network. Referring to fig. 1, a network card 111 and a network card 112 are disposed in the server 11 (i.e., a lower concept of the computing device), and the server 11 accesses the network 12 and the network 13 through the network card 111 and the network card 112, respectively. The network 12 is connected to the router 13, and the network 14 is connected to the router 15. At this point, server 11 generates two default routes, namely 0.0.0.0via 192.168.0.1 (through router 13 to access network 134 and network 135) and 0.0.0.0via192.168.1.1 (through router 15 to access network 154 and network 155). However, for the server 11, only one default route is typically used to forward the data packet to a unique destination address.
In the prior art, in order to solve the problem of conflict of routing rules in the forwarding data message of the multi-network card configured by the computing device, the DHCP protocol is usually adopted to route the networks (i.e., the network 134, the network 135, the network 154, and the network 155) to the server 11, i.e., 192.168.2.0/24via192.168.0.1, 192.168.4.0/24via 192.168.0.1, 192.168.3.0/24via192.168.1.1, 192.168.5.0/24via 192.168.1.1. However, if router 11 is in a situation of adding networks, the DHCP configuration needs to be modified. Since the DHCP client of the server 11 does not expire due to the IP lease and/or the server 11 does not restart the network to perform the update, the DHCP client of the server 11 may not acquire the updated DHCP configuration, and thus the routing table may not reflect the change of the actual network in real time.
For the case that the IP lease is not expired, the prior art usually adopts a relatively short IP lease setting means to handle the case. This, while able to solve the problem of timely updating of the routing table, increases DHCP traffic, and in particular increases the burden and computational overhead of the DHCP client of the server 11. This is clearly a disadvantage in scenarios with a large number of computer clusters or data centers. Meanwhile, when the server 11 solves the technical route of the routing table in real time in a network restarting manner, manual intervention of an administrator is required. Obviously, in the scenario of a large number of computer clusters or data centers, this solution has the problem of lack of normativity for manual intervention and resetting, and causes enormous workload for administrators. Therefore, the two technical routes are not suitable for configuring the multi-network card computing device to determine the default routing specification, thereby causing great influence on the forwarding of the data message.
In view of the above, there is a need to improve the forwarding of data packets with multi-network card computing devices in the prior art to solve the above problems.
Disclosure of Invention
The invention aims to disclose a data message forwarding method with a multi-network card computing device and a data message forwarding system with the multi-network card computing device, which are used for confirming a default routing forwarding rule of the computing device and realizing real-time updating in the process of forwarding a data message configured with the multi-network card computing device to the outside so as to determine the default routing rule, overcome the defects in the prior art and realize efficient forwarding processing on the data message.
To achieve the first object, the present invention provides a data packet forwarding method with a multi-network card computing device, including:
acquiring configuration information of a network card of a computing device, and storing a known destination address route to a router memory to form a route cache;
receiving a new routing request initiated by a computing device, and filtering out a route which is not stored in a route cache and corresponds to the new routing request;
and testing the forwarding path of the data message which is not stored in the route cache and corresponds to the route corresponding to the new route request, and adding the route which successfully establishes the forwarding path to the route cache.
As a further improvement of the present invention, before the receiving the new routing request initiated from the computing device, the method further includes:
and shifting out the unused route from the route cache according to the set aging time interval, and releasing the occupation of the unused route on the memory of the router.
As a further improvement of the present invention, after receiving a new routing request initiated from a computing device, the method further comprises:
judging whether a default route matched with the new route request exists or not;
if so, forwarding the data message corresponding to the new routing request according to a default route;
if not, calling a known destination address route from a route cache of the routing table so as to forward the data message corresponding to the new route request according to the default route.
As a further improvement of the present invention, a plurality of known destination address routes form a known destination routing table in a route cache;
the known destination routing table is collectively described by the following routing table entries: destination address, next hop route IP address, priority and aging mark;
the priority is determined by a delay value formed by forwarding the data message to a private address range through a plurality of network cards.
As a further improvement of the present invention, the data packet forwarding method is executed in a protocol stack of an operating system of the computing device.
As a further improvement of the present invention, the aging time interval is configured by an aging timer, the aging timer responding to an aging time adjustment request initiated by a user and/or an administrator to adjust the aging time interval;
the aging time interval is at least 10 seconds.
Based on the same invention idea, the invention also discloses a data message forwarding system with a multi-network card computing device, which comprises: a default route searching module, a route request reporting module and a decision module;
the default route searching module is used for acquiring configuration information of a network card of the computing device and storing a known destination address route to a router memory to form a route cache;
the routing request reporting module is used for receiving a new routing request initiated by the computing device and filtering out a route which is not stored in the routing cache and corresponds to the new routing request;
and the decision module is used for testing the forwarding path of the data message which is not stored in the route cache and corresponds to the route corresponding to the new route request, and adding the route which successfully establishes the forwarding path to the route cache.
As a further improvement of the present invention, the default route lookup module performs operations of removing the route cache and releasing the occupation of the unused route on the router memory by the decision module for the unused route according to the set aging time interval before receiving a new route request initiated from the computing device.
As a further refinement of the present invention, the default route lookup module is configured with an aging timer for setting an aging interval,
the aging timer responds to an aging time interval adjusting request initiated by a user and/or an administrator to adjust the aging time interval; the aging time interval is at least 10 seconds.
As a further improvement of the invention, the forwarding path of the data message corresponding to the route corresponding to the new route request, which is not stored in the route cache, is tested, and after the route for successfully establishing the forwarding path is added to the route cache, the decision module issues the data message to the default route searching module in the form of host route, and the default route searching module determines the only default route.
As a further improvement of the present invention, the data packet forwarding system runs in a protocol stack of an operating system of the computing device.
Compared with the prior art, the invention has the beneficial effects that:
the data message forwarding method and the data message forwarding system with the multi-network-card computing device disclosed by the invention realize the efficient forwarding of the data message in the environment of configuring a plurality of network cards to connect a public network and a private network, and do not need the computing device to adopt a restarting network or the manual intervention of an intervention administrator, so as to adapt to the forwarding requirement of the data message in the scene of a large-scale computer cluster or a data center, obviously reduce the burden and the computing overhead of a DHCP client of the computing device, and avoid the DHCP configuration modification operation.
Drawings
Fig. 1 is a diagram illustrating a network example when a server configures two network cards to perform data packet forwarding in the prior art;
FIG. 2 is a flowchart illustrating an overall data message forwarding method with a multi-card computing device according to the present invention;
FIG. 3 is a logic flow diagram of a data message forwarding method with a multi-card computing device in accordance with the present invention;
FIG. 4 is a logic flow diagram of a general route lookup;
FIG. 5 is a logic flow diagram for forwarding data messages to a computing device with multiple network cards based on known destination address routing;
FIG. 6 is a topology diagram of a data message forwarding system with a multi-NIC computing device according to the present invention;
Detailed Description
The present invention is described in detail with reference to the embodiments shown in the drawings, but it should be understood that these embodiments are not intended to limit the present invention, and those skilled in the art should understand that functional, methodological, or structural equivalents or substitutions made by these embodiments are within the scope of the present invention.
Before describing in detail various embodiments of the present invention, the terms presented in the detailed description are defined, and the technical solutions included in the present invention are described in detail through several embodiments.
Term "Data messageThe term "Message" refers to a unit of data received and/or transmitted between a computing device and another computing device or between a computing device and another computing device in a network, where the computing device in this application refers to a computer, a physical server, various intelligent devices with computing communication functions, or a virtual machine or a virtual computing cluster formed by a physical computer through virtualization technology.
Term "Logic"includes any physical and tangible functions for performing a task. For example, each operation illustrated in the flowcharts corresponds to a logical component for performing the operation. Operations may be performed using, for example, software running on a computer device, hardware (e.g., chip-implemented logic functions), etc., and/or any combination thereof. When implemented by a computing device, the logical components represent electrical components that are physical parts of the computer system, regardless of the manner in which they are implemented.
Phrase "Is configured as"or a phrase"Is configured to"includes any manner in which any kind of physical and tangible functionality may be constructed to perform the identified operations. The functions may be configured to perform operations using, for example, software running on a computer device, hardware (e.g., chip-implemented logic functions), and/or the like, and/or any combination thereof.
The first embodiment is as follows:
fig. 2 to 5 illustrate an embodiment of a data packet forwarding method with a multi-network card computing device (hereinafter, may be referred to as "data packet forwarding method") according to the present invention. The data message forwarding method runs in a protocol stack of an operating system of the computing device, and particularly runs in a TCP/IP protocol stack of the computing device 200, so as to reduce occupation and loss of resources of a Linux system kernel.
The data message forwarding method disclosed by the embodiment comprises the following steps:
step S1, obtaining configuration information of the network card of the computing device, and storing the known destination address route to the router memory to form a route cache;
step S2, receiving a new route request initiated by the computing device, and filtering out the route which is not stored in the route cache and corresponds to the new route request;
step S3, the forwarding path of the data packet corresponding to the route corresponding to the new route request that is not stored in the route cache is tested, and the route that successfully establishes the forwarding path is added to the route cache.
Referring to fig. 3, the data packet forwarding method specifically includes:
step 211, start.
Step 212, receiving a data message to be sent.
Step 213, determining whether the destination address carried by the data packet to be sent matches with the recently used route, if no match exists (i.e. there is a route that has been recently used), skipping to execute step 214, if yes, executing step 215, forwarding the data packet according to the cached routing rule, and after the forwarding operation of the data packet according to the cached routing rule is completed, ending the forwarding finally, i.e. executing step 218. The cached routing rule in step 215 is the routing rule temporarily stored in the route cache.
Step 214, determining whether a matching default route exists, if yes, skipping to execute step 217, if not, skipping to execute step 216, forwarding the data message according to the routing table, and finally, ending the forwarding, namely executing step 218.
Step 217, searching for a data packet forwarding destination address, issuing the data packet forwarding destination address to the default route searching module 10, and performing, by the default route searching module 10, searching for a route with a known destination address (specifically referring to fig. 5), and finally ending the forwarding, that is, performing step 218.
Next, the applicant describes the data message forwarding method disclosed in this embodiment in more detail.
In a computer cluster (or cloud computing platform) composed of multiple hosts (or virtual machines), a network card needs to be configured for the multiple hosts (or virtual machines). In an internet protocol network, a host may have one or more network cards that access one or more networks. Each network may be connected to a different router (e.g., router 13 and router 15 shown in fig. 1). Routers are responsible for forwarding data packets sent by hosts of one network to other hosts of another network. A routing table is maintained on the host for looking up the next-hop IP addresses of different destinations, typically the router interface addresses of the subnet where the host is located. Three routing entries are maintained in the routing table: host routing, subnet routing, default routing. A routing entry typically contains the four most important parts: a destination address, a destination mask, a next hop IP address, and a hop count for this route entry. The next hop IP address must be within the same subnet as the host. Host routing is understood to be subnet routing where the subnet address is fully covered, and only represents the next hop IP address for which one IP address is the destination. Host routing is understood to be subnet routing where the subnet address is fully covered, and only represents the next hop IP address for which one IP address is the destination. A subnet route then represents the next hop IP address to all host addresses under a certain network address. The default route then represents the next hop IP address that the data chooses without explicit route entry definition.
In a private cloud environment, in order to isolate private network data from public network data, two network cards of a host are usually connected to a public network and a private network. The public network points to the router address of the foreign network via a default route. One or more subnets formed by the private network are interconnected by routers (i.e., router 13 and router 15 shown in fig. 1).
For the convenience of explaining the present invention, the embodiment borrows the example shown in fig. 1 in explaining the data packet forwarding process. With reference to fig. 2, the applicant describes the data packet forwarding method with a multi-network card computing device in the present embodiment, and the following details are provided. The data message forwarding method can determine a routing rule for the computing device 200 configured with a plurality of network cards in the process of forwarding data messages by a public network and a private network so as to forward the data messages between the public network and the private network, wherein the forwarding can be unidirectional or bidirectional. The network cards configured in the computing device 200 are the network card 111 and the network card 112 shown in fig. 1, and may be physical network cards.
First, step S1 is executed to obtain configuration information of the network card of the computing device 200, and store the known destination address and route to the router memory to form a route cache. The network card may be understood as a physical network card (eth) in the present embodiment. The server 11 (which is a lower concept of the computing device 200 of the present invention and hereinafter may be understood as a specific example of the computing device 200) configures the network card 111 and the network card 112, the network card 111 is connected to the network 12, the network card 112 is connected to the network 14, the network 12 is connected to the router 13, and the network 14 is connected to the router 15. Router 13 connects network 134 to network 135 and router 15 connects network 154 to network 155. The network card disclosed in the present embodiment may be a physical network card, and is understood as equivalent to eth0 or eth 1.
Then, step S2 is executed to receive the new route request initiated from the computing device 200, and to filter out the route corresponding to the new route request that is not stored in the route cache. In step S2, if the new route request is initiated by the server 11, the data packet corresponding to the new route request initiated from the server 11 needs to determine the routing rule during the forwarding process to determine whether the forwarding path is forwarded from the server 11 to a specific network, i.e. the network 134, the network 135, the network 154 or the network 155 shown in fig. 1, through the network 12 or the network 14. The roles of the network 12 and the networks 134 and 135 are mutually isolated, namely, a public network and a private network, and the data message is forwarded between the network 12 and the networks 134 and 135.
Preferably, before receiving the new routing request initiated from the computing apparatus 200, the method further includes: and shifting out the unused route from the route cache according to the set aging time interval, and releasing the occupation of the unused route on the memory of the router. The occupation of the router memory in this scenario may be understood as the occupation of the router memory by one or several routes in the route cache. The aging interval is configured by the aging timer 118, and the aging timer 118 is responsive to an aging interval adjustment request initiated by a user and/or an administrator to adjust the aging interval. In this embodiment, the aging time interval is at least 10 seconds, and preferably 300 seconds. If the aging interval set by the aging timer 118 is too short, the aging timer 118 is frequently called by the physical CPU or vCPU of the computing device 200 to trigger a scan event for the destination address routing table, which may consume the computational overhead of the physical CPU or vCPU. By setting the aging time interval and the specific setting value, it is effectively avoided that the performance of the operating system (e.g., Linux system, Android system, Windows system, or any other network-capable operating system, and most preferably an open-source operating system) embedded in the computing device 200 is affected by the aging operation that is too frequent. Due to the technical scheme that routes which are not used or are not used frequently for a long time are moved out of the route cache according to the set aging time interval, and occupation of the routes which are not used or are not used frequently for a long time on the router memory is released, the decision module 30 can refresh the time delay to dynamically adapt to the real-time state of the network, so that the computing device 200 is ensured to have good real-time performance in the process of receiving and/or sending data messages.
In the example shown in fig. 1, there are four forwarding paths, path one: 192.168.2.0/24 via192.168.0.1; and a second route: 192.168.4.0/24via 192.168.0.1; path three: 192.168.3.0/24 via192.168.1.1; and path four: 192.168.5.0/24via 192.168.1.1. The invention aims to select a known destination address route from a route cache and forward a data message by a mode of a specified interface (namely a specified physical network card) according to the event of a new route request initiated by a server 11. If a certain path of the four paths can be reached by the route, the route is sent to the default route searching module 10 in the form of the host route, so as to forward the data packet through the default route determined by the default route searching module 10.
Of course, in this process, if no route with a known destination address is selected from the route cache, the routing rule is determined by a general route lookup rule (i.e., a longest match rule), and a forwarding operation is performed on the data packet, as described below with reference to fig. 4. It should be noted that "no route with a known destination address is selected from the route cache" means that no destination address in the "known destination route table" exists in the route cache during the process of forwarding the data packet based on the new route request event. The destination address belongs to an IP address within a private address range in network 134, network 135, network 154, or network 155. The general routing lookup rule is realized by looking up a routing table of an operating system, wherein the routing table consists of a destination address, a prefix, a next-hop IP address and a network card device, and the routing table is ordered from small to large according to the prefix. The next-hop IP address must be in the same subnet as the host (i.e. the upper concept of the server 11 in fig. 1), that is, the next-hop IP address can be reached without routing, and the next-hop IP address is null, which indicates that the subnet and the host are in the same subnet. The routing table used in a general routing lookup rule can be simplified as shown in the following table one:
destination address Prefix Next hop IP address Network card device
0.0.0.0 0 192.168.0.1 eth0
192.168.0.0 24 0.0.0.0 eth0
Watch 1
In table one, the routing table entry with a destination address of 0.0.0.0 and a prefix of 0 is the default route.
As shown in fig. 3, in this embodiment, after receiving a new routing request initiated from the computing apparatus 200, the method further includes:
judging whether a default route matched with the new route request exists or not;
if so, forwarding the data message corresponding to the new routing request according to a default route;
if not, calling a known destination address route from a route cache of the routing table so as to forward the data message corresponding to the new route request according to the default route.
Wherein the plurality of known destination address routes form a known destination routing table in the route cache;
the known destination routing table is collectively described by the following routing table entries: destination address, next hop route IP address, priority and aging mark;
the priority is determined by a delay value formed by forwarding the data message to a private address range through a plurality of network cards.
The term "next hop of a packet" means that the MAC address of the next hop IP address is the destination MAC address of the packet, and the MAC address is obtained through the ARP protocol, so that it is determined that the next hop IP address is fixed and the network card address of the host is in the same subnet. The router will not forward the ARP protocol message. There is a special next-hop IP address, i.e. there is no next-hop IP address, i.e. the destination network and the local network card address are in the same subnet, and for convenience of description, this is indicated by 0.0.0.0. The following describes in detail the process of performing a route lookup based on a general route lookup rule:
when the host wants to send a data packet to the destination IP address of 192.168.2.5, 192.168.2.5 sequentially compares the data packet with the routing table entry shown in table one by one, as shown below.
The IP address of the IPv4 consists of 4 numbers of 0-255, so that the IP address of the IPv4 can be pieced into a 32-bit positive integer for representation; then the binary representation of 192.168.2.5 is:
Figure BDA0002362229540000111
from left to right 31 bits to 0 bits, respectively.
The alignment process is to take 192.168.2.5 IP address with the highest prefix number. When prefix bit 0, i.e. one bit is not taken, the result is equal to destination address 0.0.0.0 in the routing table, which means that destination IP address 192.168.2.5 matches the route, and all 0 addresses are obtained, i.e. 0.0.0.0.
Assuming that the IP address with the destination address 192.168.0.1 is used for the route lookup, we can see from table one that the first default route is definitely matched, we see the second entry 192.168.0.0/24. According to the above algorithm, 192.168.0.1 takes the first 24 bits, i.e. 192.168.0.0, and the destination address of this entry is equal, and there is a match. Since the principle of general route lookup is the longest match principle, i.e. which match has the largest length (i.e. prefix), the best match is obtained. The result returned should be this longest match. Therefore, the result of the lookup of 192.168.0.1 in table one is the second entry, the data packet is sent through the interface eth0 (i.e. the physical network card), and the next-hop IP address is 0.0.0.0, so that the destination IP address and the host bit are in the same subnet. The specific process of the longest match rule of the general routing rule is shown in fig. 4, and specifically as follows.
Step 311, start to find the route.
Step 312, look up the longest match entry in the routing table.
Step 313, using the longest match as the next hop for the package.
Referring to fig. 1, if there are two default routes, the routing table of the computing device 200 is configured as shown in table two below.
Destination address Prefix Next hop IP address Network card device
0.0.0.0 0 192.168.0.1 eth0
0.0.0.0 0 192.168.1.1 eth1
192.168.0.0 24 0.0.0.0 eth0
192.168.1.0 24 0.0.0.0 eth1
Watch two
Finally, step S3 is executed to test the forwarding path of the data packet corresponding to the route corresponding to the new route request that is not stored in the route cache, and add the route that successfully establishes the forwarding path to the route cache.
According to the algorithm of the current operating system, when the default route is matched, two matching results exist, but one of the two matching results is actually selected. Such as the one that matches first (i.e., the next hop IP address is 192.168.0.1). This match is false for data packets destined for private address range 192.168.3.0/24 and private address range 192.168.5.0/24, and the next hop IP address should be 192.168.1.1, as determined from the example of fig. 1.
Therefore, in the present invention, if a default route is matched, that is, the prefix of the matched route entry is 0, and there are a plurality of route entries (default routes) with prefixes of 0, the route lookup process shown in fig. 5 is executed based on the aforementioned default route lookup module 10.
As shown in fig. 5, step 411, open lookup route, is performed first. Step 412, look up the longest match entry in the routing table. Step 413, judging whether the longest matching item prefix is 0, if yes, skipping to execute step 415, if not, skipping to execute step 414, using the longest matching item as a next packet forwarding hop, and after the step 414 is executed, skipping to execute step 419 and ending. In step 415, the routing information is sent to the default routing lookup module 10 to lookup a known destination address routing, and then step 416 is executed, whether step 415 is executed completely is judged, if yes, step 418 is executed by skipping, the result is used as a next hop of a packet, if not, step 417 is executed by skipping, the packet-sending destination address is sent to the decision module 30, the decision module 30 sends the collected reported destination address to a data packet by means of a designated interface, and at the same time, which default routing of the two default routing can reach the destination address is judged, and finally the data packet is sent to the default routing lookup module 10 in the form of a host routing. Therefore, when the data packet is forwarded next time, the data packet sent to the same destination address next time can be routed and forwarded according to the determined default route through the unique default route determined by the default route searching module 10.
This involves a newly added table, the "known destination routing table," which holds the most recently looked-up destination address and the next-hop IP address used, the priority, and an aging flag for this entry. Referring to fig. 1, assuming two IP addresses, the destination address 192.168.2.3 and the destination address 192.168.3.5, were used once, the "known destination routing table" is referred to in table three.
Figure BDA0002362229540000121
Figure BDA0002362229540000131
Watch III
Table three is generated by the decision module 30. The input information of the decision module 30 is provided by the routing request reporting module 20, and when the "known destination routing table" cannot be found, the routing request reporting module 20 will transmit the destination IP to the decision module 30 in the form of a message, such as a netlink, a pipe, or a shared memory. The decision module 30 may obtain the IP address information sent by the routing request reporting module 20 from the second table by using a corresponding netlink, a pipeline, or a shared memory.
After the decision module 30 receives an IP address, according to the current default routing condition of the computing device 200, the gateway address of each default route is used as the next-hop IP address, and a data message is sent from a corresponding physical network card (eth0) to an ICMP echo request message addressed to the IP address through an original socket (raw socket); using the original socket, the default route lookup module 10 can be skipped and packets sent directly from the corresponding network card. Meanwhile, the decision module 30 will listen to the icmp echo response message at each network card. When receiving the ICMP echo response message, the time difference (in milliseconds) between sending and receiving the ICMP echo response message is calculated and filled into the "known destination routing table" (i.e. table three described above) as the priority, and the default aging flag is set to 0.
Obviously, when both gateways can send a data message to a destination, two icmp echo response messages are obtained, and then two next hop IP addresses that are different but have the same destination are filled into a known destination routing table, and the priority is the time delay for reaching the destination through different gateways, at this time, the time delay is compared, and if the time delay is lower, the higher priority is proved.
Meanwhile, the decision module 30 will execute an aging timer 118 at intervals of a preset time by the user, traverse each routing entry in the "known destination routing table", and set the aging flag to 1 if the aging flag is 0; if the aging flag is set to 1, this route entry is deleted. Thereby recovering route entries in the "known destination routing table" that are not used for a certain time. And then, the ICMP echo request is sent again, and the action of the routing decision is executed repeatedly, wherein the action can refresh the time delay and dynamically adapt to the real-time state of the network. The aging time interval is at least 10 seconds and can be set to 300 seconds; of course, the user sets shorter or longer aging time intervals according to his own situation.
When the default route lookup module 10 finds and uses a route entry, the routing entry's aging flag is reset to 0, and the route entry is prevented from being deleted by the decision module 30, so as to indicate that the user is still using the route entry to determine the routing rule.
Based on this, the decision module 30 does not suggest to be implemented in the kernel module of the Linux system because there is a situation of waiting for the destination address to return the ICMP echo response message, and the kernel module of the Linux system does not have a waiting action, so as to prevent the waiting action from blocking the execution of other important input/output or interrupt requests. In this embodiment, the time delay value is filled as the priority, so that the user experience of surfing the internet can be dynamically optimized.
The data structure of the "known destination routing table", for example, in C language, can be implemented by the following codes:
Figure BDA0002362229540000141
the known destination routing table can be stored by a large array, and if the number of routing entries is not enough to be stored, a larger space can be dynamically applied for storing more routing entries.
In order to better understand the data message forwarding method with multi-network card computing device disclosed in this embodiment, the applicant provides a more specific example with reference to fig. 1.
If the data packet sent by the server 11 to the network 192.168.5.5 does not exist in the "known destination routing table" and matches the default route, the default route lookup module sends 192.168.5.5 to the decision module 30, and the decision module 30 sends 192.168.0.1 and 192.168.1.1 to the network card 111 and the network card 112, respectively, so as to determine which default route can reach the network 192.168.5.5. If the network 155 can be reached using the network card 112 with an egress address of 192.168.1.1 (private IP address 192.168.5.5), the decision module 30 will send a host route to the "known destination routing table": 192.168.5.5/32via 192.168.1.1. In this process, the DHCP client in the computing apparatus 200 is not required to perform an operation of automatically obtaining the server allocation IP address and the subnet mask, thereby significantly reducing the burden and the computational overhead of the DHCP client of the computing apparatus and avoiding the DHCP configuration modification operation. The next time a data message needs to be sent to network 155 having IP address 192.168.5.5 and a private address range of 192.168.5.0/24, it is sent using the entry found in the "known destination routing table" directly. Thus, server 11 does not need to explicitly know to which private networks (i.e., network 134, network 135, network 152, and network 155) two routers (i.e., router 13 and router 15) can respectively access, and does not need to modify the configuration of the DHCP service and perform a reboot of the entire network.
Finally, the applicant indicates that the data message forwarding method disclosed in the present embodiment can be applied to the computing apparatus 200 constructed by the IPv4 internet communication protocol or the IPv6 internet communication protocol, and the computing apparatus 200 includes, but is not limited to, a computer, a physical computer cluster, a virtual computer cluster, a data center, a mobile internet device, or a wearable smart device.
Example two:
referring to fig. 6, based on the same or similar inventive concepts of a data packet forwarding method with a multi-network card computing device disclosed in the first embodiment, this embodiment further discloses a data packet forwarding system 100 with a multi-network card computing device (hereinafter referred to as "data packet forwarding system 100"), which includes: a default route searching module 10, a route request reporting module 20 and a decision module 30. The data message forwarding system 100 with multi-network card computing device runs in the protocol stack of the operating system of the computing device 200 and is controlled by the administrator and/or the user.
The default route searching module 10 acquires configuration information of a network card of the computing device 200, and stores a known destination address route to a router memory to form a route cache;
a route request reporting module 20, which receives a new route request initiated by the computing device 200, and filters out a route which is not stored in the route cache and corresponds to the new route request;
the decision module 30 tests the forwarding path of the data packet corresponding to the route corresponding to the new route request, which is not stored in the route cache, and adds the route for successfully establishing the forwarding path to the route cache.
The default route lookup module 10 performs the operations of removing the route cache and releasing the occupation of the unused route to the router memory through the decision module 30 for the unused route according to the set aging time interval before receiving the new route request initiated from the computing device 200.
The default route lookup module 10 configures an aging timer 118 for setting an aging interval, the aging timer 118 being logically located in the default route lookup module 10.
The aging timer 118 is responsive to an aging interval adjustment request initiated by a user and/or administrator to adjust the aging interval; the aging time interval is at least 10 seconds.
And testing the forwarding path of the data message corresponding to the route corresponding to the new route request, which is not stored in the route cache, and after adding the route which successfully establishes the forwarding path to the route cache, issuing the route to the default route searching module 10 in the form of host route by the decision module 30, and determining the only default route by the default route searching module 10.
Please refer to the description of the first embodiment, which will not be repeated herein, for the technical solutions of the same parts included in the datagram forwarding system 100 disclosed in this embodiment and the datagram forwarding method disclosed in the first embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-listed detailed description is only a specific description of a possible embodiment of the present invention, and they are not intended to limit the scope of the present invention, and equivalent embodiments or modifications made without departing from the technical spirit of the present invention should be included in the scope of the present invention.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.
Furthermore, it should be understood that although the present description refers to embodiments, not every embodiment may contain only a single embodiment, and such description is for clarity only, and those skilled in the art should integrate the description, and the embodiments may be combined as appropriate to form other embodiments understood by those skilled in the art.

Claims (11)

1. A method for forwarding data packets with a multi-network card computing device, comprising:
acquiring configuration information of a network card of a computing device, and storing a known destination address route to a router memory to form a route cache;
receiving a new routing request initiated by a computing device, and filtering out a route which is not stored in a route cache and corresponds to the new routing request;
and testing the forwarding path of the data message which is not stored in the route cache and corresponds to the route corresponding to the new route request, and adding the route which successfully establishes the forwarding path to the route cache.
2. The data packet forwarding method of claim 1, wherein the receiving of the new routing request initiated from the computing device is preceded by:
and shifting out the unused route from the route cache according to the set aging time interval, and releasing the occupation of the unused route on the memory of the router.
3. A data packet forwarding method according to claim 2, further comprising, after receiving a new routing request initiated from a computing device:
judging whether a default route matched with the new route request exists or not;
if so, forwarding the data message corresponding to the new routing request according to a default route;
if not, calling a known destination address route from a route cache of the routing table so as to forward the data message corresponding to the new route request according to the default route.
4. A data message forwarding method according to claim 2 wherein the plurality of known destination address routes form a known destination routing table in the route cache;
the known destination routing table is collectively described by the following routing table entries: destination address, next hop route IP address, priority and aging mark;
the priority is determined by a delay value formed by forwarding the data message to a private address range through a plurality of network cards.
5. A data packet forwarding method according to any one of claims 2 to 4, wherein the data packet forwarding method runs in a protocol stack of an operating system of a computing device.
6. A data message forwarding method according to claim 5 wherein the aging time interval is configured by an aging timer responsive to an aging time adjustment request initiated by a user and/or administrator to adjust the aging time interval;
the aging time interval is at least 10 seconds.
7. A system for forwarding data packets having a multi-network card computing device, comprising: a default route searching module, a route request reporting module and a decision module;
the default route searching module is used for acquiring configuration information of a network card of the computing device and storing a known destination address route to a router memory to form a route cache;
the routing request reporting module is used for receiving a new routing request initiated by the computing device and filtering out a route which is not stored in the routing cache and corresponds to the new routing request;
and the decision module is used for testing the forwarding path of the data message which is not stored in the route cache and corresponds to the route corresponding to the new route request, and adding the route which successfully establishes the forwarding path to the route cache.
8. The system according to claim 7, wherein the default route lookup module performs an operation of removing the route cache and releasing the occupation of the unused route on the router memory through the decision module for the unused route according to a set aging interval before receiving a new route request initiated from the computing device.
9. The data packet forwarding system of claim 8, wherein the default route lookup module is configured with an aging timer for setting an aging interval,
the aging timer responds to an aging time interval adjusting request initiated by a user and/or an administrator to adjust the aging time interval; the aging time interval is at least 10 seconds.
10. The system according to claim 7, wherein the default route lookup module is configured to send the default route lookup module in a host route after testing the forwarding path of the data packet corresponding to the route corresponding to the new route request that is not stored in the route cache, and adding the route that successfully establishes the forwarding path to the route cache, and determining the unique default route by the default route lookup module.
11. The datagram forwarding system of any of claims 7-11, wherein the datagram forwarding system runs on a protocol stack of an operating system of a computing device.
CN202010025310.4A 2020-01-10 2020-01-10 Data message forwarding method and system with multi-network card computing device Pending CN111245728A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010025310.4A CN111245728A (en) 2020-01-10 2020-01-10 Data message forwarding method and system with multi-network card computing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010025310.4A CN111245728A (en) 2020-01-10 2020-01-10 Data message forwarding method and system with multi-network card computing device

Publications (1)

Publication Number Publication Date
CN111245728A true CN111245728A (en) 2020-06-05

Family

ID=70870799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010025310.4A Pending CN111245728A (en) 2020-01-10 2020-01-10 Data message forwarding method and system with multi-network card computing device

Country Status (1)

Country Link
CN (1) CN111245728A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115022215A (en) * 2022-05-25 2022-09-06 四川九州电子科技股份有限公司 Method and system for testing MAC address of optical network unit
CN115277726A (en) * 2022-05-30 2022-11-01 浪潮软件集团有限公司 Cluster data transmission method and system for dual networks

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040109466A1 (en) * 2002-12-09 2004-06-10 Alcatel Method of relaying traffic from a source to a targeted destination in a communications network and corresponding equipment
CN1553662A (en) * 2003-06-08 2004-12-08 华为技术有限公司 Method for preventing refusal service attack
CN106953795A (en) * 2016-01-07 2017-07-14 中兴通讯股份有限公司 Configure the method and device of many network interface cards
CN107453898A (en) * 2017-07-21 2017-12-08 郑州云海信息技术有限公司 A kind of network system and its network collocating method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040109466A1 (en) * 2002-12-09 2004-06-10 Alcatel Method of relaying traffic from a source to a targeted destination in a communications network and corresponding equipment
CN1553662A (en) * 2003-06-08 2004-12-08 华为技术有限公司 Method for preventing refusal service attack
CN106953795A (en) * 2016-01-07 2017-07-14 中兴通讯股份有限公司 Configure the method and device of many network interface cards
CN107453898A (en) * 2017-07-21 2017-12-08 郑州云海信息技术有限公司 A kind of network system and its network collocating method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115022215A (en) * 2022-05-25 2022-09-06 四川九州电子科技股份有限公司 Method and system for testing MAC address of optical network unit
CN115022215B (en) * 2022-05-25 2023-06-02 四川九州电子科技股份有限公司 Method and system for testing MAC address of optical network unit
CN115277726A (en) * 2022-05-30 2022-11-01 浪潮软件集团有限公司 Cluster data transmission method and system for dual networks

Similar Documents

Publication Publication Date Title
US11223579B2 (en) Data processing method, network interface card, and server
EP3780552B1 (en) Message processing method in distributed device and distributed device
JP4722157B2 (en) Intelligent load balancing and failover of network traffic
EP2767047B1 (en) Distributed ipv6 neighbor discovery for large datacenter switching systems
JP4651692B2 (en) Intelligent load balancing and failover of network traffic
US9008084B2 (en) Method of IPv6 at data center network with VM mobility using graceful address migration
JP4840943B2 (en) Intelligent load balancing and failover of network traffic
JP2001230818A (en) Route server
US9118608B2 (en) Communication apparatus, control method therefor, and computer-readable storage medium
US20130094514A1 (en) Method and switch for sending packet
CN111371920A (en) DNS front-end analysis method and system
US11929913B2 (en) Method for creating data transmission entry and related device
US20160112315A1 (en) Communication apparatus, communication method, and computer-readable recording medium
US11533294B2 (en) Management of blacklists and duplicate addresses in software defined networks
US9450880B2 (en) Load condition based transfer of processing responsibility
CN111245728A (en) Data message forwarding method and system with multi-network card computing device
US8934489B2 (en) Routing device and method for processing network packet thereof
US8023517B2 (en) System and method for improving network performance and security by controlling topology information
JP2015231131A (en) Network relay device, ddos protection method employing the device, and load distribution method
US9984036B2 (en) Communication system, control apparatus, communication method, and program
US20140334491A1 (en) Prediction based methods for fast routing of ip flows using communication/network processors
WO2017219868A1 (en) Arp entry processing method and apparatus
EP3531636B1 (en) Detecting stale memory addresses for a network device flow cache
US7843927B1 (en) Methods, systems, and computer program products for routing packets at a multi-mode layer 3 packet forwarding device
US20120250683A1 (en) Method and System for Avoiding Flooding of Packets in Switches

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200605