An instruction block loading system and loading method based on software-defined network

The SDN controller issues an instruction block code file in binary machine code format and is directly loaded into the SDN switch storage space, solving the problems of low loading efficiency of instruction blocks and large storage space in the prior art, and achieving efficient instruction block loading and storage optimization.

CN115567495BActive Publication Date: 2025-08-26INST OF ACOUSTICS CHINESE ACAD OF SCI +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110746394.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-01
Publication Date
2025-08-26
Estimated Expiration
2041-07-01

AI Technical Summary

Technical Problem

The existing instruction block loading method requires two compilation or dynamic connection descriptors need to be generated, resulting in a long compilation time and cannot meet the non-generic instruction requirements of SDN application scenarios, increasing switch storage space and code compilation time.

Method used

The SDN controller issues instruction block code files in binary machine code format to reduce control plane modification and directly load it into the SDN switch storage space, reduce code compilation time during the extended instruction process, and improve loading efficiency.

Benefits of technology

It improves the loading efficiency of instruction blocks, reduces the use of switch storage space, and solves the problems of instruction expansion complexity and storage space occupancy in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115567495B_ABST
    Figure CN115567495B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of computer network communications, and more specifically, relates to a system and method for loading instruction blocks based on software-defined networks. The system comprises: an SDN controller, configured to send a code file of an instruction block to be loaded, a block number of the instruction block to be loaded, and an operation indicator to an SDN switch; wherein the code file is in a binary machine code format; the block number of the instruction block to be loaded serves as a unique identifier of the instruction block and can uniquely identify the instruction block; and the SDN switch, configured to receive the code file of the instruction block to be loaded sent by the SDN controller, load the binary machine code in the code file into a local storage space of the SDN switch, and save the corresponding relationship between the block number of the instruction block to be loaded and the instruction block to be loaded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer network communications, and in particular, relates to an instruction block loading system and loading method based on a software defined network. Background Art

[0002] Software-defined Networking (SDN) is a network architecture that separates the control plane from data forwarding. The Protocol Oblivious Forwarding (POF) protocol, a southbound SDN protocol proposed by Huawei, uses {offset, length} to locate data. The data plane only needs to use a common instruction set to perform data operations, thus achieving protocol-aware forwarding and improving the programmability of SDN. POF instructions are divided into interpreted POF instructions and compiled POF instructions. Compiled POF instructions are not included in flow table entries. Instead, instruction blocks (consisting of a set of instructions) are stored in memory in a binary machine code format that can be directly recognized by the underlying layer.

[0003] There are two main types of existing instruction block loading methods:

[0004] In method one, the controller's compiler first compiles the user-written source code for each instruction block into standard POF messages. The switch then compiles the standard POF messages into directly recognizable binary machine code, which it then loads into local storage. However, method one requires compiling the instruction block twice to obtain the binary machine code recognizable by the switch. This double compilation process takes a long time and affects instruction block loading efficiency.

[0005] Method 2: Generate an instruction block code file based on the instructions in the POF instruction library provided by the SDN controller. The function name of the code file is the POF instruction library function name provided by the controller. The controller sends the instruction block code file, and the soft switch device compiles the instruction block code file into binary machine code and loads it into local storage space.

[0006] Although the second method only requires one compilation to obtain binary machine code that the switch can recognize, the switch needs to generate a dynamic link descriptor and can only load instructions from the SDN controller POF instruction library.

[0007] In summary, both existing methods lack consideration for the complexity of instruction expansion and require a compilation phase. For the two instruction block loading methods mentioned above, if new instructions need to be added, the POF instruction library provided by the SDN controller needs to be expanded, which involves a complex expansion process. As SDN application scenarios continue to evolve, the existing instructions in the POF protocol are unable to meet new data plane operation requirements, most of which are non-universal. Non-universal expansion of the POF instruction library places a significant burden on the SDN controller, significantly increasing the code compilation time during instruction block delivery, thereby reducing instruction block loading efficiency and increasing switch storage space usage. Summary of the Invention

[0008] To address the above-mentioned defects in the prior art, the present invention proposes an instruction block loading system and loading method based on software-defined networking. The present invention is mainly used in the process of loading instruction blocks in software-defined networks, and sends the code file of the instruction block to be loaded in binary machine code format through the SDN controller, thereby reducing the modification of the control plane in the process of extending instructions and reducing the code compilation time in the process of sending instruction blocks, thereby improving the loading efficiency of instruction blocks; by loading instruction blocks into the storage space of the SDN switch, the storage space occupied by the switch is reduced.

[0009] The present invention provides an instruction block loading system based on a software-defined network, the system comprising:

[0010] The SDN controller is configured to send a code file of an instruction block to be loaded, a block number of the instruction block to be loaded, and an operation indicator to the SDN switch; wherein the code file is a code file in a binary machine code format; and the block number of the instruction block to be loaded serves as a unique identifier of the instruction block, capable of uniquely identifying the instruction block;

[0011] The SDN switch is configured to receive a code file of an instruction block to be loaded, sent by the SDN controller, and load the binary machine code in the code file into the local storage space of the SDN switch; the SDN switch stores the correspondence between the block number of the instruction block to be loaded and the instruction block to be loaded.

[0012] As one of the improvements to the above technical solution, the SDN controller includes:

[0013] A generating module, configured to generate a block number and an operation indicator of an instruction block to be loaded; and

[0014] The sending module is used to send the code file of the instruction block to be loaded, the block number of the instruction block to be loaded, and the operation indicator to the SDN switch.

[0015] As one of the improvements to the above technical solution, the code files of the instruction blocks to be loaded include but are not limited to:

[0016] The number of the instruction to be executed in the instruction block to be loaded;

[0017] The numbers of the instructions to be executed include but are not limited to the instruction numbers of the standard instruction library provided by the SDN controller, which are instruction numbers that can be recognized by the SDN switch. Each instruction number has a corresponding execution function on the SDN switch; there is a one-to-one mapping relationship between each instruction number and each execution function;

[0018] Part of the input parameters of the execution function corresponding to the instructions to be executed in the instruction block to be loaded;

[0019] The order of instructions to be executed in the instruction block to be loaded.

[0020] As one of the improvements to the above technical solution, the SDN switch includes:

[0021] A receiving module, configured to receive a code file of a to-be-loaded instruction block, a block number of the to-be-loaded instruction block, and an operation indicator issued by the SDN controller; and

[0022] The loading module is used to load the binary machine code in the instruction block code file to be loaded into the local storage space of the SDN switch; and save the corresponding relationship between the block number of the instruction block to be loaded and the instruction block to be loaded.

[0023] As one of the improvements to the above technical solution, the SDN switch further includes:

[0024] An acquisition module, configured to determine a flow table entry corresponding to the message to be forwarded, and obtain a block number of an instruction block to be executed from the flow table entry;

[0025] The instruction block search module is used to find the corresponding instruction block to be executed according to the instruction number of the obtained execution instruction block, obtain some parameters of the execution function of the instruction to be executed and the order of the instructions to be executed;

[0026] an execution function search module, configured to obtain the execution function of the instruction to be executed according to the number of the instruction to be executed; and

[0027] The execution module is used to input the payload of the message to be forwarded, the content of the flow table entry, and some parameters of the execution function of the instruction to be executed as input parameters of the execution function of the instruction to be executed, and execute the execution function of the instruction to be executed.

[0028] The present invention also provides an instruction block loading method based on a software defined network, the method comprising:

[0029] Step 1) The SDN controller sends a code file of an instruction block to be loaded, the block number of the instruction block to be loaded, and an operation indicator to the SDN switch; wherein the code file is in binary machine code format and can be directly saved by the switch as an instruction block; the block number of the instruction block to be loaded serves as a unique identifier of the instruction block, which can uniquely identify the instruction block;

[0030] Step 2) The SDN switch receives the code file of the instruction block to be loaded sent by the SDN controller, and loads the binary machine code in the code file of the instruction block to be loaded into the local storage space of the SDN switch to form an instruction block.

[0031] As one of the improvements to the above technical solution, the method further includes:

[0032] Step 3) The SDN switch determines the flow table entry corresponding to the message to be forwarded, and obtains the block number of the instruction block to be executed from the flow table entry;

[0033] Step 4) The SDN switch finds the block of instructions to be executed, obtains some parameters of the execution function of the instructions to be executed and the order of the instructions to be executed;

[0034] Step 5) The SDN switch obtains the execution function of the instruction to be executed according to the number of the instruction to be executed;

[0035] Step 6) The SDN switch uses the payload of the message to be forwarded, the flow table entry content, and some parameters of the execution function of the instruction to be executed as input parameters of the execution function of the instruction to be executed, inputs them to the execution function of the instruction to be executed, and executes the execution function of the instruction to be executed;

[0036] Step 7) Continue to execute the instructions to be executed in sequence according to the order of the instructions to be executed obtained in step 4), and repeat steps 5) and 6) to execute the execution functions of the corresponding instructions to be executed until the instructions in the instruction block to be executed are completed.

[0037] As one of the improvements to the above technical solution, in step 2), before the SDN switch loads the binary machine code as an instruction block, the method further includes: the SDN switch checking whether the received information is complete, including but not limited to:

[0038] Whether the block number of the instruction block to be loaded is repeated;

[0039] Whether the instructions to be executed in the instruction block to be loaded have corresponding execution functions in the SDN switch;

[0040] Whether the input parameters of the execution function corresponding to the instructions to be executed in the instruction block to be loaded are complete.

[0041] The beneficial effects of the present invention compared with the prior art are:

[0042] The present invention issues a code file of the instruction block to be loaded in binary machine code format through the SDN controller, and directly loads the binary encoder code into the local storage space, greatly reducing the modification of the control plane during the instruction expansion process and eliminating the need for compilation, thereby improving the loading efficiency of the instruction block. By loading only the instruction block into the storage space of the SDN switch (POF switch), the storage space occupied by the POF switch is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a flow chart of an embodiment of a method for loading instruction blocks based on a software-defined network according to the present invention;

[0044] Figure 2 It is a flowchart of executing an instruction block of an instruction block loading method based on a software defined network of the present invention;

[0045] Figure 3 It is a structural diagram of an instruction block loading system based on a software defined network of the present invention;

[0046] Figure 4 This is a flowchart of instruction block loading of method 2 among the existing instruction block loading methods in the background art. DETAILED DESCRIPTION

[0047] The present invention will now be further described with reference to the accompanying drawings.

[0048] The present invention addresses scenarios where users need to customize the forwarding functionality of the SDN data plane and extend POF instructions. However, these instructions are non-universal, and directly extending the controller's provided POF instruction library would require a series of complex modifications. To address this situation, the instruction block loading system described in the present invention can be used to load instruction blocks containing non-universal instructions.

[0049] The present invention provides an instruction block loading system and loading method based on software-defined networking, which can solve the problem of excessive non-general instructions in the process of POF instruction expansion, which brings a great burden to the SDN controller. At the same time, it saves code compilation time in the process of instruction block issuance, thereby improving the loading efficiency of instruction blocks and reducing the storage space occupied by switches.

[0050] like Figure 3 As shown, the present invention provides an instruction block loading system based on a software defined network, the system comprising:

[0051] The SDN controller is configured to send a code file of an instruction block to be loaded, a block number of the instruction block to be loaded, and an operation indicator to the SDN switch; wherein the code file is a code file in a binary machine code format; and the block number of the instruction block to be loaded serves as a unique identifier of the instruction block, capable of uniquely identifying the instruction block;

[0052] The block number of the instruction block is generated in a manner including but not limited to being generated according to the content of the instruction block code file to be loaded and the SDN switch device number;

[0053] The operation indicator includes instruction operations for adding an instruction block, deleting an instruction block, and modifying an instruction block;

[0054] Using code files in binary machine code format, SDN switches can directly load them as instruction blocks without compilation, greatly improving loading efficiency.

[0055] Specifically, the SDN controller includes:

[0056] A generating module, configured to generate a block number and an operation indicator of an instruction block to be loaded; and

[0057] The sending module is used to send the code file of the instruction block to be loaded, the block number of the instruction block to be loaded, and the operation indicator to the SDN switch.

[0058] The code files of the instruction blocks to be loaded include but are not limited to:

[0059] The number of the instruction to be executed in the instruction block to be loaded;

[0060] The numbers of the instructions to be executed include but are not limited to the instruction numbers of the standard instruction library provided by the SDN controller, which are instruction numbers that can be recognized by the SDN switch. Each instruction number has a corresponding execution function on the SDN switch; there is a one-to-one mapping relationship between each instruction number and each execution function; the method provided by the present invention is to solve the problem of issuing instructions that are not in the standard instruction library. Only the switch needs to recognize the instruction number, and the controller does not need to recognize the instruction number.

[0061] Part of the input parameters of the execution function corresponding to the instructions to be executed in the instruction block to be loaded;

[0062] The order of instructions to be executed in the instruction block to be loaded.

[0063] The SDN switch is configured to receive a code file of an instruction block to be loaded, which is sent by the SDN controller, and load the binary machine code in the code file of the instruction block to be loaded into a local storage space of the SDN switch to form an instruction block to be loaded; wherein the SDN switch stores a correspondence between a block number of the instruction block to be loaded and the instruction block to be loaded;

[0064] The SDN switch determines the flow table entry corresponding to the message to be forwarded, and obtains the block number of the instruction block to be executed from the flow table entry;

[0065] The SDN switch finds the block of instructions to be executed, obtains some parameters of the execution function of the instructions to be executed, and obtains the order of the instructions to be executed;

[0066] The SDN switch obtains an execution function of the instruction to be executed according to the number of the instruction to be executed;

[0067] The SDN switch takes the payload of the message to be forwarded, the content of the flow table entry, and some parameters of the execution function of the instruction to be executed as input parameters of the execution function of the instruction to be executed, inputs them to the execution function of the instruction to be executed, and executes the execution function of the instruction to be executed.

[0068] Specifically, SDN switches include:

[0069] A receiving module, configured to receive a code file of a to-be-loaded instruction block, a block number of the to-be-loaded instruction block, and an operation indicator issued by the SDN controller;

[0070] The loading module is used to load the binary machine code in the instruction block code file to be loaded into the local storage space of the SDN switch to form an instruction block, which includes the binary machine code and the block number of the instruction block with a unique identifier; and save the corresponding relationship between the block number of the instruction block to be loaded and the instruction block to be loaded.

[0071] An acquisition module, configured to determine a flow table entry corresponding to the message to be forwarded, and obtain a block number of an instruction block to be executed from the flow table entry;

[0072] The instruction block search module is used to find the corresponding instruction block to be executed based on the instruction number of the obtained execution instruction block, and obtain some parameters of the execution function of the instruction to be executed and the order of the instructions to be executed; wherein, the partial parameters are based on the specific instruction and the execution function corresponding to the instruction, for example, the packetIn instruction requires the packetIn parameter of the execution function; wherein, the instruction block identifier indicates whether the content of the instruction block issued is to generate an instruction block or modify the instruction block; the instruction block search module matches the flow table entry and uses the block number of the instruction block in the flow table entry to find the corresponding instruction block.

[0073] an execution function search module, configured to obtain the execution function of the instruction to be executed according to the number of the instruction to be executed; and

[0074] The execution module is used to input the payload of the message to be forwarded, the content of the flow table entry, and some parameters of the execution function of the instruction to be executed as input parameters of the execution function of the instruction to be executed, and execute the execution function of the instruction to be executed.

[0075] The present invention also provides an instruction block loading method based on a software defined network, the method comprising:

[0076] Step 1) The SDN controller sends a code file of an instruction block to be loaded, a block number of the instruction block to be loaded, and an operation indicator to the SDN switch; wherein the code file is a code file in binary machine code format; the block number of the instruction block to be loaded serves as a unique identifier of the instruction block, which can uniquely identify the instruction block;

[0077] Step 2) The SDN switch receives the code file of the instruction block to be loaded issued by the SDN controller, and loads the binary machine code in the code file of the instruction block to be loaded into the local storage space of the SDN switch to form the instruction block to be loaded;

[0078] Step 3) The SDN switch determines the flow table entry corresponding to the message to be forwarded, and obtains the block number of the instruction block to be executed from the flow table entry;

[0079] Step 4) The SDN switch finds the block of instructions to be executed, obtains some parameters of the execution function of the instructions to be executed and the order of the instructions to be executed;

[0080] Step 5) The SDN switch obtains the execution function of the instruction to be executed according to the number of the instruction to be executed;

[0081] Step 6) The SDN switch uses the payload of the message to be forwarded, the flow table entry content, and some parameters of the execution function of the instruction to be executed as input parameters of the execution function of the instruction to be executed, inputs them to the execution function of the instruction to be executed, and executes the execution function of the instruction to be executed;

[0082] Step 7) Continue to execute the instructions to be executed in sequence according to the order of the instructions to be executed obtained in step 4), and repeat steps 5) and 6) to execute the execution functions of the corresponding instructions to be executed until the instructions in the instruction block to be executed are completed.

[0083] In step 3), before the SDN switch loads the binary machine code in the instruction block code file to be loaded as the instruction block, the method further includes: the SDN switch checking whether the received information is complete, including but not limited to:

[0084] Whether the block number of the instruction block to be loaded is repeated;

[0085] Whether the execution instructions in the instruction block to be loaded have corresponding execution functions in the SDN switch;

[0086] Whether the input parameters of the execution function corresponding to the instructions to be executed in the instruction block to be loaded are complete;

[0087] If there is a duplicate block number of the instruction block to be loaded, the execution instruction in the instruction block to be loaded has no corresponding execution function in the SDN switch, or the input parameters of the execution function corresponding to the instruction to be executed in the instruction block to be loaded are incomplete, the image controller returns an error code and the switch terminates the remaining operations.

[0088] Example 1.

[0089] When the execution instructions contained in the instruction block to be loaded are common execution instructions in the protocol-unaware forwarding POF instruction library provided by the SDN controller; Figure 1 As shown, the present invention provides an instruction block loading method based on software defined network:

[0090] First, the SDN controller generates a block number of the instruction block to be loaded based on the content of the instruction block code file to be loaded and the SDN switch device number, which is used to uniquely identify the instruction block;

[0091] According to the operation requirements, the corresponding operation indicator is obtained, indicating that the operation is to add an instruction block, delete an instruction block, or modify an instruction block;

[0092] Next, the SDN switch receives the instruction block code file, instruction block number, and operation indicator from the SDN controller. At this step, the SDN switch checks whether the received information is complete, including whether the instruction block number is unique; whether the instructions to be executed in the instruction block to be loaded have corresponding execution functions in the SDN switch; and whether the input parameters of the execution functions corresponding to the instructions to be executed in the instruction block to be loaded are complete. If there are any errors, the SDN switch returns an error message to the controller.

[0093] Next, the SDN switch loads the binary machine code in the instruction block code file to be loaded into the local storage space of the SDN switch, and saves the corresponding relationship between the instruction block number and the instruction block.

[0094] like Figure 2 As shown, the method further includes:

[0095] Step 1) The SDN switch determines the flow table entry corresponding to the message to be forwarded, and obtains the block number of the instruction block to be executed from the flow table entry;

[0096] Step 2) The SDN switch finds the block of instructions to be executed, obtains the identification number of the instruction to be executed, some parameters of the instruction function to be executed, and the order of the instructions to be executed;

[0097] Step 3) The SDN switch obtains an execution function for the instruction to be executed based on the number of the instruction to be executed; wherein each instruction number has a one-to-one mapping relationship with each instruction execution function;

[0098] Step 4) The SDN switch uses the payload of the message to be forwarded, the content of the flow table entry, and some parameters of the instruction function to be executed as input parameters of the instruction function to be executed, and executes the instruction function to be executed.

[0099] Step 5) Repeat steps 3 to 4 according to the order of the instructions to be executed obtained in step 2 until all the instructions in the instruction block to be executed are executed.

[0100] Example 2.

[0101] When the execution instruction contained in the instruction block to be loaded is a non-general execution instruction, that is, an execution instruction not included in the protocol-unaware forwarding POF instruction library provided by the SDN controller, the method of the present invention specifically includes:

[0102] First, the SDN controller generates a block number of the instruction block to be loaded based on the content of the instruction block code file to be loaded and the SDN switch device number, which is used to uniquely identify the instruction block;

[0103] Generate corresponding operation indicators according to the operation requirements, indicating that the operation is to add an instruction block, delete an instruction block, or modify an instruction block;

[0104] Send the instruction block code file, operation indicator and instruction block number to the SDN switch.

[0105] Next, the SDN switch receives the instruction block code file, operation indicator, and instruction block number from the SDN controller and loads the binary machine code from the instruction block code file into an instruction block. During this step, the SDN switch checks whether the received new message is complete, including whether the instruction block number is unique; whether the instructions to be executed in the loaded instruction block have corresponding execution functions in the SDN switch; and whether the input parameters for the corresponding execution functions of the instructions to be executed in the loaded instruction block are complete. If any errors are found, the switch returns an error message to the controller.

[0106] like Figure 2 As shown, the method further includes:

[0107] Step 1) The SDN switch determines the flow table entry corresponding to the message to be forwarded, and obtains the block number of the instruction block to be executed from the flow table entry;

[0108] Step 2) The SDN switch finds the block of instructions to be executed, obtains the identification number of the instruction to be executed, some parameters of the instruction function to be executed, and the order of the instructions to be executed;

[0109] Step 3) The SDN switch obtains an execution function for the instruction to be executed based on the number of the instruction to be executed; wherein each instruction number has a one-to-one mapping relationship with each instruction execution function;

[0110] Step 4) The SDN switch uses the payload of the message to be forwarded, the content of the flow table entry, and some parameters of the instruction function to be executed as input parameters of the instruction function to be executed, and executes the instruction function to be executed.

[0111] Step 5) Repeat steps 3 to 4 according to the order of the instructions to be executed obtained in step 2 until all the instructions in the instruction block to be executed are executed.

[0112] For non-general execution instructions, since they are not in the POF instruction library, method 2 is the existing loading method, such as Figure 4 As shown, if you want to load an instruction block containing non-general instructions, the specific process of the loading method provided by Method 2 is as follows:

[0113] Step 1) The controller POF instruction library and instruction library function add instructions that need to be expanded;

[0114] Step 2) The controller generation module generates the instruction block source code that needs to be issued according to the POF instruction library function;

[0115] Step 3) The controller sends the instruction block source code, instruction block number, and operation indicator;

[0116] Step 4) The soft switch device receives the instruction block source code file issued by the controller and determines whether the received information is complete. If not, it provides feedback to the controller. If complete, it proceeds to step 5.

[0117] Step 5) The soft switch device converts the source code in the instruction block code file into instruction block code and compiles it into binary machine code;

[0118] Step 6) The soft switch device generates a dynamic link descriptor;

[0119] Step 7) The soft switch device generates a dynamic link instruction block according to the binary machine code, and saves the description relationship between the dynamic link descriptor and the dynamic link instruction block.

[0120] Compared to the method described in the present invention, the second method requires first expanding the controller's POF instruction library functions when expanding non-universal instructions; the switch needs to convert the source code in the code file into instruction block code and compile it to obtain binary machine code; and the switch needs to generate a dynamic link descriptor and save the correspondence between the dynamic link descriptor and the instruction block. However, the present invention does not require expanding the controller's instruction library. The instruction block code files issued by the controller are directly in binary machine code format, requiring no conversion or compilation, and can be directly loaded to form instruction blocks, nor does it require the generation of a dynamic link descriptor, greatly improving loading efficiency.

[0121] Finally, it should be noted that the above embodiments are intended only to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions to the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention and are intended to be encompassed by the claims of the present invention.

Claims

1. An instruction block loading system based on software-defined network, characterized in that: The system includes: The SDN controller is configured to send a code file of an instruction block to be loaded, a block number of the instruction block to be loaded, and an operation indicator to the SDN switch; wherein the code file is a code file in a binary machine code format; and the block number of the instruction block to be loaded serves as a unique identifier of the instruction block, capable of uniquely identifying the instruction block; The SDN switch is configured to receive the code file of the instruction block to be loaded issued by the SDN controller, check whether the received information is complete, and load the binary machine code in the code file into the local storage space of the SDN switch; the SDN switch stores the correspondence between the block number of the instruction block to be loaded and the instruction block to be loaded; The checking of whether the received information is complete includes but is not limited to: Whether the block number of the instruction block to be loaded is repeated; Whether the instructions to be executed in the instruction block to be loaded have corresponding execution functions in the SDN switch; Whether the input parameters of the execution function corresponding to the to-be-executed instructions in the to-be-loaded instruction block are complete; The code files of the instruction block to be loaded include but are not limited to: The number of the instruction to be executed in the instruction block to be loaded; The numbers of the instructions to be executed include but are not limited to the instruction numbers of the standard instruction library provided by the SDN controller, which should be instruction numbers that can be recognized by the SDN switch. Each instruction number has a corresponding execution function on the SDN switch; there is a one-to-one mapping relationship between each instruction number and each execution function; Part of the input parameters of the execution function corresponding to the instructions to be executed in the instruction block to be loaded; The order of instructions to be executed in the instruction block to be loaded.

2. The instruction block loading system according to claim 1, characterized in that: The SDN controller includes: A generating module, configured to generate a block number and an operation indicator of an instruction block to be loaded; and The sending module is used to send the code file of the instruction block to be loaded, the block number of the instruction block to be loaded, and the operation indicator to the SDN switch.

3. The instruction block loading system according to claim 1, characterized in that: The SDN switch includes: A receiving module, configured to receive a code file of a to-be-loaded instruction block, a block number of the to-be-loaded instruction block, and an operation indicator issued by the SDN controller; and The loading module is used to load the binary machine code in the instruction block code file to be loaded into the local storage space of the SDN switch; and save the corresponding relationship between the block number of the instruction block to be loaded and the instruction block to be loaded.

4. The instruction block loading system according to claim 3, characterized in that: The SDN switch further includes: An acquisition module, configured to determine a flow table entry corresponding to the message to be forwarded, and obtain a block number of an instruction block to be executed from the flow table entry; The instruction block search module is used to find the corresponding instruction block to be executed according to the instruction number of the obtained execution instruction block, obtain some parameters of the execution function of the instruction to be executed and the order of the instructions to be executed; an execution function search module, configured to obtain the execution function of the instruction to be executed according to the number of the instruction to be executed; and The execution module is used to input the payload of the message to be forwarded, the content of the flow table entry, and some parameters of the execution function of the instruction to be executed as input parameters of the execution function of the instruction to be executed, and execute the execution function of the instruction to be executed.

5. A method for loading an instruction block based on a software-defined network, the method being implemented based on the instruction block loading system based on a software-defined network according to any one of claims 1 to 4, the method comprising: Step 1) The SDN controller sends a code file of an instruction block to be loaded, the block number of the instruction block to be loaded, and an operation indicator to the SDN switch; wherein the code file is in binary machine code format and can be directly saved by the switch as an instruction block; the block number of the instruction block to be loaded serves as a unique identifier of the instruction block, which can uniquely identify the instruction block; Step 2) The SDN switch receives the code file of the instruction block to be loaded issued by the SDN controller, and loads the binary machine code in the code file of the instruction block to be loaded into the local storage space of the SDN switch to form an instruction block; In step 2), before the SDN switch loads the binary machine code as an instruction block, the method further includes: the SDN switch checking whether the received information is complete, including but not limited to: Whether the block number of the instruction block to be loaded is repeated; Whether the instructions to be executed in the instruction block to be loaded have corresponding execution functions in the SDN switch; Whether the input parameters of the execution function corresponding to the instructions to be executed in the instruction block to be loaded are complete.

6. The instruction block loading method according to claim 5, characterized in that: The method further comprises: Step 3) The SDN switch determines the flow table entry corresponding to the message to be forwarded, and obtains the block number of the instruction block to be executed from the flow table entry; Step 4) The SDN switch finds the block of instructions to be executed, obtains some parameters of the execution function of the instructions to be executed and the order of the instructions to be executed; Step 5) The SDN switch obtains the execution function of the instruction to be executed according to the number of the instruction to be executed; Step 6) The SDN switch uses the payload of the message to be forwarded, the flow table entry content, and some parameters of the execution function of the instruction to be executed as input parameters of the execution function of the instruction to be executed, inputs them to the execution function of the instruction to be executed, and executes the execution function of the instruction to be executed; Step 7) Continue to execute the instructions to be executed in sequence according to the order of the instructions to be executed obtained in step 4), and repeat steps 5) and 6) to execute the execution functions of the corresponding instructions to be executed until the instructions in the instruction block to be executed are completed.

Citation Information

Patent Citations

  • Conflict detection method and apparatus and controller

    CN106301861A

  • Instruction block loading method and system, and soft exchange device

    CN106484375A