CN115834485A - Load sharing routing method and device - Google Patents

Load sharing routing method and device Download PDF

Info

Publication number
CN115834485A
CN115834485A CN202111074618.9A CN202111074618A CN115834485A CN 115834485 A CN115834485 A CN 115834485A CN 202111074618 A CN202111074618 A CN 202111074618A CN 115834485 A CN115834485 A CN 115834485A
Authority
CN
China
Prior art keywords
routing
load sharing
value
message
entry
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
CN202111074618.9A
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN202111074618.9A priority Critical patent/CN115834485A/en
Priority to PCT/CN2022/118771 priority patent/WO2023040903A1/en
Publication of CN115834485A publication Critical patent/CN115834485A/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering

Landscapes

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

Abstract

The invention discloses a load sharing and routing method and a device, wherein the load sharing and routing method comprises the following steps: the forwarding layer calculates to obtain a routing value according to the characteristic field of the user message; creating a new message routing entry in the load sharing routing table, and uploading the message routing entry to the control layer; the control layer traverses the exit link corresponding to the message routing entry and adjusts the routing value in the load sharing routing table according to the sample number of the exit link; and the forwarding layer searches and obtains the outlet forwarding information of the user message according to the routing value in the load sharing routing table. According to the scheme provided by the embodiment of the invention, a better routing value can be obtained, and the improvement of the load sharing precision is facilitated.

Description

Load sharing routing method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a load sharing routing method and apparatus.
Background
Because data flow in a network is larger and higher, requirements of users on performance such as bandwidth and time delay are higher and higher, if optimal routing forwarding is adopted, all data flows are forwarded through a single link, and high performance requirements of the bandwidth and the time delay are difficult to meet, therefore, multiple paths need to be established according to different routes, and flow data are distributed to different links for forwarding through a certain rule, so as to realize a load sharing function.
Disclosure of Invention
The present invention is directed to solve at least one of the technical problems in the prior art, and provides a load sharing routing method and apparatus, which can obtain a better routing value and is beneficial to improving the accuracy of load sharing.
In a first aspect, an embodiment of the present invention provides a load sharing routing method, which is applied to a routing device, where the routing device includes a forwarding plane and a control plane, the forwarding plane is provided with a load sharing routing table, the load sharing routing table is used to store a packet routing entry, the packet routing entry includes a feature field of a user packet and a routing value corresponding to the feature field, and the method includes:
the forwarding layer calculates to obtain a routing value according to the characteristic field of the user message;
creating a new message routing entry in the load sharing routing table, and uploading the message routing entry to the control layer;
the control layer traverses the exit link corresponding to the message routing entry, and adjusts the routing value in the load sharing routing table according to the sample number of the exit link;
and the forwarding layer searches and obtains the outlet forwarding information of the user message according to the routing value in the load sharing routing table.
In a second aspect, an embodiment of the present invention provides a load sharing routing apparatus, including a routing value calculation module located in a forwarding plane, a load sharing routing module, and a load sharing decision module located in a control plane, where:
the routing value calculation module is used for calculating a routing value according to the characteristic field of the user message;
the load sharing routing module is provided with a load sharing routing table, and the load sharing routing table stores message routing entries which comprise characteristic fields of user messages and routing values corresponding to the characteristic fields; the load sharing routing module is used for creating a new message routing entry in the load sharing routing table and sending the message routing entry to the load sharing decision module;
the load sharing decision module is used for traversing the exit link corresponding to the message routing entry and adjusting the routing value in the load sharing routing table according to the sample number of the exit link.
The embodiment of the invention comprises the following steps: a load sharing routing method and device. According to the scheme provided by the embodiment of the invention, the routing value is obtained by calculating the characteristic field of the user message through the forwarding layer, the message routing entry is generated according to the characteristic field and the corresponding routing value, the message routing entry is stored in the load sharing routing table, the message routing entry is sent to the control layer through the forwarding layer, the control layer traverses the exit link corresponding to the message routing entry, the routing value in the load sharing routing table is adjusted according to the number of samples of the exit link, the routing value is adjusted according to the actual load condition of the exit link, the forwarding layer searches according to the routing value in the load sharing routing table to obtain the exit forwarding information of the user message, and through the effective matching of the forwarding layer and the control layer, the better routing value can be finally calculated, the unbalanced condition of the user message is reduced, and the precision of load sharing is improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
The invention is further described below with reference to the drawings and examples;
FIG. 1 is a flow chart of steps of a load sharing routing method provided by an embodiment of the present invention;
FIG. 2 is a flow chart of steps of a load sharing routing method according to another embodiment of the present invention;
FIG. 3 is a flow chart of steps of a load sharing routing method provided by another embodiment of the present invention;
FIG. 4 is a flowchart illustrating steps of a load sharing routing method according to another embodiment of the present invention;
FIG. 5 is a flowchart illustrating an embodiment of a load sharing routing method according to another embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a load sharing routing device according to another embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a load sharing routing device according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of a load sharing routing device according to another embodiment of the present invention.
Detailed Description
Reference will now be made in detail to the present preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to like elements throughout.
In the description of the present invention, if there are first and second described only for the purpose of distinguishing technical features, it is not understood that relative importance is indicated or implied or that the number of indicated technical features or the precedence of the indicated technical features is implicitly indicated or implied. It should be noted that although functional blocks are partitioned in a schematic diagram of an apparatus and a logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the partitioning of blocks in the apparatus or the order in the flowchart.
In the description of the present invention, unless otherwise explicitly limited, terms such as arrangement, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific contents of the technical solutions.
The embodiments of the present invention will be further explained with reference to the drawings.
Referring to fig. 1, a first aspect of the present invention provides a load sharing routing method, which is applied to a routing device, where the routing device includes a forwarding plane and a control plane, the forwarding plane is provided with a load sharing routing table, the load sharing routing table is used to store a message routing entry, the message routing entry includes a feature field of a user message and a routing value corresponding to the feature field, and the load sharing routing method includes, but is not limited to, step S110, step S120, step S130, and step S140:
step S110: the forwarding layer calculates to obtain a routing value according to the characteristic field of the user message;
it should be noted that the user packet includes data information to be sent, so as to implement data exchange and transmission in the network system, the forwarding layer calculates a routing value according to a characteristic field of the user packet, the routing value is a parameter identifying an egress link to which the user packet is forwarded, the forwarding layer may calculate the routing value by using Cyclic Redundancy Check (CRC) for the characteristic field, or calculate by using other Hash algorithms, for example, by using a Message Digest Algorithm (Message-Digest Algorithm 5, md5) or by using a Secure Hash Algorithm 1 (Secure Hash Algorithm 1, sha-1), and a person skilled in the art has an incentive to select different Hash algorithms according to actual situations, which is not limited in this embodiment.
It is understood that the feature field may be five-tuple information, or at least one of the following parameters: the MAC Address, the IP Address, and the port number, that is, preset parameters can be selected as feature fields, so as to calculate a corresponding routing value, thereby generating a packet routing entry, where the feature fields may be based on a physical Address (Media Access Control Address, MAC Address), including but not limited to a source MAC Address + a destination MAC Address, a source MAC Address, or a destination MAC Address, or based on a logical Address (IP Address), including but not limited to a source IP Address + a destination IP Address, a source IP Address, or a destination IP Address, or based on a port number, including but not limited to a User Datagram Protocol (UDP) port number, a Transmission Control Protocol (TCP) port number, etc., a feature field set based on the source IP Address + the destination IP Address is introduced below, and a forwarding layer performs hash algorithm calculation on the feature fields to obtain a feature value, which corresponds to different egress links of a User packet, when a User switches to different services, the source IP Address or the destination IP Address in the feature fields will change, thereby obtaining different traffic flows efficiently.
Step S120: creating a new message routing entry in the load sharing routing table, and uploading the message routing entry to a control layer;
it should be noted that the message routing entry is generated according to the traffic data, when the user needs to use the traffic service, a new message routing entry is created according to the characteristic field and the corresponding routing value by obtaining the characteristic field of the user message and is stored in the load sharing routing table, and the message routing entry is sent to the control plane, and the control plane maintains the message routing entry, so that the function of deciding the routing value in the load sharing routing table can be performed, and the condition of unbalanced user message sharing is reduced.
Step S130: the control layer traverses the exit link corresponding to the message routing entry, and adjusts the routing value in the load sharing routing table according to the sample number of the exit link;
it should be noted that, after receiving the packet routing entry sent on the forwarding layer, the control layer traverses the egress links corresponding to the packet routing entry, so as to know the load sharing condition of each egress link, and adjusts the routing value in the load sharing routing table according to the number of samples of the egress link, so as to play a role in deciding the routing value in the load sharing routing table.
Step S140: and the forwarding layer searches and obtains the outlet forwarding information of the user message according to the routing value in the load sharing routing table.
It should be noted that, after the routing value in the load sharing routing table is initially generated by the forwarding layer according to the characteristic field of the user packet, the routing value is continuously adjusted by the control layer to refresh the routing value, so that the routing value in the load sharing routing table can be changed according to the actual situation of the egress link, and thus the forwarding layer can search and obtain the corresponding egress forwarding information, and can balance the user packet and allocate the user packet to different links for forwarding, so as to achieve the purpose of high-precision load sharing.
It can be understood that the forwarding layer sets a load sharing routing table, can decide the egress forwarding information of the user packet, and can forward the user packet to other egress links by actively refreshing the routing value through the control layer, so that the user packet can be forwarded more uniformly, and the requirement of sharing precision under the condition of small sample number is met.
According to the scheme provided by the embodiment of the invention, the routing value is obtained by calculating the characteristic field of the user message through the forwarding layer, the message routing entry is generated according to the characteristic field and the corresponding routing value, the message routing entry is stored in the load sharing routing table, the message routing entry is sent to the control layer through the forwarding layer, the control layer traverses the exit link corresponding to the message routing entry, the routing value in the load sharing routing table is adjusted according to the number of samples of the exit link, the routing value is adjusted according to the actual load condition of the exit link, the forwarding layer searches according to the routing value in the load sharing routing table to obtain the exit forwarding information of the user message, and through the effective matching of the forwarding layer and the control layer, the better routing value can be finally calculated, the unbalanced condition of the user message is reduced, and the precision of load sharing is improved.
In the above load sharing routing method, the step S120 of creating a new message routing entry in the load sharing routing table includes:
and searching the load sharing routing table according to the characteristic field, and if the hit cannot be searched, establishing a new message routing entry in the load sharing routing table.
Because the message routing entries are generated according to the traffic data, when the user needs to use the traffic service, the load sharing routing table is searched according to the characteristic field of the user message, when the user uses a certain traffic service for the first time, the load sharing routing table in the initial state has no corresponding message routing entry, namely, the characteristic field cannot be searched for a hit, a new message routing entry is created according to the characteristic field and the corresponding routing value and is inserted into the load sharing routing table, it can be understood that the characteristic field is an index for searching the load sharing routing table, namely, a table lookup key value, and the content of the load routing table is a routing value, so as to determine whether the hit message entry can be searched, namely, the load routing table is searched through the characteristic field to obtain a specific message routing entry, so as to obtain the corresponding routing value, if no hit is searched, the message routing entry is inserted for the first time and stored in the load sharing routing table, and as the exit link is selected through the characteristic field of the user message for forwarding, the content of the user is related to the result of the message routing value, thereby being beneficial to avoiding the situations of packet routing order, jitter, etc.
In the above load sharing and routing method, the method further includes, but is not limited to, the following steps:
when searching the load sharing routing table according to the characteristic field, if the searching is hit, directly searching and obtaining the outlet forwarding information of the user message according to the routing value in the message routing entry.
It should be noted that the characteristic field is used as an index of the load sharing routing table, which may also be referred to as a matching condition, when the forwarding layer searches the load sharing routing table according to the characteristic field, if the search fails to hit, it indicates that the user packet is a first packet of the traffic data, a new packet routing entry is created in the load sharing routing table, if the search hits, it indicates that the traffic data is a second routing device, and a corresponding matching result is obtained according to the characteristic field, i.e., a routing value stored in the load sharing routing table and corresponding to the user packet is obtained.
As shown in fig. 2, in the above load sharing routing method, the control plane is provided with a load sharing decision table; step S130 is to traverse the egress link corresponding to the packet routing entry, and adjust the routing value in the load sharing routing table according to the sample number of the egress link, including but not limited to step S210 to step S230:
step 210: receiving a message routing entry sent on a forwarding layer and storing the message routing entry to a load sharing decision table;
step 220: traversing the exit link corresponding to the message routing entry, and adjusting the routing value in the load sharing decision table according to the sample number of the exit link;
step 230: and synchronizing the routing value in the load sharing decision table to the load sharing routing table.
The control layer receives the message routing entries sent on the forwarding layer and stores the message routing entries in the load sharing decision table, and adjusts the routing values in the load sharing decision table according to the number of samples of the egress links by traversing the egress links corresponding to the message routing entries, the routing values in the load sharing decision table are refreshed at regular time and are synchronized to the load sharing routing table, so as to play a role in deciding the routing values in the load sharing routing table.
As shown in fig. 3, in the load sharing routing method, the routing values in the load sharing routing table are adjusted according to the number of samples of the egress link in step S130, which includes but is not limited to steps S310 to S340:
step S310: counting the number of samples of all the outlet links to obtain the total number of samples;
step S320: obtaining a sample number average value according to the total sample number and the number of the exit links;
step S330: calculating the difference value between the sample number of each exit link and the average value of the sample number;
step S340: and adjusting the routing value in the load sharing routing table according to the difference value.
Specifically, the control plane periodically traverses the egress links corresponding to all the packet routing entries, and performs corresponding smoothing processing according to the number of samples of the egress links, and one of the smoothing processing algorithms is introduced below, for example, there are N egress links, the corresponding number of samples is A1, A2,.. An, the number of samples of the N egress links is counted to obtain the total number of samples, i.e., the SUM of the number of samples, the average value of the number of samples is obtained according to the total number of samples and the number of egress links, the average value of the number of samples B = SUM (A1, A2.., an)/N, the difference between the number of samples of each egress link and the average value of the number of samples is calculated, the difference X = An-B, and the routing value in the load routing table is adjusted according to the difference, for example, there are 4 egress links, the number of samples of the 4 egress links is counted, the number of samples of the egress link 1, the egress link 2, the egress link 3, and the egress link 4 is 20,25,30,25, respectively, the calculated difference values of the corresponding egress links are-5, 0, +5, and 0, respectively, then the routing values in the 5 message routing entries corresponding to the egress link 3 are adjusted, and the 5 user messages allocated to the egress link 3 can be transferred to the egress link 1, so that the load sharing of each egress link is uniform, which is beneficial for solving the problem that the egress link cannot share the user message transmission in a balanced manner, improving the precision of load sharing, and ensuring the efficient forwarding of the user message, it should be noted that the control layer in the embodiment of the present invention is not limited to the algorithm for smooth processing mentioned in the above example, and other algorithms for smooth balancing can be selected, as long as the algorithm for balancing can be achieved, a person skilled in the art has a motivation to select different algorithms for smooth processing according to actual situations, this embodiment is not limited to these.
As shown in fig. 4, in the load sharing routing method, the forwarding layer is further provided with a load sharing keep-alive table for storing keep-alive entries, where the keep-alive entries include the labels of the packet routing entries and the state values of the packet routing entries; the load sharing routing method further includes, but is not limited to, step S410, step S420 and step S430:
step S410: when searching a load sharing routing table according to the characteristic field, if the searching is hit, setting the state value of the message routing entry as a first state value;
step S420: the control layer scans the load sharing keep-alive table every other first timing period and sets the state value of the message routing entry in the keep-alive entry as a second state value;
step S430: and if the state values of the message routing entries are all second state values in n continuous first timing periods, deleting the corresponding message routing entries in the load sharing routing table, wherein n is a set value.
It should be noted that the forwarding layer is provided with a load sharing keep-alive table, the table is kept alive by the forwarding layer, and is mainly responsible for keeping alive of the message routing entries of the load sharing routing table, a label in the keep-alive entry is used for indicating the corresponding message routing entry in the load sharing routing table, a state value is used for marking the use state of the message routing entry, the state value of the message routing entry in the keep-alive entry is updated according to the hit condition when the load sharing routing table is searched according to the characteristic field, for example, the state value is set to one bit, the first state value indicates hit, 1 is used as the first state value, 0 is used as the second state value, when the forwarding layer hits the load sharing routing table, setting the state value of the corresponding message routing entry to 1, in addition, scanning the load sharing keep-alive table by the control layer at intervals of a first certain time period, reading the content of the load sharing keep-alive table, setting the state value of the message routing entry to 0, where n can be a set value 3, and deleting the corresponding message routing entry in the load sharing routing table if the state value of the message routing entry in the keep-alive entry is 0 in three consecutive first certain time periods, considering that the entry can age, where it needs to be noted that n can be other set values, such as 1, 2, 4, and the like, and those skilled in the art have an incentive to adjust different set values according to actual conditions, which is not limited in this embodiment. It can be understood that, because a user may switch and select different services within a short time when using the traffic service, the storage space of the load sharing routing table is effectively large, and the control layer scans the load sharing keep-alive table at regular time and deletes aged message routing entries at regular time, so that the message routing entries which are not needed to be used can be aged, the storage space in the load sharing routing table is released, thereby being beneficial to ensuring that the capacity of the load sharing routing table does not overflow, and providing an efficient traffic service for the user.
In the above load sharing routing method, a forwarding layer is provided with a load sharing hash table, and the load sharing hash table stores egress forwarding information of an egress link; in step S140, the exit forwarding information of the user packet is obtained by searching according to the routing value in the load sharing routing table, which includes but is not limited to the following steps:
and searching the load sharing hash table according to the hash table base address and the routing value in the load sharing routing table to obtain the outlet forwarding information of the user message.
It should be noted that, the load sharing hash table stores the egress forwarding information of each egress link, where the egress forwarding information corresponds to a routing value in the load sharing routing table, and the load sharing hash table hashes according to the weight of each egress link, and a lookup key value is a hash table base address and a routing value, where the routing value is obtained by looking up a table from the load sharing routing table, and the routing value is a lookup offset of the load sharing hash table, and the egress forwarding information of the user packet is found by using the hash table base address and the routing value as index information of the load sharing hash table, so as to find the corresponding egress link.
It should be noted that the load sharing routing method according to the embodiment of the present invention achieves a better hash effect by effectively matching the control plane and the forwarding plane, and meets the effect of high-precision load sharing, which is only a preferred embodiment of the present invention and does not limit the application scenario of the present invention.
In addition, in order to describe the load sharing and routing method provided by the present invention in more detail, a technical solution of the present invention will be described below with a specific embodiment.
Referring to fig. 5, fig. 5 is a flowchart illustrating a detailed implementation of a load sharing routing method according to another embodiment of the present invention, where the load sharing routing method includes the following steps:
step S510: the forwarding layer calculates the characteristic field of the user message by using a Hash algorithm to obtain a routing value;
step S520: searching a load sharing routing table, searching a table key value as a characteristic field, judging whether the load is hit, if not, entering the step S530, otherwise, entering the step S570;
step S530: and inserting the message routing entry into a load sharing routing table, wherein the message routing entry comprises a characteristic field of the user message and a corresponding routing value.
Step S540: sending the message routing entry to a control layer, wherein the message routing entry carries a characteristic field and a routing value;
step S550: the control layer receives the message routing item sent on the forwarding layer and stores the message routing item to a load sharing decision table;
step S560, traverse the exit link corresponding to the message routing entry and adjust the routing value in the load sharing decision table, and synchronize the routing value in the load sharing decision table to the load sharing routing table;
step S570: writing a load sharing keep-alive table, hitting the load sharing routing table at each forwarding level, and updating keep-alive entries corresponding to the load sharing keep-alive table;
step S580: searching a load sharing hash table, and obtaining outlet forwarding information of the user message through a hash table base address and a routing value;
step S590: finding out the export forwarding information and forwarding the user message to the corresponding export.
As shown in fig. 6, a second aspect of the present invention provides a load sharing routing apparatus, which includes a routing value calculating module 100 located at a forwarding plane, a load sharing routing module 200, and a load sharing decision module 300 located at a control plane, wherein:
the routing value calculation module 100 is configured to calculate a routing value according to a characteristic field of a user packet;
the load sharing routing module 200 is provided with a load sharing routing table, where message routing entries are stored, where the message routing entries include a characteristic field of a user message and a routing value corresponding to the characteristic field; the load sharing routing module 200 is configured to create a new message routing entry in the load sharing routing table, and send the message routing entry to the load sharing decision module 300;
the load sharing decision module 300 is configured to traverse the egress link corresponding to the packet routing entry, and adjust the routing value in the load sharing routing table according to the sample number of the egress link.
It should be noted that the routing device is divided into a control plane and a forwarding plane, the forwarding plane is used for forwarding a decision packet for searching various hardware table entries, the forwarding chip may be a programmable device, such as a network processor and an Application Specific Integrated Circuit (ASIC), the control plane runs on a Central Processing Unit (CPU), and mainly runs a protocol to perform logic calculation and write a hardware table.
According to the scheme provided by the embodiment of the invention, the routing value calculation module 100 of the forwarding layer calculates the characteristic field of the user message to obtain the routing value, the load sharing routing module 200 is provided with a load sharing routing table, a message routing entry is generated according to the characteristic field and the corresponding routing value, the message routing entry is stored in the load sharing routing table, the message routing entry is sent to the load sharing decision module 300 of the control layer through the load sharing routing module 200, the load sharing decision module 300 traverses the exit link corresponding to the message routing entry, the routing value in the load sharing routing table is adjusted according to the sample number of the exit link, the routing value is adjusted according to the actual load condition of the exit link, the load sharing routing module 200 searches for the exit forwarding information of the user message according to the routing value in the routing table, and through the effective cooperation of the forwarding layer and the control layer, the optimal routing value can be finally calculated, the condition of the user message sharing can be reduced, and the accuracy of load sharing can be improved.
It should be noted that the characteristic field may be a source IP address, a destination IP address, a source MAC address, a destination MAC address, and other fields, and when the characteristic field changes, the routing value calculation module 100 calculates the characteristic field to obtain different routing values, which is beneficial to meeting the forwarding requirement of different service flows.
In the above load sharing routing apparatus, the load sharing routing module 200 creates a new message routing entry in the load sharing routing table, including:
and searching the load sharing routing table according to the characteristic field, and if the hit cannot be searched, establishing a new message routing entry in the load sharing routing table.
Specifically, the load sharing routing table may adopt a hash table, a table lookup key value is a characteristic field of the user packet, whether a packet routing entry is hit is judged through the characteristic field, and if the packet routing entry corresponding to the characteristic field does not exist in the initial state load sharing routing table, the packet routing entry is inserted for the first time, and the characteristic field and the corresponding routing value are stored.
In the load sharing routing device, when the load sharing routing module 200 searches the load sharing routing table according to the characteristic field, if the search is hit, the exit forwarding information of the user message is searched and obtained directly according to the routing value in the message routing entry.
It can be understood that, when the load sharing routing module 200 searches the load sharing routing table according to the characteristic field, if the search is hit, it indicates that the traffic data is to be routed again, so as to obtain a matching result corresponding to the characteristic field, that is, the routing value stored in the load sharing routing table and corresponding to the user packet is obtained, and if the subsequent packet of the traffic data enters the routing device again, the previous routing value can be directly obtained, so as to obtain the corresponding egress forwarding information, which is beneficial to ensuring efficient user packet forwarding.
In the load sharing routing device, the load sharing decision module 300 is provided with a load sharing decision table; the load sharing decision module 300 traverses the exit links corresponding to the message routing entries, and adjusts the routing values in the load sharing routing table according to the sample number of the exit links, including: receiving a message routing entry sent on a forwarding layer and storing the message routing entry to a load sharing decision table; traversing the exit link corresponding to the message routing entry, and adjusting the routing value in the load sharing decision table according to the sample number of the exit link; and synchronizing the routing value in the load sharing decision table to the load sharing routing table.
The control layer can continuously adjust the routing value in the table entry by maintaining the message routing entry in the load sharing decision table and feed back the routing value to the forwarding layer, so that the routing value in the load sharing routing table can be synchronously updated, and a better routing value can be obtained by effectively matching the control layer and the forwarding layer, thereby being beneficial to improving the load sharing precision.
In the above load sharing routing apparatus, the load sharing decision module 300 adjusts the routing value in the load sharing routing table according to the sample number of the egress link, and includes: counting the number of samples of all the outlet links to obtain the total number of samples; obtaining a sample number average value according to the total sample number and the number of the exit links; calculating the difference value between the sample number of each exit link and the average value of the sample number; and adjusting the routing value in the load sharing routing table according to the difference value.
The load sharing decision module 300 in the control plane regularly traverses the egress links corresponding to the packet routing entries, and performs corresponding smoothing processing according to the number of samples of the egress links, thereby refreshing the routing values in the load sharing routing table, that is, the user packet with the egress link with a larger number of samples can be transferred to other egress links, and the other egress links forward the user packet, which is beneficial to improving the load sharing precision and ensuring efficient forwarding of the user packet.
As shown in fig. 7, the load sharing routing apparatus further includes a load sharing keep-alive module 400 located at the forwarding layer, where the load sharing keep-alive module 400 is provided with a load sharing keep-alive table for storing keep-alive entries, and the keep-alive entries include labels of the packet routing entries and state values of the packet routing entries;
when the load sharing routing module 200 searches the load sharing routing table according to the characteristic field, if the search is hit, the state value of the message routing entry is set as a first state value;
the load sharing decision module 300 scans the load sharing keep-alive table every other first timing period, and sets the state value of the message routing entry in the keep-alive entry as a second state value; and if the state values of the message routing entries are all second state values in n continuous first timing periods, deleting the corresponding message routing entries in the load sharing routing table, wherein n is a set value.
The load sharing keep-alive module 400 is provided with a load sharing keep-alive table, and is mainly responsible for keeping alive of the message routing entries of the load sharing routing table, the hit condition of the load sharing routing table is searched according to the characteristic field in the load sharing routing module 200, the load sharing keep-alive module 400 updates the state values of the corresponding message routing entries in the keep-alive entries, if the hit condition is searched, the state values of the corresponding message routing entries in the keep-alive entries are set to be first state values, and if the state values are second state values in n continuous first time periods, and the corresponding message routing entries are indicated to be temporarily not needed to be used, the corresponding message routing entries in the load sharing routing table are deleted, so that the capacity of the load sharing routing table is favorably ensured not to overflow, and efficient traffic can be provided for users.
As shown in fig. 8, the load sharing routing apparatus further includes a load sharing hash module 500 located at a forwarding layer, where the load sharing hash module 500 is provided with a load sharing hash table, and the load sharing hash table stores egress forwarding information of an egress link; and the forwarding layer searches the load sharing hash table according to the hash table base address and the routing value in the load sharing routing table to obtain the export forwarding information of the user message.
The forwarding layer is further provided with a load sharing hash module 500, the load sharing hash table stores the egress forwarding information of each egress link, the egress forwarding information corresponds to the routing value in the load sharing routing table, the load sharing hash table hashes according to the weight of each egress link, and the lookup key value is the hash table base address and the routing value, wherein the routing value is obtained by looking up the load sharing routing table, the egress forwarding information of the user packet is found by using the hash table base address and the routing value as the load sharing hash table index information, so as to find the corresponding egress link.
It should be noted that, the load sharing routing device in the embodiment of the second aspect of the present invention is a device corresponding to the load sharing routing method in the embodiment of the first aspect, and specific technical solutions and principles may refer to the description of the load sharing routing method in the embodiment of the first aspect, and it can be understood that all the preferred embodiments mentioned in the embodiment of the first aspect are applicable to the load sharing routing device in the embodiment of the second aspect.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.

Claims (14)

1. A load sharing routing method is applied to a routing device, the routing device includes a forwarding plane and a control plane, the forwarding plane is provided with a load sharing routing table, the load sharing routing table is used for storing message routing entries, the message routing entries include a characteristic field of a user message and a routing value corresponding to the characteristic field, the method includes:
the forwarding layer calculates to obtain a routing value according to the characteristic field of the user message;
creating a new message routing entry in the load sharing routing table, and uploading the message routing entry to the control layer;
the control layer traverses the exit link corresponding to the message routing entry and adjusts the routing value in the load sharing routing table according to the sample number of the exit link;
and the forwarding layer searches and obtains the outlet forwarding information of the user message according to the routing value in the load sharing routing table.
2. The load sharing routing method of claim 1, wherein the creating a new message routing entry in the load sharing routing table comprises:
and searching the load sharing routing table according to the characteristic field, and if the load sharing routing table is not searched and hit, establishing a new message routing entry in the load sharing routing table.
3. The load sharing routing method of claim 2, further comprising:
and when the load sharing routing table is searched according to the characteristic field, if the load sharing routing table is searched for hit, directly searching for the outlet forwarding information of the user message according to the routing value in the message routing entry.
4. The load sharing routing method according to claim 1, wherein the control plane is provided with a load sharing decision table;
the traversing the exit link corresponding to the message routing entry and adjusting the routing value in the load sharing routing table according to the sample number of the exit link includes:
receiving the message routing entries sent on the forwarding layer and storing the message routing entries to the load sharing decision table;
traversing the exit link corresponding to the message routing entry, and adjusting the routing value in the load sharing decision table according to the sample number of the exit link;
and synchronizing the routing value in the load sharing decision table to the load sharing routing table.
5. The load sharing routing method of claim 1, wherein the adjusting the routing values in the load sharing routing table according to the number of samples of the egress link comprises:
counting the number of samples of all the egress links to obtain the total number of samples;
obtaining a sample number average value according to the total sample number and the number of the exit links;
calculating the difference between the number of samples of each egress link and the average value of the number of samples;
and adjusting the routing value in the load sharing routing table according to the difference value.
6. The load sharing routing method according to claim 2, wherein the forwarding layer is further provided with a load sharing keep-alive table for storing keep-alive entries, and the keep-alive entries include labels of the message routing entries and state values of the message routing entries; the method further comprises the following steps:
when the load sharing routing table is searched according to the characteristic field, if the searching is hit, the state value of the message routing entry is set as a first state value;
the control layer scans the load sharing keep-alive table at intervals of a first timing period, and sets the state value of the message routing entry in the keep-alive entry as a second state value;
and if the state values of the message routing entries are the second state values in n continuous first timing periods, deleting the corresponding message routing entries in the load sharing routing table, wherein n is a set value.
7. The load sharing routing method according to claim 1, wherein the forwarding plane is provided with a load sharing hash table, and the load sharing hash table stores egress forwarding information of an egress link;
the finding out the exit forwarding information of the user message according to the routing value in the load sharing routing table includes:
and searching the load sharing hash table according to the hash table base address and the routing value in the load sharing routing table to obtain the outlet forwarding information of the user message.
8. A load sharing routing device is characterized in that the device comprises a routing value calculation module, a load sharing routing module and a load sharing decision module, wherein the routing value calculation module, the load sharing routing module and the load sharing decision module are positioned on a forwarding layer, and the load sharing decision module is positioned on a control layer, wherein:
the routing value calculation module is used for calculating a routing value according to the characteristic field of the user message;
the load sharing routing module is provided with a load sharing routing table, and the load sharing routing table stores message routing entries which comprise characteristic fields of user messages and routing values corresponding to the characteristic fields; the load sharing routing module is used for creating a new message routing entry in the load sharing routing table and sending the message routing entry to the load sharing decision module;
the load sharing decision module is used for traversing the exit link corresponding to the message routing entry and adjusting the routing value in the load sharing routing table according to the sample number of the exit link.
9. The load sharing routing device of claim 8, wherein the creating a new message routing entry in the load sharing routing table comprises:
and searching the load sharing routing table according to the characteristic field, and if the load sharing routing table is not searched and hit, establishing a new message routing entry in the load sharing routing table.
10. The load sharing routing apparatus of claim 9, wherein when the load sharing routing module searches the load sharing routing table according to the characteristic field, if the search is hit, the load sharing routing module directly searches for the egress forwarding information of the user packet according to the routing value in the packet routing entry.
11. The load sharing routing device according to claim 8, wherein the load sharing decision module is provided with a load sharing decision table;
the traversing the exit link corresponding to the message routing entry and adjusting the routing value in the load sharing routing table according to the sample number of the exit link includes:
receiving the message routing entry sent on the forwarding layer and storing the message routing entry to the load sharing decision table;
traversing the exit link corresponding to the message routing entry, and adjusting the routing value in the load sharing decision table according to the sample number of the exit link;
and synchronizing the routing value in the load sharing decision table to the load sharing routing table.
12. The load sharing routing device of claim 8, wherein the adjusting the routing values in the load sharing routing table according to the number of samples of the egress link comprises:
counting the number of samples of all the egress links to obtain the total number of samples;
obtaining a sample number average value according to the total sample number and the number of the exit links;
calculating the difference between the number of samples of each egress link and the average value of the number of samples;
and adjusting the routing value in the load sharing routing table according to the difference value.
13. The load sharing routing device according to claim 9, further comprising a load sharing keep-alive module located at a forwarding layer, wherein the load sharing keep-alive module is provided with a load sharing keep-alive table for storing keep-alive entries, and the keep-alive entries include labels of the message routing entries and state values of the message routing entries;
when the load sharing routing module searches the load sharing routing table according to the characteristic field, if the search is hit, the state value of the message routing entry is set as a first state value;
the load sharing decision module scans the load sharing keep-alive table every other first timing period and sets the state value of the message routing entry in the keep-alive entry as a second state value; and if the state values of the message routing entries are the second state values in n continuous first timing periods, deleting the corresponding message routing entries in the load sharing routing table, wherein n is a set value.
14. The load sharing routing apparatus according to claim 8, further comprising a load sharing hash module located at a forwarding plane, wherein the load sharing hash module is provided with a load sharing hash table, and the load sharing hash table stores egress forwarding information of the egress link; and the forwarding layer searches the load sharing hash table according to the hash table base address and the routing value in the load sharing routing table to obtain the outlet forwarding information of the user message.
CN202111074618.9A 2021-09-14 2021-09-14 Load sharing routing method and device Pending CN115834485A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111074618.9A CN115834485A (en) 2021-09-14 2021-09-14 Load sharing routing method and device
PCT/CN2022/118771 WO2023040903A1 (en) 2021-09-14 2022-09-14 Load balancing routing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111074618.9A CN115834485A (en) 2021-09-14 2021-09-14 Load sharing routing method and device

Publications (1)

Publication Number Publication Date
CN115834485A true CN115834485A (en) 2023-03-21

Family

ID=85514907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111074618.9A Pending CN115834485A (en) 2021-09-14 2021-09-14 Load sharing routing method and device

Country Status (2)

Country Link
CN (1) CN115834485A (en)
WO (1) WO2023040903A1 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101184049B (en) * 2007-12-12 2010-06-16 中兴通讯股份有限公司 Dynamic load sharing method and system
CN102098224B (en) * 2011-02-16 2015-06-03 中兴通讯股份有限公司 Method and device for sharing data stream loads
US9130883B2 (en) * 2011-09-23 2015-09-08 Futurewei Technologies, Inc. Method and apparatus to increase forwarding silicon functionality through packet manipulation
CN107659505B (en) * 2017-09-27 2020-03-13 迈普通信技术股份有限公司 SDN network routing method and SDN controller

Also Published As

Publication number Publication date
WO2023040903A1 (en) 2023-03-23

Similar Documents

Publication Publication Date Title
US9705799B2 (en) Server-side load balancing using parent-child link aggregation groups
US7808971B2 (en) Routing cache for distributed hash tables
EP2214357B1 (en) Method and system for facilitating forwarding a packet in a content-centric network
EP2652924B1 (en) Synchronizing state among load balancer components
JP3717836B2 (en) Dynamic load balancer
EP2779581A1 (en) Wire-speed pending interest table
US20150280929A1 (en) Scalable ip-services enabled multicast forwarding with efficient resource utilization
US7835304B2 (en) Method and apparatus for assigning IP addresses
CN108337172A (en) Extensive OpenFlow flow table classification storage architecture and acceleration lookup method
US20080101381A1 (en) Address resolution protocol (arp) cache management methods and devices
US10320675B2 (en) System and method for routing packets in a stateless content centric network
US7224670B2 (en) Flow control in computer networks
CN111901236B (en) Method and system for optimizing openstack cloud network by using dynamic routing
Wan et al. T-cache: Dependency-free ternary rule cache for policy-based forwarding
CN113315705A (en) Flexible IP addressing method and device based on single Hash bloom filter
US6201755B1 (en) Method and system for storing and retrieving information in a communications node
Nallusamy et al. Decision Tree‐Based Entries Reduction scheme using multi‐match attributes to prevent flow table overflow in SDN environment
KR101384794B1 (en) Message routing platform
US10684960B2 (en) Managing cache memory in a network element based on costs associated with fetching missing cache entries
US7353331B2 (en) Hole-filling content addressable memory (HCAM)
Wu et al. Data lifetime enhancement for improving QoS in NDN
CN106789671B (en) Service message forwarding method and device
CN115834485A (en) Load sharing routing method and device
CN1182680C (en) Pacing synchronizing method for rout selecting information in data exchange environmemt
JP2000083055A (en) Router

Legal Events

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