CN113726907B - Routing processing method, network element equipment, device and readable storage medium - Google Patents

Routing processing method, network element equipment, device and readable storage medium Download PDF

Info

Publication number
CN113726907B
CN113726907B CN202111081924.5A CN202111081924A CN113726907B CN 113726907 B CN113726907 B CN 113726907B CN 202111081924 A CN202111081924 A CN 202111081924A CN 113726907 B CN113726907 B CN 113726907B
Authority
CN
China
Prior art keywords
address
route
node
target
network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111081924.5A
Other languages
Chinese (zh)
Other versions
CN113726907A (en
Inventor
刘真余
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111081924.5A priority Critical patent/CN113726907B/en
Publication of CN113726907A publication Critical patent/CN113726907A/en
Application granted granted Critical
Publication of CN113726907B publication Critical patent/CN113726907B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The invention discloses a routing processing method, network element equipment, a device and a readable storage medium, wherein the method comprises the following steps: acquiring a target data message carrying a target network address from a user state thread, and carrying out route inquiry on the target network address in a forwarding information table; if at least two available routes associated with the destination network address are found in the forwarding information table, obtaining the message characteristic information of the target data message; carrying out hash processing on the random salt value and the message characteristic information associated with the current gateway to obtain a hash result for carrying out route load balancing; determining a target route matched with the hash result from at least two available routes; and carrying out route forwarding on the target data message according to the target route. By adopting the invention, the route balancing load can be realized, and the communication efficiency can be improved.

Description

Routing processing method, network element equipment, device and readable storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a routing processing method, a network element device, an apparatus, and a readable storage medium.
Background
With the continuous development of communication technology, many demands which do not exist before emerge, and for the scenes of old urban areas, museums, mining plant robots, remote control and the like which are inconvenient to construct and wire and have requirements on network quality, 5G (5 th Generation Mobile Networks, fifth generation mobile communication technology) cloud is a good solution, and network quality and transmission rate can be greatly improved through the special line capacity of accessing 5G and cloud through the end side, so that the network requirements of low service time delay and high reliability are met.
Because the data message does not establish a long connection, it is forwarded by one hop and one hop, and routing is the key of the whole end-to-end network connectivity. There may be multiple routes available in the forwarding table that match the application service, which may be referred to as equivalent routes. When a large number of data messages are requested, it is important to select which equivalent route is used to complete the forwarding of the data messages. At present, for equivalent routing, balanced forwarding is generally performed according to each data message, so that more uniform load sharing can be achieved on the gateway. However, in the scene of unbalanced network organization and unbalanced time delay of the upstream and downstream networks, the data message reaches the destination through different paths, and the time delay jitter of the different paths has large difference, so that the message of the receiving party reaches disorder order, thereby influencing the communication efficiency.
Disclosure of Invention
The embodiment of the application provides a route processing method, network element equipment, a device and a readable storage medium, which can realize route balancing load and improve communication efficiency.
An aspect of an embodiment of the present application provides a routing processing method, including:
acquiring a target data message carrying a target network address from a user state thread, and carrying out route inquiry on the target network address in a forwarding information table;
if at least two available routes associated with the destination network address are found in the forwarding information table, obtaining the message characteristic information of the target data message;
carrying out hash processing on the random salt value and the message characteristic information associated with the current gateway to obtain a hash result for carrying out route load balancing;
determining a target route matched with the hash result from at least two available routes;
and carrying out route forwarding on the target data message according to the target route.
An aspect of an embodiment of the present application provides a routing processing apparatus, including:
the route inquiry module is used for acquiring a target data message carrying a target network address from the user state thread and carrying out route inquiry on the target network address in the forwarding information table;
The feature acquisition module is used for acquiring the message feature information of the target data message if at least two available routes associated with the target network address are found in the forwarding information table;
the hash module is used for carrying out hash processing on the random salt value and the message characteristic information associated with the current gateway to obtain a hash result for carrying out route load balancing;
the route determining module is used for determining a target route matched with the hash result from at least two available routes;
and the forwarding module is used for carrying out route forwarding on the target data message according to the target route.
Wherein, the characteristic acquisition module includes:
the first acquisition unit is used for acquiring a source network address and a protocol type corresponding to the target data message from message header information of the target data message;
the second acquisition unit is used for acquiring a destination physical address and a source physical address corresponding to the target data message from the Ethernet frame header information corresponding to the target data message;
and the determining unit is used for determining the destination network address, the source network address, the protocol type, the destination physical address and the source physical address as the message characteristic information of the target data message.
Wherein the hash module comprises:
the sequence generating unit is used for generating a random input sequence according to the random salt value and the message characteristic information associated with the current gateway;
the filling unit is used for filling the random input sequence based on the length of the random input sequence to obtain a sequence to be processed with a standard length;
and the cyclic shift unit is used for carrying out cyclic shift processing on the sequence to be processed to obtain a hash result for carrying out route load balancing.
Wherein, the route determination module includes:
the remainder determining unit is used for converting the hash result into an offset value, and performing remainder operation on the offset value and the total number of the routes of at least two available routes to obtain a target remainder;
and the route selection unit is used for acquiring routes corresponding to the target remainder from at least two available routes and determining the routes corresponding to the target remainder as target routes matched with the hash result.
Wherein, the above-mentioned route processing device still includes:
the route table acquisition module is used for acquiring the route information table if the available route associated with the destination network address is not found in the forwarding information table; the routing information table includes a dictionary tree for storing network addresses and available routes associated with the network addresses;
The hierarchical query module is used for performing hierarchical query processing on the dictionary tree to obtain an available route associated with the destination network address;
a forwarding table updating module, configured to update a forwarding information table according to an available route associated with a destination network address, to obtain an updated forwarding information table;
and the updating query module is used for carrying out routing query on the destination network address in the updating forwarding information table.
Wherein, hierarchical query module includes:
the network segment determining unit is used for performing AND operation on the destination network address and the k-th wheel network mask in the k-th round of inquiry processing to obtain a k-th round of network segment address; k is a positive integer; the number of mask bits of the kth wheel net mask is the difference between the longest mask bit and (k-1);
the inquiring unit is used for inquiring the dictionary tree according to the network segment address of the kth round;
the processing unit is used for stopping the query processing if the next-hop gateway address corresponding to the network segment address of the kth round is queried in the dictionary tree, and determining an available route associated with the destination network address according to the next-hop gateway address;
and the processing unit is also used for executing the k+1 round of query processing if the next hop gateway address corresponding to the network segment address of the k round is not queried in the dictionary tree.
The number of node layers of the dictionary tree is N; n is a positive integer;
a query unit comprising:
the dividing subunit is used for dividing the network segment address of the kth round to obtain N node addresses;
the traversing subunit is used for traversing the dictionary tree by N layers of nodes according to N node addresses to obtain leaf nodes of the network segment addresses of the kth round in the dictionary tree;
an address determining subunit, configured to determine, if a next-hop gateway address is mapped to a leaf node corresponding to the network segment address of the kth round, find the next-hop gateway address corresponding to the network segment address of the kth round in the dictionary tree;
the address determining subunit is further configured to determine that the next-hop gateway address corresponding to the network segment address of the kth round is not found in the dictionary tree if the next-hop gateway address is not mapped in the leaf node corresponding to the network segment address of the kth round.
Wherein the available routes associated with the destination network address include available routes respectively corresponding to at least two route discovery protocols;
a forwarding table update module comprising:
a protocol determining unit, configured to obtain, from at least two route discovery protocols, a route discovery protocol with a highest priority as an optimal route discovery protocol;
A route acquisition unit configured to acquire, from available routes associated with the destination network address, an available route corresponding to an optimal route discovery protocol as an optimal available route;
and the forwarding table updating unit is used for adding the destination network address and the optimal available route into the forwarding information table to obtain an updated forwarding information table.
Wherein, the above-mentioned route processing device still includes:
the route discovery module is used for acquiring the newly-added network address and the available route related to the newly-added network address based on the route discovery protocol; the available routes include the next hop gateway address;
the node address determining module is used for dividing the node address of the newly added network address according to the number N of dictionary layers of the dictionary tree included in the routing information table to obtain N node addresses with sequence relations corresponding to the network address; n is a positive integer;
the dictionary tree updating module is used for updating the dictionary tree according to the N node addresses to obtain an updated dictionary tree; the updated dictionary tree includes leaf nodes corresponding to the newly added network address; the leaf node corresponding to the newly added network address contains the last node address in the N node addresses;
and the association storage module is used for storing the next hop gateway address and the leaf node corresponding to the newly added network address in association with the routing information table.
Wherein, dictionary tree update module includes:
the node traversing unit is used for traversing the target node set of the ith layer of the dictionary tree according to the ith node address in the N node addresses; i is a positive integer less than N; when i is 1, the nodes in the target node set have a connection relationship with the root node of the dictionary tree; when i is not 1, the nodes in the target node set have a connection relationship with the nodes containing the i-1 node addresses in the target node set of the i-1 layer;
the traversal judging unit is used for traversing the target node set in the (i+1) th layer of the dictionary tree according to the (i+1) th node address in the N node addresses if the target node set in the (i) th layer of the dictionary tree is traversed to the node containing the (i) th node address;
the traversal judging unit is further configured to, if the node containing the ith node address is not traversed to the target node set of the ith layer of the dictionary tree, create a new node containing the ith node address, add the new node containing the ith node address to the target node set of the ith layer of the dictionary tree, and continue traversing the target node set of the ith+1 layer of the updated dictionary tree according to the ith+1 node address in the N node addresses;
And the updating unit is used for acquiring the updated dictionary tree when traversing to the node corresponding to the address containing the N node in the target node set in the N layer or adding the newly added node corresponding to the address containing the N node in the target node set in the N layer.
In one aspect, an embodiment of the present application provides a network element device, including: a processor, a memory, a network interface;
the processor is connected to the memory and the network interface, where the network interface is used to provide a data communication network element, the memory is used to store a computer program, and the processor is used to call the computer program to make the network element device execute the method in the embodiment of the present application.
In one aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored therein, the computer program being adapted to be loaded by a processor and to perform a method according to embodiments of the present application.
In one aspect, the embodiments of the present application provide a computer program product or a computer program, where the computer program product or the computer program includes computer instructions, where the computer instructions are stored in a computer readable storage medium, and where a processor of a network element device reads the computer instructions from the computer readable storage medium, and where the processor executes the computer instructions, so that the network element device performs a method in an embodiment of the present application.
In the embodiment of the application, a target data message carrying a target network address is acquired from a user mode thread, and the target network address is subjected to route inquiry in a forwarding information table; if at least two available routes associated with the destination network address are found in the forwarding information table, obtaining the message characteristic information of the target data message; carrying out hash processing on the random salt value and the message characteristic information associated with the current gateway to obtain a hash result for carrying out route load balancing; determining a target route matched with the hash result from at least two available routes; and carrying out route forwarding on the target data message according to the target route. By adopting the method provided by the embodiment of the application, the same routing node can distribute the data messages with the same characteristics to the same route, so that when the data messages reach a destination through different routes, a receiving party can receive out-of-order messages because of larger time delay jitter differences of different routes, and the communication efficiency is improved; and meanwhile, the route selection is adjusted through the random salt value associated with the current gateway, so that the data messages with different message characteristics can be routed to different routing nodes with higher probability, and the load balancing in the whole routing process is realized.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a network architecture according to an embodiment of the present application;
fig. 2a is a schematic diagram of a scenario of a routing process provided in an embodiment of the present application;
fig. 2b is a schematic diagram of a routing process according to an embodiment of the present application;
fig. 3 is a schematic flow chart of a routing processing method provided in an embodiment of the present application;
FIG. 4 is a schematic flow chart of a route hash matching according to an embodiment of the present application;
fig. 5 is a schematic flow chart of a routing processing method provided in an embodiment of the present application;
FIG. 6a is a schematic diagram of a four-layer dictionary tree structure according to an embodiment of the present application;
FIG. 6b is a schematic diagram of a three-layer dictionary tree structure according to an embodiment of the present application;
fig. 7 is a schematic diagram of forwarding information table update according to an embodiment of the present application;
Fig. 8 is a schematic structural diagram of a network element device provided in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a network element device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Specifically, referring to fig. 1, fig. 1 is a schematic structural diagram of a network architecture according to an embodiment of the present application. As shown in fig. 1, the network architecture may include an application server cluster, a base station 4000a, a gateway 4000b, and a terminal device cluster. Wherein the application server cluster may in particular comprise one or more application servers, the number of application servers in the application server cluster will not be limited here. As shown in fig. 1, the plurality of application servers may specifically include an application server 2000a, application servers 2000b, …, and an application server 2000n, where the application server 2000a, the application servers 2000b, …, and the application server 2000n may respectively make dedicated connection with the gateway 4000b, so that each application server may perform data interaction with the gateway 4000b through the dedicated connection.
It can be understood that the application servers in the application server cluster may be independent physical servers, or may be a server cluster or a distributed system formed by a plurality of physical servers, or may be cloud servers that provide cloud databases, cloud services, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligence platforms, and the like.
It is to be understood that the network architecture may be applied in a service scenario supporting edge computing (i.e., mobile edge computing, mobile Edge Computing, abbreviated as MEC), and the application servers in the application server cluster may be edge application servers in edge computing. The edge computing refers to a platform integrating network, computing storage and application core capabilities on the network edge side close to a subject or data source, and provides edge intelligent service nearby, so that key requirements of industry digitization in aspects of agile connection, real-time service, data optimization, application intelligent security, privacy protection and the like are met. Edge computing enables operators and third party services to host close to the access point of the terminal device, enabling efficient service delivery by reducing end-to-end delay and load on the transport network.
The fifth generation mobile communication technology (5 th Generation Mobile Networks, fifth generation mobile communication technology, abbreviated as 5G) is a new generation broadband mobile communication technology with high speed, low time delay and large connection characteristics, and is a network infrastructure for realizing man-machine object interconnection. In the application scenario of 5G, the peak rate of 5G service usually exceeds 10Gbps, and the bandwidth requirement is up to several tens of Gbps, so that huge pressure is caused on wireless mid-transmission and backhaul mobile networks. Therefore, the 5G service requirement needs to sink the service to the network edge as much as possible to realize local offloading of the service, and reduce network delay caused by network transmission and multi-stage service forwarding.
The terminal device cluster may specifically include one or more terminal devices (UE), and the number of terminal devices in the terminal device cluster will not be limited herein. As shown in fig. 1, the plurality of terminal devices may specifically include a terminal device 3000a, terminal devices 3000b, …, and a terminal device 3000m, where the terminal device 3000a, the terminal devices 3000b, …, and the terminal device 3000m may respectively perform a communication connection with the base station 4000a through a 5G transmission manner, so that each terminal device may perform data interaction with the base station 4000a through the communication connection.
It is understood that the terminal devices in the terminal device cluster may include terminal application products in the fields of civil, commercial, industrial, military, etc., such as smart phones, tablet computers, notebook computers, palm computers, mobile internet devices (mobile internet device, MID), wearable devices (e.g., smart watches, smart bracelets, etc.), smart computers, smart vehicles, smart homes, unmanned aerial vehicles, ATM machines, cameras, traffic lights, generators, or various types of sensors, etc. It should be understood that each terminal device in the terminal device cluster shown in fig. 1 may be integrally installed with an application client (i.e., an application program), and when the application client runs in each terminal device, data interaction may be performed between the application server in the application server cluster shown in fig. 1 and the application server through the base station 4000a and the gateway 4000b, respectively. The application client may specifically include: vehicle clients, smart home clients, entertainment clients (e.g., game clients), multimedia clients (e.g., video clients), social clients, and information-based clients (e.g., news clients), etc.
The number of the base stations corresponding to the base station 4000a may be plural, the plural base stations may be responsible for access and management of the terminal device on the wireless side, different terminal devices may correspond to different base stations, different terminal devices may also correspond to the same base station, and the base station corresponding to each terminal device is not limited herein, and here, the base station corresponding to each terminal device is exemplified as the base station 4000 a.
The gateway 4000b may be a Core Network element ("Network element" may also be referred to as "Network function") in a 5G Core Network (5G Core, which may be simply referred to as 5 GC), where the gateway 4000b may be a UPF (User Plane Function ) in the Core Network element, and the 5G UPF may be responsible for Data routing and forwarding of a Control Plane (i.e., control Plane, CP) and a user Plane (i.e., data Plane, DP) and may be interconnected with an external Data Network (Data Network), such as an operator service, the internet, or a third party service, etc.
It will be appreciated that base station 4000a may establish a "control plane" connection (i.e., control plane) between a terminal device (e.g., terminal device 3000 a) and gateway 4000b, which control plane may be used to forward signaling messages between the two, including handset authentication, registration, mobility management, etc.; the base station may establish a "user plane" connection (i.e., a data plane) between terminal device 3000a and gateway 4000b that may be used to forward user data traffic therebetween. The control plane and the user plane are thoroughly separated, and the gateway 4000b can be distributed and deployed at the edge closer to the user side together with edge calculation, so that network delay can be reduced.
It should be understood that under a 5G network, assuming that a certain terminal device (for example, the terminal device 3000 a) wants to access a data network outside the mobile communication network, the terminal device 3000a may initiate an access request, forward the access request to the base station 4000a, and the base station 4000a may forward a traffic flow requested by the terminal device 3000a to the gateway 4000b in the 5G core network, and then forward the traffic flow through the gateway 4000b and then send the traffic flow to the external data network.
Among other things, edge computation may be employed to meet different business needs in order to achieve more efficient service delivery. It should be noted that, in the edge computing scenario, one application service may be provided by a plurality of edge application servers (e.g., application server 2000a, application servers 2000b, …, application server 2000n shown in fig. 1) that are typically deployed at different sites. To route traffic of an application (e.g., application Y) to an edge application server, the end device needs to know the IP address (Internet Protocol Address) of the edge application server that serves the application Y, the end device can discover to obtain the IP address (e.g., IP address 1) of the appropriate edge application server (e.g., the one closest to the end device (e.g., application server 2000 a)) so that traffic can be routed to the edge application server by gateway 4000b, and service delays, traffic routing paths, and user service experience can be optimized. Based on this, edge application server discovery is the process by which the terminal device looks up the IP address of the appropriate edge application server using the domain name system. Among them, the domain name system (DNS, domain Name Server) is a service of the internet, which serves as a distributed database mapping domain names and IP addresses to each other, enabling users to access the internet more conveniently.
As shown in fig. 1, after the terminal device discovers that the IP address 1 of the application server 2000a corresponding to the application Y is obtained through the edge application server, the data packet generated by running the application Y will carry the IP address 1. The data message is forwarded to gateway 4000b. It should be noted that, when the gateway 4000b and the application server 2000a are not in the same network or far away from each other, the transmission of the data packet does not establish a long connection, and needs to be forwarded by one hop and one hop, in other words, there may be multiple gateways (not shown in the figure) between the gateway 4000b and the application server 2000a, and the data packet may be forwarded from one gateway to another gateway, then forwarded by another gateway, and finally forwarded to the application server 2000a. Therefore, after obtaining the data packet carrying the IP address 1, the gateway 4000b selects an appropriate route according to the IP address 1 to route and forward the data packet, that is, forwards the data packet to the next-hop gateway according to the next-hop gateway address included in the route, and then the next-hop gateway continues to select an appropriate route according to the IP address 1 to route and forward the data packet, so that the data packet can finally reach the edge application server 2000a corresponding to the IP address 1.
The gateway may have a plurality of available routes when performing route query according to the network address (i.e., the IP address), and when the number of available routes acquired by the gateway is at least two, the gateway may help to select a target route by considering load balancing through a random salt value, and then forward a data packet according to the target route. For ease of understanding, please refer to fig. 2 a-2 b together, fig. 2 a-2 b are schematic diagrams of a routing process according to an embodiment of the present application. The terminal device 20 shown in fig. 2a may be any terminal device in the terminal device cluster in the embodiment corresponding to fig. 1, for example, the terminal device 20 may be the terminal device 3000a; the gateway 21 shown in fig. 2a is a gateway to which the terminal device 20 is directly connected, that is, all data messages of the terminal device are sent to the gateway 21, and the gateway 21 may be the gateway 4000b in the embodiment corresponding to fig. 1; the gateway 22, the gateway 23, and the gateway 24 shown in fig. 2a may be the gateways that help to forward the data message when the data message communication is performed between the gateway 4000b and the application server in fig. 1; the application server 26 shown in fig. 2a may be any application server in the application server cluster in the embodiment corresponding to fig. 1, for example, the application server 26 may be the application server 2000a.
As shown in fig. 2a, the terminal device 20 may integrate and install an application Y, and when the terminal device 20 starts the application Y, the network address of the application server 26 corresponding to the application Y may be found to be IP1 through the edge application server. The network address IP1 is then carried in the data message generated by the terminal device 20 running the application Y. As shown in fig. 2a, the data packet carrying the network address IP1 arrives at the application server 26 from the terminal device 20, three paths can be implemented, the first path is the terminal device 20, the gateway 21, the gateway 22, the gateway 25, the application server 26, the second path is the terminal device 20, the gateway 21, the gateway 22, the gateway 24, the application server 26, and the third path is the terminal device 20, the gateway 21, the gateway 23, the gateway 24, and the application server 26. The data message may pass through any of the three paths described above from the terminal device 20 to the application server 26. However, it will be appreciated that, since the data packet is forwarded hop-by-hop, in practice, for a single gateway, only the target route for the data packet needs to be determined, where the target route includes the next-hop gateway address, and the gateway may decide to forward the data packet to the gateway corresponding to the next-hop gateway address according to the target route. Taking gateway 21 as an example, gateway 21 only care whether to forward the data message to gateway 22 or gateway 23, assuming gateway 21 forwards the data message to gateway 22 according to the target route, then gateway 22 proceeds to decide whether to forward the data message to gateway 24 or gateway 25.
Further, the gateway 21 determines the target route of the data packet, and forwards the data packet according to the target route, which is described with reference to fig. 2b. As shown in fig. 2b, the gateway 21 receives the data packet 200 carrying the network address IP1 sent by the terminal device 20, and the gateway 21 performs a routing query on the network address IP1 in the forwarding information table 210. The forwarding information table 210 includes a plurality of forwarding entries, each of which specifies a certain network address to be reached, a port through which the forwarding information needs to pass, and a next hop network address. Through the traversal query of the forwarding information table 210, the gateway 21 obtains an available route 1 and an available route 2, wherein the available route 1 corresponds to a forwarding table entry 1 in the forwarding information table 210, which indicates that the network address IP1 is reached, and the gateway 21 needs to forward the data packet from the port 1 to a next-hop gateway corresponding to the next-hop network address IP 2; the available route 2 corresponds to forwarding entry 2 in forwarding information table 210, indicating that network address IP1 is reached, and gateway 21 needs to forward data packet 200 from port 2 to the next-hop gateway corresponding to next-hop network address IP 3. The gateway 21 finds at least two available routes in the forwarding information table 210, at this time, the gateway 21 obtains the random salt value 220 associated with the message feature information and the gateway 21, and then hashes the message feature information and the random salt value 220 to obtain a hash result 230 for performing route load balancing. The message characteristic information refers to characteristic information of the data message 200, such as address information, used protocol information, and the like. Wherein the hashing process is used to convert the data into a random output having a particular size. The random salt 220 is a specific string, when the original data is hashed, the random salt 220 is randomly inserted into the original data, and the obtained hash result 230 is different from the hash result of the original data, that is, the hash result of the message characteristic information can be adjusted by the random salt. After obtaining the hash result 230, the gateway 21 selects a target route matching the hash result, and if the target route matching the hash result 230 is the available route 1, the gateway 21 forwards the data packet 200 according to the available route 1, that is, forwards the data packet 200 from the port 1 to the next-hop gateway corresponding to the next-hop network address IP 2. It can be understood that the hash results corresponding to the data messages with the same message characteristic information are the same, so that the gateway 21 can distribute the data messages with the same message characteristic information to the fixed next-hop gateway, and the problem of disorder of the receiving end can be avoided. Alternatively, when gateway 21 finds only one available route in forwarding information table 210, data packet 200 may be routed directly based on the found available route.
In a possible embodiment, the random salt values associated with different gateways may be different, so that when the different gateways hash the message feature information of the same data message according to their own random salt values, the obtained hash results are different. In addition, when the message characteristic information of the plurality of data messages is hashed, the added random salt values are different, and the obtained hash results may have great difference, so that even when the current gateway performs the hash processing, the obtained hash result matching routes of the plurality of data messages with different message characteristics are the same, when the next-hop gateway performs the hash processing, the random salt values of the next-hop gateway are different from the random salt values of the current gateway, the hash result matching routes corresponding to the plurality of data messages with different message characteristics are not the same any more, and therefore the data message split is realized, and the load balance of the routes of the data messages in the whole network is realized. For example, the gateway 21 associates the random salt value a, the gateway 21 receives the data message a and the data message b, the gateway 21 hashes the data message a and the data message b respectively through the random salt value a, the hash result corresponding to the data message a and the hash result corresponding to the data message b may be similar, and all the data messages a and the data message b may be forwarded to the gateway 22 by the gateway 21 as the available route matching of the gateway 22 with the next hop gateway; the gateway 22 is associated with a random salt value B, and since the random salt value a and the random salt value B are different, after the gateway 22 hashes the data packet a and the data packet B respectively through the random salt value B, the obtained hash result corresponding to the data packet a and the hash result corresponding to the data packet B may have a great difference, the hash result corresponding to the data packet a may be that the next hop gateway is an available route match of the gateway 24, the hash result corresponding to the data packet B may be that the next hop gateway is an available route match of the gateway 25, the gateway 22 forwards the data packet a to the gateway 24, and forwards the data packet B to the gateway 25. It can be understood that when the data messages with different message characteristics are hashed, because the added random salt values are different, the hash degree is very different, so that even if a certain gateway routes a plurality of data messages to the same next-hop gateway, when the next-hop gateway routes a plurality of data messages, the data messages can still be shunted to different gateways with high probability, thereby balancing the traffic load in the whole network.
Alternatively, multiple gateways in the same hop may be respectively associated with the same random salt value, or may be respectively associated with different random salt values, where the random salt values may be directly set in each gateway.
Optionally, when the situation of uneven load occurs, the random salt value associated with the currently set gateway can be further adjusted, and the whole routing process can be ensured to be balanced as much as possible through the adjusted random salt value.
Further, referring to fig. 3, fig. 3 is a flow chart of a routing processing method according to an embodiment of the present application, where the method may be performed by a network element device (for example, the gateway 4000b shown in fig. 1). As shown in fig. 3, the routing processing method at least includes the following steps S101 to S105:
step S101, obtaining a target data message carrying a target network address in a user mode thread, and carrying out route inquiry on the target network address in a forwarding information table.
Specifically, a Linux (an operating system) memory space may be divided into a kernel space corresponding to a kernel mode and a user space corresponding to a user mode. The network element device may place the routing protocol from Linux kernel protocol layer resolution into user space. The network element device can process the data message and the route in the user space, so that the searching and matching of the route can be performed in the user mode, frequent context switching can be avoided, and the processing efficiency of the message data can be improved.
Specifically, the destination network address may be an IP address, i.e., an internet protocol address, which is a unified address format provided by the IP protocol, and assigns a logical address to each network and each host on the internet, so as to mask the difference of physical addresses.
Specifically, the forwarding information table (Forwarding Info Base, FIB) includes network addresses and available routes associated with the network addresses, such as the forwarding information table 210 shown in fig. 2 b. When the network element device performs route inquiry on the destination network address, the network element device firstly traverses in the forwarding information table to confirm whether available routes associated with the destination network address are stored in the forwarding information table.
Step S102, if at least two available routes associated with the destination network address are found in the forwarding information table, the message characteristic information of the target data message is obtained.
In particular, there may be multiple paths from the network element device to the destination network address, and thus multiple available routes associated with the destination network address may be stored in the forwarding information table. If the network element device finds at least two available routes associated with the destination network address in the forwarding information table, the network element device may select one available route from the at least two available routes as a target route according to the message characteristics of the data message. Therefore, the network element device will first acquire the message characteristic information of the target data message.
Specifically, the message characteristic information may include a destination network address, a source network address, a protocol type, a destination physical address, and a source physical address, and the source of obtaining the message characteristic information may be adjusted according to actual situations, which is only illustrated by taking the message characteristic information including the above five information as an example. Wherein, the source network address refers to the IP address of the computer equipment generating the data message; the source physical address refers to the physical address of the computer device that generated the data message, i.e., the media access control address (Media Access Control Address, MAC); the destination network address refers to the IP address of the computer equipment to be accessed by the computer equipment generating the data message; the destination physical address refers to the MAC address of the computer equipment to be accessed by the computer equipment generating the data message; the protocol type is a protocol type of the data packet, such as ICMP (Internet Control Message Protocol ) protocol, TCP (Transmission Control Protocol, transmission control protocol) protocol, UDP (User Datagram Protocol ) protocol, and the like. Wherein the MAC address is applied at the data link layer, and the data link layer protocol can transfer data from one node to another node of the same link through the MAC address of the node; the IP address is applied at the network layer, and the network layer protocol allows data to be transferred from one network to another.
Specifically, the implementation process of the network element device to obtain the message characteristic information of the target data message may be: acquiring a source network address and a protocol type corresponding to the target data message from message header information of the target data message; acquiring a destination physical address and a source physical address corresponding to the target data message from Ethernet frame header information corresponding to the target data message; and determining the destination network address, the source network address, the protocol type, the destination physical address and the source physical address as message characteristic information of the target data message. Wherein the data message comprises message header information and message data information, wherein the message header information generally comprises various control information added for correctly transmitting data, such as protocol type identification, destination IP address, source IP address and the like; the message data information includes data to be transmitted by the protocol. The protocol type identifiers corresponding to different protocol types are different, and the protocol type of the data message can be determined through the protocol type identifiers. The Ethernet frame is a link layer protocol data unit obtained after the data message is encapsulated, so that the data in the data message can be transmitted in a data link layer; the header information of the ethernet frame includes a destination physical address and a source physical address.
Step S103, hash processing is carried out on the random salt value associated with the current gateway and the message characteristic information, and a hash result for carrying out route load balancing is obtained.
Specifically, the current gateway refers to network element equipment executing the routing processing method, and the network element equipment corresponds to a random salt value, namely a section of specific character string value. The network element equipment can generate a random input sequence according to the corresponding random salt value and the message characteristic information; then filling the random input sequence based on the length of the random input sequence to obtain a sequence to be processed with a standard length; and finally, performing cyclic offset processing on the sequence to be processed to obtain a hash result for carrying out route load balancing. The process of generating the random input sequence according to the corresponding random salt value and the message characteristic information can be as follows: and inserting the random salt value into a certain specific position in the message characteristic information, and sequentially converting the message characteristic information inserted with the random salt value into a binary sequence to obtain a random input sequence. The process of filling the random input sequence based on the length of the random input sequence to obtain the sequence to be processed with the standard length may be: firstly determining the length of a random input sequence, converting the length of the random input sequence into binary sequence representation, filling the random input sequence, and if the length of the random input sequence after filling the binary sequence corresponding to the length is smaller than the standard length, filling between the random input sequence and the binary sequence corresponding to the length of the random input sequence, wherein the first bit filled behind the random input sequence is 1, and the rest is 0, and the filled random input sequence is the sequence to be processed with the standard length. Wherein the standard length may be a multiple of 512 bits (bits); the length of the binary sequence corresponding to the length of the random input sequence is 64 bits. The process of performing cyclic offset processing on the sequence to be processed to obtain a hash result for performing route load balancing may be: grouping the sequence to be processed according to the standard length to obtain m groups, wherein m is a positive integer; and then, carrying out 4 rounds of transformation on each group, calculating by taking 4 constants as initial variables, re-outputting 4 variables, carrying out operation on the next group by taking the 4 variables, and outputting the 4 variables from low to high according to the order of addresses to obtain a hash result if the 4 variables are the last group. Wherein, the 4 constants may be a=0x67452301, b=0x0efcdab89, c=0x98badcfe, d=0x 10325476, which need to be converted into a binary sequence before operation; thus, the resulting hash result is a 128-bit binary sequence.
In particular, the random salt value associated with the current gateway may be different from the random salt value associated with the next hop gateway. The random salt values associated with other gateways that are on the same hop as the current gateway may be the same or different than the random salt values associated with the current gateway. In order to implement communication between a terminal device cluster (for example, the terminal device cluster shown in fig. 1 and an application server cluster (for example, the application server cluster shown in fig. 1) in the foregoing), a plurality of network element devices are typically deployed in the network, so as to implement forwarding, by a one-hop and one-hop manner, a data packet generated by a sender to a receiving method, where the sender may be any one of the terminal devices in the terminal device cluster or any one of the application servers in the application server cluster and the receiver may be any one of the application servers in the application server cluster or any one of the terminal devices in the terminal device cluster. It should be noted that, the random salt values associated with different network element devices are different, because the hash processing is performed by adopting different random salt values and the message characteristic information of the same data message, the influence degree on the hash result is different; when the same random salt value is adopted to carry out hash processing on the message characteristic information of different data messages, the influence degree of the random salt value on the hash result is different. For example, the data packet a arrives at the network element device 1 associated with the random salt value a, the network element device 1 hashes the packet feature information of the data packet a, the offset value corresponding to the obtained hash result is assumed to be 1, then the network element device 1 selects the target route according to the offset value to forward the data packet a to the network element device 2 associated with the random salt value b, the network element device 2 hashes the packet feature information of the data packet a, the offset value corresponding to the obtained hash result may be 2, and the offset value corresponding to the hash result obtained by the network element device 1 is different, because the influence degree of different random salt values on the hash processing of the data packet of the same packet feature information is different. In addition, it is assumed that the data packet B also reaches the network element device 1, where the packet characteristic information of the data packet B and the packet characteristic information of the data packet a are different, after the network element device 1 hashes the packet characteristic information of the data packet B, the offset value corresponding to the obtained hash result is assumed to be 1, and the network element device forwards the data packet B to the network element device 2. The network element device 2 hashes the characteristic information of the data message B, and the offset value corresponding to the obtained hash result may be 3, because the same random salt value affects different degrees of the hash processing of the data messages of different characteristic information of the data message. In short, the random salt values associated with the network element devices in the network are different, so that the network element devices can better disperse a large number of data messages to different network element devices when forwarding the data messages, and load balancing of the network is realized.
Step S104, determining a target route matched with the hash result from the at least two available routes.
Specifically, the network element device may convert the hash result into an offset value, and perform remainder operation on the offset value and the total number of routes of at least two available routes to obtain a target remainder; and acquiring routes corresponding to the target remainder from at least two available routes, and determining the routes corresponding to the target remainder as target routes matched with the hash result. As can be seen from the above, the hash result is a 128-bit binary sequence, so that the hash result can be converted into a decimal offset value, and assuming that the offset value obtained after the decimal conversion is 327, the total number of routes of at least two available routes is 4, and the remainder operation is performed by 327 and 4, so that the target remainder is 3. It can be understood that the total number of routes is 4, the value of the target remainder may be any of 0,1,2, and 3, each possible remainder corresponds to an available route, and the target remainder is which possible remainder, i.e. which possible remainder corresponds to the available route is selected. And if the target remainder is 3, the target route matched with the hash result is an available route corresponding to 3.
Step S105, performing route forwarding on the target data packet according to the target route.
Specifically, according to the target route, the network element device may perform route forwarding on the target data packet, where the target route indicates that the target route has the output interface information and the next-hop gateway address, and the network element device may select a port according to the output interface information, and then forward the target data packet through the port, so that the target data packet reaches the network element device corresponding to the next-hop gateway address.
According to the method provided by the embodiment of the application, the network element equipment can acquire the target data message carrying the target network address from the user mode thread, and then route inquiry is carried out on the target network address in the forwarding information table; if at least two available routes associated with the destination network address are found in the forwarding information table, obtaining the message characteristic information of the target data message; carrying out hash processing on the random salt value and the message characteristic information associated with the current gateway to obtain a hash result for carrying out route load balancing; then determining a target route matched with the hash result from at least two available routes; and finally, carrying out route forwarding on the target data message according to the target route, so that the same network element equipment can distribute the data message with the same characteristics to the same route, and the problem that when the data message reaches a destination through different routes, a receiver receives disordered messages because of large delay jitter differences of different routes is avoided, thereby improving the communication efficiency, and simultaneously, the route selection is adjusted through the random salt value associated with the network element equipment, so that the data message with different message characteristics can be routed to different route nodes with larger probability, and the load balance in the whole route process is realized.
For ease of understanding, please refer to fig. 4, fig. 4 is a schematic flow chart of route hash matching according to an embodiment of the present application. The network element device can distribute the data messages (such as source IP address, destination IP address, source MAC, destination MAC, etc.) with the same characteristics to a fixed path according to the characteristics of the data messages, so as to avoid the disorder problem of the receiving end. The route hash matching may include the following steps S201-S203:
step S201, the network element equipment extracts the five-tuple as the message characteristic information, and adds a random salt value into the message characteristic information to obtain a sequence to be processed.
Specifically, the network element device may obtain several parameters, including the source MAC address, the destination MAC address, the source IP address, the destination IP address, and the transport layer protocol, as the characteristic information of the packet according to the ethernet and the IP packet header information, and the specific implementation may refer to the above step S102, which is not described herein again. Then, a random salt (salt) value is added to the message characteristic information to generate a hash key, that is, the random input sequence described in fig. 3, so that hash polarization can be avoided by adding the random salt value, and then the hash key is filled to obtain a sequence to be processed, and specific implementation can be seen in the step S103, and details are not repeated here.
Step S202, performing cyclic offset processing on the sequence to be processed according to a hashing algorithm to obtain a hashing result.
Specifically, the cyclic shift processing is performed on the sequence to be processed, and an MD5 (Message-Digest Algorithm 5) hashing Algorithm may be used, where cyclic left shift may be performed on 16 32-bit blocks with 4 rounds of shift, so that the same hashing factor may be changed more frequently and flexibly, and the hashing result is more balanced.
Step S203, available routes are matched according to the hash result.
Specifically, the network element device may convert the hash result into an offset value, then perform a remainder operation on the offset value and the number of available routes to obtain a target remainder, and select an available route matching the target remainder as the target route. Through the above-mentioned route hash matching, the network element device can determine which available route the message of this feature is forwarded according to.
By adopting the method provided by the embodiment of the application, the data messages with the same characteristics are distributed to the fixed paths, so that the problem that the messages of the receiver arrive at disorder due to the fact that the delay jitter difference of different paths is large can be avoided, and the communication efficiency can be greatly improved especially in the scenes of unbalanced upstream and downstream network networking structures and unbalanced delay.
Further, referring to fig. 5, fig. 5 is a flowchart of a routing processing method according to an embodiment of the present application, where the method may be performed by a network element device (e.g., the gateway 4000b shown in fig. 1). As shown in fig. 3, the routing processing method at least includes the following steps S301 to S305:
step S301, a target data message carrying a target network address is obtained from a user mode thread, and the target network address is subjected to route inquiry in a forwarding information table.
Specifically, the implementation of step S301 may refer to the specific description of step S101 in the embodiment corresponding to fig. 3, which is not described herein.
Step S302, if the available route associated with the destination network address is not found in the forwarding information table, a routing information table is obtained; the routing information table includes a dictionary tree for storing network addresses and available routes associated with the network addresses.
Specifically, the network address and the available route associated with the network address contained in the forwarding information table are copied from the routing information table (Routing Info Base, RIB). All routing information acquired by the gateway device is stored in the routing information table, irrespective of the specific routing protocol, where all routing protocols preserve their routes. In other words, the routing information table is placed whenever the network address and the new route associated with the network address are learned by the routing protocol running on the network element device. Since the routing information table maintains a set of network topologies for various routing protocols, a large number of network addresses and available routes associated with the network addresses are stored in the routing information table, and one network address can correspond to a plurality of available routes. It can be understood that when the network element device forwards the data packet, the network element device selects the optimal available route from the available routes corresponding to the network address to forward the data packet, and the rest available routes are used as standby routes, and are selected when the optimal available route has a fault and other problems. Because of the excessive routing information stored in the routing information table, network element devices typically consume a significant amount of time when querying the routing information table. Therefore, the network element device determines the available route associated with the network address from the route information table according to the prefix longest-matching principle of the route, and then adds the available route associated with the network address, which accords with the prefix longest-matching principle of the route, into the forwarding information table. The prefix longest matching principle of the route means that the network element device performs matching of each bit of the network address and the routing information table until an available route with the longest matching degree is found, for example, the network element device stores two available routes 192.168.1.0/24 and 192.168.0.0/16, the network element device searches for an available route with the destination address 192.168.1.5, selects the available route 192.168.1.0/24 as a transmission according to the prefix longest matching principle of the route, namely, writes the available route 192.168.1.0/24 into the forwarding information table, and writes the available route 192.168.0/16 into the forwarding information table according to the prefix longest matching principle when the available route 192.168.1.0/24 is deleted. The network element device may first perform route query from the forwarding information table when receiving the data packet carrying the destination network address, and query the routing information table when no available route associated with the destination network address is queried in the forwarding information table.
Specifically, the routing information table is composed of three elements, namely a network address, a subnet mask and a next-hop gateway address. Wherein the subnet mask is used to indicate which bits of an IP address identify the subnet in which the host is located and which bits identify the bit mask of the host. The subnet mask is to be used in conjunction with an IP address. For example, IP address 196.168.192.4 is converted to binary 11000000101010001100000000000100, and if its subnet mask is 24, the corresponding binary 11111111111111111111111100000000 of the subnet mask is and-calculated to obtain 11000000101010001100000000000000, i.e., the corresponding segment address is 196.168.192.0. The longer the subnet mask, the more accurate the IP address and segment address that the subnet mask matches, and the more closely the next hop gateway address is to the destination network address that the longer the subnet mask is selected for the available route when route forwarding. Taking into account the nature of the routing format, a dictionary (Trie) tree hierarchy may be employed to store network addresses and available routes associated with the network addresses. The dictionary tree is a tree structure, the root node does not contain characters, and each node except the root node only contains one character; from the root node to a certain node, the characters passing through the path are connected to form a character string corresponding to the node; all child nodes of each node contain different characters.
Step S303, carrying out hierarchical query processing on the dictionary tree to obtain available routes associated with the destination network address.
According to the prefix longest matching principle, the network element device can start from a 32-bit subnet mask, perform hierarchical query processing on the dictionary tree, and can perform 32 rounds of hierarchical query at most, and the implementation process of the hierarchical query can be as follows: in the k round of inquiry processing, performing AND operation on the target network address and a k round of sub-network mask to obtain a network segment address of the k round; wherein k is a positive integer; the number of masking bits of the kth sub-net mask is the difference between the longest masking bit number, i.e., the length of the network address, and (k-1), 32 bits; then, inquiring the dictionary tree according to the network segment address of the kth round; if the next-hop gateway address corresponding to the network segment address of the kth round is queried in the dictionary tree, stopping query processing, and determining an available route associated with the destination network address according to the next-hop gateway address; and if the next hop gateway address corresponding to the network segment address of the kth round is not queried in the dictionary tree, executing the k+1 round of query processing.
Specifically, assuming that the number of node layers of the dictionary tree is N, where N is a positive integer, the process of querying the dictionary tree according to the network segment address of the kth round may be: dividing the network segment address of the kth round to obtain N node addresses; traversing the dictionary tree by N layers of nodes according to the N node addresses to obtain leaf nodes of the network segment addresses of the kth round in the dictionary tree; if the leaf node corresponding to the network segment address of the kth round is mapped with the next-hop gateway address, determining that the next-hop gateway address corresponding to the network segment address of the kth round is found in the dictionary tree; if the next-hop gateway address is not mapped in the leaf node corresponding to the network segment address of the kth round, determining that the next-hop gateway address corresponding to the network segment address of the kth round is not found in the dictionary tree.
For the convenience of understanding the above process, please refer to fig. 6a, fig. 6a is a schematic diagram of a four-layer dictionary tree structure according to an embodiment of the present application. The network address consists of a 32-bit binary number, typically divided into 4 "8-bit binary numbers" (i.e., 4 bytes). The IP address is usually expressed in the form of (a.b.c.d) in "point decimal", where a, b, c, d are all decimal integers between 0 and 255. Examples: the point decimal IP address (100.4.5.6), in effect, is a 32-bit binary number (01100100.00000100.00000101.00000110), so that a four-level dictionary tree can be constructed from decimal integers corresponding to every 8-bit binary number of the network address. As shown in fig. 6a, in the dictionary tree, the first layer node may include 256 nodes, each node in the first layer node may be connected with 256 child nodes corresponding to the decimal integer corresponding to the first octet binary number of the network address, and all the child nodes corresponding to the nodes in the first layer node are the second layer nodes of the dictionary tree, which can be understood that the number of the nodes in the second layer node may be 256×256 at most. And so on, nodes of third layer node in field number the number may be up to 256 x 256, number of nodes of the fourth layer node at most can be 256×256×256×256. The nodes in the fourth layer of nodes in the dictionary tree can be called leaf nodes of the dictionary tree, and the data surface processing object mapped by the leaf nodes can indicate how to process the data message in the next step and can also store the corresponding next-hop gateway address. Assuming that the network element device needs to find an available route corresponding to the destination network address 192.168.192.250 and conforming to the prefix longest matching principle, the network element device performs multi-round hierarchical query on the dictionary tree by reducing the length of the subnet mask, and does not stop the query until the available route associated with the destination network address is obtained. Assuming that the network element device is performing round 9 query for available routing query associated with the destination network address on the dictionary tree, and the longest mask bit number is 32, the mask bit number of the round 9 subnet mask is 24, and the network element device first matches the 24-bit subnet mask with the destination network address 192.168.192.250 to obtain the segment address 192.168.192.0 of round 9. Then, the network element equipment divides the network segment address according to the node layer number 4 of the dictionary tree to obtain four node addresses 192, 168 and 0, and then, the network element equipment starts to perform hierarchical node traversal from the root node of the dictionary tree, as shown in fig. 6a, the query starts from the root node, and finds a node corresponding to the node address 192 in the first layer node as a path node one; then, in the second layer node of the dictionary tree, a node with a connection relation with the path node I is obtained, and then a node corresponding to the node address 168 is obtained from the group of nodes to be used as a path node II; then, in the third layer node of the dictionary tree, a node with a connection relation with the path node II is obtained, and then a node corresponding to the node address 192 is obtained from the group of nodes to be used as a path node III; finally, in the fourth layer node of the dictionary tree, the node with the connection relation with the path node three is obtained, then the node corresponding to the node address 0 is obtained from the group of nodes and used as the path node four, namely the leaf node corresponding to the network address, the leaf node can be mapped with the next-hop gateway address, and the next-hop gateway address is assumed to be 10.10.10.1, at the moment, the network element equipment can obtain the available route associated with the network address 192.168.192.250, namely 192.168.192.0/24, and the next-hop address is 10.10.1. After finding the available route associated with the network address, the network element device will stop the query, but if the leaf node is not mapped with the next hop gateway address, the network element device will perform the 10 th round of query.
According to the structure and the division characteristics of the network address, the levels of the dictionary tree may be set to three layers, and for convenience of understanding, please refer to fig. 6b, fig. 6b is a schematic diagram of the three-layer dictionary tree structure provided in the embodiment of the present application. As shown in fig. 6b, the first layer of the dictionary tree is constructed according to the decimal integer corresponding to the first 16-bit binary number of the network address, and the first layer of nodes may include 65536 nodes. Then, the second layer of the dictionary tree is constructed according to decimal integers corresponding to binary numbers from the 17 th bit to the 24 th bit of the network address, so that each node in the first layer of nodes can be connected with 256 child nodes, and the child nodes corresponding to all the nodes in the first layer of nodes are the second layer of nodes of the dictionary tree. Similarly, the third layer of the dictionary tree is constructed according to decimal integers corresponding to binary numbers from 25 th bit to 32 rd bit of the network address. The first layer and the second layer in the four-layer dictionary tree are combined to obtain the first layer in the three-layer dictionary tree, so that the space storage can be reduced, and meanwhile, at most, 3 layers of searching is only needed when the routes are matched in the query time, so that the route query time is reduced.
Step S304, updating the forwarding information table according to the available route associated with the destination network address, and obtaining an updated forwarding information table.
Specifically, the network element device may add the available routes associated with the destination network address to the forwarding information table, to obtain an updated forwarding information table.
Optionally, the leaf node may be mapped with a plurality of next-hop gateway addresses, that is, the available routes associated with the destination network address obtained by the network element device may be a plurality of available routes, and the plurality of available routes may include available routes corresponding to at least two route discovery protocols respectively, where, according to the protocol priority, the network element device obtains, from the at least two route discovery protocols, the route discovery protocol with the highest priority as the optimal route discovery protocol; then, from available routes associated with the destination network address, the available route corresponding to the optimal route discovery protocol is obtained and used as the optimal available route; and finally, adding the destination network address and the optimal available route into a forwarding information table to obtain an updated forwarding information table.
Step S305, performing a routing query on the destination network address in the updated forwarding information table.
Specifically, after the updated forwarding information table is obtained, the process of the network element device performing the routing query on the destination network address may refer to the above steps S102 to S105, which are not described herein again.
Alternatively, to save memory space, instead of initially building all nodes, the dictionary tree is continually inserted and updated after new routes are available. When the network element device obtains the newly-added network address and the available route related to the newly-added network address based on the route discovery protocol, the node address division processing can be performed on the newly-added network address according to the dictionary layer number N of the dictionary tree included in the route information table, and then N node addresses with sequence relations corresponding to the network address are obtained. Wherein the available routes include a next hop gateway address; n is a positive integer. Then, the network element device may update the dictionary tree according to the N node addresses, to obtain an updated dictionary tree. The updated dictionary tree includes leaf nodes corresponding to the newly added network address, the leaf nodes corresponding to the newly added network address including a last node address of the N node addresses. And finally, the network element equipment associates and stores the next-hop gateway address and the leaf node corresponding to the newly added network address into a routing information table.
Optionally, the process of updating the dictionary tree according to the N node addresses to obtain the updated dictionary tree may be: traversing the target node set of the ith layer of the dictionary tree according to the ith node address in the N node addresses; i is a positive integer less than N; when i is 1, the nodes in the target node set have a connection relationship with the root node of the dictionary tree; when i is not 1, the nodes in the target node set have a connection relationship with the nodes containing the i-1 node addresses in the target node set of the i-1 layer; if the target node set in the ith layer of the dictionary tree is traversed to the node containing the ith node address, traversing the target node set in the ith+1 layer of the dictionary tree according to the (i+1) th node address in the N node addresses; if the node containing the ith node address is not traversed to the target node set of the ith layer of the dictionary tree, creating a new node containing the ith node address, adding the new node containing the ith node address to the target node set of the ith layer of the dictionary tree, and continuously traversing the target node set in the ith+1 layer of the updated dictionary tree according to the (i+1) th node address in the N node addresses; and when traversing to the node corresponding to the address containing the N node in the target node set in the N layer, or adding a new node corresponding to the address containing the N node in the target node set in the N layer, acquiring the updated dictionary tree.
By adopting the method provided by the embodiment of the application, the dictionary tree structure is adopted to construct the routing information table, so that the routing query time can be reduced when the routing query is carried out, and meanwhile, the dictionary tree is dynamically created and updated according to the discovery of the new routing, so that the memory space can be saved, and the query time can be reduced.
For better understanding the relationship between the routing information table and the forwarding information table and the routing query process for the destination network address in the embodiment corresponding to fig. 5, please refer to fig. 7, fig. 7 is a schematic diagram of updating the forwarding information table according to the embodiment of the present application. When the network element device calculates the routing information, the paths calculated by different routing protocols may be different, and the network element device writes the routes found by all the routing protocols into the routing information table, as shown in fig. 7, assuming that 3 routes destined for network address 2.2.2.2 are newly added in the routing information table RIB, and the next-hop gateway addresses are 1.1.1.1,1.1.1.2,1.1.1.3 respectively. The network element equipment selects a route with the most route prefix matching as an optimal route, and places the optimal route in an Active state; while the other routes are put in Inactive state as backup routes. At this time, the routing table entry in the Active state is imported into the forwarding FIB table by the routing RIB table, and is used as a forwarding basis. Among the three newly added routes to network address 2.2.2.2, this route 2.2.0/30 is set to Inactive in the forwarding FIB table due to the longest prefix match principle. The other two routes have the same prefix, both of which are 2.2.2.2/32, and may be called Equal Cost Multi-path (ECMP), and the next hop gateway addresses of the two Equal Cost routes ECMP are different. The network element equipment sets the two ECMP equivalent routes to an Active state at the same time, and adds the two ECMP equivalent routes to a forwarding information table; when the two ECMP equivalent routes are written into the forwarding information table, the network element equipment also analyzes the next-hop gateway address of the ECMP equivalent route and determines the port corresponding to the next-hop gateway address and the network address of the port binding. As shown in fig. 7, the ECMP equivalent route with the next-hop gateway address of 1.1.1.1 corresponds to port 1 of the binding network address 10.1.1.1.1, and the ECMP equivalent route with the next-hop gateway address of 1.1.1.2 corresponds to port 2 of the binding network address 10.1.1.2. When the network element device queries the route with the destination network address 2.2.2.2 as shown in fig. 7, the network element device firstly performs route query from the forwarding FIB in the user mode to obtain the two ECMP equivalent routes, then performs load balancing processing on the two ECMP equivalent routes, namely, the hashing processing described in the embodiment corresponding to fig. 3, then selects one route from the two ECMP equivalent routes as the target route, and then performs route rewriting based on the target route (the target route includes the next hop gateway address) in the user mode, and can find the port with the next hop gateway address and the network address bound by the route rewriting, thereby realizing forwarding of the data message carrying the destination network address according to the port and the network address of the port. For example, the network element device selects an ECMP equivalent route with a next hop gateway address of 1.1.1.1, then the network element device performs route rewriting according to 1.1.1.1, finds port 1 binding network address 10.1.1.1, and forwards the data message through port 1. When the route topology changes, the route RIB table and the forwarding FIB table are updated simultaneously, for example, when the route 2.2.2.0/30 is changed to 2.2.2.2/32, the route RIB table sets the route to an Active state, and then the forwarding FIB table writes the route.
Fig. 8 is a schematic structural diagram of a network element device according to an embodiment of the present application. The network element means may be a computer program (comprising program code) running on the network element device, e.g. the network element means is an application software; the device can be used for executing corresponding steps in the data processing method provided by the embodiment of the application. As shown in fig. 8, the network element device 1 may include: a route query module 101, a feature acquisition module 102, a hash module 103, a route determination module 104, and a forwarding module 105.
The route inquiry module 101 is configured to obtain a target data packet carrying a destination network address from a user mode thread, and perform route inquiry on the destination network address in a forwarding information table;
the feature obtaining module 102 is configured to obtain message feature information of the target data message if at least two available routes associated with the destination network address are found in the forwarding information table;
a hashing module 103, configured to perform hashing processing on the random salt value and the message characteristic information associated with the current routing node, to obtain a hashing result for performing routing load balancing;
a route determining module 104, configured to determine a target route that matches the hash result from at least two available routes;
And the forwarding module 105 is configured to route and forward the target data packet according to the target route.
The specific functional implementation manners of the route query module 101, the feature obtaining module 102, the hash module 103, the route determining module 104, and the forwarding module 105 may refer to steps S101 to S105 in the embodiment corresponding to fig. 3, and are not described herein.
Referring to fig. 8, the feature acquisition module 102 may include: a first acquisition unit 1021, a second acquisition unit 1022, and a determination unit 1023.
A first obtaining unit 1021, configured to obtain, from header information of a target data packet, a source network address and a protocol type corresponding to the target data packet;
a second obtaining unit 1022, configured to obtain, from ethernet frame header information corresponding to the target data packet, a destination physical address and a source physical address corresponding to the target data packet;
the determining unit 1023 is configured to determine the destination network address, the source network address, the protocol type, the destination physical address, and the source physical address as the message characteristic information of the target data message.
The specific functional implementation manner of the first acquiring unit 1021, the second acquiring unit 1022, and the determining unit 1023 may refer to step S102 in the embodiment corresponding to fig. 3, and will not be described herein.
Referring to fig. 8, the hashing module 103 may include: a sequence generation unit 1031, a stuffing unit 1032, and a cyclic shift unit 1033.
A sequence generating unit 1031, configured to generate a random input sequence according to a random salt value and message characteristic information associated with a current routing node;
a filling unit 1032, configured to perform filling processing on the random input sequence based on the length of the random input sequence, to obtain a sequence to be processed with a standard length;
the cyclic shift unit 1033 is configured to perform cyclic shift processing on the sequence to be processed, and obtain a hash result for performing route load balancing.
The specific functional implementation manners of the sequence generating unit 1031, the filling unit 1032, and the cyclic shift unit 1033 may refer to step S103 in the embodiment corresponding to fig. 3, and are not described herein.
Referring to fig. 8, the route determination module 104 may include: the remainder determination unit 1041 and the routing unit 1042.
A remainder determining unit 1041, configured to convert the hash result into an offset value, and perform remainder operation on the offset value and the total number of routes of the at least two available routes to obtain a target remainder;
the route selection unit 1042 is configured to obtain a route corresponding to the target remainder from at least two available routes, and determine the route corresponding to the target remainder as a target route matching the hash result.
The specific functional implementation manner of the remainder determining unit 1041 and the routing unit 1042 may refer to step S104 in the embodiment corresponding to fig. 3, and will not be described herein.
Referring to fig. 8, the network element apparatus 1 may further include: a routing table acquisition module 106, a hierarchy query module 107, a forwarding table update module 108, and an update query module 109.
A routing table obtaining module 106, configured to obtain a routing information table if an available route associated with the destination network address is not found in the forwarding information table; the routing information table includes a dictionary tree for storing network addresses and available routes associated with the network addresses;
a hierarchical query module 107, configured to perform hierarchical query processing on the dictionary tree to obtain an available route associated with the destination network address;
a forwarding table updating module 108, configured to update the forwarding information table according to the available route associated with the destination network address, to obtain an updated forwarding information table;
the update query module 109 is configured to perform a routing query on the destination network address in the update forwarding information table.
The specific functional implementation manners of the routing table obtaining module 106, the hierarchical query module 107, the forwarding table updating module 108, and the updating query module 109 may refer to step S301-step S305 in the embodiment corresponding to fig. 5, and are not described herein.
Referring to fig. 8, the hierarchical query module 107 may include: a network segment determination unit 1071, a query unit 1072, and a processing unit 1073.
A network segment determining unit 1071, configured to perform an and operation on the destination network address and the kth round of sub-network mask in the kth round of query processing, to obtain a network segment address of the kth round; k is a positive integer; the number of mask bits of the kth wheel net mask is the difference between the longest mask bit and (k-1);
a query unit 1072, configured to query the dictionary tree according to the network segment address of the kth round;
a processing unit 1073, configured to stop the query process if a next-hop gateway address corresponding to the network segment address of the kth round is queried in the dictionary tree, and determine an available route associated with the destination network address according to the next-hop gateway address;
the processing unit 1073 is further configured to execute the k+1st round of query processing if the next hop gateway address corresponding to the network segment address of the k round is not queried in the dictionary tree.
The specific functional implementation manners of the network segment determining unit 1071, the querying unit 1072 and the processing unit 1073 may refer to step S303 in the embodiment corresponding to fig. 5, and are not described herein.
The number of node layers of the dictionary tree is N; n is a positive integer;
Referring to fig. 8, the query unit 1072 may include: a scribe sub-unit 10721, a traverse sub-unit 10722, and an address determination sub-unit 10723.
A dividing subunit 10721, configured to divide the network segment address of the kth round to obtain N node addresses;
a traversing subunit 10722, configured to perform N-level node traversal on the dictionary tree according to the N node addresses, to obtain leaf nodes of the network segment address of the kth round in the dictionary tree;
an address determining subunit 10723, configured to determine, if a next-hop gateway address is mapped to a leaf node corresponding to the network segment address of the kth round, that the next-hop gateway address corresponding to the network segment address of the kth round is found in the dictionary tree;
the address determining subunit 10723 is further configured to determine that the next-hop gateway address corresponding to the network segment address of the kth round is not found in the dictionary tree if the next-hop gateway address is not mapped in the leaf node corresponding to the network segment address of the kth round.
The specific functional implementation manner of the dividing subunit 10721, the traversing subunit 10722 and the address determining subunit 10723 may refer to step S303 in the embodiment corresponding to fig. 5, and will not be described herein.
Wherein the available routes associated with the destination network address include available routes respectively corresponding to at least two route discovery protocols;
Referring to fig. 8, the forwarding table updating module 108 may include: protocol determining unit 1081, route acquiring unit 1082, and forwarding table updating unit 1083.
A protocol determining unit 1081, configured to obtain, from at least two route discovery protocols, a route discovery protocol with a highest priority as an optimal route discovery protocol;
a route acquisition unit 1082 configured to acquire, from available routes associated with the destination network address, an available route corresponding to the optimal route discovery protocol as an optimal available route;
a forwarding table updating unit 1083, configured to add the destination network address and the optimal available route into the forwarding information table, to obtain an updated forwarding information table.
The specific functional implementation manner of the protocol determining unit 1081, the route acquiring unit 1082 and the forwarding table updating unit 1083 may refer to step S304 in the embodiment corresponding to fig. 5, and will not be described herein.
Referring to fig. 8, the network element apparatus 1 may further include: a route discovery module 110, a node address determination module 111, a dictionary tree update module 112, and an association storage module 113.
A route discovery module 110, configured to obtain a newly added network address and an available route associated with the newly added network address based on a route discovery protocol; the available routes include the next hop gateway address;
The node address determining module 111 is configured to perform node address division processing on the newly added network address according to the number N of dictionary layers of the dictionary tree included in the routing information table, to obtain N node addresses with sequential relationships corresponding to the network address; n is a positive integer;
a dictionary tree updating module 112, configured to update the dictionary tree according to the N node addresses, to obtain an updated dictionary tree; the updated dictionary tree includes leaf nodes corresponding to the newly added network address; the leaf node corresponding to the newly added network address contains the last node address in the N node addresses;
and the association storage module 113 is configured to store the next hop gateway address and the leaf node corresponding to the newly added network address in association with the routing information table.
The specific functional implementation manners of the route discovery module 110, the node address determination module 111, the dictionary tree update module 112, and the association storage module 113 may be referred to the description of the alternative embodiments in the embodiments corresponding to fig. 5, and will not be described herein.
Referring to fig. 8, the dictionary tree update module 112 may include: a node traversing unit 1121, a traversal judging unit 1122, and an updating unit 1123.
A node traversing unit 1121, configured to traverse the target node set of the ith layer of the dictionary tree according to the ith node address in the N node addresses; i is a positive integer less than N; when i is 1, the nodes in the target node set have a connection relationship with the root node of the dictionary tree; when i is not 1, the nodes in the target node set have a connection relationship with the nodes containing the i-1 node addresses in the target node set of the i-1 layer;
A traversal determining unit 1122, configured to, if traversing to a node containing the ith node address in the target node set of the ith layer of the dictionary tree, continue traversing the target node set of the ith+1 layer of the dictionary tree according to the (i+1) th node address in the N node addresses;
the traversal determining unit 1122 is further configured to, if the node including the ith node address is not traversed to the target node set of the ith layer of the dictionary tree, create a new node including the ith node address, add the new node including the ith node address to the target node set of the ith layer of the dictionary tree, and continue traversing the target node set of the ith+1 layer of the updated dictionary tree according to the (i+1) th node address of the N node addresses;
an updating unit 1123, configured to obtain an updated dictionary tree when traversing to a node corresponding to an nth node address in the target node set in the nth layer, or when adding a new node corresponding to the nth node address in the target node set in the nth layer.
The specific functional implementation manners of the node traversing unit 1121, the traversing judging unit 1122, and the updating unit 1123 may be referred to the optional descriptions in the embodiment corresponding to fig. 5, and will not be described herein.
In the embodiment of the application, a target data message carrying a target network address is acquired from a user mode thread, and the target network address is subjected to route inquiry in a forwarding information table; if at least two available routes associated with the destination network address are found in the forwarding information table, obtaining the message characteristic information of the target data message; carrying out hash processing on the random salt value and the message characteristic information associated with the current gateway to obtain a hash result for carrying out route load balancing; determining a target route matched with the hash result from at least two available routes; and carrying out route forwarding on the target data message according to the target route. By adopting the method provided by the embodiment of the application, the same routing node can distribute the data messages with the same characteristics to the same route, so that when the data messages reach a destination through different routes, a receiving party can receive out-of-order messages because of larger time delay jitter differences of different routes, and the communication efficiency is improved; and meanwhile, the route selection is adjusted through the random salt value associated with the current gateway, so that the data messages with different message characteristics can be routed to different routing nodes with higher probability, and the load balancing in the whole routing process is realized.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a network element device according to an embodiment of the present application. As shown in fig. 9, the network element device 1000 may include: processor 1001, network port 1003, and memory 1004, and in addition, the above network element device 1000 may further include: at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The network port 1003 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others. The memory 1004 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1004 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 9, an operating system, a network communication module, and a device control application may be included in the memory 1004, which is one type of computer-readable storage medium. In the embodiment of the present application, the network element device 1000 may be a gateway.
In the network element device 1000 shown in fig. 9, the network port 1003 may provide a network communication network element; and the processor 1001 may be configured to invoke a device control application program stored in the memory 1004, to cause the network element device 1000 to perform:
Acquiring a target data message carrying a target network address from a user state thread, and carrying out route inquiry on the target network address in a forwarding information table;
if at least two available routes associated with the destination network address are found in the forwarding information table, obtaining the message characteristic information of the target data message;
carrying out hash processing on the random salt value and the message characteristic information associated with the current gateway to obtain a hash result for carrying out route load balancing;
determining a target route matched with the hash result from at least two available routes;
and carrying out route forwarding on the target data message according to the target route.
It should be understood that the network element device 1000 described in the embodiments of the present application may perform the description of the data processing method in the embodiments corresponding to fig. 3 or fig. 5, which is not described herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium stores a computer program executed by the aforementioned network element device 1, where the computer program includes program instructions, when executed by the processor, can execute the description of the data processing method in the embodiment corresponding to fig. 3 or fig. 5, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application.
The computer readable storage medium may be a network element apparatus provided in any one of the foregoing embodiments or an internal storage unit of the network element device, for example, a hard disk or a memory of the network element device. The computer readable storage medium may also be an external storage device of the network element device, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card) or the like, which are provided on the network element device. Further, the computer readable storage medium may also include both an internal storage unit and an external storage device of the network element device. The computer readable storage medium is used for storing the computer program and other programs and data required by the network element device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
Furthermore, it should be noted here that: embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the network element device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the network element device performs the method provided in any of the corresponding embodiments of fig. 3, fig. 5, and any of the foregoing.
The terms first, second and the like in the description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the term "include" and any variations thereof is intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, article, or device that comprises a list of steps or elements is not limited to the list of steps or modules but may, in the alternative, include other steps or modules not listed or inherent to such process, method, apparatus, article, or device.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied as electronic hardware, as a computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of network elements in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether these network elements are implemented in hardware or software depends on the specific application and design constraints of the solution. The skilled person may use different methods for implementing the described network elements for each specific application, but such implementation should not be considered beyond the scope of the present application.
The methods and related devices provided in the embodiments of the present application are described with reference to the method flowcharts and/or structure diagrams provided in the embodiments of the present application, and each flowchart and/or block of the method flowcharts and/or structure diagrams may be implemented by computer program instructions, and combinations of flowcharts and/or blocks in the flowchart and/or block diagrams. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or structural diagram block or blocks. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or structures.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not intended to limit the scope of the claims herein, as the equivalent of the claims herein shall be construed to fall within the scope of the claims herein.

Claims (11)

1. A routing method, comprising:
acquiring a target data message carrying a target network address from a user state thread, and carrying out route inquiry on the target network address in a forwarding information table;
if at least two available routes associated with the destination network address are found in the forwarding information table, obtaining the message characteristic information of the target data message;
generating a random input sequence according to a random salt value associated with a current gateway and the message characteristic information, filling the random input sequence based on the length of the random input sequence to obtain a sequence to be processed with a standard length, and performing cyclic offset processing on the sequence to be processed to obtain a hash result for carrying out route load balancing;
converting the hash result into an offset value, carrying out remainder operation on the offset value and the total number of routes of the at least two available routes to obtain a target remainder, and obtaining a route corresponding to the target remainder from the at least two available routes as a target route;
And carrying out route forwarding on the target data message according to the target route.
2. The method according to claim 1, wherein the obtaining the message characteristic information of the target data message includes:
acquiring a source network address and a protocol type corresponding to the target data message from message header information of the target data message;
acquiring a destination physical address and a source physical address corresponding to the target data message from Ethernet frame header information corresponding to the target data message;
and determining the destination network address, the source network address, the protocol type, the destination physical address and the source physical address as message characteristic information of the target data message.
3. The method as recited in claim 1, further comprising:
if the available route associated with the destination network address is not found in the forwarding information table, acquiring a routing information table; the routing information table includes a dictionary tree for storing network addresses and available routes associated with the network addresses;
performing hierarchical query processing on the dictionary tree to obtain an available route associated with the destination network address;
Updating the forwarding information table according to the available route associated with the destination network address to obtain an updated forwarding information table;
and carrying out route inquiry on the destination network address in the updated forwarding information table.
4. A method according to claim 3, wherein said hierarchically querying the dictionary tree to obtain available routes associated with destination network addresses comprises:
in the kth round of inquiry processing, performing AND operation on the destination network address and the kth round of wheel network masks to obtain a network segment address of the kth round; k is a positive integer; the number of masking bits of the kth wheel net mask is the difference between the longest number of masking bits and (k-1);
inquiring the dictionary tree according to the network segment address of the kth round;
if the next-hop gateway address corresponding to the network segment address of the kth round is queried in the dictionary tree, stopping query processing, and determining an available route associated with a destination network address according to the next-hop gateway address;
and if the next hop gateway address corresponding to the network segment address of the kth round is not queried in the dictionary tree, executing the k+1 round of query processing.
5. The method of claim 4, wherein the number of node levels of the dictionary tree is N; n is a positive integer; and searching the dictionary tree according to the network segment address of the kth round, wherein the searching comprises the following steps:
Dividing the network segment address of the kth round to obtain N node addresses;
traversing the dictionary tree by N levels of nodes according to the N node addresses to obtain leaf nodes of the network segment addresses of the kth round in the dictionary tree;
if the leaf node corresponding to the network segment address of the kth round is mapped with a next-hop gateway address, determining to find the next-hop gateway address corresponding to the network segment address of the kth round in the dictionary tree;
and if the next-hop gateway address is not mapped in the leaf node corresponding to the network segment address of the kth round, determining that the next-hop gateway address corresponding to the network segment address of the kth round is not found in the dictionary tree.
6. A method according to claim 3, wherein the available routes associated with the destination network address comprise available routes respectively corresponding to at least two route discovery protocols;
the updating the forwarding information table according to the available route associated with the destination network address, to obtain an updated forwarding information table, including:
acquiring a route discovery protocol with the highest priority from the at least two route discovery protocols as an optimal route discovery protocol;
Obtaining an available route corresponding to the optimal route discovery protocol from the available routes associated with the destination network address as an optimal available route;
and adding the destination network address and the optimal available route into the forwarding information table to obtain an updated forwarding information table.
7. A method according to claim 3, further comprising:
acquiring a newly added network address and an available route associated with the newly added network address based on a route discovery protocol; the available routes include a next hop gateway address;
according to the number N of dictionary layers of the dictionary tree included in the routing information table, carrying out node address division processing on the newly added network address to obtain N node addresses with sequential relation corresponding to the network address; n is a positive integer;
updating the dictionary tree according to the N node addresses to obtain an updated dictionary tree; the updated dictionary tree comprises leaf nodes corresponding to the newly added network addresses; the leaf node corresponding to the newly added network address contains the last node address in the N node addresses;
and storing the next-hop gateway address and the leaf node corresponding to the newly added network address in association with the routing information table.
8. The method of claim 7, wherein updating the dictionary tree based on the N node addresses results in an updated dictionary tree, comprising:
traversing the target node set of the ith layer of the dictionary tree according to the ith node address in the N node addresses; i is a positive integer less than N; when i is 1, the nodes in the target node set have a connection relationship with the root node of the dictionary tree; when i is not 1, the nodes in the target node set have a connection relationship with the nodes containing the i-1 node addresses in the target node set of the i-1 layer;
if the target node set of the ith layer of the dictionary tree is traversed to the node containing the ith node address, traversing the target node set of the ith layer of the dictionary tree according to the (i+1) th node address in the N node addresses;
if the node containing the ith node address is not traversed to the target node set of the ith layer of the dictionary tree, creating a new node containing the ith node address, adding the new node containing the ith node address to the target node set of the ith layer of the dictionary tree, and continuously traversing the target node set in the ith+1 layer of the updated dictionary tree according to the (i+1) th node address in the N node addresses;
And when traversing to the node corresponding to the address containing the N node in the target node set in the N layer, or adding a new node corresponding to the address containing the N node in the target node set in the N layer, acquiring the updated dictionary tree.
9. A network element apparatus, comprising:
the route inquiry module is used for acquiring a target data message carrying a target network address from a user state thread and carrying out route inquiry on the target network address in the forwarding information table;
the feature acquisition module is used for acquiring the message feature information of the target data message if at least two available routes associated with the target network address are found in the forwarding information table;
the hash module is used for generating a random input sequence according to the random salt value and the message characteristic information associated with the current gateway, filling the random input sequence based on the length of the random input sequence to obtain a sequence to be processed with a standard length, and performing cyclic offset processing on the sequence to be processed to obtain a hash result for carrying out route load balancing;
the route determining module is used for converting the hash result into an offset value, carrying out remainder operation on the offset value and the total number of routes of the at least two available routes to obtain a target remainder, and obtaining a route corresponding to the target remainder from the at least two available routes as a target route;
And the forwarding module is used for carrying out route forwarding on the target data message according to the target route.
10. A network element device, comprising: a processor, a memory, and a network interface;
the processor is connected to the memory and the network interface, wherein the network interface is configured to provide data communication functions, the memory is configured to store program code, and the processor is configured to invoke the program code to cause the network element device to perform the method of any of claims 1-8.
11. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program adapted to be loaded by a processor and to perform the method of any of claims 1-8.
CN202111081924.5A 2021-09-15 2021-09-15 Routing processing method, network element equipment, device and readable storage medium Active CN113726907B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111081924.5A CN113726907B (en) 2021-09-15 2021-09-15 Routing processing method, network element equipment, device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111081924.5A CN113726907B (en) 2021-09-15 2021-09-15 Routing processing method, network element equipment, device and readable storage medium

Publications (2)

Publication Number Publication Date
CN113726907A CN113726907A (en) 2021-11-30
CN113726907B true CN113726907B (en) 2024-03-19

Family

ID=78684242

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111081924.5A Active CN113726907B (en) 2021-09-15 2021-09-15 Routing processing method, network element equipment, device and readable storage medium

Country Status (1)

Country Link
CN (1) CN113726907B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115065632B (en) * 2022-03-31 2023-11-17 重庆金美通信有限责任公司 Lightweight tree network data forwarding method
CN115022242B (en) * 2022-08-08 2022-11-18 深圳高灯计算机科技有限公司 Network layer identification method and device, computer equipment and storage medium
CN116390189B (en) * 2023-06-05 2023-08-15 微网优联科技(成都)有限公司 Route planning method, device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101841485A (en) * 2010-05-28 2010-09-22 华为技术有限公司 Method and relevant device for sharing multicast traffic
CN102307136A (en) * 2011-07-06 2012-01-04 杭州华三通信技术有限公司 Method for processing message and device thereof
CN104168201A (en) * 2014-08-06 2014-11-26 福建星网锐捷网络有限公司 Multipath forwarding method and device
CN106453091A (en) * 2016-10-28 2017-02-22 武汉烽火网络有限责任公司 Equivalent routing management method and device of router forwarding plane
CN108259326A (en) * 2016-12-29 2018-07-06 华为技术有限公司 Routing table update method, apparatus, distribution node and leaf message forwarding equipment
CN108809940A (en) * 2018-05-04 2018-11-13 四川理工学院 Network system server interacts encryption method with client
CN111049746A (en) * 2018-10-12 2020-04-21 华为技术有限公司 Routing table item generation method, dictionary tree generation method and device
CN112965824A (en) * 2021-03-31 2021-06-15 北京金山云网络技术有限公司 Message forwarding method and device, storage medium and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101841485A (en) * 2010-05-28 2010-09-22 华为技术有限公司 Method and relevant device for sharing multicast traffic
CN102307136A (en) * 2011-07-06 2012-01-04 杭州华三通信技术有限公司 Method for processing message and device thereof
CN104168201A (en) * 2014-08-06 2014-11-26 福建星网锐捷网络有限公司 Multipath forwarding method and device
CN106453091A (en) * 2016-10-28 2017-02-22 武汉烽火网络有限责任公司 Equivalent routing management method and device of router forwarding plane
CN108259326A (en) * 2016-12-29 2018-07-06 华为技术有限公司 Routing table update method, apparatus, distribution node and leaf message forwarding equipment
CN108809940A (en) * 2018-05-04 2018-11-13 四川理工学院 Network system server interacts encryption method with client
CN111049746A (en) * 2018-10-12 2020-04-21 华为技术有限公司 Routing table item generation method, dictionary tree generation method and device
CN112965824A (en) * 2021-03-31 2021-06-15 北京金山云网络技术有限公司 Message forwarding method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN113726907A (en) 2021-11-30

Similar Documents

Publication Publication Date Title
US10601769B2 (en) Mapping between classical URLs and ICN networks
CN110313162B (en) System and method for facilitating content delivery to multiple recipients in a network environment
CN113726907B (en) Routing processing method, network element equipment, device and readable storage medium
US11082342B2 (en) System and method to facilitate content forwarding using Bit Index Explicit Replication (BIER) in an Information-Centric Networking (ICN) environment
US10164910B2 (en) Method and apparatus for an information-centric MAC layer
WO2018067352A1 (en) Unicast branching based multicast
US10791051B2 (en) System and method to bypass the forwarding information base (FIB) for interest packet forwarding in an information-centric networking (ICN) environment
US20140153577A1 (en) Session-based forwarding
WO2005026871A2 (en) Packet classification
EP2869511B1 (en) Hash-based forwarding of packets with hierarchically structured variable-length identifiers over ethernet
CN1822570A (en) Automatic discovery of psuedo-wire peer addresses in ethernet-based networks
US20120185487A1 (en) Method, device and system for publication and acquisition of content
EP3446460B1 (en) Content routing in an ip network that implements information centric networking
US9450909B2 (en) Method of and a processing device handling a protocol address in a network
CN116982307A (en) Method and computing device for enforcing functional filtering rules in a clustered infrastructure
US10986209B2 (en) Secure and reliable on-demand source routing in an information centric network
US20100046529A1 (en) Method of configuring the quality-of-service profile of a given stream at an access node of a packet communications network
Jayanthi et al. Next generation internet protocol-Technical realms
CN108199960B (en) Multicast data message forwarding method, entrance routing bridge, exit routing bridge and system
US20090319646A1 (en) Naming system layer
CN116723144B (en) Multicast service data transmission method and device
WO2023169364A1 (en) Routing generation method and apparatus, and data message forwarding method and apparatus
CN115834722A (en) Data processing method, device, network element equipment and readable storage medium
CN117675966A (en) Data transmission method, data transmission device, equipment and storage medium
CN117376233A (en) Data processing method, device and system

Legal Events

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