Multimodal network compilation method, system, and storage medium
The method converts multimodal network source code into intermediate representations and microcode instructions for programmable network elements, addressing deployment challenges by enabling flexible processing of custom protocol data packets and supporting user-defined fields.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-10-10
- Publication Date
- 2026-03-12
AI Technical Summary
Multimodal networks are difficult to deploy with programmable network element equipment due to the use of ASIC chips that have fixed logic for message identification, limiting the ability to expand or add new features, and the lack of open-source compilers for programmable ASICs.
A method involving the conversion of a multimodal network's source code into an intermediate representation, extraction of node attributes, and generation of programming instruction sequences for user-defined fields, followed by conversion into microcode instructions for programmable network elements, enabling flexible processing of custom protocol data packets.
This approach reduces the difficulty of developing and deploying multimodal networks by allowing flexible processing of custom protocol data packets, supporting user-defined fields and flex-edit functions, and mapping the network program to programmable network element devices.
Smart Images

Figure 0007828979000007 
Figure 0007828979000008 
Figure 0007828979000009
Abstract
Description
[Technical Field]
[0001] <Related Applications> This invention claims priority to a Chinese patent application entitled "Multimodal network compilation method, system and storage medium," filed on September 25, 2023, with application number 202311235737.7, the entire text of which is incorporated herein by reference.
[0002] The present invention relates to the field of network communications, and more particularly to a multimodal network compilation method, system and storage medium. [Background technology]
[0003] Multimodal network is an addressing and routing technology that supports diversity, and it is decomposed and analyzed according to the addressing mechanism, routing process, data message structure, data exchange process of network elements, application support method and other elements of various identity networks, and the operating logic of any identity space and the respective advantages are taken as the key points to construct an addressing and routing model for multimodal heterogeneous identity space.In multimodal network scenarios, it is necessary to use programmable network element equipment to support the processing of unknown protocol messages when designing network elements.
[0004] Traditional network switches use ASIC chips to switch data, and the data flow entering the switch is forwarded at a rate limited by the ASIC. Because the logic for identifying messages in ASIC chips is fixed and only supports specific protocols, once development is complete, it is difficult to continuously expand other applications, and adding new features requires chip R&D companies to spend a long time on development. Compilers for commercial chips developed by programmable ASICs are not open source and are subject to various non-disclosure agreements, making it difficult to deploy multimodal networks on programmable network element equipment.
[0005] In the related art, no effective solution has been provided to the problem that multimodal networks are difficult to deploy with programmable network element equipment. Summary of the Invention
[0006] According to various embodiments of the present invention, a multimodal network compilation method, system, and storage medium are provided.
[0007] In the first embodiment, obtaining an intermediate representation of a source code of a multimodal network, the intermediate representation being composed of a plurality of nodes, each node representing an intermediate representation element, and node types including at least one of a header, a structure, a parser, an action, a matching action table, and a control program; traversing the intermediate representation and extracting node attributes according to the traversed node type; converting the node attributes into a programming instruction sequence for a target network element device based on user-defined fields, wherein the target network element device supports user-defined fields and flex-edit functions; and converting the programming instruction sequence and preset flow table file into microcode instructions and transmitting the microcode instructions to the target network element device, wherein the preset flow table file carries instruction information for transferring the microcode instructions.
[0008] In some embodiments thereof, the step of traversing the intermediate representation and extracting node attributes according to the traversed node types comprises: constructing an abstract visitor and declaring interface methods to access concrete element classes; instantiating the abstract visitor, obtaining a concrete implementation visitor, and implementing an operation to access a concrete element class through the concrete implementation visitor.
[0009] In some embodiments thereof, the step of constructing an abstract visitor and declaring interface methods to access concrete element classes comprises: defining a visitor acceptance method for each node as an abstract node, the visitor acceptance method indicating that each node can be accessed by a visitor; representing the constants of the node type as concrete element classes and providing concrete implementations to access the concrete element classes.
[0010] In some embodiments thereof, the step of traversing the intermediate representation and extracting node attributes according to the traversed node types comprises: determining whether the current node is in a preset collection when traversing to the current node according to a preset search method, wherein the accessed node is stored in the preset collection; if yes, accessing the next node; If not, saving the current node in the preset collection and recursively accessing other nodes.
[0011] In some embodiments, the step of traversing to the current node according to the preset search method includes: first traversing the root node and then recursively traversing the child nodes of said root node; or for each parent node, first traversing the child nodes of said parent node and then traversing said parent node; or The method includes the steps of: importing the current node into a preset queue; if the preset queue is not empty, moving the current node out of the queue to access the current node; and if the current node has child nodes, importing the child nodes into the preset queue in order.
[0012] In some embodiments thereof, the intermediate representation comprises: A header intermediate representation in which each node represents one header and the node attributes include Node_type, which is a Type_Header constant, name, which is a header alias, and fields, which is a list collection containing header attributes and attribute lengths; An intermediate structure representation in which each node represents one structure and the attributes of the node include Node_type, which is a Type_Struct constant, name, which is the custom structure name, and fields, which is a list collection containing the structure variable type, variable name, and variable length; a parser intermediate representation in which the attributes of the root node include Node_type, which is a PolymorphicParser constant, name, which is the custom parser name, applyParams, and state, the applyParams node is for storing formal parameter variables, each formal parameter variable being one child node, the state node is for storing parsing statements, each state statement being one child node, the Node_type of the state child node is a ParserState constant, and the state child node includes a components child node for storing the method and parameters required for parsing the header and a selectExpression child node for identifying the next header to parse based on the header currently being parsed; The node attributes include Node_type, which is a PolymorphicAction constant, name, which is the custom action name, parameters, and body. The parameters node is for storing formal parameter variables, and each formal parameter variable is a child node. The body node is for storing action execution statements, and each action is a child node. An action intermediate representation. The attributes of the node include a match-action table intermediate representation that includes a TableProperties constant Node_type, a match-action table name, and properties that include the condition match node, action node, and default action node of the action table; The attributes of the node include a Node_type, which is a BlockStatement constant, and components, where the components node is for storing decision statements, each decision condition is one child node, the Node_type of the components child node is an IfStatement constant, and the attributes of components include a control program intermediate representation that includes a condition child node, an ifTrue child node, and an ifFalse child node.
[0013] In some embodiments, the action intermediate representation, the match action table intermediate representation, and the control program intermediate representation have the same parent node, and the attributes of the parent node include Node_type, which is a PolymorphicControl constant, name, which is the name of the custom control pipeline, applyParams, controlLocals, and body, the applyParams node is for storing formal parameter variables, and each formal parameter is one child node, the controlLocals node is composed of an action intermediate representation node and a match action table intermediate representation node, and the body node is composed of a control program intermediate representation node.
[0014] In some embodiments thereof, the step of traversing the intermediate representation and extracting node attributes according to the traversed node types comprises: When the Node_type of the traversed node is a Type_Header constant, extracting header attribute and attribute length information of the current node; When the Node_type of the traversed node is a Type_Struct constant, extracting the structure variable type, variable name, and variable length information of the current node; extracting parse statement information for the current node when the Node_type of the traversed node is a PolymorphicParser constant; extracting action execution information of the current node when the Node_type of the traversed node is a PolymorphicAction constant; extracting action table information of the current node when the Node_type of the traversed node is a TableProperties constant; extracting decision statement information of the current node when the Node_type of the traversed node is a BlockStatement constant.
[0015] In some embodiments, the programming instruction sequence of the target network element device is a key-value pair, the user-defined field is the key of the key-value pair, and the occupancy length, offset, priority, and offset starting point of the user-defined field are the values of the key-value pair.
[0016] In some embodiments thereof, the step of converting the programming instruction sequence and the preset flow table file into microcode instructions and transmitting the microcode instructions to the target network element device comprises: extracting field match values for the user-defined fields from the flow table file; and matching the extracted field match value with the programming instruction sequence to generate the microcode instruction.
[0017] In some embodiments thereof, the multimodal network includes at least one of an IPV4 network, an IPV6 network, a Mobile First network, a named network, a geographical indication network, and an industrial control agreement network.
[0018] In a second aspect, this embodiment provides a multimodal network compilation system, the multimodal network compilation system comprising: a front-end compiler for analyzing the source code of the multimodal network and generating an intermediate representation; a back-end compiler coupled to the front-end compiler for receiving the intermediate representation and for performing the multimodal network compilation method according to the first aspect.
[0019] In a third aspect, this embodiment provides a storage medium having a computer program stored thereon that, when executed by a processor, performs the multimodal network compilation method according to the first aspect above.
[0020] The details of one or more embodiments of the invention are set forth in the drawings and description below. Other features, objects, and advantages of the invention will become apparent from the description, drawings, and claims. [Brief explanation of the drawings]
[0021] To better describe and explain the embodiments and / or examples of the inventions disclosed herein, reference may be made to one or more drawings. Additional details or examples for illustrating the drawings should not be considered as limiting the scope of the disclosed inventions, either of the presently described embodiments and / or examples, or the best modes of these inventions as currently understood.
[0022] [Figure 1] FIG. 1 is a hardware structure block diagram of a terminal of a multimodal network compilation method according to one or more embodiments. [Figure 2] 1 is a flowchart of a multimodal network compilation method according to one or more embodiments. [Figure 3] FIG. 1 illustrates a principle diagram of a traversal intermediate representation according to one or more embodiments. [Figure 4] 1 is a flowchart of a multimodal network compilation method according to one or more embodiments. [Figure 5] FIG. 1 is an architectural block diagram of a multimodal network compilation system according to one or more embodiments. [Figure 6] FIG. 1 is an architectural block diagram of a multimodal network compilation system according to one or more embodiments. [Figure 7] 1 is a flowchart of a method of operating a multimodal network compilation system in accordance with one or more embodiments. [Figure 8] FIG. 2 is a diagram illustrating a data packet format according to one or more embodiments. [Figure 9] FIG. 1 is a diagram illustrating the internal structure of a computing device according to one or more embodiments. DETAILED DESCRIPTION OF THE INVENTION
[0023] The following clearly and completely describes the technical solutions of the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. It is obvious that the described embodiments are only some embodiments of the present invention, and do not represent all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without any creative work fall within the scope of protection of the present invention.
[0024] Unless otherwise defined, technical or scientific terms used herein shall have the common meaning understood by those skilled in the art. In the present invention, the terms "a," "one," "one kind," "this," "these," and similar terms do not limit the number and may refer to either singular or plural. The terms "comprise," "include," "included," "having," and any variations thereof in the present invention are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent in the process, method, product, or device. In the present invention, the terms "connect," "couple," "coupled," and similar terms are not limited to physical or mechanical connections and may include electrical connections, whether direct or indirect. In the present invention, the term "plurality" refers to two or more than two. "And / or" describes the relationship between related objects and indicates that three types of relationships can exist. For example, "A and / or B" can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. Generally, the character " / " indicates that the related objects before and after it are in an "or" relationship. The terms "first," "second," "third," etc., used in the present invention are merely used to distinguish between similar objects and do not indicate a particular order of the objects.
[0025] The method embodiments provided herein may be implemented in a terminal, a computer, or a similar computing device. For example, the method may be implemented in a terminal. FIG. 1 is a hardware structural block diagram of a terminal for implementing the multimodal network compilation method of one embodiment of the present invention. As shown in FIG. 1, the terminal may include one or more processors 102 (only one of which is shown in FIG. 1) and a memory 104 for storing data. The processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA. The terminal may further include a transmission device 106 and an input / output device 108 for communication functions. Those skilled in the art will appreciate that the structure shown in FIG. 1 is merely exemplary and does not limit the structure of the terminal. For example, the terminal may include more or fewer components than those shown in FIG. 1, or may have a different configuration than those shown in FIG. 1.
[0026] The memory 104 may be configured to store computer programs such as application software programs and modules, e.g., a computer program corresponding to the multimodal network compilation method of the present embodiment. The processor 102 executes the computer programs stored in the memory 104 to perform various functional applications and data processing, i.e., to implement the above-described method. The memory 104 may include high-speed random access memory or non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some embodiments, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0027] The transmission device 106 is for transmitting and receiving data over a network, including a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC) that can connect to other network devices via a base station and communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module for wirelessly communicating with the Internet. In one embodiment, FIG. 2 is a flowchart of the multimodal network compilation method of this embodiment, which is illustrated by taking the terminal shown in FIG. 1 as an example, and includes the following steps:
[0028] In step S201, an intermediate representation of the source code of the multimodal network is obtained, where the intermediate representation is composed of a plurality of nodes, each node representing one intermediate representation element, and the node types include at least one of a header, a structure, a parser, an action, a matching action table, and a control program.
[0029] Multimodal networks, including IPV4 networks, IPV6 networks, Mobile First networks, named networks, geographical indication networks, and industrial control agreement networks.
[0030] The intermediate representation element refers to the representation format of the source program during the conversion from the source code of the multimodal network to the target code. The intermediate representation element includes a header, a structure, a parser, an action, a match action table, and a control program. The type of the intermediate representation element is a node type.
[0031] The intermediate representation means that the intermediate representation elements are stored in a diagram structure. The intermediate representation may be a directed acyclic graph.
[0032] In step S202, the intermediate representation is traversed and node attributes are extracted according to the traversed node types.
[0033] The node attributes of each node include public attributes including the node type and node name, and special attributes that are set differently depending on the node type.
[0034] Step S203: converting the node attributes into a programming instruction sequence for the target network element equipment based on the user-defined field, where the target network element equipment supports the user-defined field and flex-edit function.
[0035] The target network element device supports the User Defined Field (UDF) and Flex Edit functions. UDF starts from the Layer 2 / Layer 3 / Layer 4 header of the message and specifies a specific field of the message at a custom offset. In combination with an Access Control List (ACL), it supports the purpose of processing special messages. Flex Edit starts from the Layer 2 / Layer 3 / Layer 4 header of the message and adds, deletes, or modifies a data segment of a specified length at a specified offset, customizing the message content according to the UDF function and enabling more flexible support for new protocol types.
[0036] The programming instruction sequence of the target network element device is a key-value pair, the user-defined field is the key of the key-value pair, and the occupancy length, offset, priority, and offset start point of the user-defined field are the values of the key-value pair.
[0037] Step S204 of converting the programming instruction sequence and the preset flow table file into microcode instructions and sending the microcode instructions to the target network element device, where the preset flow table file carries instruction information for transferring the microcode instructions.
[0038] Specifically, the field match value of the user-defined field is extracted from the flow table file, and the extracted field match value is matched with a programming instruction sequence to generate a microcode instruction.
[0039] In the above steps S201 to S204, by obtaining an intermediate representation of the source code of the multimodal network, node attributes are extracted, and the node attributes are converted into programming instruction sequences for the target network element device according to the user-defined fields. The programming instruction sequences and the preset flow table file are converted into microcode instructions, and the microcode instructions are sent to the target network element device, so that the underlying heterogeneous hardware resources of the network switch can be blocked. The multimodal network program is mapped to the programmable network element device, which reduces the difficulty of developing and deploying the multimodal network and realizes flexible processing of custom protocol data packets.
[0040] In one embodiment, the following types of intermediate representations are shown:
[0041] (1) A header intermediate representation, where each node represents one header, and the node attributes include Node_type, which is a Type_Header constant, name, which is a header alias, and fields, which is a list collection containing header attributes and attribute lengths.
[0042] (2) A structure intermediate representation, where each node represents one structure, and the attributes of the node include Node_type, which is a Type_Struct constant, name, which is the custom structure name, and fields, which is a list collection containing the structure variable type, variable name, and variable length.
[0043] (3) A parser intermediate representation, in which the attributes of the root node include a Node_type that is a PolymorphicParser constant, a name that is a custom parser name, applyParams, and state, in which the applyParams node is for storing formal parameter variables, each formal parameter variable being one child node, the state node is for storing parsing statements, each state statement being one child node, the Node_type of the state child node is a ParserState constant, and the state child node includes a components child node that stores the method and parameters required to parse the header and a selectExpression child node that identifies the next header to parse based on the currently parsed header.
[0044] (4) An action intermediate representation, in which the attributes of a node include a Node_type, which is a PolymorphicAction constant, a name, which is a custom action name, parameters, and body, in which the parameters node is for storing formal parameter variables, each formal parameter variable being one child node, and the body node is for storing action execution statements, each action being one child node.
[0045] (5) Match-action table intermediate representation, where the attributes of a node include Node_type, which is a TableProperties constant, name, which is the name of the match-action table, and properties, which include the condition match node, action node, and default action node of the action table.
[0046] (6) A control program intermediate representation, in which the attributes of a node include a Node_type, which is a BlockStatement constant, and components, where the components node is for storing decision statements, each decision condition is one child node, the Node_type of the components child node is an IfStatement constant, and the attributes of components include a condition child node, an ifTrue child node, and an ifFalse child node.
[0047] Furthermore, the action intermediate representation, match action table intermediate representation, and control program intermediate representation have the same parent node, and the attributes of the parent node include Node_type, which is a PolymorphicControl constant, name, which is the name of the custom control pipeline, applyParams, controlLocals, and body, the applyParams node is for storing formal parameter variables, and each formal parameter is one child node, the controlLocals node is composed of an action intermediate representation node and a match action table intermediate representation node, and the body node is composed of a control program intermediate representation node.
[0048] In one embodiment, the step of traversing the intermediate representation and extracting node attributes according to the traversed node type comprises: When the Node_type of the traversed node is a Type_Header constant, extracting header attribute and attribute length information of the current node; When the Node_type of the traversed node is a Type_Struct constant, extracting the structure variable type, variable name, and variable length information of the current node; extracting parse statement information for the current node when the Node_type of the traversed node is a PolymorphicParser constant; extracting action execution information of the current node when the Node_type of the traversed node is a PolymorphicAction constant; extracting action table information of the current node when the Node_type of the traversed node is a TableProperties constant; extracting decision statement information of the current node when the Node_type of the traversed node is a BlockStatement constant. In one embodiment, the step of traversing the intermediate representation and extracting node attributes according to the traversed node type includes the steps of constructing an abstract visitor and declaring interface methods to access concrete element classes, and instantiating the abstract visitor, obtaining concrete realization visitors, and implementing operations to access concrete element classes using the concrete realization visitors.
[0049] Furthermore, the step of constructing an abstract visitor and declaring interface methods for accessing concrete element classes includes the steps of defining a visitor acceptance method for each node as an abstract node, where the visitor acceptance method indicates that each node can be accessed by a visitor, and providing a concrete implementation for accessing the concrete element class by taking a constant expression of the node type as the concrete element class.
[0050] In this embodiment, the intermediate representation and the access actions are decoupled to provide extensibility to operations on the intermediate representation. For example, in a certain intermediate representation, nodes may be modified or added later, but the intermediate representation traversal method of this embodiment does not affect subsequent processing of the nodes.
[0051] For example, the terminal includes a back-end compiler, and FIG. 3 illustrates the principle of the traversal intermediate representation in this embodiment. As shown in FIG. 3, the back-end compiler 52 uses a visitor model to traverse a directed acyclic graph 31. The directed acyclic graph 31 is implemented using a DAGTree, which is a tree structure that allows a visitor object to traverse all abstract nodes 34 in a container. The abstract visitor 32 is used to declare interface methods for accessing specific element classes. The concrete implementation visitor 33 implements operations for accessing specific element classes 35 and specifies operations for visitors to access specific elements. The abstract nodes 34 define a visitor accept method accept, which indicates that each node can be accessed by a visitor. The concrete element classes 35 include TypeHeaderNode, TypeStructNode, ParserStateNode, PolymorphicActionNode, PolymorphicTableNode, and PolymorphicControlNode, and provide concrete implementations for visitors to access these element classes.
[0052] Furthermore, three optional preset search methods are shown below.
[0053] (1) First, traverse the root node, and then recursively traverse the child nodes of the root node.
[0054] (2) For each parent node, first traverse the child nodes of the parent node, then traverse the parent node.
[0055] (3) The current node is transferred to the preset queue, and if the preset queue is not empty, the current node is moved out of the queue and accessed, and if the current node has child nodes, the child nodes are transferred to the preset queue in order.
[0056] In one embodiment, Figure 4 shows a flowchart of another multimodal network compilation method. As shown in Figure 4, the flow includes: A step S401 of obtaining an intermediate representation of the source code of the multimodal network; Step S402: determining whether the intermediate representation has been successfully generated, and if so, executing step S403; if not, executing step S404; a step S403 of traversing the intermediate representation and extracting node attributes based on the Node_Type; Step S404 of processing according to the error case; Step S405: converting the node attributes into attribute information of the target platform according to the mapping rules between the source code and the target code of the multimodal network; Step S406: determining whether or not there is an error in the attribute information of the target platform, and if so, returning to step S404, and if not, executing step S407; Step S407: generating a programming instruction sequence identifiable for the target platform based on the attribute information of the target platform; Step S408 determines whether there is an error in the programming instruction sequence, and if so, returns to step S404, and if not, executes step S409; and step S409 of converting the programming instruction sequence and the preset flow table file into microcode instructions and outputting the microcode instructions to a target file.
[0057] Extract node attributes based on Node_type and convert them into attribute information of the target platform, convert the function format of the network element platform into a target platform action parameter set, generate a programming instruction sequence based on the user-defined field and flexedit network element equipment, and output it to a target file.
[0058] In one embodiment, a multimodal network compilation system is provided. Figure 5 is a structural block diagram of the multimodal network compilation system of this embodiment. As shown in Figure 5, the multimodal network compilation system 5 includes a front-end compiler 51 and a back-end compiler 52. Here, the front-end compiler 51 is for analyzing the source code of the multimodal network and generating intermediate representation data, and the back-end compiler 52 is coupled to the front-end compiler 51 to receive the intermediate representation and to perform the multimodal network compilation method of any of the method embodiments described above.
[0059] In one embodiment, Figure 6 provides a structural block diagram of another multimodal network compilation system. As shown in Figure 6, the front-end compiler 51 includes a lexical analysis module 511, a grammar analysis module 512, a semantics analysis module 513, and an intermediate code generation module 514, and the back-end compiler 52 includes a target code generation module 521.
[0060] A lexical analysis module 511 uses regular expression matching to extract words from the multimodal network source code and performs progressive scanning to identify grammatical elements, storing the identified grammatical elements in a hash table, where the keys of the hash table are type encodings consisting of keywords, operators, constants, and identifiers, and the values of the hash table are the names of the identifiers or constant values.
[0061] A grammar analysis module 512 for removing and integrating non-critical parts of the multimodal network source program, such as spaces, comments, etc., and generating an abstract syntax tree.
[0062] a semantics analysis module 513 for performing semantics checks to check whether the abstract syntax tree generated by the grammar analysis module 512 matches the defined semantics; if there are any semantic errors such as type errors, out-of-range length, repeated definitions, etc., the front-end compiler 51 terminates compilation and outputs error information.
[0063] an intermediate code generation module 514 for generating a directed acyclic graph of the intermediate representation based on the abstract syntax tree information and merging common sub-expressions;
[0064] a target code generation module 521 for taking the intermediate representation as input, generating an instruction set in the target language based on a mapping rule between the multimodal network source program language and the target language, and constructing it as a corresponding target file output;
[0065] In one embodiment, a method for operating a multimodal network compilation system is provided. FIG. 7 shows a flowchart of the method for operating a multimodal network compilation system in this embodiment. As shown in FIG. 7, the flow includes: Step S501 of programming using a multimodal network program to describe the data packet processing logic of the multimodal network; S502, using a multimodal network compilation system, compiling the multimodal network program as a sequence of identifiable programming instructions for a target platform, the target platform including user-defined fields and FlexEdit-based network element devices; and step S503, in the target platform, converting the programming instruction sequence and the flow table file into microcode instructions by an ASIC control plane driver and sending them to the ASIC chip.
[0066] Extract node attributes based on Node_type and convert them into attribute information of the target platform, convert the function format of the network element platform into a target platform action parameter set, generate a programming instruction sequence based on the user-defined field and flexedit network element equipment, and output it to a target file.
[0067] Multimodal networks, including IPV4 networks, IPV6 networks, Mobile First networks, named networks, geographical indication networks, and industrial control agreement networks.
[0068] Data packet processing logic refers to multimodal network data packet transmission. Specifically, it includes modeling of multimodal network data packet headers, modeling of multimodal network data packet header analysis, modeling of multimodal network tables and actions, and modeling of multimodal network control flow. Taking geographical display modal transmission as an example, a multimodal network program is used to create a geographical display modal program, addressing information such as latitude, longitude, and coverage area. The front-end compiler converts the multimodal network program into a target-independent intermediate representation and passes the intermediate representation to the back-end compiler, which converts the intermediate representation into a programming instruction sequence based on user-defined fields and flexedit.
[0069] In one embodiment, keywords were extracted from the match fields of the geographical display modal, such as latitude and longitude, length and width, shape, etc., as follows:
[0070] hdr.gbc.geoAreaPosLat, hdr.gbc.geoAreaPosLon, hdr.gbc.disa, hdr.gbc.disb, hdr.its.stationid
[0071] These keywords were converted into programming instruction sequence fields as follows:
[0072] “key”:{“disa”:{“length”:16,“offset”:496,“priority”:7,“start”:“L2”,“value”:“~ / ”},“disb”:{“length”:,“offset”:512,“priori ty”:7,“start”:“L2”,“value”:“~ / ”},“etherType”:{“length”:16,“offset”:96,“priority”:7,“start”:“L2”,“value”:“0x8947”},“geoA reaPosLat”:{“length”:32,“offset”:432,“priority”:7,“start”:“L2”,“value”:“~ / ”},“geoAreaPosLon”:{“length”:32,“offset”:464 ,“priority”:7,“start”:“L2”,“value”:“~ / ”},“stationid”:{“length”:32,“offset”:16,“priority”:7,“start”:“L2”,“value”:“~ / ”}}.
[0073] “length”:16 indicates that the length occupied by disa is 16 bits, “offset”:496 indicates that the offset is 496 bits, “priority”:7 indicates the priority, “start”:“L2” indicates that it is offset from the Layer 2 header field, and “value”:“~ / ” indicates that the matching value should be obtained according to the flow table.
[0074] At the same time as synchronizing the programming instruction sequence to the ASIC management plane driver, a flow table file is created to guide the ASIC chip transfer, and the format of the flow table is shown in Table 1. ID represents the flow table number, TABLE represents the table name, KEY represents the key of the key-value pair, ACTION represents the action to be performed, MATCH represents the user-defined field, and VALUE represents the field match value.
[0075] Table 1 Flow table format JPEG0007828979000001.jpg65170
[0076] The ASIC driver converts the microcode instructions into microcode instructions based on the flow table file and the programming instruction sequence, and sends the microcode instructions to the ASIC chip. The format of the microcode instructions is shown in Table 2. RULE represents the transfer rule of the microcode instructions.
[0077] Table 2 Microcode instruction format JPEG0007828979000002.jpg137170JPEG0007828979000003.jpg70170
[0078] In one embodiment, taking the mobile first network transmission as an example, a multimodal network program is used to create a mobile first network modal program, and a globally unique identifier GUID is used as its transmission addressing flag. Figure 8 shows a packet format diagram of this embodiment. As shown in Figure 8, the data packet format includes an Ethernet destination address, a source address, type 27c0 information, and a custom identity mark ID type, source identity src_guid, destination identity dest_guid field, and load.
[0079] The front-end compiler converts the multimodal network program into a target-independent intermediate representation and transfers the intermediate representation to the back-end compiler, which converts the intermediate representation into a programming instruction sequence based on the user-defined fields and flexedit, and converts the extracted keywords, for example, the match field of the geographical display modal is hdr.mf.dest_guid and the action field is change_mac, into programming instruction sequence fields.
[0080] "key":{"dest_guid":{"length":32,"offset":176,"priority":7,"start":"L2","value":"~ / "}},"action":{"change_mac":{"length":48,"offset":48,"priority":7,"start":"L2","value":"~ / "}},where "length":16 indicates that the length of the modified field of change_mac is 48 bits, "offset":48 indicates that the offset is 48 bits, "priority":7 indicates the priority, "start":"L2" indicates the offset from the Layer 2 header field, and "value":"~ / " indicates that the modified value should be obtained according to the flow table. At the same time as synchronizing the programming command sequence to the ASIC management plane driver, a flow table file is created to guide the ASIC chip transfer. The format of the flow table is shown in Table 3.
[0081] Table 3 Flow table format JPEG0007828979000004.jpg28170
[0082] The ASIC driver sends the microcode instructions to the ASIC chip based on the flow table file and the programming instruction sequence, and the format of the microcode instructions is shown in Table 4.
[0083] Table 4. Microcode instruction format JPEG0007828979000005.jpg72170JPEG0007828979000006.jpg41170
[0084] In addition to the multimodal network compilation method provided in the above embodiments, this embodiment may also be implemented by providing a storage medium that stores a computer program that, when executed by a processor, implements the multimodal network compilation method of any one of the above embodiments.
[0085] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure may be as shown in FIG. 9 . The computer device 9 includes a processor 92, a memory 93, a communication interface 94, a display unit 95, and an input device 96, all connected via a system bus 91. The processor 92 of the computer device 9 provides calculation and control capabilities. The memory 93 of the computer device 9 includes a non-volatile storage medium 931 and an internal memory 932. The non-volatile storage medium 931 stores an operating system and computer programs. The internal memory 932 provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium 931. The communication interface 94 of the computer device 9 is for wired or wireless communication with an external terminal, and the wireless method may be realized by Wi-Fi, a mobile cellular network, NFC (Near Field Communication), or other technologies. The computer program, when executed by the processor 92, realizes a multimodal network compilation method. The display unit 95 of the computer device 9 may be a liquid crystal display or an E-ink display, and the input device 96 of the computer device 9 may be a touch layer covering the display unit 95, or may be a button, a trackball, or a trackpad provided on the housing of the computer device 9, or may be an external keyboard, trackpad, or mouse. The computer device 9 may further include an input / output interface 97, a communication interface 94, the display unit 95, and the input device 96, which are connected to the system bus 91 via the input / output interface 97.
[0086] Those skilled in the art will understand that the structure shown in FIG. 9 is merely a block diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. A specific computer device may include more or fewer components than those shown, or may combine certain components, or may have a different component arrangement.
[0087] It should be understood that the specific embodiments described herein are only for illustrating this application, and are not intended to limit it. According to the examples provided in the present invention, any other examples that a person skilled in the art can obtain without creative work fall within the scope of protection of the present invention.
[0088] Obviously, the drawings are merely examples or embodiments of the present invention, and those skilled in the art can apply the present invention to other similar situations by using these drawings without any creative work. It should be understood that although the work performed in this development process may be complex and lengthy, those skilled in the art will recognize that modifications such as specific design, manufacturing, or production based on the technical content disclosed in the present invention are merely common technical means, and should not be deemed to detract from the content disclosed in the present invention.
[0089] In the present invention, the term "embodiment" means that the specific features, structures, or characteristics described in the embodiment are included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily mean that it is the same embodiment, or that it is independent of or a substitute for other embodiments by being mutually exclusive with other embodiments. Those skilled in the art can explicitly or implicitly understand that the embodiments described in the present invention can be combined with other embodiments without conflict.
[0090] It should be noted that the user information (including, but not limited to, user device information, user personal information, etc.) and data (including, but not limited to, data for analysis, data for storage, data for display, etc.) according to the present invention are all information and data authorized by the user or fully authorized by all parties. In the embodiments of the present invention, the acquisition, storage, use, processing, etc. of data all comply with the relevant provisions of national laws and regulations.
[0091] Those skilled in the art will understand that all or part of the steps in the above-described method embodiments can be accomplished by instructing relevant hardware using a computer program. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, the computer program can include the steps of the above-described method embodiments. Any references to memory, database, or other media used in the embodiments provided herein may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM®), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache, etc. For illustrative purposes and not limitation, RAM may be in multiple forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database according to each embodiment provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a distributed database using a blockchain. The processor according to each embodiment provided herein may be, but is not limited to, a general-purpose processor, a central processor, a graphics processor, a digital signal processor, programmable logic, data processing logic using quantum computing, etc.
[0092] The technical features of the above-mentioned embodiments can be combined in any desired manner. For the sake of brevity, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, any combination should be considered to be within the scope of the present specification.
[0093] The above examples only show some embodiments of the present invention, and the descriptions are specific and detailed, but this should not be understood as limiting the scope of the patent application. It should be noted that those skilled in the art can make further modifications and improvements without departing from the concept of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent application should be determined based on the scope of the accompanying claims.
Claims
1. A multimodal network compilation system, comprising: The multimodal network compilation system comprises: a front-end compiler for analyzing the source code of the multimodal network and generating an intermediate representation; a back-end compiler coupled to the front-end compiler for receiving the intermediate representation and for performing a multimodal network compilation method; the intermediate representation is composed of a plurality of nodes, each node representing one intermediate representation element, and the node types include at least one of a header, a structure, a parser, an action, a matching action table, and a control program; The multimodal network compilation method includes: traversing the intermediate representation and extracting node attributes according to the traversed node type; converting the node attributes into a programming instruction sequence for a target network element device based on user-defined fields, wherein the target network element device supports user-defined fields and flex-edit functions; converting the programming instruction sequence and the preset flow table file into microcode instructions and transmitting the microcode instructions to the target network element device, the preset flow table file carrying instruction information for transmitting the microcode instructions. A multimodal network compilation system comprising:
2. traversing the intermediate representation and extracting node attributes according to the traversed node types, constructing an abstract visitor and declaring interface methods to access concrete element classes; instantiating the abstract visitor, obtaining a concrete implementation visitor, and implementing an operation to access a concrete element class through the concrete implementation visitor.
2. The multimodal network compilation system of claim 1.
3. The steps to construct an abstract visitor and declare interface methods to access concrete element classes are: defining a visitor acceptance method for each node as an abstract node, the visitor acceptance method indicating that each node can be accessed by a visitor; representing the constants of the node type as concrete element classes and providing concrete implementations that access the concrete element classes.
3. The multimodal network compilation system of claim 2.
4. traversing the intermediate representation and extracting node attributes according to the traversed node types, determining whether the current node is in a preset collection when traversing to the current node according to a preset search method, wherein the accessed node is stored in the preset collection; if yes, accessing the next node; If not, saving the current node to the preset collection and recursively accessing other nodes.
2. The multimodal network compilation system of claim 1.
5. The step of traversing to the current node according to the preset search method is first traversing the root node and then recursively traversing the child nodes of said root node; or for each parent node, first traversing the child nodes of said parent node and then traversing said parent node; or and populating the current node into a preset queue, and if the preset queue is not empty, moving the current node out of the queue to access the current node, and if the current node has child nodes, populating the child nodes into the preset queue in order.
5. The multimodal network compilation system of claim 4.
6. The intermediate representation is A header intermediate representation in which each node represents one header and the attributes of the node include Node_type, which is a Type_Header constant, name, which is a header alias, and fields, which is a list collection including header attributes and attribute lengths; A structure intermediate representation in which each node represents one structure and the attributes of the node include Node_type, which is a Type_Struct constant, name, which is a custom structure name, and fields, which is a list collection including structure variable types, variable names, and variable lengths; a parser intermediate representation whose root node's attributes include Node_type, which is a PolymorphicParser constant, name, which is the custom parser name, applyParams, and state, wherein the applyParams node is for storing formal parameter variables, each formal parameter variable being one child node, the state node is for storing parsing statements, each state statement being one child node, the Node_type of the state child node being a ParserState constant, and the state child node includes a components child node for storing the method and parameters required for parsing the header, and a selectExpression child node for identifying the next header to be parsed based on the currently parsed header; An action intermediate representation in which the attributes of the node include Node_type, which is a PolymorphicAction constant, name, which is the custom action name, parameters, and body, the parameters node is for storing formal parameter variables, each formal parameter variable is one child node, the body node is for storing action execution statements, each action is one child node; A match action table intermediate representation including, as the node attributes, Node_type, which is a TableProperties constant, name, which is the match-action table name, and properties, which include the condition match node, action node, and default action node of the action table; The attributes of the node include Node_type, which is a BlockStatement constant, and components, the components node is for storing a decision statement, each decision condition is one child node, the Node_type of the components child node is an IfStatement constant, and the attributes of the components include a condition child node, an ifTrue child node, and an ifFalse child node.
2. The multimodal network compilation system of claim 1.
7. The action intermediate representation, the match action table intermediate representation, and the control program intermediate representation have the same parent node, and the attributes of the parent node include Node_type, which is a PolymorphicControl constant, name, which is a custom control pipeline name, applyParams, controlLocals, and body. The applyParams node is for storing formal parameter variables, and each formal parameter is one child node. The controlLocals node is composed of an action intermediate representation node and a match action table intermediate representation node, and the body node is composed of a control program intermediate representation node.
7. The multimodal network compilation system of claim 6.
8. traversing the intermediate representation and extracting node attributes according to the traversed node types, When the Node_type of the traversed node is a Type_Header constant, extracting header attribute and attribute length information of the current node; When the Node_type of the traversed node is a Type_Struct constant, extracting the structure variable type, variable name, and variable length information of the current node; extracting parse statement information of the current node when the Node_type of the traversed node is a PolymorphicParser constant; Extracting action execution information of the current node when the Node_type of the traversed node is a PolymorphicAction constant; extracting action table information of the current node when the Node_type of the traversed node is a TableProperties constant; extracting decision statement information of the current node when the Node_type of the traversed node is a BlockStatement constant.
8. The multimodal network compilation system of claim 7.
9. The programming instruction sequence of the target network element device is a key-value pair, the user-defined field is the key of the key-value pair, and the occupancy length, offset, priority, and offset start point of the user-defined field are the values of the key-value pair.
2. The multimodal network compilation system of claim 1.
10. converting the programming instruction sequence and the preset flow table file into microcode instructions and transmitting the microcode instructions to the target network element device, extracting field match values for the user-defined fields from the preset flow table file; and matching the extracted field match value with the programming instruction sequence to generate the microcode instruction.
10. The multimodal network compilation system of claim 9.
11. The multimodal network includes at least one of an IPV4 network, an IPV6 network, a Mobile First network, a named network, a geographical indication network, and an industrial control agreement network.
2. The multimodal network compilation system of claim 1.
12. A computer-readable storage medium on which a computer program is stored, The computer program, when executed by a processor, implements the steps of a multimodal network compilation method, The multimodal network compilation method includes: obtaining an intermediate representation of a source code of a multimodal network, the intermediate representation being composed of a plurality of nodes, each node representing an intermediate representation element, and node types including at least one of a header, a structure, a parser, an action, a matching action table, and a control program; traversing the intermediate representation and extracting node attributes according to the traversed node type; converting the node attributes into a programming instruction sequence for a target network element device based on user-defined fields, wherein the target network element device supports user-defined fields and flex-edit functions; converting the programming instruction sequence and the preset flow table file into microcode instructions and transmitting the microcode instructions to the target network element device, the preset flow table file carrying instruction information for transmitting the microcode instructions. A computer-readable storage medium comprising:
13. The step of traversing the intermediate representation and extracting node attributes according to the traversed node types, comprising: constructing an abstract visitor and declaring interface methods to access concrete element classes; instantiating the abstract visitor, obtaining a concrete implementation visitor, and implementing an operation to access a concrete element class through the concrete implementation visitor.
13. The computer-readable storage medium of claim 12.
Citation Information
Patent Citations
Modal deployment method and modal deployment system of multi-modal network
CN116074208A
Modal intermediate representation-oriented compiling method, system and equipment and storage medium
CN116737130A
Compilation method, compilation device, and compilation program
JP2015210740A
Heterogeneity-agnostic and topology-agnostic data plane programming
US20210365253A1