SDN (Software Defined Network) data packet forwarding method and system based on prime number label

By using prime number labels and the Chinese Remainder Theorem to calculate forwarding codes in SDN networks, the problems of high control overhead and complex processing in MPLS technology are solved, achieving efficient and flexible packet forwarding and supporting multicast and broadcast.

CN121037294APending Publication Date: 2025-11-28FUJIAN NORMAL UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511356239.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Multiprotocol Label Switching (MPLS) technology suffers from high control overhead, complex processing, and poor flexibility in network forwarding, especially in multicast scenarios.

Method used

A prime-number-based SDN network packet forwarding method is adopted. The SDN controller assigns globally unique prime-number labels to forwarding devices within the network domain and uses the Chinese Remainder Theorem to calculate the forwarding code. The forwarding device only needs to perform modulo operations to determine the output port, reducing label exchange and descrambling operations between devices.

Benefits of technology

It simplifies the forwarding process, reduces control overhead, and improves network flexibility and forwarding efficiency. It can efficiently support unicast, multicast, and broadcast data forwarding and adapt to changes in network topology and business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121037294A_ABST
    Figure CN121037294A_ABST
Patent Text Reader

Abstract

The invention discloses an SDN (Software Defined Network) data packet forwarding method based on prime number labels, which is suitable for a network domain comprising an SDN controller and a plurality of forwarding devices. The method aims to solve the problems of high control overhead, complex processing and poor flexibility caused by dependence on distributed label switching, forwarding table maintenance and hop-by-hop label operation in a multi-protocol label switching (MPLS) technology. According to the method, an SDN controller allocates a globally unique prime number label for each forwarding path in a network domain, calculates a unique forwarding code for each forwarding device based on the Chinese remainder theorem, and issues the forwarding code to a corresponding device for storage. When the forwarding device receives the data packet carrying the prime number label, the output port can be determined and forwarded according to the result only by executing one modular operation, label information exchange between devices is not needed, and label unsealing operation of each hop is not needed. According to the invention, the forwarding process is simplified, the control overhead is reduced, and unicast, multicast and broadcast data forwarding can be efficiently supported at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network, in particular to a prime number label based SDN network data packet forwarding method and system. BACKGROUND

[0002] Multiprotocol Label Switching (MPLS) technology avoids the time-consuming longest prefix matching (LPM) process in traditional IP forwarding by dividing equivalence classes (FEC) and performing table lookup forwarding based on pre-allocated labels, thereby improving forwarding efficiency. However, MPLS technology still has some inherent defects in actual deployment:

[0003] Firstly, it relies on underlying routing protocols or manual configuration to generate routing tables and label forwarding tables (LFIB, Label Forwarding Information Base), which is complex in architecture;

[0004] Secondly, label information needs to be frequently exchanged between neighboring routers, resulting in significant communication and control overhead;

[0005] Thirdly, since the labels within the domain are not globally unique, the data packet needs to be complicatedly exchanged (i.e. unpacking and packing operations) during the forwarding process, which increases the processing delay and implementation complexity. In addition, MPLS also faces challenges in supporting diversified forwarding scenarios such as multicast. SUMMARY

[0006] Therefore, it is necessary to provide a prime number label based SDN network data packet forwarding technical solution to solve the problems of large communication overhead and complex processing caused by relying on distributed label exchange and label forwarding table in MPLS technology.

[0007] To achieve the above purpose, in a first aspect, the present application provides a prime number label based SDN network data packet forwarding method, which is suitable for a network domain, the network domain comprising an SDN controller and a plurality of forwarding devices, the forwarding devices comprising network domain edge entry devices, edge exit devices and internal forwarding devices;

[0008] The method comprises the following steps performed by the SDN controller:

[0009] S1: constructing a prime number label set, the prime number label set containing a plurality of prime number labels, and the value of the smallest prime number label being greater than , N being the maximum number of output ports of the forwarding devices in the network domain;

[0010] S2: calculating a unique forwarding code for each forwarding device F j in the network domain , the forwarding code Based on the forwarding device F j The forwarding information for each forwarding path is calculated based on the Chinese Remainder Theorem, and the forwarding information includes the prime number label t assigned to each forwarding path. i and the remainder b after forwarding i Remainder b after forwarding i With each forwarding path in forwarding device F j The output port identifier corresponds to i, which is the index of the forwarding path. The value of i ranges from [1, m], where m represents the number of forwarding paths.

[0011] S3: Forwarding code Send to the corresponding forwarding device F j Storage, where j is the index of the forwarding device, and the value range of j is [1, T], where T is the number of forwarding devices in the network domain; the forwarding device performs the following steps:

[0012] S4: When the edge ingress device receives a data packet whose destination address is not within the network domain, it retrieves a prime label t issued by the SDN controller from the prime label set according to the forwarding path. i And encapsulate the prime number tag for the data packet;

[0013] S5: Forwarding devices within the network domain F j Upon receiving the prime number tag t i When handling data packets, use the locally stored forwarding code. For prime number label t i Perform a modulo operation to obtain the forwarding remainder b corresponding to the current forwarding device. p Based on the aforementioned forwarding remainder b p Determine the output port and forward the data packet through the determined output port;

[0014] S6: Before forwarding the data packet out of the network domain, the edge egress device removes the prime number tag t from the data packet. i .

[0015] Furthermore, forwarding code Based on the forwarding device F j The forwarding information for each forwarding path is calculated using the Chinese Remainder Theorem, and the calculation formula is as follows:

[0016] ;

[0017] in, For the Chinese Remainder Theorem algorithm, Labeling prime numbers The corresponding forwarding remainder.

[0018] Furthermore, the SDN controller is also configured to perform the following steps:

[0019] Based on the prime number label t i Calculate a global label product The calculation formula is as follows:

[0020] ;

[0021] in, Indicates the cumulative multiplication symbol;

[0022] Global label product Distribute the data to each forwarding device for storage;

[0023] The forwarding device is also used to perform the following steps:

[0024] Based on global label product With the prime number tag t in the data packet i The specific steps to determine whether to forward a data packet are as follows:

[0025] like If the current data packet is selected, the forwarding device forwards it; otherwise, the forwarding device discards it. , Modulo operation.

[0026] Furthermore, in calculating the global label product... When, the combination of prime number labels used is any one of the following:

[0027] All combinations of prime number labels in the prime number label set;

[0028] The set of prime number labels has been distributed to all forwarding devices within the network domain.

[0029] Furthermore, the method also includes:

[0030] Based on the number of output ports of each forwarding device within the network domain, all forwarding devices are divided into multiple device groups according to a gradient. A subset of prime number labels is determined for each device group, and the lower bound of the prime number labels in the prime number label subset corresponding to each device group is denoted as t. sub , t sub Not less than , This represents the maximum value of the output port of the forwarding device within the l-th device group;

[0031] When a prime label needs to be assigned to a new forwarding path, an unused prime label is selected from the subset of prime labels corresponding to the device group to which the forwarding device that has the most ports that the forwarding path needs to pass through belongs.

[0032] Furthermore, prior to executing step S5, the method also includes a computation mode selection step, performed by the SDN controller as follows:

[0033] S41: Evaluate the current compute resource idle rate C of the SDN controller. s And to assess the idle rate C of computing resources of each forwarding device within the network domain. Fj ;

[0034] S42: Dynamically select the calculation mode based on the evaluation results:

[0035] If C s Higher than the first preset threshold and C Fj If the value is below the second preset threshold, the controller calculation mode is selected, specifically: the SDN controller calculates the forwarding code. Then, further processing is performed on each F-line flowing through the forwarding device. j The prime number label t of the forwarding path i Calculate its corresponding forwarding remainder b i The calculation formula is b i = mod t i And forward the remainder b i With the corresponding prime number label t i The mapping relationship is sent to the forwarding device F. j Otherwise, select the device computing mode, specifically: the SDN controller will forward the code. Send to forwarding device F j ; Relay device F j When executing step S5, the following judgment is made: if the local received storage contains the mapping relationship, then based on the prime number tag t in the data packet... i Find the corresponding forwarding remainder b from the mapping relationship. i and b i As the remainder of forwarding b p If the local storage contains a forwarding code Then execute mod t i The calculation is performed to obtain the forwarding remainder b. p .

[0036] Furthermore, the forwarding code As the method uses a dynamic code, it also includes a forwarding code update step, as detailed below:

[0037] When the SDN controller assigns a prime number label t to a new forwarding path new At that time, the SDN controller determines the set of target forwarding devices that need to update the forwarding code based on the forwarding devices traversed by the new forwarding path;

[0038] For each forwarding device in the target forwarding device set, the SDN controller recalculates the new forwarding code based on the historical forwarding information of that forwarding device and the new forwarding information corresponding to the new forwarding path. and the updated forwarding code Send to the corresponding forwarding device F j .

[0039] Furthermore, the forwarding code update step is performed by the SDN controller according to the following optimized steps: for each forwarding device F j Maintain an update counter to record the number of new forwarding paths that the SDN controller determines need to be processed by the forwarding device since the last forwarding code update; when the value of any update counter reaches a preset threshold, or within a certain time window T... window When the growth rate of the internal update counter exceeds the preset rate threshold, a batch update process is triggered. After the batch update process is triggered, the SDN controller recalculates the forwarding code for all forwarding devices that need to be updated, and uniformly distributes the recalculated forwarding code to the corresponding forwarding devices. After the forwarding code is distributed, the SDN controller resets the corresponding update counter.

[0040] In a second aspect, this application provides an SDN network packet forwarding system based on prime number labels. The system includes a network domain, which includes an SDN controller and multiple forwarding devices. The forwarding devices include network domain edge ingress devices, edge egress devices, and internal forwarding devices. The SDN controller and the multiple forwarding devices interact according to the method described in any one of claims 1 to 8.

[0041] Unlike existing technologies, the SDN network packet forwarding method and system based on prime number labels described above aims to solve the problems of high control overhead, complex processing, and poor flexibility caused by the reliance on distributed label switching, maintenance of forwarding tables, and hop-by-hop label operations in Multiprotocol Label Switching (MPLS) technology. The method involves the SDN controller assigning globally unique prime number labels to each forwarding path within the network domain, calculating a unique forwarding code for each forwarding device based on the Chinese Remainder Theorem, and then distributing the forwarding code to the corresponding device for storage. When a forwarding device receives a packet carrying a prime number label, it only needs to perform a single modulo operation to determine the output port and forward the packet, eliminating the need for inter-device label information exchange and hop-by-hop label unpacking operations. This invention simplifies the forwarding process, reduces control overhead, and can simultaneously and efficiently support unicast, multicast, and broadcast data forwarding. Attached Figure Description

[0042] Figure 1The flowchart illustrates a prime-number-label-based SDN network packet forwarding method according to a first exemplary embodiment of the present invention.

[0043] Figure 2 A flowchart illustrating a prime-number-label-based SDN network packet forwarding method according to a second exemplary embodiment of the present invention;

[0044] Figure 3 The flowchart illustrates the SDN network packet forwarding method based on prime number tags according to the third exemplary embodiment of the present invention.

[0045] Figure 4 This is a flowchart of a SDN network packet forwarding method based on prime number tags according to a fourth exemplary embodiment of the present invention;

[0046] Figure 5 This is a flowchart of a SDN network packet forwarding method based on prime number tags according to a fifth exemplary embodiment of the present invention;

[0047] Figure 6 This is a flowchart of a SDN network packet forwarding method based on prime number tags according to the sixth exemplary embodiment of the present invention;

[0048] Figure 7 This is a schematic diagram of the architecture of an SDN network packet forwarding system based on prime number labels, which is an exemplary embodiment of the present invention. Detailed Implementation

[0049] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.

[0050] In this document, the term "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The term "embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment, nor does it specifically limit its independence or connection with other embodiments. In principle, in this application, as long as there are no technical contradictions or conflicts, the technical features mentioned in each embodiment can be combined in any way to form corresponding implementable technical solutions.

[0051] Unless otherwise defined, the technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the use of related terms herein is merely for the purpose of describing particular embodiments and is not intended to limit this application.

[0052] In the description of this application, the term "and / or" is used to describe the logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and A and B exist simultaneously. Additionally, the character " / " in this document generally indicates that the preceding and following objects have an "or" logical relationship.

[0053] In this application, terms such as “first” and “second” are used only to distinguish one entity or operation from another, and do not necessarily require or imply any actual quantity, hierarchy or order relationship between these entities or operations.

[0054] Unless otherwise specified, the use of terms such as “comprising,” “including,” “having,” or other similar expressions in this application is intended to cover non-exclusive inclusion, which does not exclude the presence of additional elements in a process, method, or product that includes elements, such that a process, method, or product that includes a series of elements may include not only those defined elements but also other elements not expressly listed, or elements inherent to such process, method, or product.

[0055] As understood in the Examination Guidelines, in this application, expressions such as "greater than," "less than," and "exceeding" are understood to exclude the stated number; expressions such as "above," "below," and "within" are understood to include the stated number. Furthermore, in the description of the embodiments in this application, "multiple" means two or more (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups" and "multiple times," unless otherwise explicitly specified.

[0056] like Figure 1 and Figure 2 As shown, in a first aspect, this application provides an SDN network packet forwarding method based on prime number labels, applicable to a network domain, the network domain including an SDN controller and multiple forwarding devices, the forwarding devices including network domain edge ingress devices, edge egress devices and internal forwarding devices.

[0057] In this embodiment, a network domain refers to a network area centrally managed by an SDN controller. It contains an SDN controller and multiple forwarding devices, enabling independent forwarding control of data packets within the domain and data interaction with devices outside the domain through edge devices.

[0058] The SDN controller is the centralized control core of the network domain, responsible for global decisions such as prime number tag management, forwarding code calculation, and control information distribution, realizing "separation of control and forwarding" and solving the problem of weak path controllability in traditional networks.

[0059] Forwarding devices refer to hardware devices within a network domain that perform the function of forwarding data packets. They can be classified into the following three categories according to their functions:

[0060] Edge entry devices are located at the network domain boundary, receive data packets sent from outside the domain to the domain, and are responsible for encapsulating prime number tags in the data packets;

[0061] Edge egress devices, located at the network domain boundary, are responsible for removing prime number tags from data packets before forwarding them out of the network domain.

[0062] Internal forwarding devices, located within the network domain, only forward data packets with prime number tags within the domain. They determine the forwarding remainder by using the forwarding code and the prime number tag in the data packet, and determine the forwarding port based on the forwarding remainder, thus enabling fast multi-hop forwarding of data packets within the domain.

[0063] The method includes: such as Figure 1 As shown, the SDN controller performs the following steps:

[0064] S1: Construct a set of prime number labels.

[0065] In step S1, the prime number tag set contains multiple prime number tags (each prime number tag is unique), which ensures the uniqueness of prime number tags within the set and the independence of forwarding logic, and the value of the smallest prime number tag in the set is greater than... N represents the maximum number of output ports of the forwarding devices within the network domain. This ensures that when the forwarding remainder is converted to N bits, it can cover all ports of the forwarding devices within the network domain without any mapping conflicts.

[0066] S2: For each forwarding device F in the network domain j Calculate a unique forwarding code.

[0067] In step S2, the forwarding device F j The corresponding forwarding code is denoted as Let represent the forwarding code corresponding to the j-th forwarding device, where j ranges from [1, T], and T is the number of forwarding devices in the network domain. Forwarding code Based on the forwarding device F j The forwarding information for each forwarding path is calculated based on the Chinese Remainder Theorem, and the forwarding information includes the prime number label t assigned to each forwarding path. i and the remainder b after forwarding i Remainder b after forwarding i With each forwarding path in forwarding device F j The output port identifier corresponds to the index of the forwarding path. The value of i ranges from [1, m], where m represents the number of forwarding paths. Each forwarding path corresponds to a prime number label and a forwarding remainder.

[0068] Forwarding code This refers to each forwarding device F j The unique control parameter assigned is calculated using the Chinese Remainder Theorem (CRT) based on the "prime tag-forwarding remainder" pairs of all forwarding paths the device has traversed. This can condense multi-path forwarding rules and reduce the amount of control information sent.

[0069] A forwarding path is a sequence of forwarding devices that a data packet passes through from the source to the destination. Each forwarding path corresponds to a unique prime number label (used to identify the path).

[0070] Forwarding remainder and forwarding path in a certain forwarding device F j The output port identifier directly corresponds to the value. Through the mapping relationship of "remainder → N bits → output port", the output port of the data packet in each forwarding device is determined, so as to realize the multi-hop fast forwarding of data packets in the network domain.

[0071] S3: Send the forwarding code to the corresponding forwarding device F j Storage. For example... Figure 2 As shown, the forwarding device performs the following steps:

[0072] S4: When the edge ingress device receives a data packet whose destination address is not within the network domain, it retrieves a prime label t issued by the SDN controller from the prime label set according to the forwarding path. i And encapsulate the prime number tag for the data packet;

[0073] S5: Forwarding devices within the network domain F j Upon receiving the prime number tag t i When processing data packets, use the locally stored forwarding code to tag prime numbers t. i Perform a modulo operation to obtain the forwarding remainder b corresponding to the current forwarding device. p Based on the aforementioned forwarding remainder b p Determine the output port and forward the data packet through the determined output port;

[0074] S6: Before forwarding the data packet out of the network domain, the edge egress device removes the prime number tag t from the data packet. i .

[0075] In specific implementation Figure 1 When implementing this method, the SDN controller first performs network domain parameter probing, obtaining the number of output ports of all forwarding devices within the network domain through an interface, and determining the maximum number of output ports N (for example, if the maximum number of ports in the domain is 4, then N=4). When constructing a set of prime number labels based on N, the following two constraints must be satisfied:

[0076] Coprime: All prime number labels in a set are pairwise coprime (e.g., when N=4, 2). N =16, the set of prime number labels can be set as {17,19,23,29,...}, all of which are greater than 16 and coprime, to ensure that each prime number label corresponds to a unique forwarding path and avoid label conflicts.

[0077] Lower bound: The smallest prime number label is greater than 2 N This ensures that when the remainder of subsequent forwarding is converted to N-bit binary, the value range can cover all ports (e.g., when N=4, 2). 4 =16, the remainder is at most 15, which can be converted to 4 bits of binary, corresponding to 4 output ports.

[0078] Then the SDN controller first sorts out each forwarding device F j All forwarding paths that the data has passed through, and historical forwarding information for each historical forwarding path (including prime number tags t). m Remainder b m (where m is the number of paths), and calculates the unique forwarding code of the forwarding device based on historical forwarding information using the Chinese Remainder Theorem (CRT). The calculation formula is as follows:

[0079] ;

[0080] in, For the Chinese Remainder Theorem algorithm, Labeling prime numbers The corresponding forwarding remainder.

[0081] The Chinese Remainder Theorem (CRT) is defined as follows: If there exists a pair of pairwise integers t1, t2, ... t... i , ...,t m and any integers b1, b2, ... b i , ...,b m Then there exists a unique integer M (modulo t1×t2×t) i ...×t m ), such that M mod t k =b k (k=1,2,...,m). In this application, the CRT is used to calculate a single forwarding code for each forwarding device based on multiple sets of "prime tag-forwarding remainders". .

[0082] Suppose it has flowed through a certain forwarding device F jThe prime number tags and forwarding remainders corresponding to the forwarding paths are as follows: (t1=29, b1=1), (t2=17, b2=8), (t3=19, b3=6), (t4=23, b4=11). Therefore, the formula for calculating the forwarding code is as follows: =CRT[(29,17,19,23),(1,8,6,11)]=119771, subsequent forwarding device F j Only this value needs to be stored to handle forwarding of 4 paths. For example, forwarding device F j If data packets need to be forwarded from ports 2 and 4, then when N=4, the binary representation of the port mapping is 1010, corresponding to the decimal remainder b. p =10.

[0083] After the forwarding codes for each forwarding device are calculated, the SDN controller sends the calculated forwarding codes to the corresponding forwarding devices through flow tables (such as OpenFlow flow tables). The forwarding devices store the codes in their local caches (such as hardware caches) for subsequent packet forwarding calculations.

[0084] When an edge ingress device receives a regular IP data packet sent from outside the domain (the destination address is not within the local network domain and needs to be forwarded through the domain), it first retrieves the unique prime label t assigned by the SDN controller from the prime label set, based on the packet's forwarding path (pre-planned by the SDN controller). i , then t i Encapsulated into the IP packet header (forming a structure of "prime number tag + IP packet"), completing the intra-domain identification of the packet.

[0085] Edge entry devices, internal forwarding devices, and edge exit devices (when the outbound logic is not triggered) within the network domain receive a prime number tag t. i After receiving the data packet, perform the following operations:

[0086] Extract the prime number tag t from the packet header i ;

[0087] Retrieve the locally stored forwarding code for the prime number label t i Perform modulo operation, the calculation formula is as follows: b p = modt i (b) p (remainder of forwarding)

[0088] b p Convert to an N-bit binary number (e.g., N=4, b) p =8 corresponds to binary 1000), each bit of the binary number corresponds to an output port of the forwarding device ("1" indicates that the port needs to forward, "0" indicates that it does not forward).

[0089] Data packets are forwarded through the output port identified by a binary number.

[0090] For example, forwarding device F j The stored forwarding code value is 119771. When the inserted prime number tag t is received... i When the data packet is 29, the forwarding remainder is calculated by modulo operation: 119771 mod 29 = 1, which is 0001 in binary, corresponding to port 1. Therefore, the current data packet is forwarded from port 1 of the current forwarding device.

[0091] The edge export device receives a tag with a prime number t i When a data packet needs to be forwarded out of the network domain (e.g., the destination address of the data packet is a device outside the domain), the prime number tag t should be removed from the data packet header first. i It is then converted back into a regular IP data packet and forwarded to an external device to ensure that the external device can resolve it correctly (the external device does not support prime number tag logic).

[0092] With the above scheme, forwarding devices do not need to maintain traditional routing tables or MPLS LFIB tables; they can complete forwarding using only prime labels and forwarding codes, reducing device configuration and maintenance costs. Furthermore, by globally allocating prime labels through the SDN controller, forwarding devices do not need to exchange label information as in MPLS, reducing additional network traffic. Through the uniqueness of prime labels and multi-port mapping of forwarding remainders, unicast (single-port binary), multicast (multi-port binary), and broadcast (all-1 binary) are naturally supported, overcoming MPLS's unsuitability for multicast. The SDN controller can dynamically adjust prime label allocation and forwarding code calculation, flexibly modifying forwarding paths to adapt to changes in network topology or service requirements.

[0093] In some embodiments, the SDN controller is further configured to perform the following steps:

[0094] Based on the prime number label t i Calculate a global label product The calculation formula is as follows:

[0095] ;

[0096] in, Indicates the cumulative multiplication symbol;

[0097] Global label product Distribute the data to each forwarding device for storage;

[0098] The forwarding device is also used to perform the following steps:

[0099] Based on global label product With the prime number tag t in the data packet iThe specific steps to determine whether to forward a data packet are as follows:

[0100] like If the current data packet is selected, the forwarding device forwards it; otherwise, the forwarding device discards it. , Modulo operation.

[0101] In this embodiment, the forwarding device performs a data packet validity verification before calculating the forwarding remainder. The specific steps are as follows:

[0102] Extract the prime number tag t from the packet header i ;

[0103] Calling local storage M cd Perform modulo operation: result = M cd mod t i ;

[0104] If result = 0, that is, t i It is M cd The factors of t i The SDN controller assigns a valid prime number label. The forwarding device calculates the forwarding remainder using the forwarding code and the prime number label, determines the output port using the forwarding remainder, and forwards the current data packet through the determined output port.

[0105] If result ≠ 0, it means t i If the label is invalid (such as an externally forged label or an incorrectly encapsulated label), the forwarding device will directly discard the data packet and will not perform any subsequent forwarding operations.

[0106] The above scheme is implemented through M cd Verification can quickly identify data packets carrying illegal tags, preventing illegal data from consuming network bandwidth or causing forwarding errors, thus improving network security. Furthermore, the validity verification of data packets is performed locally by the forwarding device, eliminating the need to query the SDN controller for the validity of prime number tags, reducing the amount of interaction between the SDN controller and the forwarding device, and improving network response speed.

[0107] In some embodiments, when calculating the global label product When, the combination of prime number labels used is any one of the following:

[0108] All combinations of prime number labels in the prime number label set;

[0109] The set of prime number tags has been distributed to all forwarding devices within the network domain;

[0110] The set of prime number labels is the combination of prime number labels used in data packets being forwarded within the network domain.

[0111] In this embodiment, the calculation is performed using the three different combinations of prime number labels mentioned above. The advantages and disadvantages are shown in Table 1 below:

[0112] Table 1 Calculation of different prime number label combinations Advantages and disadvantages

[0113] Tag combination Update frequency Storage space Judgment efficiency All tags in the prime tag set Low Large Low Tags in the prime tag set that have been issued Medium Medium Medium Tags in the prime tag set that are in use High Small High

[0114] Calculate using all tags in the set of prime number tags No updates are needed during subsequent forwarding. The drawback is that at this time... The value is large, requiring a large amount of storage space, and at the same time, it needs to be determined. It will take a long time.

[0115] Calculate using the prime number tags already distributed in the prime number tag set. During subsequent forwarding, whenever a new tag is used, it needs to be updated. The advantage is that at this time... Smaller values ​​require less storage space, and the judgment is also faster. It takes less time.

[0116] Calculate using the prime number labels already in use from the set of prime number labels. In subsequent forwarding processes, updates are required not only when new prime number tags are used. When old labels are no longer in use, they also need to be updated. Furthermore, unused prime number tags also need to be recycled. The advantage is that at this point... The value is the smallest, and the storage space occupied is also the smallest. Simultaneously, the judgment... It requires the least amount of time.

[0117] In practical scenarios, suitable combinations of prime labels for calculating the label product can be selected based on the characteristics of the network devices. For example, three combinations can be flexibly chosen according to network scale, label update frequency, and device storage resources. When the SDN controller has sufficient storage resources, combination 1 (all labels in the prime label set to reduce update operations) can be selected. When the SDN controller has limited storage resources, combination 3 (labels currently in use in the prime label set to improve the verification efficiency of subsequent data packets) can be selected, achieving a balance between resources and performance. The M values ​​of the three combinations... cd The calculation logic is based on the accumulation of prime numbers, and the verification logic of the forwarding device does not need to be modified. Only the SDN controller needs to adjust the range of prime number tag combinations for input calculation, which reduces the cost of solution upgrade and has good compatibility.

[0118] In some embodiments, such as Figure 3As shown, the method further includes:

[0119] Step S301: Based on the number of output ports of each forwarding device in the network domain, divide all forwarding devices into multiple device groups according to the gradient, and determine a subset of prime number labels within each device group.

[0120] In step S301, a device group is a collection of devices divided according to the number of output ports of the forwarding devices within the network domain. For example, devices with 4-8 output ports are divided into group 1, and devices with 9-16 output ports are divided into group 2, so as to achieve centralized management of devices with similar number of ports.

[0121] The prime number tag subset is a set of prime number tags assigned separately to each device group. It is a subset of the "prime number tag set". The prime number tags in the subset still satisfy the pairwise coprime property.

[0122] The lower bound of the prime number labels in the prime number label subset corresponding to each device group is denoted as t. sub The lower bound of the values ​​of prime number labels in the prime number label subset (t) sub () refers to the lower bound of the smallest prime number label in each subset of prime number labels, which must satisfy t sub ≥ ,in, This represents the maximum value of the output port of the forwarding device within the l-th device group, ensuring that the prime number labels in the subset can adapt to the port mapping requirements of the devices in this group.

[0123] Step S302: When it is necessary to assign a prime label to a new forwarding path, select an unused prime label from the subset of prime labels corresponding to the device group to which the forwarding device with the most ports required by the forwarding path belongs.

[0124] In practical applications, the SDN controller performs the following operations:

[0125] Collect the number of output ports of all forwarding devices in the network domain (e.g., forwarding device A has 4 ports, device B has 10 ports, and device C has 6 ports).

[0126] Devices are grouped according to the number of ports (e.g., the port number division gradient is set as [1-8], [9-16], [17-32]). Among the aforementioned forwarding devices, forwarding device A (with 4 ports) and forwarding device C (with 6 ports) are assigned to group 1 (N). l =8), forwarding device B (with 10 ports) is assigned to group 2 (N) l =16);

[0127] Record the maximum number of ports N in each group. lFor example, N in group 1 l =8, N in group 2 l =16.

[0128] For each device group, the SDN controller constructs a separate subset of prime number tags, as follows:

[0129] Calculate the lower bound t of the subset sub , where the lower bound t of the subset of group 1 sub ≥2 8 =256, the lower bound t of the subset of group 2 sub ≥2 16 =65536;

[0130] Select prime number labels for the subsets. The prime number label subset corresponding to group 1 is {257, 263, 269, ...} (all values ​​are greater than 256 and are pairwise coprime), and the prime number label subset corresponding to group 2 is {65537, 65539, 65543, ...} (all values ​​are greater than 65536 and are pairwise coprime).

[0131] When a new forwarding path is added, the SDN controller analyzes all the forwarding devices traversed by that path to determine the device group to which these devices belong. If a forwarding path passes through only forwarding devices belonging to the same device group, such as forwarding device A and forwarding device C in group 1, where forwarding device A is an edge ingress device, the SDN controller will select an unused prime label from the subset of prime labels corresponding to group 1, such as 263, and issue it to forwarding device A. After forwarding device A receives an IP packet from outside the domain, it adds this prime label to the header of the received IP packet.

[0132] If a forwarding path crosses multiple groups and passes through forwarding devices in multiple device groups, such as forwarding device A in group 1 and forwarding device B in group 2, then an unused prime number tag is selected from the prime number tag subset corresponding to the forwarding device with the most output ports. For example, 65539 is selected from the prime number tag subset corresponding to group 2 and sent to forwarding device A.

[0133] The above design avoids assigning excessively large prime number tags to forwarding devices with a low number of ports (e.g., a 4-port device does not need to use a tag greater than 65536), reducing tag value redundancy and improving remainder calculation efficiency. Furthermore, the prime number tags in the subset are adapted to the number of ports in the group, ensuring no wasted bits when converting the forwarding remainder to binary, reducing invalid calculations for device port determination, and improving forwarding efficiency.

[0134] In some embodiments, such as Figure 4As shown, before executing step S5, the method further includes a computation mode selection step, which is performed by the SDN controller in the following steps:

[0135] S41: Evaluate the current compute resource idle rate C of the SDN controller. s And to assess the idle rate C of computing resources of each forwarding device within the network domain. Fj ;

[0136] S42: Dynamically select the calculation mode based on the evaluation results:

[0137] If C s Higher than the first preset threshold and C Fj

[0138] If the value is below the second preset threshold, the controller calculation mode is selected, specifically: the SDN controller calculates the forwarding code. Then, further processing is performed on each F-line flowing through the forwarding device. j The prime number label t of the forwarding path i Calculate its corresponding forwarding remainder b i The calculation formula is b i = mod t i And forward the remainder b i With the corresponding prime number label t i The mapping relationship is sent to the forwarding device F. j Otherwise, select the device computing mode, specifically: the SDN controller will forward the code. Send to forwarding device F j ; Relay device F j When executing step S5, the following judgment is made: if the local received storage contains the mapping relationship, then based on the prime number tag t in the data packet... i Find the corresponding forwarding remainder b from the mapping relationship. i and b i As the remainder of forwarding b p If the local storage contains a forwarding code Then execute mod t i The calculation is performed to obtain the forwarding remainder b. p .

[0139] In this embodiment, the resource idle rate C s The metric used to measure the remaining computing power of an SDN controller is calculated as the percentage of idle computing resources out of the total computing resources. A higher value indicates more sufficient computing power.

[0140] In practical applications, the SDN controller performs the following evaluation periodically (e.g., every 10 seconds):

[0141] Calculate resource idle rate C s By monitoring the CPU utilization and memory usage of the SDN controller, the proportion of idle resources is calculated. For example, if the CPU utilization is 20%, then C... s =80%.

[0142] Calculate the idle rate of computing resources C of the forwarding device Fj Collect the idle rate of computing resources for each forwarding device, such as 25% for forwarding device A, 35% for forwarding device B, and 35% for forwarding device C. Fj .

[0143] Then, select the mode based on the evaluation results: If C s >First preset threshold (e.g., 70%) and C Fj If the threshold is less than the second preset threshold (e.g., 40%), it indicates that the SDN controller has sufficient computing resources, but the forwarding devices within the network domain have limited resources. In this case, after calculating the forwarding code, the SDN controller will perform the following additional calculations: based on the forwarding code issued to each forwarding device and the prime number label assigned to each forwarding path, it will perform a modulo operation to calculate the forwarding remainder corresponding to each forwarding device. The mapping table between the prime number label and the forwarding remainder will then be sent to the forwarding devices, which will then receive and store the mapping table.

[0144] Other cases (such as C) s ≤70% or C Fj (≥40%) indicates that the forwarding device resources are sufficient or the SDN controller resources are strained. In this case, after calculating the forwarding code of each forwarding device, only the forwarding code is sent to each forwarding device, and the mapping table is not calculated. That is, each forwarding device calculates the forwarding remainder by calling its own computing power resources based on the forwarding code and prime number tag stored locally.

[0145] Preferably, the first and second preset thresholds are not fixed values; the SDN controller can dynamically adjust them based on historical network load data. If the system is in controller computing mode for an extended period, the first preset threshold can be lowered (e.g., from 70% to 60%) to trigger forwarding devices to share the computing load earlier. If the network is latency-sensitive (e.g., in a real-time video transmission scenario), the second preset threshold can be appropriately increased (e.g., from 30% to 40%) to prioritize the computing speed of forwarding devices.

[0146] The above approach avoids over-concentrating computational tasks on the SDN controller or forwarding devices within the network domain. When the forwarding devices are under high load, the SDN controller handles the computation; when the SDN controller is under high load, the forwarding devices share the load, improving overall network performance. Simultaneously, the forwarding devices can automatically switch execution logic based on their local storage (mapping tables or forwarding codes), reducing deployment costs.

[0147] In some embodiments, such asFigure 5 As shown, the forwarding code As the method uses a dynamic code, it also includes a forwarding code update step, as detailed below:

[0148] Step S501: When the SDN controller assigns a prime label t to a new forwarding path new At that time, the SDN controller determines the set of target forwarding devices that need to update the forwarding code based on the forwarding devices traversed by the new forwarding path;

[0149] For each forwarding device in the target forwarding device set, the SDN controller recalculates a new forwarding code based on the historical forwarding information of that forwarding device and the new forwarding information corresponding to the new forwarding path, and updates the forwarding code accordingly. Send to the corresponding forwarding device F j .

[0150] In this embodiment, the dynamic code refers to a forwarding code that is not a fixed value but can be dynamically updated as new forwarding paths are added within the network domain, ensuring that it always adapts to the latest set of forwarding paths. A new forwarding path refers to a forwarding path planned by the SDN controller to meet new service requirements (such as new users or new services), which requires the allocation of a new prime number label t. new The target forwarding device set refers to all forwarding devices (including edge ingress devices, internal forwarding devices, and edge egress devices) traversed by the new forwarding path. The forwarding codes of these devices need to be updated for the new path.

[0151] When the SDN controller assigns a prime number label t to a new forwarding path new When the new path is resolved, the topology of the new path is parsed. For example, if the new forwarding path is "Edge ingress device E1 → Internal forwarding device I1 → Internal forwarding device I2 → Edge egress device E2", all forwarding devices traversed by the forwarding path are extracted to form the target forwarding device set {E1, I1, I2, E2}.

[0152] For each forwarding device in the target set, the first step is to collect the historical forwarding information of all forwarding devices in the set, i.e., the existing "prime number tag-forwarding remainder" pairs, such as (t1, b1), (t2, b2), etc. Then, new forwarding information is added, i.e., the "t" values ​​of the new forwarding path on each forwarding device in the target forwarding device set. new -b new "Yes, of which, b" new This represents the forwarding remainder on the forwarding device for the new forwarding path. Then, based on historical forwarding information and the forwarding information of the new forwarding path, the forwarding code is recalculated using the CRT, with the formula: CRT[(t1,t2,...,t...]. new ),(b1,b2,...,b newAfter the calculation is completed, the SDN controller sends the newly calculated forwarding codes of each forwarding device to the corresponding forwarding devices through the flow table. The forwarding devices receive and temporarily store the new forwarding codes, waiting for the switching opportunity (such as when there are no data packets to process), to replace the old forwarding codes, and use the new forwarding codes to perform subsequent forwarding remainder calculations.

[0153] The above solution enables the network domain to flexibly add new forwarding paths without restarting devices or interrupting existing forwarding, thus meeting business expansion needs. Adding a new forwarding path only requires updating the forwarding code of the relevant forwarding device, without modifying the overall network device configuration, reducing maintenance costs. During the forwarding code update process, the forwarding device can process existing data packets before switching to the new code, avoiding forwarding interruptions or errors.

[0154] In some embodiments, such as Figure 6 As shown, the forwarding code update step is performed by the SDN controller according to the following optimized steps: S601: For each forwarding device F j Maintain an update counter, which records the number of new forwarding paths that the SDN controller determines need to be processed by the forwarding device since the last forwarding code update; S602: When the value of any update counter reaches a preset number threshold, or within a certain time window T window When the growth rate of the internal update counter exceeds the preset rate threshold, a batch update process is triggered; S603: After the batch update process is triggered, the SDN controller recalculates the forwarding code for all forwarding devices that need to be updated, and uniformly distributes the recalculated forwarding code to the corresponding forwarding devices; S604: After the forwarding code is distributed, the SDN controller resets the corresponding update counter.

[0155] In this embodiment, the SDN controller is configured for each forwarding device F. j An independent update counter is allocated, with an initial value of 0. The counter is updated whenever a new forwarding path passes through forwarding device F. j When the counter value is incremented by 1, for example, if a forwarding device adds 3 forwarding paths, the counter value will be 3.

[0156] After triggering the batch update command, the SDN controller collects all forwarding devices with counter values ​​greater than 0 (i.e., devices requiring updates). For each device requiring an update, based on all its historical forwarding information and the forwarding information of newly added forwarding paths, it recalculates the corresponding forwarding code. All new forwarding codes are then uniformly distributed to the corresponding forwarding devices via batch flow tables, reducing the communication overhead of multiple distributions. After all new forwarding codes have been distributed and the forwarding devices have confirmed receipt, the SDN controller resets the update counter of the corresponding device to 0, awaiting the next round of counting.

[0157] The above scheme combines multiple individual updates of the forwarding code into a single batch update, reducing the control channel communication volume between the SDN controller and the forwarding device. This is particularly suitable for scenarios where new forwarding paths are frequently added. By controlling the number or rate thresholds, it ensures that the update of the forwarding code is not excessively delayed (triggered immediately when the number / rate conditions are met), while avoiding unnecessary frequent updates.

[0158] like Figure 7 As shown, in a second aspect, this application provides an SDN network packet forwarding system based on prime number labels. The system includes a network domain, which includes an SDN controller and multiple forwarding devices. The forwarding devices include network domain edge ingress devices, edge egress devices, and internal forwarding devices. The SDN controller and the multiple forwarding devices interact according to the method described in the first aspect of this application.

[0159] It should be noted that although the above embodiments have been described herein, this does not limit the scope of patent protection of the present invention. Therefore, any changes and modifications made to the embodiments described herein based on the innovative concept of the present invention, or equivalent structural or procedural transformations made using the content of the present invention's specification and drawings, directly or indirectly applying the above technical solutions to other related technical fields, are all included within the scope of patent protection of the present invention.

Claims

1. A method for prime number label based SDN network packet forwarding, suitable for a network domain, characterized in that, The network domain comprises an SDN controller and a plurality of forwarding devices, the forwarding devices comprising network domain edge ingress devices, edge egress devices and internal forwarding devices; The method comprises the following steps performed by the SDN controller: S1: constructing a prime number label set, wherein the prime number label set comprises a plurality of prime number labels, and the value of the smallest prime number label is greater than N is the maximum number of output ports of the forwarding device in the network domain. S2: for each forwarding device F in the network domain j calculating a unique forwarding code , the forwarding code based on the forwarding information of each forwarding path that has ever passed through the forwarding device F j , the forwarding information including a prime number label t i and a forwarding remainder b i assigned to each forwarding path, the forwarding remainder b i corresponding to the output port identification of each forwarding path at the forwarding device F j , i being the index of the forwarding path, i ranging from 1 to m, m representing the number of forwarding paths; S3: send the forwarding code to the corresponding forwarding device F j store, j is the index of the forwarding device, j ∈ [1, T], T is the number of forwarding devices in the network domain; the forwarding device performs the following steps:​ S4: the edge entry device acquires one prime number label t from the prime number label set according to the forwarding path when receiving a data packet with a destination address not in the network domain, and encapsulates the prime number label t for the data packet i issued by the SDN controller S5: Each forwarding device F in the network domain j Upon receiving a data packet carrying a prime number label t i , a modulo operation is performed on the prime number label t i using a locally stored forwarding code to obtain a forwarding remainder b p corresponding to the current forwarding device, and an output port is determined according to the forwarding remainder b p , and the data packet is forwarded through the determined output port. S6: The edge egress device removes the prime number tag t from the data packet before forwarding the data packet out of the network domain i .

2. The prime number tag based SDN network packet forwarding method of claim 1, wherein, Forwarding code The forwarding information of each forwarding path based on the once flowing through the forwarding device F j is calculated according to the Chinese remainder theorem, and the calculation formula is as follows: ; wherein, is a Chinese remainder theorem algorithm, is a prime label corresponding forwarding remainder.

3. The prime number tag based SDN network packet forwarding method of claim 1 or 2, wherein, The SDN controller is further configured to perform the following steps: According to the prime number tag t i Computing a global tag product The calculation formula is as follows: ; wherein represents a cumulative multiplication symbol; Global label product Distribute the data to each forwarding device for storage; The forwarding devices are further configured to perform the following steps: According to the global label product With the prime number label t in the data packet i Determine whether to forward the data packet, specifically: If then the forwarding device forwards the current packet, otherwise the forwarding device drops the current packet, , is a modulo operation.

4. The prime number tag based SDN network packet forwarding method of claim 3, wherein, Calculating the global label product When, the combination of prime number labels used is any one of the following: All prime label combinations in the prime label set; Prime label combinations in the prime label set that have been assigned to all forwarding devices in the network domain; Prime label combinations in the prime label set that are used in the data packets being forwarded in the network domain.

5. The prime number label based SDN network packet forwarding method of claim 3 or 4, wherein, The method further comprises: According to the size of the output port number of each forwarding device in the network domain, all the forwarding devices are divided into multiple device groups in gradient, and a prime label sub-set in each device group is determined, and the lower bound of the value of the prime label in the prime label sub-set corresponding to each device group is denoted as t sub , t sub is not less than , , and the maximum value of the output port of the forwarding device in the lth device group is denoted as When a prime label needs to be assigned to a new forwarding path, a prime label that is not occupied is selected from a prime label subset corresponding to the device group to which the forwarding device with the largest number of ports required to be passed through by the forwarding path belongs.

6. The prime number tag based SDN network packet forwarding method of claim 1, wherein, Before step S5 is performed, the method further comprises a mode selection step, in which the SDN controller performs the following steps: S41: evaluate the current computing resource idle rate C of the SDN controller s and evaluate the computing resource idle rate C of each forwarding device in the network domain Fj ; S42: dynamically selecting a calculation mode according to the evaluation result: If C s is higher than the first preset threshold and C Fj is lower than the second preset threshold, the SDN controller calculates the mode, specifically, the SDN controller calculates the forwarding code , and further calculates the forwarding remainder b i for each prime number tag t i of the forwarding path through the forwarding device F j , the calculation formula is b i = mod t i , and the mapping relationship between the forwarding remainder b i and the corresponding prime number tag t i is sent to the forwarding device F j ; otherwise, the device calculates the mode, specifically, the SDN controller sends the forwarding code to the forwarding device F j ; when the forwarding device F j executes step S5, the following judgment is made: if the local storage stores the mapping relationship, the corresponding forwarding remainder b i is found from the mapping relationship according to the prime number tag t i in the data packet, and b i is taken as the forwarding remainder b p ; if the local storage stores the forwarding code , the operation of mod t i is performed to obtain the forwarding remainder b p .

7. The prime number tag based SDN network packet forwarding method of claim 1, wherein, The forwarding code The forwarding code is dynamic, and the method further comprises a forwarding code updating step, as follows: When the SDN controller assigns a prime number label t to a new forwarding path new The SDN controller determines a target set of forwarding devices that need to update their forwarding code according to the forwarding devices that the new forwarding path passes through. For each of the target forwarding device set, the SDN controller recalculates a new forwarding code based on historical forwarding information of the forwarding device and new forwarding information corresponding to the new forwarding path , and issues the updated forwarding code to the corresponding forwarding device F j .

8. The prime number tag based SDN network packet forwarding method of claim 7, wherein, The forwarding code updating step is performed by the SDN controller according to the following optimization steps: for each forwarding device F j maintaining an update counter for recording the number of new forwarding paths determined by the SDN controller and to be processed by the forwarding device since the last forwarding code update; triggering a batch updating process when the value of any update counter reaches a preset number threshold, or the growth rate of the value of the update counter exceeds a preset rate threshold within a certain time window T window within a certain time window T After the batch update process is triggered, the SDN controller re-computes the forwarding code for all forwarding devices that need to be updated, and assigns the re-computed forwarding code to the corresponding forwarding devices; after the forwarding code is assigned, the SDN controller resets the corresponding update counter.

9. A prime number tag based SDN network packet forwarding system, characterized in that, The system comprises a network domain, the network domain comprising an SDN controller and a plurality of forwarding devices, the forwarding devices comprising network domain edge ingress devices, edge egress devices and internal forwarding devices, the SDN controller and the plurality of forwarding devices interacting according to the method of any one of claims 1 to 8.