Message forwarding method and device, equipment and storage medium

By optimizing the packet forwarding method in the router and using the extended part of the ARP table and routing information table for fast retrieval, the problem of long processing delay in the router is solved, and the packet forwarding efficiency and network service quality are improved.

CN118764431APending Publication Date: 2024-10-11SHEN ZHOU SHU MA WANG LUO BEI JING YOU XIAN GONG SI +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411053014.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing routers need to traverse the entire routing table when processing service packets, resulting in long processing delays and affecting network service quality.

Method used

After the router receives the message, it determines whether the source IP address matches the ARP entry. If it does not match, it sends a check message and adds forwarding information to the routing information table, assigns it to the extended part, and prioritizes retrieval to reduce addressing. time.

Benefits of technology

By optimizing the retrieval sequence and content management of the routing information table, packets are forwarded directly according to the retrieved forwarding information, which reduces processing delays and improves packet forwarding efficiency and network service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764431A_ABST
    Figure CN118764431A_ABST
Patent Text Reader

Abstract

The invention discloses a message forwarding method and device, equipment and a storage medium, and relates to the technical field of communication, the method comprises the following steps: receiving a first message, if a first IP address is not hit in an address resolution protocol (ARP) table item, a first router sends a check message to the first IP address; if a response message of the check message is received, first forwarding information of the first host is added in a routing information table, the forwarding information comprises first routing information, a first next hop address and a first port, and the first routing information comprises an IP address and mask information of the first host; distributing the first forwarding information to an extension part of the routing information table, and receiving a second message; retrieving the extended part of the routing information table according to the destination IP address of the second message to obtain a first retrieval result; and if the first retrieval result represents that the forwarding information is retrieved, the first router forwards the second message according to the retrieved forwarding information. The method can reduce the processing delay of the network equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a message forwarding method, device, equipment and storage medium. Background Art

[0002] With the development of communication technology, the capacity and bandwidth of network equipment (such as routers) are getting larger and larger, and the computing power is getting stronger and stronger. While network bandwidth and network security meet user needs, more users have higher requirements for the quality of network services.

[0003] In actual scenarios, the quality of network services is usually improved by reducing network latency. The latency of a single network device includes transmission latency, serialization latency, processing latency, and queue latency. Among them, processing latency refers to the latency generated by the router when it receives a service message and forwards it. Currently, after receiving a service message, the router needs to traverse the entire routing table, perform the longest mask match, obtain the optimal forwarding path, and then forward the service message.

[0004] It can be seen that in the current process of forwarding business messages, the entire routing table needs to be traversed, which takes a long time. Summary of the invention

[0005] The present application provides a message forwarding method, apparatus, device and storage medium, which can reduce the processing delay of network equipment.

[0006] In order to achieve the above objectives, this application adopts the following technical solutions:

[0007] In a first aspect, the present application provides a message forwarding method, applied to a first router, the method comprising:

[0008] The first router receives a first message, the source IP address of the first message is the first IP address, the destination IP address is the second IP address, and the source MAC is the first MAC address, the first IP address is the IP address of the first host, and the second IP address is the IP address of the second host;

[0009] If the first IP address is not found in the Address Resolution Protocol ARP table entry, the first router sends a check message to the first IP address;

[0010] If the first router receives a response message to the check message, first forwarding information of the first host is added to the routing information table, where the forwarding information includes first routing information, a first next hop address, and a first port, the first routing information includes an IP address and mask information of the first host, the first next hop address is a first MAC address, and the first port is a port for receiving the response message;

[0011] The first router distributes the first forwarding information to an extended portion of the routing information table, and during message forwarding, the extended portion of the routing information table is retrieved before the original portion of the routing information table;

[0012] The first router receives a second message;

[0013] The first router searches the extended portion of the routing information table according to the destination IP address of the second message to obtain a first search result;

[0014] If the first search result indicates that forwarding information is retrieved, the first router forwards the second message according to the retrieved forwarding information.

[0015] In some possible implementations, the method further includes:

[0016] The first router obtains the number of messages whose source IP addresses are the IP addresses in the extended part forwarding information in each received message;

[0017] The first router sorts the forwarding information in the extended part corresponding to the source IP address in descending order of the number of packets.

[0018] In some possible implementations, the method further includes:

[0019] The first router sets an aging time for the first forwarding information in the extended part of the routing information table;

[0020] When the first forwarding information is not used for more than the aging time, the first router deletes the first forwarding information from the extended part of the routing information table.

[0021] In some possible implementations, the method further includes:

[0022] The first router receives a deletion message sent by the second router, wherein the deletion message is determined by the second router when a failure occurs in the first host;

[0023] The first router deletes the first forwarding information from the extended part of the routing information table according to the IP address of the first host carried in the deletion message.

[0024] In some possible implementations, the method further includes:

[0025] The first router obtains the amount of information of the extended part of the forwarding information in the routing information table;

[0026] If the information quantity is greater than or equal to the quantity threshold, the first router deletes the forwarding information with the least number of messages from the extended part in the routing information table.

[0027] In some possible implementations, the quantity threshold is determined by the following formula:

[0028] k=(nm)×a

[0029] Among them, k is the quantity threshold, n is the maximum capacity of the routing information table of the first router, m is the occupied capacity of the routing information table of the first router, and a is a preset ratio.

[0030] In some possible implementations, the method further includes:

[0031] If the first search result representation does not retrieve the forwarding information, then the original part of the routing information representation is retrieved, and the second message is forwarded according to the retrieved forwarding information.

[0032] In a second aspect, the present application provides a message forwarding device, the device comprising:

[0033] A receiving module, configured to receive a first message, wherein the source IP address of the first message is the first IP address, the destination IP address is the second IP address, and the source MAC is the first MAC address, the first IP address is the IP address of the first host, and the second IP address is the IP address of the second host;

[0034] A sending module, configured to send a check message to the first IP address if the first IP address is not found in the ARP table entry;

[0035] an adding module, configured to add first forwarding information of the first host to the routing information table if a response message to the inspection message is received, the forwarding information including first routing information, a first next hop address and a first port, the first routing information including an IP address and mask information of the first host, the first next hop address being a first MAC address, and the first port being a port for receiving the response message; assigning the first forwarding information to an extended portion of the routing information table, wherein the extended portion of the routing information table is retrieved before the original portion of the routing information table during message forwarding;

[0036] The receiving module is further used to receive a second message;

[0037] A retrieval module, used to retrieve the extended part of the routing information table according to the destination IP address of the second message to obtain a first retrieval result;

[0038] A forwarding module is configured to forward the second message according to the retrieved forwarding information if the first search result indicates that forwarding information has been retrieved.

[0039] In a third aspect, the present application provides a computing device, including a memory and a processor;

[0040] One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as described in any one of the first aspects.

[0041] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method as described in any one of the first aspects.

[0042] It can be seen from the above technical solution that the present application has at least the following beneficial effects:

[0043] The present application discloses a message forwarding method, which can be applied to a first router. The method includes: the first router receives a first message, and then determines whether the source IP address in the first message is not hit in the ARP table item. If it is hit, a check message is sent to the source IP address. If a response message to the check message is received, the first forwarding information of the first host is added to the routing information table. The IP address of the first host is the source IP address of the first message. The first forwarding information includes the first routing information, the first next hop address and the first port of the first host. The first routing information includes the IP address and mask information of the first host. The first next hop address is the source MAC address of the first message, and the first port is the port for receiving the response message. The first router allocates the first forwarding information to the extended part of the routing information table. In the process of message forwarding, the extended part of the routing information table is retrieved before the original backup. The first router receives a second message, retrieves the extended part of the routing information table according to the destination IP address of the second message, and if the forwarding information is retrieved, the second message is forwarded according to the retrieved forwarding information.

[0044] After the first router retrieves the forwarding information in the extended part of the routing information table, it no longer continues to retrieve the remaining part of the routing information table, and directly forwards the second message according to the retrieved forwarding information, thereby reducing the addressing time, reducing the processing delay, and further reducing the network delay in the message forwarding process, thereby improving the efficiency of message forwarding.

[0045] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of features or beneficial effects means that specific technical features, technical solutions or beneficial effects are included in at least one embodiment. Therefore, the description of technical features, technical solutions or beneficial effects in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be realized without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in a specific embodiment that does not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;

[0047] Figure 2 A flowchart of a message forwarding method provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of a message forwarding device provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The terms "first", "second", "third", etc. in the specification of this application and the accompanying drawings are used to distinguish different objects rather than to limit a specific order.

[0051] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0052] like Figure 1 As shown, the figure is a schematic diagram of an application scenario provided by an embodiment of the present application.

[0053] This application scenario includes router 1, router 2 and router 3. Port 11 of router 1 is connected to port 21 of router 2, port 12 of router 1 is connected to port 31 of router 3, and port 22 of router 2 is connected to port 32 of router 3. The IP address of port 11 is 12.1.1.1 / 24, the IP address of port 21 is 12.1.1.2 / 24, the IP address of port 12 is 13.1.1.1 / 24, the IP address of port 31 is 13.1.1.2 / 24, the IP address of port 22 is 23.1.1.2 / 24, and the IP address of port 32 is 23.1.1.2 / 24. The IP address of host 1 is 192.168.1.1 / 24, the IP address of host 2 is 172.16.2.1 / 24, the IP address of host 3 is 192.168.3.1 / 16, the IP address of host 4 is 172.16.4.1 / 16, and the IP address of host 5 is 172.10.5.1 / 24.

[0054] Illustratively, the routing information table recorded in router 1 is shown in Table 1.

[0055] Table 1:

[0056] Serial number Route Type Routing information Priority cost value Next hop address Outbound interface 1 O 192.168.0.0 / 16 110 1 13.1.1.2 port2 2 O 172.16.0.0 / 16 110 1 13.1.1.2 port2 3 O 192.168.1.0 / 24 110 1 12.1.1.2 port1 4 O 172.16.2.0 / 24 110 1 12.1.1.2 port1

[0057] Each row in Table 1 represents a forwarding information, and the forwarding information may include a sequence number, a route type, route information, a priority, a cost value, a next hop address, and an outbound interface.

[0058] After receiving the message, router 1 will forward the message based on the above table 1, for example, matching the routing information in table 1 in the order of sequence number until all the routing information is traversed, and then judging which routing information has the best path through the mask information, and forwarding the message according to the best path.

[0059] For example, when host 5 accesses host 1, the message needs to be routed and forwarded on router 1. Continuing with the above example, the destination IP of the message is 192.168.1.1. When router 1 performs route addressing, it will match the routing information in table 1 one by one. When it matches 192.168.0.0 / 16, it will not forward it directly, but will continue to match and continue addressing according to the sequence number, and then it will match 192.168.1.0 / 24 until the traversal of table 1 is completed. Then router 1 will judge the advantages and disadvantages of routing information 192.168.0.0 / 16 and 192.168.1.0 / 24, and then get the best path to host 1 is routing information 192.168.1.0 / 24, and then forward the message according to the routing information.

[0060] Yes, during the addressing and forwarding process, router 1 needs to traverse the entire routing table, which takes a long time and leads to a large processing delay.

[0061] In view of this, an embodiment of the present application provides a message forwarding method, which improves the efficiency of the message in the routing addressing process, thereby reducing the processing delay of the router in processing the message, thereby improving the service quality of the message.

[0062] Specifically, the method can be applied to a first router, the first router receives a first message, and then determines whether the source IP address in the first message hits the ARP table entry, if not, sends a check message to the source IP address, if a response message to the check message is received, then adds the first forwarding information of the first host to the routing information table, the IP address of the first host is the source IP address of the first message, the first forwarding information includes the first routing information of the first host, the first next hop address and the first port, the first routing information includes the IP address and mask information of the first host, the first next hop address is the source MAC address of the first message, and the first port is the port for receiving the response message. The first router assigns the first forwarding information to the extended part of the routing information table, and in the process of message forwarding, the extended part of the routing information table is retrieved before the original backup. The first router receives a second message, retrieves the extended part of the routing information table according to the destination IP address of the second message, and if the forwarding information is retrieved, forwards the second message according to the retrieved forwarding information.

[0063] After the first router retrieves the forwarding information in the extended part of the routing information table, since the routing information in the forwarding information is determined by the IP address and the 32-bit mask information, there is no need to continue to retrieve the remaining part of the routing information table, and the second message is directly forwarded according to the retrieved forwarding information, thereby reducing the addressing time, reducing the processing delay, and then reducing the network delay in the message forwarding process, thereby improving the efficiency of message forwarding.

[0064] In order to make the technical solution of the present application clearer and easier to understand, the technical solution of the present application is described in detail below in conjunction with the accompanying drawings. Figure 2 As shown, the figure is a flow chart of a message forwarding method provided in an embodiment of the present application, which can be applied to a first router, and the method includes:

[0065] S201. A first router receives a first message.

[0066] The source IP address of the first message is the first IP address, the destination IP address is the second IP address, and the source MAC is the first MAC address. The first IP address is the IP address of the first host, and the second IP address is the IP address of the second host.

[0067] Continue to see Figure 1 , the first host may be host 1, the second host may be host 5, and the first message may be a message sent by host 1 to host 5. The first router may be router 1, and after receiving the first message sent by host 1, router 2 forwards the first message to router 1, and then router 1, that is, the first router, may receive the first message.

[0068] In some embodiments, the first router may enable the IPFIX function, thereby obtaining relevant information of the first message based on the IPFIX function. Among them, IPFIX (IP Flow Information Export) is the full name of IP data flow information export, which is a standard protocol for flow information measurement in the network published by IETF (Internet Engineering Task Force). As an important network traffic monitoring protocol, IPFIX plays an important role in network management, optimization and security detection.

[0069] S202: If the first IP address is not found in the ARP table entry, the first router sends a check message to the first IP address.

[0070] The ARP table entry is an important data structure in the ARP (Address Resolution Protocol) used to store the mapping relationship between IP addresses and MAC addresses. Based on the ARP table entry, the IP address can be quickly converted to the MAC address during network communication, thereby ensuring that the data can be correctly sent to the target device.

[0071] After the first router receives the first message, it can parse the first message to obtain the source IP address (IP address of host 1), the destination IP address (IP address of host 5) and the source MAC address (MAC address of router 2) of the first message, and then know that the first message is sent from host 1 to host 5 and forwarded by router 2. After host 5 receives the first message from host 1, there is a situation where a message is fed back to host 5. Host 5 feeds back a message to host 1, and the first router (router 1) is also required to forward the message. In order to reduce the processing delay of router 1 in the message forwarding process, the router can determine whether the source IP address (i.e., the first IP address) of the first message is hit in the ARP table after receiving the first message. If it is not hit, it is necessary to add an extended route in the routing information table of router 1, so as to facilitate router 1 to quickly address and forward. If it is hit, router 1 can forward the message sent from host 5 to host 1 based on the ARP table, so that there is no need to add an extended route in the routing information table of router 1.

[0072] When the source IP address of the first message does not match in the ARP table entry, router 1 sends a check message to the first IP address, thereby performing a reverse path check to determine whether the first IP address is reachable.

[0073] S203: If the first router receives a response message to the check message, the first router adds the first forwarding information of the first host to the routing information table.

[0074] The forwarding information includes first routing information, a first next hop address and a first port. The first routing information includes an IP address and mask information of a first host, the first next hop address is a first MAC address, and the first port is a port for receiving the response message.

[0075] If the first router receives a response message to the check message, it indicates that the first IP address is reachable; if the first router does not receive the check message, it indicates that the first IP address is unreachable.

[0076] When the first router receives a response message to the check message, the first router may add the first forwarding information of the first host to the routing information table.

[0077] Table 2 below shows a schematic table of newly added forwarding information.

[0078] Table 2:

[0079] Index number Routing information Priority Next hop address Outbound interface Aging time(s) 1 192.168.1.1 / 32 110 12.1.1.2 port11 1800

[0080] Among them, the first routing information is 192.168.1.1 / 32, which means that the IP address is 192.168.1.1, the mask information is 32 bits, the next hop address is 12.1.1.2, the outbound interface is port 11, and the aging time is 1800s.

[0081] S204: The first router distributes the first forwarding information to an extended part of the routing information table.

[0082] In the process of message forwarding, the extended part of the routing information table is retrieved before the original part of the routing information table.

[0083] The following Table 3 shows a routing information table after adding extended routing on the basis of Table 1.

[0084] Serial number Route Type Routing information Priority cost value Next hop address Outbound interface 1 ET 192.168.1.1 / 32 110 0 12.1.1.2 port11 2 O 192.168.0.0 / 16 110 1 13.1.1.2 port2 3 O 172.16.0.0 / 16 110 1 13.1.1.2 port2 4 O 192.168.1.0 / 24 110 1 12.1.1.2 port1 5 O 172.16.2.0 / 24 110 1 12.1.1.2 port1

[0085] Among them, the routing type is ET, which means that the forwarding information is newly added, and the routing type is O, which means that the forwarding information is the original dynamic learning. It can be seen from Table 3 that the forwarding information with sequence number 1 belongs to the extended part of the routing information table, and the forwarding information with sequence numbers 2-5 belongs to the original part of the routing information table. The first router allocates the forwarding information of the extended part to the front position of the routing information table, so that the forwarding information can be retrieved first. Since the forwarding information includes routing information, next hop address and outgoing interface, and the routing information includes IP address and 32-bit mask information, the optimal path sent to the IP address can be determined based on the forwarding information, and the message can be forwarded directly without the need to retrieve the remaining forwarding information in the routing information table. The optimal path is comprehensively determined, thereby shortening the addressing time, thereby reducing the processing delay of the first router and improving the service quality of the network. The cost value refers to the path overhead value, which is calculated based on the link bandwidth. The larger the link bandwidth, the smaller the cost value; under the same priority, the smaller the cost value, the better the route.

[0086] It should be noted that the above only takes router 1 recording the forwarding information of host 1 as an example for introduction. Router 1 can record the forwarding information of hosts 1-4, as shown in Table 4 below.

[0087] Table 4:

[0088] Serial number Routing information Priority Next hop Outbound interface Aging time(s) 1 192.168.1.1 / 32 110 12.1.1.2 port11 1800 2 172.168.2.1 / 32 110 12.1.1.2 port11 1800 3 192.168.3.1 / 32 110 13.1.1.2 port12 1800 4 172.168.4.1 / 32 110 13.1.1.2 port12 1800

[0089] The forwarding information corresponding to sequence number 1 is for host 1, the forwarding information corresponding to sequence number 2 is for host 2, the forwarding information corresponding to sequence number 3 is for host 3, and the forwarding information corresponding to sequence number 4 is for host 4. The forwarding information shown in Table 4 may be an extended part of the routing information table.

[0090] S205: The first router receives the second message.

[0091] After the first router expands the original routing information table, the first router receives the second message and may forward the second message according to the expanded routing information table.

[0092] S206: The first router searches the extended portion of the routing information table according to the destination IP address of the second message to obtain a first search result.

[0093] In some examples, the second message is a message sent from the second host to the first host, that is, a message sent from host 5 to host 1. The destination IP address of the second message is 192.168.1.1, and the source IP address of the second message is 172.10.5.1. After receiving the second message, router 1 can determine the destination IP address of the second message, and then preferentially search the extended part of the routing information table based on the destination IP address to obtain a first search result. The first search result includes the forwarding information corresponding to the destination IP address retrieved in the extended part, or the forwarding information corresponding to the destination IP address retrieved.

[0094] S207: If the first search result indicates that forwarding information is retrieved, the first router forwards the second message according to the retrieved forwarding information.

[0095] Referring to Table 3 above, when the destination IP address of the second message is 192.168.1.1, router 1 can retrieve the forwarding information corresponding to the destination IP address in the extended part of the routing information table, and then forward the second message according to the forwarding information. Exemplarily, after the router obtains the forwarding information, it can determine the routing information, priority, next hop address, outbound interface, and other information. Router 1 forwards the second message to the next hop address through the outbound interface.

[0096] S208: If the first search result indicates that no forwarding information is found, the first router searches the original portion of the routing information representation and forwards the second message according to the retrieved forwarding information.

[0097] If router 1 does not retrieve forwarding information in the extended part of the routing information table, the router will continue to retrieve the original part until the entire routing information table is traversed and at least one forwarding information is obtained. Then, from the at least one forwarding information, the optimal forwarding information sent to the destination IP address of the second message is determined, that is, the optimal path, and then the second message is forwarded according to the optimal path.

[0098] In some embodiments, the first router may also obtain the number of messages whose source IP addresses in each received message are the IP addresses in the extended part midway forwarding information, and then sort the forwarding information in the extended part corresponding to the source IP address in descending order of the number of messages. Subsequently, the first router may prioritize the search starting from the forwarding information with the largest number of messages according to the number of messages in the forwarding information, thereby making it easier to retrieve the corresponding forwarding information, thereby further improving the processing efficiency of the first router and reducing the processing delay of the first router.

[0099] For example, the extended part of the routing information table includes the forwarding information of host 1 and the forwarding information of host 2. Through these two forwarding information, the first router can send messages to these two hosts respectively. After receiving the message, the first router can determine which host the message comes from through the source IP address of the message, that is, the first router has a need to send a message to this source IP address. Then, the first router retrieves the source IP address in the extended part. For example, if the IP address in the forwarding information of host 1 is hit, the number of messages corresponding to the IP address of host 1 is increased by 1. After a period of time, the number of messages corresponding to the IP address of host 1 counted by the first router is 900, and the number of messages corresponding to the IP address of host 2 is 1000. The first router can put the forwarding information of host 2 in front of the forwarding information of host 1, so that the forwarding information of host 2 is retrieved before the forwarding information of host 1, thereby improving the forwarding efficiency.

[0100] The first router may reorder the forwarding information of the extended part at each preset period, and the preset period may be 30 minutes, 1 day, 1 week, 1 month, etc. For example, if the preset period is 30 minutes, after 30 minutes, the number of messages corresponding to the IP address of host 1 counted by the first router is 800, while the number of messages corresponding to the IP address of host 2 is 400. Then, the first router ranks the forwarding information of host 1 ahead of the forwarding information of host 2, so that the forwarding information of host 1 is retrieved before the forwarding information of host 2, thereby improving the forwarding efficiency.

[0101] In some embodiments, the first router may set an aging time for the first forwarding information in the extended part of the routing information table, and when the first forwarding information exceeds the aging time and is not used, the first router deletes the first forwarding information from the extended part of the routing information table. If the forwarding information in the routing information table is not used for a long time, it will not only occupy the table space, but also increase the retrieval burden, and then the forwarding information that has not been used for a long time can be deleted from the routing information table, thereby further improving the retrieval efficiency and reducing the processing delay of the first router.

[0102] In some embodiments, the first router may also receive a deletion message sent by the second router, the deletion message is determined by the second router when the first host fails, and the first router deletes the first forwarding information from the extended part of the routing information table according to the IP address of the first host carried in the deletion message, thereby no longer allowing the message to be forwarded to the first host. Because the first host fails, even if the message is forwarded to the first host, the first host cannot respond to the message normally, which not only wastes network resources, but also fails to get a normal response. After the first router prohibits forwarding messages to the first host, the waste of network resources can be reduced and the forwarding efficiency can be improved.

[0103] For example, Figure 1 As shown, the second router can be router 2, and router 2 and host 1, in the case of host 1 failure, router 2 sends a deletion message to router 1, thereby prompting router 1 to delete the forwarding information of host 1 from the extended part of the routing information table of router 1 according to the deletion message.

[0104] In some embodiments, the first router obtains the number of forwarding information in the extended part of the routing information table; if the number of information is greater than or equal to the number threshold, the first router deletes the forwarding information with the least number of messages from the extended part of the routing information table. The forwarding information with the least number of messages may be forwarding information that has not been used for a long time. If the forwarding information that has not been used for a long time has been stored in the extended part of the routing information table, it will occupy the capacity of the extended part. When the number of forwarding information in the extended part is greater than or equal to the number threshold, the forwarding information with the least number of uses is deleted, thereby providing a storage location for the subsequently added forwarding information. The number threshold may be a pre-set value or a dynamically planned value.

[0105] In some embodiments, the quantity threshold is determined by the following formula:

[0106] k=(nm)×a

[0107] Among them, k is the quantity threshold, n is the maximum capacity of the routing information table of the first router, m is the occupied capacity of the routing information table of the first router, and a is a preset ratio, for example, a=80%, and the preset ratio can be flexibly adjusted.

[0108] Based on the above description, an embodiment of the present application provides a message forwarding method, in which, after the first router retrieves the forwarding information in the extended part of the routing information table, it no longer continues to retrieve the remaining part of the routing information table, and directly forwards the second message according to the retrieved forwarding information, thereby reducing the addressing time, reducing the processing delay, and further reducing the network delay of the message forwarding process, thereby improving the efficiency of message forwarding.

[0109] Combination of the above Figure 1 to Figure 2 The message forwarding method provided in the embodiment of the present application is introduced in detail. The following will introduce the apparatus and device provided in the embodiment of the present application in conjunction with the accompanying drawings.

[0110] like Figure 3 As shown, the figure is a schematic diagram of a message forwarding device provided in an embodiment of the present application, the device comprising:

[0111] A receiving module 301 is used to receive a first message, wherein the source IP address of the first message is the first IP address, the destination IP address is the second IP address, and the source MAC is the first MAC address, the first IP address is the IP address of the first host, and the second IP address is the IP address of the second host;

[0112] A sending module 302, configured to send a check message to the first IP address if the first IP address is not found in the ARP table entry;

[0113] An adding module 303 is used to add first forwarding information of the first host in the routing information table if a response message to the check message is received, the forwarding information including first routing information, a first next hop address and a first port, the first routing information including an IP address and mask information of the first host, the first next hop address being a first MAC address, and the first port being a port for receiving the response message; assigning the first forwarding information to an extended part of the routing information table, wherein the extended part of the routing information table is retrieved before the original part of the routing information table during message forwarding;

[0114] The receiving module 301 is further configured to receive a second message;

[0115] A retrieval module 304, configured to retrieve the extended portion of the routing information table according to the destination IP address of the second message to obtain a first retrieval result;

[0116] The forwarding module 305 is configured to forward the second message according to the retrieved forwarding information if the first search result indicates that forwarding information has been retrieved.

[0117] Optionally, the device further includes an acquisition module and a sorting module;

[0118] The acquisition module is used to acquire the number of messages whose source IP addresses are the IP addresses in the extended part midway forwarding information in each received message;

[0119] The sorting module is used to sort the forwarding information in the extended part corresponding to the source IP address in the order of the number of messages from large to small.

[0120] Optionally, the device also includes a deletion module, which is used to set an aging time for the first forwarding information in the extended part of the routing information table. When the first forwarding information is not used within the aging time, the first forwarding information is deleted from the extended part of the routing information table.

[0121] Optionally, the receiving module 301 is further used to receive a deletion message sent by the second router, where the deletion message is determined by the second router when a failure occurs in the first host;

[0122] The deleting module is further configured to delete the first forwarding information from the extended portion of the routing information table according to the IP address of the first host carried in the deletion message.

[0123] Optionally, the acquisition module is further used to acquire the amount of information of the forwarding information of the extended part in the routing information table;

[0124] The deleting module is further configured to delete the forwarding information with the least number of messages from the extended part in the routing information table if the number of the information is greater than or equal to a number threshold.

[0125] Optionally, the retrieval module 304 is further configured to retrieve the original part of the routing information representation if the first retrieval result representation does not retrieve the forwarding information;

[0126] The forwarding module 305 is used to forward the second message according to the retrieved forwarding information.

[0127] The message forwarding device according to the embodiment of the present application may correspond to the method described in the embodiment of the present application, and the above-mentioned other operations and / or functions of each module / unit of the message forwarding device are respectively for realizing Figure 2 For the sake of brevity, the corresponding processes of each method in the illustrated embodiment are not described in detail here.

[0128] The present application embodiment also provides a computing device. The computing device may be a first router. Figure 4 As shown, this figure is a schematic diagram of a computing device provided in an embodiment of the present application, such as Figure 4 As shown, computing device 400 includes bus 401, processor 402, communication interface 403 and memory 404. Processor 402, memory 404 and communication interface 403 communicate with each other via bus 401.

[0129] The bus 401 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0130] The processor 402 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0131] The communication interface 403 is used for communicating with the outside.

[0132] The memory 404 may include a volatile memory, such as a random access memory (RAM). The memory 404 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0133] The memory 404 stores executable codes, and the processor 402 executes the executable codes to perform the aforementioned message forwarding method.

[0134] Specifically, in implementing Figure 3 In the case of the embodiment shown, and Figure 3 When each module or unit of the message forwarding device described in the embodiment is implemented by software, the execution Figure 3 The software or program code required for the functions of each module / unit in the system may be partially or completely stored in the memory. The processor executes the program code corresponding to each unit stored in the memory to execute the above-mentioned message forwarding method.

[0135] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned message forwarding method.

[0136] The embodiment of the present application further provides a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.

[0137] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0138] When the computer program product is executed by a computer, the computer executes any of the aforementioned message forwarding methods. The computer program product may be a software installation package, and when any of the aforementioned message forwarding methods is needed, the computer program product may be downloaded and executed on a computer.

[0139] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

[0140] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. A message forwarding method, characterized in that: Applied to a first router, the method includes: The first router receives a first message, the source IP address of the first message is the first IP address, the destination IP address is the second IP address, and the source MAC is the first MAC address, the first IP address is the IP address of the first host, and the second IP address is the IP address of the second host; If the first IP address is not found in the Address Resolution Protocol ARP table entry, the first router sends a check message to the first IP address; If the first router receives a response message to the check message, first forwarding information of the first host is added to the routing information table, where the forwarding information includes first routing information, a first next hop address, and a first port, the first routing information includes an IP address and mask information of the first host, the first next hop address is a first MAC address, and the first port is a port for receiving the response message; The first router distributes the first forwarding information to an extended portion of the routing information table, and during message forwarding, the extended portion of the routing information table is retrieved before the original portion of the routing information table; The first router receives a second message; The first router searches the extended portion of the routing information table according to the destination IP address of the second message to obtain a first search result; If the first search result indicates that forwarding information is retrieved, the first router forwards the second message according to the retrieved forwarding information.

2. The method according to claim 1, characterized in that The method further comprises: The first router obtains the number of messages whose source IP addresses are the IP addresses in the extended part forwarding information in each received message; The first router sorts the forwarding information in the extended part corresponding to the source IP address in descending order of the number of packets.

3. The method according to claim 1, characterized in that The method further comprises: The first router sets an aging time for the first forwarding information in the extended part of the routing information table; When the first forwarding information is not used for more than the aging time, the first router deletes the first forwarding information from the extended part of the routing information table.

4. The method according to claim 1, characterized in that: The method further comprises: The first router receives a deletion message sent by the second router, wherein the deletion message is determined by the second router when a failure occurs in the first host; The first router deletes the first forwarding information from the extended part of the routing information table according to the IP address of the first host carried in the deletion message.

5. The method according to claim 2, characterized in that: The method further comprises: The first router obtains the amount of information of the extended part of the forwarding information in the routing information table; If the information quantity is greater than or equal to the quantity threshold, the first router deletes the forwarding information with the least number of messages from the extended part in the routing information table.

6. The method according to claim 5, characterized in that The quantity threshold is determined by the following formula: k=(nm)×a Among them, k is the quantity threshold, n is the maximum capacity of the routing information table of the first router, m is the occupied capacity of the routing information table of the first router, and a is a preset ratio.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: If the first search result representation does not retrieve the forwarding information, then the original part of the routing information representation is retrieved, and the second message is forwarded according to the retrieved forwarding information.

8. A message forwarding device, characterized in that: The device comprises: A receiving module, configured to receive a first message, wherein the source IP address of the first message is the first IP address, the destination IP address is the second IP address, and the source MAC is the first MAC address, the first IP address is the IP address of the first host, and the second IP address is the IP address of the second host; A sending module, configured to send a check message to the first IP address if the first IP address does not hit in the ARP table entry; an adding module, configured to add first forwarding information of the first host to the routing information table if a response message to the inspection message is received, the forwarding information including first routing information, a first next hop address and a first port, the first routing information including an IP address and mask information of the first host, the first next hop address being a first MAC address, and the first port being a port for receiving the response message; assigning the first forwarding information to an extended portion of the routing information table, wherein the extended portion of the routing information table is retrieved before the original portion of the routing information table during message forwarding; The receiving module is further used to receive a second message; A retrieval module, used to retrieve the extended part of the routing information table according to the destination IP address of the second message to obtain a first retrieval result; A forwarding module is configured to forward the second message according to the retrieved forwarding information if the first search result indicates that forwarding information has been retrieved.

9. A computing device, characterized in that including memory and processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 7.