WO2016000171A1 - 指令序列确定的方法和相关设备及*** - Google Patents

指令序列确定的方法和相关设备及*** Download PDF

Info

Publication number
WO2016000171A1
WO2016000171A1 PCT/CN2014/081272 CN2014081272W WO2016000171A1 WO 2016000171 A1 WO2016000171 A1 WO 2016000171A1 CN 2014081272 W CN2014081272 W CN 2014081272W WO 2016000171 A1 WO2016000171 A1 WO 2016000171A1
Authority
WO
WIPO (PCT)
Prior art keywords
instruction
sequences
sequence
instruction sequences
network
Prior art date
Application number
PCT/CN2014/081272
Other languages
English (en)
French (fr)
Inventor
李楠
王临春
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP14896488.5A priority Critical patent/EP3147778A4/en
Priority to PCT/CN2014/081272 priority patent/WO2016000171A1/zh
Priority to CN201480047145.5A priority patent/CN105493037A/zh
Publication of WO2016000171A1 publication Critical patent/WO2016000171A1/zh
Priority to US15/391,627 priority patent/US20170109173A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/40Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks using virtualisation of network functions or resources, e.g. SDN or NFV entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5041Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the time relationship between creation and deployment of a service
    • H04L41/5054Automatic deployment of services triggered by the service manager, e.g. service implementation by automatic configuration of network components
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/70Virtual switches
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5077Network service management, e.g. ensuring proper service fulfilment according to agreements wherein the managed service relates to simple transport services, i.e. providing only network infrastructure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/38Flow based routing

Definitions

  • the present invention relates to the field of computer technology
  • a network processor is usually used to implement forwarding processing of network >3 ⁇ 4 text.
  • the network processor refers to a programmable processor dedicated to processing the network >3 ⁇ 4 text.
  • the network message processing program can be written in assembly language or high-level language, and the network processor implements the network packet processing forwarding process by executing the network message processing program.
  • the forwarding process of the network message is usually abstracted into a series of "match-action” operations, and the series of "match-action” operations can be converted into a network message processing program through translation, and Run on a network processor.
  • the network packet processing program installed and running in a packet forwarding device such as a router or a switch needs to support forwarding processing of dozens or even hundreds of different network protocols, and each network protocol may involve multiple different reports.
  • a packet forwarding device such as a router or a switch
  • different packet forwarding operations need to be performed, so that the network packet processing program installed and running in the normal packet forwarding device becomes very complicated.
  • the network message handler is usually very complicated to design, making it easier to introduce more program vulnerabilities, and the more protocols and functions supported, the higher the chip performance requirements of the network processor. Summary of the invention
  • the embodiment of the invention provides a method for determining an instruction sequence and a related device and system, so as to improve the amount of invalid code running by the packet forwarding processing device.
  • a method for determining an instruction sequence may include:
  • each of the M1 instruction sequences includes a unique entry instruction
  • the M1 instruction sequence includes a unique exit instruction
  • the M1 is a positive integer
  • the M1 instruction sequence is a sequence of instructions for constructing a network message processing program for processing network messages.
  • the method further includes:
  • the network packet processing program includes the M1 instruction sequences.
  • the method further includes: acquiring XI entries, wherein the mapping of the XI entries to the XI tables is - correspondingly, determining XI instruction sequences for implementing the table lookup function of the XI tables, the XI The mapping between the instruction sequence and the XI tables is corresponding to, wherein the network message processing program further includes the XI instruction sequences, where the XI is a positive integer.
  • the first entry includes at least one of the following: an identifier of the first table, the first table, and a sequence of instructions for implementing a lookup function of the first table, wherein the first entry Is any one of the XI entries.
  • the M1 instruction sequence bijective to effective forwarding The data stream has a directed edge of M1 in the directed graph, wherein the XI tables are bijective to the XI nodes in the directed graph of the effective forwarding data stream,
  • the effective forwarding data flow directed graph includes: X nodes and M directed edges, the M directed edges are bijective to M instruction sequences, and the X nodes are bijective to X tables, a M1 stripe directed edge is a subset of the set of M directed edges, the XI nodes being a subset of the set of X nodes, and the M and X are positive integers;
  • the next instruction of the exit instruction of the instruction sequence corresponding to the input edge of the node il of the X nodes is one of the instruction sequences of the instruction sequence for implementing the table lookup function of the table corresponding to the node il Is one of the exit instructions of the instruction sequence for implementing the table lookup function of the table corresponding to the node j1, wherein the node il is any one of the X nodes, and the node j1 is the X Any of the nodes.
  • the network packet processing program further includes: M2 is a positive integer, and the intersection of the set of M1 instruction sequences and the set of the M2 instruction sequences is an empty set.
  • the network packet processing program further includes X2 instruction sequences for supporting a table lookup function of the XI tables, where the mapping of the X2 instruction sequences and the X2 tables is - corresponding to the X2 tables.
  • the X2 is a positive integer, wherein an intersection of the set of XI instruction sequences and the set of the X2 instruction sequences is an empty set.
  • the effective forwarding data flow directed graph is obtained by trimming the node and/or the directed edge in the initial forwarding data flow directed graph; wherein the initial valid forwarding data flow directed graph includes: X0 nodes and M0 a directed edge, wherein the mapping of the M0 directed edge and the M0 instruction sequence is - corresponding, the mapping of the X0 node and the X0 table is - corresponding, wherein the M is directed
  • the set of edges is a subset of the set of M0 directed edges
  • the set of X nodes is a subset of the set of X0 nodes
  • the M0 and the X0 are positive integers.
  • the determining, by the Ml instruction sequence, the function for determining the function identified by the function identifier includes:
  • the function identifier is an index, and the function identifier is determined from the M0 command sequences. Ml instruction sequence.
  • the method further includes: acquiring an application scenario identifier, where the M0 instruction sequences are M0 instruction sequences identified by the application scenario identifier.
  • the constructing the network message processing program includes: constructing a network "3 ⁇ 4 text processing program based on the directed edges and nodes in the directed data flow directed graph.
  • the one of the M1 instruction sequences The next instruction of the sequence of the exit instruction is one of the entry instructions of one of the sequence of instructions in the sequence of XI instructions, and/or the previous instruction of the entry instruction of one of the sequence of instructions of the M1 sequence of instructions, An exit instruction for one of the sequences of instructions in the sequence of XI instructions.
  • the network processing program further includes: a function for supporting the function identified by the function identifier
  • the M2 instruction sequences wherein the M2 is a positive integer, wherein an intersection of the set of the M1 instruction sequences and the set of the M2 instruction sequences is an empty set, wherein the M2 instruction sequences are The next instruction of the exit point of an instruction sequence, one of the entry instructions of one of the sequences of instructions in the XI instruction sequence, and/or the previous instruction of the entry instruction of one of the sequence of instructions of the M2 instruction sequence Is one of the exit instructions of one of the sequences of instructions in the sequence of XI instructions.
  • the network packet processing program further includes a table lookup function for supporting the XI tables
  • the X2 instruction sequences are implemented, where the X2 is a positive integer, and the set of the XI instruction sequences is The intersection of the set of X2 instruction sequences is an empty set;
  • the next instruction of the M1 instruction sequence or the exit instruction of one of the M2 instruction sequences is one of the entry instructions of one of the X2 instruction sequences, and/or
  • the M1 instruction sequence or the previous instruction of the entry instruction of one of the M2 instruction sequences is one of the exit instructions of one of the X2 instruction sequences.
  • an instruction sequence determining apparatus includes:
  • An obtaining unit configured to obtain a function identifier
  • a determining unit configured to determine M1 instruction sequences for implementing the function identified by the function identifier acquired by the acquiring unit, where each instruction sequence in the M1 instruction sequences includes a unique entry instruction, Each of the M1 instruction sequences includes a unique exit instruction, and the M1 is a positive integer, wherein the M1 instruction sequences are instruction sequences for constructing a network message processing program for processing network messages. .
  • the instruction sequence determining apparatus further includes:
  • a program unit configured to build a network packet processing program, and generate a program upgrade patch by using the constructed network packet processing program, and send the program upgrade patch to the packet forwarding processing device; or construct a network text processing program and install the network Network document processing program;
  • the network packet processing program includes the M1 instruction sequences.
  • the obtaining unit is further configured to acquire XI entries, where the mapping of the XI entries to the XI tables is - corresponding;
  • the determining unit is further configured to: determine XI instruction sequences for implementing a table lookup function of the XI tables, where the mapping of the XI instruction sequences and the XI tables is corresponding to, where
  • the network message processing program further includes the XI instruction sequences, wherein the XI is a positive integer.
  • the M1 instruction sequences are bijected to the M1 directed edges in the directed graph of the effective forwarding data stream, wherein the XI tables are bijective to the XI in the directed graph of the valid forwarding data stream. node,
  • the effective forwarding data flow directed graph includes: X nodes and M directed edges, the M directed edges are bijective to M instruction sequences, and the X nodes are bijective to X tables, a M1 stripe directed edge is a subset of the set of M directed edges, the XI nodes being a subset of the set of X nodes, and the M and X are positive integers;
  • the next instruction of the exit instruction of the instruction sequence corresponding to the input edge of the node il of the X nodes is one of the instruction sequences of the instruction sequence for implementing the table lookup function of the table corresponding to the node il Is one of the exit instructions of the instruction sequence for implementing the table lookup function of the table corresponding to the node j1, wherein the node ii is any one of the X nodes, and the node ji is the X Any of the nodes.
  • the network packet processing program further includes the M2 being a positive integer for supporting the function identified by the function identifier, and the intersection of the set of the M1 instruction sequences and the set of the M2 instruction sequence is an empty set.
  • the network packet processing program further includes X2 instruction sequences for supporting a table lookup function of the XI tables, where the mapping of the X2 instruction sequences and the X2 tables is - corresponding to the X2 tables.
  • the X2 is a positive integer, wherein an intersection of the set of XI instruction sequences and the set of the X2 instruction sequences is an empty set.
  • the next instruction of the exit instruction of one of the instruction sequences is one of the entry instructions of one of the sequences of instructions in the XI instruction sequence, and/or one of the M1 instruction sequences
  • the previous instruction of the entry instruction of the instruction sequence is one of the exit instructions of one of the instruction sequences in the XI instruction sequence.
  • the network packet processing program further includes a function for supporting the function identified by the function identifier.
  • An M2 instruction sequence where the M2 is a positive integer, where an intersection of the set of the M1 instruction sequences and the set of the M2 instruction sequences is an empty set, wherein one of the M2 instruction sequences
  • the next instruction of the exit point of the sequence of instructions, one of the entry instructions of one of the sequences of instructions in the sequence of XI instructions, and/or the previous instruction of the entry instruction of one of the sequences of instructions of the M2 instruction sequence An exit instruction for one of the sequences of instructions in the sequence of XI instructions.
  • the network packet processing program further includes X2 instruction sequences for supporting a table lookup function of the XI tables, wherein the X2 is a positive integer, the set of the XI instruction sequences and the X2 instruction The intersection of the sets of sequences is an empty set;
  • the next instruction of the M1 instruction sequence or the exit instruction of one of the M2 instruction sequences is one of the entry instructions of one of the X2 instruction sequences, and/or
  • the M1 instruction sequence or the previous instruction of the entry instruction of one of the M2 instruction sequences is one of the exit instructions of one of the X2 instruction sequences.
  • a management device includes:
  • processor a processor, a memory, and a network interface, wherein the processor, the memory, and the network interface are connected by a communication bus;
  • the memory is configured to store program code and transmit the program code to the processor; wherein the processor is configured to perform the following steps according to the program code:
  • Each of the M1 instruction sequences includes a unique entry instruction, each of the M1 instruction sequences includes a unique exit instruction, and the M1 is a positive integer, where the network message
  • the handler includes the M1 instruction sequences.
  • the processor is further configured to: acquire XI entries, where the XI entries are in one-to-one correspondence with the mappings of the XI tables, and determine XI instruction sequences for implementing the table lookup function of the XI tables, where The mapping between the XI instruction sequences and the XI tables is corresponding to, wherein the network message processing program further includes the XI instruction sequences, where the XI is a positive integer.
  • the M1 instruction sequences are dual-shot to the M1 directed edge in the directed data stream directed graph , wherein the XI tables are dual-shot to the XI nodes in the directed graph of the valid forwarding data stream,
  • the effective forwarding data flow directed graph includes: X nodes and M directed edges, the M directed edges are bijective to M instruction sequences, and the X nodes are bijective to X tables, a M1 stripe directed edge is a subset of the set of M directed edges, the XI nodes being a subset of the set of X nodes, and the M and X are positive integers;
  • the next instruction of the exit instruction of the instruction sequence corresponding to the input edge of the node il of the X nodes is one of the instruction sequences of the instruction sequence for implementing the table lookup function of the table corresponding to the node il Is one of the exit instructions of the instruction sequence for implementing the table lookup function of the table corresponding to the node j1, wherein the node il is any one of the X nodes, and the node j1 is the X Any of the nodes.
  • the network packet processing program further includes: A positive integer, the intersection of the set of M1 instruction sequences and the set of the M2 instruction sequences is an empty set.
  • the network>3 ⁇ 4 text processing program further includes The mapping of the X2 instruction sequences to the X2 tables is - corresponding to the X2 instruction sequences implemented by the lookup table function of the XI tables, wherein the X2 tables are children of the X tables.
  • the set X2 is a positive integer, wherein an intersection of the set of the XI instruction sequences and the set of the X2 instruction sequences is an empty set.
  • the effective forwarding data flow directed graph is obtained by pruning the node and/or the directed edge in the initial forwarding data flow directed graph; wherein the initial valid forwarding data flow directed graph includes: X0 nodes and
  • M0 is a directed edge, wherein the mapping of the M0 directed edge to the M0 instruction sequence is - corresponding, the mapping of the X0 nodes to the X0 tables is - corresponding to the M directed edges
  • the set is a subset of the set of M0 directed edges
  • the set of X nodes is a subset of the set of X0 nodes
  • the M0 and the X0 are positive integers.
  • the processor is further configured to: obtain an application scenario identifier, where the M0 instruction sequence is The M0 instruction sequences identified by the application scenario identifier are described.
  • the processor is configured to: construct a network based on the directed edge and the node in the directed graph of the effective forwarding data flow 4 ⁇ .
  • the next instruction of the egress instruction of one of the M1 instruction sequences is the XI One of the entry instructions of one of the sequences of instructions, and/or, said
  • the previous instruction of the entry instruction of one of the instruction sequences in the M1 instruction sequence is one of the exit instructions of one of the sequences of instructions in the XI instruction sequence.
  • the ninth possible implementation of the third aspect further includes: 2 instruction sequences for supporting the function of the function identified by the function identifier, where the ⁇ 2 is a positive integer, where the set of the M1 instruction sequences An intersection with the set of the M2 instruction sequences is an empty set, wherein a next instruction of an exit point of one of the M2 instruction sequences is one of the instruction sequences in the XI instruction sequence An entry instruction, and/or a previous instruction of an entry instruction of one of the sequence of instructions of the M2 instruction sequence, is one of the exit instructions of one of the sequences of instructions in the sequence of XI instructions.
  • the network packet processing program further includes X2 instruction sequences for supporting a table lookup function of the XI tables, wherein the X2 is a positive integer, the set of the XI instruction sequences and the X2 instruction The intersection of the sets of sequences is an empty set;
  • the next instruction of the M1 instruction sequence or the exit instruction of one of the M2 instruction sequences is one of the entry instructions of one of the X2 instruction sequences, and/or
  • the M1 instruction sequence or the previous instruction of the entry instruction of one of the M2 instruction sequences is one of the exit instructions of one of the X2 instruction sequences.
  • a packet forwarding processing device includes:
  • processors a processor, a network processor, a memory, and a network interface, wherein the processor, the network processor, the memory, and the network interface are connected by a communication bus;
  • the memory is used to store the program code, and the program code is transmitted to the processor; the processor is configured to perform the following steps according to the program code: acquiring a function identifier, determining to implement the function identifier a sequence of M1 instructions of the identified function, constructing a network message processing program and installing the network message processing program to the network processor, each instruction sequence in the M1 instruction sequences including a unique entry instruction, Each of the M1 instruction sequences includes a unique exit instruction, the M1 is a positive integer, and the network message processing program includes the M1 instruction sequences;
  • the network processor is configured to install the network packet processing program, and according to the network packet The program handles network messages received from the network interface.
  • the processor is further configured to: acquire XI entries, where the XI entries are in one-to-one correspondence with the mappings of the XI tables, and determine XI instruction sequences for implementing the table lookup function of the XI tables, where The mapping between the XI instruction sequences and the XI tables is corresponding to, wherein the network message processing program further includes the XI instruction sequences, where the XI is a positive integer.
  • the M1 instruction sequences are dual-shot to the M1 directed edge in the directed data stream directed graph , wherein the XI tables are dual-shot to the XI nodes in the directed graph of the valid forwarding data stream,
  • the effective forwarding data flow directed graph includes: X nodes and M directed edges, the M directed edges are bijective to M instruction sequences, and the X nodes are bijective to X tables, a M1 stripe directed edge is a subset of the set of M directed edges, the XI nodes being a subset of the set of X nodes, and the M and X are positive integers;
  • the next instruction of the exit instruction of the instruction sequence corresponding to the input edge of the node il of the X nodes is one of the instruction sequences of the instruction sequence for implementing the table lookup function of the table corresponding to the node il Is one of the exit instructions of the instruction sequence for implementing the table lookup function of the table corresponding to the node j1, wherein the node ii is any one of the X nodes, and the node ji is the X Any of the nodes.
  • the network packet processing program further includes: A positive integer, the intersection of the set of M1 instruction sequences and the set of the M2 instruction sequences is an empty set.
  • the network>3 ⁇ 4 text processing program further includes The mapping of the X2 instruction sequences to the X2 tables is - corresponding to the X2 instruction sequences implemented by the lookup table function of the XI tables, wherein the X2 tables are children of the X tables.
  • the effective forwarding data flow directed graph is obtained by trimming the node and/or the directed edge in the initial forwarding data flow directed graph; wherein the initial valid forwarding data flow directed graph includes: X0 nodes and M0 a directed edge, wherein the mapping of the M0 directed edge to the M0 instruction sequence is - corresponding, the mapping of the X0 node to the X0 table is - corresponding to the M directed edge A set is a subset of the set of M0 directed edges, the set of X nodes is a subset of the set of X0 nodes, and the M0 and the X0 are positive integers.
  • the processor is further configured to: obtain an application scenario identifier, where the M0 instruction sequence is The M0 instruction sequences identified by the application scenario identifier are described.
  • the processor is configured to: construct a network processing program based on the directed edges and nodes in the directed data flow directed graph.
  • the next instruction of the egress instruction of one of the M1 instruction sequences is the XI One of the entry instructions of one of the sequences of instructions in the instruction sequence, and/or the previous instruction of the entry instruction of one of the sequences of instructions of the M1 instruction sequence is one of the sequences of instructions in the sequence of XI instructions One of the export instructions.
  • the network packet processing program further includes M2 An instruction sequence, where the M2 is a positive integer, where an intersection of the set of the M1 instruction sequences and the set of the M2 instruction sequence is an empty set, wherein one of the M2 instruction sequences is one of the instruction sequences The next instruction at the exit point, one of the instructions in the sequence of XI instructions One of the entry instructions of the sequence, and/or the previous instruction of the entry instruction of one of the sequence of instructions of the M2 instruction sequence, is one of the exit instructions of one of the sequences of instructions in the sequence of XI instructions.
  • the network packet processing program further includes X2 instruction sequences for supporting a table lookup function of the XI tables, wherein the X2 is a positive integer, the set of the XI instruction sequences and the X2 instruction The intersection of the sets of sequences is an empty set;
  • the next instruction of the M1 instruction sequence or the exit instruction of one of the M2 instruction sequences is one of the entry instructions of one of the X2 instruction sequences, and/or
  • the M1 instruction sequence or the previous instruction of the entry instruction of one of the M2 instruction sequences is one of the exit instructions of one of the X2 instruction sequences.
  • a communication system can include:
  • a packet forwarding processing device configured to send a packet carrying a function identifier
  • a management device configured to receive the packet carrying the function identifier, determine an M1 instruction sequence for implementing the function identified by the function identifier, construct a network packet processing program, and generate the network packet processing program by using the network packet processing program
  • the program upgrades the patch, and sends the program upgrade patch to the packet forwarding processing device; or, the network packet processing program is configured to send the network packet processing program to the packet forwarding processing device, where the M1 is
  • Each of the instruction sequences includes a unique entry instruction
  • each of the M1 instruction sequences includes a unique exit instruction
  • the M1 is a positive integer
  • the network message processing program includes The M1 instruction sequences.
  • each instruction sequence in the M1 instruction sequences includes a unique entry.
  • An instruction each of the M1 instruction sequences includes a unique exit instruction, and since the program code is divided by the granularity of the instruction sequence, this provides a mechanism for customizing the network message processing program, which can be based on acquisition
  • the function identifier is selected to obtain the instruction sequence ⁇
  • the invalid code in the network message processing program run by the instruction execution device is reduced.
  • FIG. 1 is a schematic flowchart of a method for determining an instruction sequence according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram showing a relationship between an instruction sequence and a function identifier according to an embodiment of the present invention
  • FIG. FIG. 2 is a schematic diagram of a directed graph of an initial forwarding data flow according to an embodiment of the present invention
  • FIG. 2-d is a schematic diagram of a directed graph of a forwarded data stream according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of an apparatus for determining an instruction sequence according to an embodiment of the present invention
  • FIG. 1 is a schematic flowchart of a method for determining an instruction sequence according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram showing a relationship between an instruction sequence and a function identifier according to an embodiment of the present invention
  • FIG. FIG. 2 is a schematic diagram of a directed graph of an initial forwarding data flow according to an embodiment of the present invention
  • FIG. 2-d is
  • FIG. 4 is a schematic diagram of a management device according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a forwarding processing device according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic diagram of a communication system according to an embodiment of the present invention. detailed description
  • the embodiment of the invention provides a method for determining an instruction sequence and a related device and system, so as to improve the amount of invalid code running by the packet forwarding processing device.
  • the instruction sequence determining method may include: acquiring a function identifier; determining M1 instruction sequences for implementing the function identified by the function identifier, wherein each instruction sequence in the M1 instruction sequences includes a unique entry instruction (eg, the first instruction of each of the M1 instruction sequences is a unique entry instruction of a respective instruction sequence), each of the M1 instruction sequences containing a unique exit instruction (eg eg The last instruction of each of the M1 instruction sequences is an egress instruction of a corresponding instruction sequence, where the M1 is a positive integer, where the M1 instruction sequences are constructed for processing a network text.
  • the instruction sequence of the network " ⁇ text handler.
  • FIG. 1 is a schematic flowchart of a method for determining an instruction sequence according to an embodiment of the present invention.
  • An instruction sequence determining method provided by an embodiment of the present invention may include the following content:
  • each of the M1 instruction sequences includes a unique entry instruction (eg, the first instruction of each of the M1 instruction sequences is the only entry instruction of the corresponding instruction sequence)
  • Each of the M1 instruction sequences includes a unique exit instruction (eg, for example, the last instruction of each of the M1 instruction sequences is an exit instruction of a corresponding instruction sequence, wherein the M1 is A positive integer, where the M1 instruction sequences are instruction sequences for constructing a network message processing program for processing network messages.
  • the device performing step 101 and step 102 may be a management device (such as a network management server or a software-defined networking (SDN) controller).
  • the device performing step 101 and step 102 may also be a packet forwarding processing device (e.g., a route or a network switch, etc.).
  • the function identifier obtained by the foregoing may identify a function of performing forwarding processing on one or more network protocols.
  • the function identified by the function identifier obtained by the foregoing may include at least one of the following functions: Counting the byte count of the network packet, and adding a virtual local area network to the network packet (English: virtual local area Network, abbreviated: VLAN) tag, delete the VLAN tag in the network packet, modify the network protocol (English: Internet Protocol, abbreviation: IP) in the header of the differential service code point (English: differentiated services code Point, abbreviation: DSCP) The value of the field.
  • the function identified by the function identifier may also include other one or more functions.
  • the method for obtaining the function identifier may be various.
  • the network interface may receive the packet carrying the function identifier sent by other devices, or may obtain the function identifier through the user interface (for example, the human-machine interaction interface).
  • the above function identifiers can also be obtained in other ways.
  • the device performing step 101 is a network management server or an SDN controller
  • the network management server or SDN controller can obtain the above function identifier through its user interface.
  • the network management server or the SDN controller can also receive packets carrying the function identification (for example, from the packet forwarding processing device or other third-party devices) through the network interface.
  • the packet forwarding processing device can obtain the foregoing function identifier through its user interface, or The packet forwarding processing device can receive the packet carrying the function identifier from the network management server or the SDN controller or other third-party device through the network interface.
  • each instruction sequence in the M1 instruction sequences includes a unique entry instruction.
  • Each of the M1 instruction sequences includes a unique exit instruction, wherein since the program code is divided by the granularity of the instruction sequence, this provides a mechanism for customizing the network message processing program, which in turn can be based on Obtaining the function identifier (that is, based on the requirement) to filter and obtain the instruction sequence that meets the requirements, thereby facilitating the construction of a network message processing program that is more compatible with the actual requirements, which is beneficial to improving the instruction execution device and the network report it runs.
  • the matching degree of the word processing program reduces the invalid code in the network message processing program run by the instruction execution device (such as the message forwarding processing device).
  • the application scenario identifier when acquiring the function identifier, may also be obtained, where the application scenario identifier may identify a set of M0 instruction sequences. That is, the full set of instruction sequences can be determined based on the application scenario identification.
  • the different application scenario identifiers may identify a complete set of different instruction sequences. Two application scenarios identify the intersection of the two complete sets of instruction sequences identified A set may be an empty set or a non-empty set.
  • the determining the M1 instruction sequence for implementing the function identified by the function identifier may include: determining, by using the function identifier, an identifier from the set of M0 instruction sequences identified by the application scenario identifier.
  • J matching the function identifier is output.
  • the set of M0 instruction sequences is a complete set of instruction sequences for implementing various functions, or the set of M0 instruction sequences is a complete set of instruction sequences for implementing various functions corresponding to a certain application scenario.
  • each of the M0 instruction sequences may be pre-marked with at least one function identifier.
  • At least one function identifier that is marked by a sequence of instructions indicates that the sequence of instructions can be used to implement the functions identified by the at least one function identifier.
  • Figures 2-a and 2-b show two possible ways to identify the tag function. Among them, some of the M0 instruction sequences may be marked as being usable to implement multiple functions, as shown in Figure 2-b.
  • the instruction sequence for implementing the function a1 includes the instruction sequence all, the instruction sequence al2, and the instruction sequence al3, and the instruction sequence for implementing the function bl includes the instruction sequence all, the instruction sequence b11, the instruction sequence bl2, and the instruction sequence bl3, which are visible.
  • the set of instruction sequences a1 is the intersection between the set of instruction sequences for implementing function a1 and the set of instruction sequences for implementing function bl.
  • the instruction sequence determining method may further include: a management device (such as a network management server or a software-defined network controller) constructing a network packet processing program and utilizing the constructed network.
  • the packet processing program generates a program upgrade patch, and sends the program upgrade patch to the packet forwarding processing device (correspondingly, the packet forwarding processing device can use the program upgrade patch to upgrade the local network>3 ⁇ 4 text processing program, and utilize the upgraded Network processing protocol to process received network messages); or management device (such as network management server or software-defined network control sequence (correspondingly, packet forwarding processing device is installed and received on the packet forwarding processing device)
  • the received network packet processing program uses the installed network packet processing program to process the received network packet; or the packet forwarding processing device can construct a network packet processing program and install on the packet forwarding processing device.
  • the network packet processing program (correspondingly, the packet forwarding processing device can be installed and installed A good network message processing program is used to process the received network message.
  • the network message processing program includes the M1 instruction sequences.
  • the XI entries may also be obtained (for example, the XI entries are carried in the packet carrying the acquired function identifier), where the XI The mapping of entries to XI tables is - corresponding, the XI is a positive integer.
  • the table is, for example, a routing table, an incoming label map (English: incoming label map) table, a forwarding information base (English: forward information base) table, and a media access control ⁇ 'J (English: media access Control table, mask: ACL table, longest prefix match (English: longest prefix match, LPM), exact match (English: exact match, EM for short) Table, direct access (English: direct) table, flow table (English: flow table), flow table can refer to OpenFlow Switch Specification 1.4.0 (English: OpenFlow Switch Specification version 1.4.0).
  • the instruction sequence determining method may further include: determining XI instruction sequences for implementing a table lookup function of the XI tables, where the mapping of the XI instruction sequences to the XI tables is one-to-one correspondence
  • the network message processing program further includes the XI instruction sequences.
  • the report message handler may not include a sequence of instructions for implementing the lookup function of the certain table.
  • the first one of the XI entries may include at least one of the following information: an identifier of the first table, the first table, and one of a table lookup function for implementing the first table.
  • the first table and/or one instruction sequence for implementing the table lookup function of the first table may be indexed according to the identifier of the first table.
  • one instruction sequence for implementing the look-up table function of the first table may be indexed according to the first table itself (the first table may or may not include the identifier of the first table).
  • the sequence of instructions for implementing the lookup function of a table may include at least one exit instruction and at least one entry instruction, that is, the sequence of instructions for implementing the lookup function of a table may have at least one point and At least one exit point.
  • the next instruction of the egress instruction of one of the M1 instruction sequences is one of the entry instructions of one of the instruction sequences in the XI instruction sequence, And/or, the entry of one of the instruction sequences in the M1 instruction sequence
  • the previous instruction of the instruction is one of the exit instructions of one of the sequences of instructions in the XI instruction sequence.
  • the network packet processing program may further include M2 instruction sequences for supporting the implementation of the function identified by the function identifier.
  • the next instruction of the egress instruction of one of the M2 instruction sequences is one of the entry instructions of one of the instruction sequences in the XI instruction sequence, and/or the M2 instruction sequence
  • the previous instruction of the entry instruction of one of the instruction sequences is one of the exit instructions of one of the sequences of instructions in the XI instruction sequence.
  • some upper-level functions may require some underlying functionality to support, one of which may be used to support an upper-level function or multiple upper-level functions, and an upper-level function may also require multiple underlying functions to support it. Therefore, when the function identifier is obtained, it may be necessary to determine not only the M1 instruction sequences for implementing the functions identified by the acquired function identifiers, but also the M2 instruction sequences for supporting the functions defined by the function identifiers.
  • the network processing program may further include X2 instruction sequences for supporting a table lookup function of the XI tables, where the X2 is a positive integer, wherein the M1 instruction sequence or the next instruction of the exit instruction of one of the M2 instruction sequences is one of the entry instructions of one of the X2 instruction sequences, And/or, the M1 instruction sequence or the previous instruction of the entry instruction of one of the M2 instruction sequences is one of the exit instructions of one of the X2 instruction sequences.
  • the correlation between the instruction sequence and the table for implementing the function identified by the function identifier may be reflected by forwarding the data flow directed graph, of course, due to the table and the method for implementing the table.
  • the instruction sequence of the table lookup function is related. Therefore, the forwarded data stream directed graph can also show the instruction sequence for realizing the function identified by the function identifier and the table lookup function for implementing the table to some extent.
  • the initial forwarded data stream directed graph may include a sequence of instructions for implementing all functions
  • the corresponding edge also includes a sequence of instructions corresponding to all the tables related to all functions.
  • the M1 instruction sequences are dual-shot to the M1 directed edges in the directed graph of the effective forwarding data stream, where the XI tables are bijective to the effective forwarding.
  • the data stream has XI nodes in the graph.
  • the effective forwarding data flow directed graph includes: X nodes and M strip directed edges, the M strips have bidirectionally directed to M instruction sequences, and the X nodes are bijective to X tables.
  • the set of the M1 directed edges is a subset of the set of the M directed edges, and the set of the XI nodes is a subset of the set of the X nodes, wherein the M and X are A positive integer.
  • the X tables include the XI tables and the X2 tables
  • the M instruction sequences include the M1 instruction sequence and the M2 instruction sequences.
  • the next instruction of the egress instruction of the instruction sequence corresponding to the inbound edge of the node of the X nodes is a table lookup function for implementing a table corresponding to the node.
  • the previous instruction of the entry instruction of the instruction sequence corresponding to the outbound edge of the node of the X nodes may be one of the export instructions of the instruction sequence for implementing the table lookup function of the table corresponding to each node.
  • the next instruction of the exit instruction of the instruction sequence corresponding to the input edge of the node il is one of the entry instructions of the instruction sequence for implementing the table lookup function of the table corresponding to the node il, and the node il is the X Any node in the node.
  • the previous instruction of the entry instruction of the instruction sequence corresponding to the outbound edge of the node j1 may be one of the export instructions of the instruction sequence for implementing the table lookup function of the table corresponding to the node j1, where the node j1 is the X Any of the nodes.
  • the packet forwarding processing device may perform the export instruction of the instruction sequence corresponding to the inbound edge of the node i2.
  • the table lookup function for implementing the table corresponding to the node i2 is performed by using corresponding hardware, and the node i2 is any one of the X nodes.
  • the message forwarding processing device may execute an entry instruction of an instruction sequence corresponding to one of the outbound edges of the node j2 after executing the table lookup function for implementing the table corresponding to the node j2 by using the corresponding hardware, where the node j2 is the X Any node in the node.
  • the network processing program may further include M2 instruction sequences for supporting implementation of the function identified by the function identifier, where the M2 The instruction sequence is a subset of the set of M instruction sequences. The intersection of the set of the M1 instruction sequences and the set of the M2 instruction sequences is an empty set.
  • the network processing program further includes X2 instruction sequences for supporting a table lookup function implementation of the XI tables, and the X2 instruction sequences and X2 Table - correspondingly, the set of the X2 tables is a subset of the set of the X tables, and the X2 is a positive integer, wherein the set of the XI instruction sequences and the set of the X2 instruction sequences The intersection is an empty set.
  • the valid forwarding data flow directed graph is obtained by pruning a node and a directed edge in the initial forwarding data flow directed graph, or the effective forwarding data flow directed graph It is obtained by trimming the directed edges of the initial forwarding data stream in the directed graph.
  • the initial valid forwarding data flow directed graph includes: X0 nodes and M0 directed edges, the M0 directed edges correspond to M0 instruction sequences, the X0 nodes and X0 tables— Correspondingly, the set of M directed edges is a subset of the set of M0 directed edges, the X nodes are subsets of the X0 nodes, and the M0 and the X0 are positive Integer.
  • the effective forwarding data flow directed graph can be obtained by pruning the invalid node and/or the invalid directed edge in the initial forwarding data flow directed graph, wherein the effective directed edge can be regarded as corresponding to the M instruction sequences.
  • the directed edge, the forwarded data stream is removed from the graph, and the directed edge other than the effective directed edge is considered to be an invalid directed edge, and the M instruction sequences include the M1 instruction sequence and the M2
  • the sequence of instructions, of course M2 may be equal to zero.
  • the valid node may be regarded as a node corresponding to the X tables, and the node that is to be forwarded in the data stream directed graph except the node other than the valid node may be regarded as an invalid node, and the X tables include the XI tables and The X2 tables, of course, X2 may be equal to zero.
  • FIG. 2-c shows an initial forwarding data flow directed graph, wherein it is assumed that the invalid node includes the node corresponding to Table 3, and the invalid edge includes the instruction sequence N6, The instruction sequence N2, the instruction sequence N3 and the directed sequence N4 correspond to the directed edges, so that an initial forwarding data stream directed graph is pruned to obtain a valid forwarding data stream.
  • the directed graph can be as shown in Figure 2-d.
  • the constructing a network packet processing program includes: constructing a network packet processing program based on the directed edges and nodes in the effective forwarding data flow directed graph.
  • the association between the instruction sequence for implementing the table lookup function of the table and the instruction sequence for implementing the function identified by the function identifier may be embodied.
  • the relationship therefore, is based on the effective forwarding of the directed edges and nodes in the directed graph of the data stream, facilitating the rapid construction of the network>3 ⁇ 4 text handler.
  • the program code is divided into the granularity of the instruction sequence, and then the combination instruction is Sequence to obtain the network message processing program, which provides a mechanism for customizing the network message processing program, so that the network message processing program that meets the requirements can be generated according to the required function, thereby facilitating the construction to match the actual requirements.
  • More powerful network message processing program which is beneficial to improve the packet forwarding processing device and the network packet processing program it runs.
  • an embodiment of the present invention provides an instruction sequence determining apparatus 300, which may include: an obtaining unit 310 and a determining unit 320.
  • the acquiring unit 310 is configured to receive an instruction that carries the function identifier.
  • the function identifier acquired by the obtaining unit 310 may identify a function of performing forwarding processing on one or more network protocols.
  • the function identified by the function identifier obtained by the foregoing may include at least one of the following functions: counting the byte count of the network packet, adding a VLAN tag to the network packet, deleting the VLAN tag in the network packet, and modifying the network packet.
  • the function identified by the function identifier may also include one or more other functions.
  • the obtaining unit 310 may obtain a function identifier by using a user interface (for example, a person may receive a function identifier that is sent by another device through a network interface. Machine interaction interface, etc.) Get the function identifier.
  • the obtaining unit 310 can also obtain the above function identifier by other means.
  • the obtaining unit 310 can obtain the above-mentioned function identifier through its user interface, or the obtaining unit 310 can also receive through the network interface (for example, from a packet forwarding processing device or the like). A packet carrying a function identifier of a third-party device.
  • the instruction sequence determining apparatus 300 is a message forwarding processing device (where the message forwarding processing device can be, for example, a router or a switch thereof), and the obtaining unit 310 can obtain the function identifier through the user interface, or the obtaining unit 310 can A message carrying a function identification, such as from a network management server or a software defined network controller or other third party device, is received over the network interface.
  • the message forwarding processing device can be, for example, a router or a switch thereof
  • the obtaining unit 310 can obtain the function identifier through the user interface, or the obtaining unit 310 can A message carrying a function identification, such as from a network management server or a software defined network controller or other third party device, is received over the network interface.
  • the obtaining unit 310 can obtain the above-mentioned function identifier through its user interface, or the obtaining unit 310 can also receive through the network interface (for example, from a packet forwarding processing device or the like). A packet carrying a function identifier of a third-party device.
  • the instruction sequence determining apparatus 300 is a message forwarding processing device (where the message forwarding processing device can be, for example, a router or a switch thereof), and the obtaining unit 310 can obtain the function identifier through the user interface, or the obtaining unit 310 can A message carrying a function identification, such as from a network management server or a software defined network controller or other third party device, is received over the network interface.
  • the message forwarding processing device can be, for example, a router or a switch thereof
  • the obtaining unit 310 can obtain the function identifier through the user interface, or the obtaining unit 310 can A message carrying a function identification, such as from a network management server or a software defined network controller or other third party device, is received over the network interface.
  • the determining unit 320 is configured to determine M1 instruction sequences for implementing the function identified by the function identifier.
  • each of the M1 instruction sequences includes a unique entry instruction (eg, the first instruction of each of the M1 instruction sequences is the only entry instruction of the corresponding instruction sequence)
  • Each instruction sequence in the M1 instruction sequence contains a unique exit finger Let (for example, the last instruction of each of the M1 instruction sequences is an exit instruction of the corresponding instruction sequence, wherein the M1 is a positive integer.
  • the M1 instruction sequences are used for A sequence of instructions for processing a network message.
  • the obtaining unit 310 is further configured to obtain an application scenario identifier, where the application scenario identifier may identify a set of M0 instruction sequences. That is, the full set of instruction sequences can be determined based on the application scenario identification. Different application scenario identifiers may identify a complete set of different instruction sequences. The intersection of the two corpora of instruction sequences identified by the two application context identifiers may be an empty set or a non-empty set.
  • the determining unit 320 may be specifically configured to: determine, by using the function identifier as an index, an M1 command that matches the function identifier from among a set of M0 instruction sequences identified by the application scenario identifier. sequence.
  • the set of M0 instruction sequences is a complete set of instruction sequences for implementing various functions, or the set of M0 instruction sequences is a complete set of instruction sequences for implementing various functions corresponding to a certain application scenario.
  • each of the M0 instruction sequences may be pre-marked with at least one function identifier.
  • the at least one function identifier marked by the sequence of instructions indicates that the sequence of instructions can be used to implement the function identified by the at least one function identifier.
  • Figures 2-a and 2-b show two possible ways to identify the tag function.
  • Some of the instruction sequences in the M0 instruction sequences may be marked as being available for implementing multiple functions, such as shown in Figure 2-b.
  • the instruction sequence for implementing the function a1 includes the instruction sequence all, the instruction sequence al2, and the instruction sequence al3, and the instruction sequence for implementing the function bl includes the instruction sequence all, the instruction sequence b11, the instruction sequence bl2, and the instruction sequence bl3, which are visible.
  • the set of instruction sequences a1 is the intersection between the set of instruction sequences for implementing function a1 and the set of instruction sequences for implementing function bl.
  • the instruction sequence determining apparatus 300 further includes: a program unit 330, configured to construct a network text processing program, and generate a program upgrade patch by using the constructed network packet processing program, and send the program upgrade patch to the packet forwarding processing device ( Correspondingly, the packet forwarding processing device can use the program upgrade patch to upgrade the local network>3 ⁇ 4 text processing program, and use the upgraded network>3 ⁇ 4 text processing program to process the received network message); or, the program unit 330 , configured to construct a network packet processing program, and send the network packet processing program to the packet forwarding processing device (correspondingly, the packet forwarding processing device can The received network message processing program is installed, and the received network message processing program is used to process the received network text); or the program unit 330 constructs a network>3 ⁇ 4 text processing program and installs the network to process the received Network message).
  • the network packet processing program includes the M1 instruction sequences.
  • the obtaining unit 310 is further configured to acquire XI entries, where the mapping of the XI entries to the XI tables is-corresponding.
  • the determining unit 320 is further configured to: determine XI instruction sequences for implementing a table lookup function of the XI tables, where the mapping of the XI instruction sequences and the XI tables is - corresponding, where
  • the network message processing program further includes the XI instruction sequences, wherein the XI is a positive integer.
  • the network message processing program may not include an instruction sequence for implementing the table lookup function of the table.
  • the next instruction of the egress instruction of one of the M1 instruction sequences is one of the entry instructions of one of the instruction sequences in the XI instruction sequence
  • the previous instruction of the entry instruction of one of the instruction sequences in the M1 instruction sequence is one of the exit instructions of one of the instruction sequences in the XI instruction sequence.
  • the network processing program further includes M2 instruction sequences for supporting a function implemented by the function identifier, where the M2 is a positive integer, where An intersection of the set of the M1 instruction sequences and the set of the M2 instruction sequences is an empty set, wherein a next instruction of an exit point of one of the M2 instruction sequences is the XI instruction sequence
  • One of the entry instructions of one of the instruction sequences, and/or the previous instruction of the entry instruction of one of the sequence of instructions of the M2 instruction sequence is one of the exits of one of the sequences of instructions in the XI instruction sequence Instruction.
  • the network processing program further includes X2 instruction sequences for supporting a table lookup function implementation of the XI tables, where the X2 is a positive integer.
  • An intersection of the set of XI instruction sequences and the set of X2 instruction sequences is an empty set;
  • the next instruction of the exit instruction is one of the entry instructions of one of the sequences of instructions in the X2 instruction sequence, and/or the entry of one of the M1 instruction sequences or the M2 instruction sequences
  • the last instruction of the instruction is one of the exit instructions of one of the sequences of instructions in the X2 instruction sequence.
  • the correlation between the instruction sequence and the table for implementing the function identified by the function identifier may be reflected by forwarding the data flow directed graph, of course, due to the table and the method for implementing the table.
  • the instruction sequence of the table lookup function is related. Therefore, the forwarded data stream directed graph can also show the instruction sequence for realizing the function identified by the function identifier and the table lookup function for implementing the table to some extent.
  • the initial forwarded data stream directed graph may include an edge corresponding to a sequence of instructions for implementing all functions, and includes a sequence of instructions corresponding to all tables related to all functions, which may be prune by trimming the initial forwarded data stream.
  • Figure you can get a directed graph of the effective forwarding data stream.
  • the M1 instruction sequences are dual-shot to the M1 directed edges in the directed graph of the effective forwarding data stream, where the XI tables are bijective to the effective forwarding.
  • the effective forwarding data flow directed graph includes: X nodes and M directed edges, the M directed edges are bijective to M instruction sequences, and the X nodes are bijective to X tables, a M1 stripe directed edge is a subset of the set of M directed edges, the XI nodes being a subset of the set of X nodes, and the M and X are positive integers;
  • the next instruction of the exit instruction of the instruction sequence corresponding to the input edge of the node il of the X nodes is one of the instruction sequences of the instruction sequence for implementing the table lookup function of the table corresponding to the node il Is one of the exit instructions of the instruction sequence for implementing the table lookup function of the table corresponding to the node j1, wherein the node il is any one of the X nodes, and the node j1 is the X Any of the nodes.
  • the network “3 ⁇ 4 text processing program further includes The M2 instruction sequences are implemented by the function identifier, wherein the M2 instruction sequences are a subset of the M instruction sequences, where the M2 is a positive integer, and the M1 instruction sequences are The intersection of the set and the set of M2 instruction sequences is an empty set.
  • the network processing program further includes X2 instruction sequences for supporting a table lookup function implementation of the XI tables, and the X2 instruction sequences and X2
  • the mapping of the table is - correspondingly, the X2 tables are a subset of the X tables, and the X2 is a positive integer, wherein an intersection of the set of the XI instruction sequences and the set of the X2 instruction sequences Empty set.
  • the instruction sequence determining apparatus 300 in this embodiment may be a network management server or a packet forwarding processing device, or may be an SDN controller, or may be different from the network management server and the packet forwarding processing device. Third-party devices with SDN controllers.
  • each instruction sequence in the M1 instruction sequences after acquiring the function identifier, determining M1 instruction sequences for implementing the function identified by the function identifier, each instruction sequence in the M1 instruction sequences. Including a unique entry instruction, each of the M1 instruction sequences includes a unique exit instruction, wherein since the program code is divided by the granularity of the instruction sequence, this provides a mechanism for customizing the network message handler.
  • the instruction sequence can be selected according to the acquisition function identifier (that is, based on the requirement), thereby facilitating the construction of a network message processing program with stronger matching with actual requirements, which is beneficial to improving the instruction execution device and the operation thereof.
  • the matching degree of the network message processing program reduces the invalid code in the network file processing program run by the instruction execution device (such as the message forwarding processing device).
  • FIG. 4 is a structural block diagram of a management device 400 according to another embodiment of the present invention.
  • the management device 400 may include at least one processor 401, at least one network interface 404, a memory 405, and at least one communication bus 402. Communication bus 402 is used to implement connection communication between these components.
  • the management device 400 optionally includes a user interface 503, including an output device (eg, a touch screen, a liquid crystal display, a holographic image or a projection device, an input device (eg, a keyboard, a mouse, Trackball (English: trackball), touchpad or touch screen, etc. Camera and pickup device, etc.).
  • the memory 405 may include a read only memory and a random access memory, and provides instructions and data to the processor 501. A portion of the memory 405 may also include a non-volatile random access memory.
  • the processor 401 may be a central processing unit (English: central processing unit, abbreviated as CPU), or may be a combination of a CPU and a hardware chip.
  • the above hardware chip may be a combination of one or more of the following: an application-specific integrated circuit (ASIC), a field-programmable gate array (English: field-programmable gate array, abbreviation: FPGA) And complex programmable logic device (English: complex programmable logic device, abbreviation: CPLD).
  • ASIC application-specific integrated circuit
  • FPGA field-programmable gate array
  • CPLD complex programmable logic device
  • the memory 405 is configured to store the program code and transmit the program code to the processor 501.
  • the memory may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviation: RAM); the memory may also include a non-volatile memory (English: non-volatile memory).
  • a volatile memory such as a random access memory (English: random-access memory, abbreviation: RAM)
  • the memory may also include a non-volatile memory (English: non-volatile memory).
  • read-only memory English: read-only memory, abbreviation: ROM
  • flash memory English: flash memory
  • hard disk English: hard disk drive, abbreviation: HDD
  • SSD solid state drive
  • the memory may also include a combination of the above types of memories.
  • Network interface 404 can be implemented by an optical transceiver, an electrical transceiver, a wireless transceiver, or any combination thereof.
  • the optical transceiver can be a small form factor pluggable transceiver (English: small form-factor pluggable transceiver, abbreviation: SFP), and the enhanced small form-factor pluggable (English: enhanced small form-factor pluggable, Abbreviation: SFP+) Transceiver or 10 Gigabit small form-factor pluggable (English: 10 Gigabit small form-factor pluggable, abbreviation: XFP) Transceiver.
  • the electrical transceiver can be an Ethernet (English: Ethernet) network interface controller (English: network interface controller, abbreviation: NIC).
  • the wireless transceiver can be a wireless network interface controller (English: wireless network interface controller, abbreviation: WNIC).
  • the memory 405 stores the following elements, executable modules or data structures, or a subset thereof, or their extended set:
  • the operating system 4051 includes various system programs for implementing various basic services. And handle hardware-based tasks.
  • the application module 4052 includes various applications for implementing various application services.
  • the memory 405 is configured to store a program code, and transmit the program code to the processor 401;
  • the processor 401 is configured to perform the following steps according to the program code: acquiring a function identifier, determining an M1 instruction sequence for implementing the function identified by the function identifier, constructing a network packet processing program, and using the constructed
  • the network file processing program generates a program upgrade patch, and sends the program upgrade patch to the packet forwarding processing device by using the network interface; or constructs a network packet processing program and sends the network packet processing device to the packet forwarding processing device by using the network interface a network message processing program, wherein each of the M1 instruction sequences includes a unique entry instruction, each of the M1 instruction sequences includes a unique exit instruction, and the M1 is positive An integer, where the network packet processing program includes the M1 instruction sequences.
  • the processor is further configured to: obtain XI entries, where the mapping of the XI entries to the XI tables is-corresponding to determine XI instructions for implementing the table lookup function of the XI tables. a sequence, the mapping of the XI instruction sequences to the XI tables is - corresponding, wherein the network message processing program further includes the XI instruction sequences, wherein the XI is a positive integer.
  • the M1 instruction sequences are bijected to the M1 directed edges in the directed graph of the effective forwarding data stream, where the XI tables are bijective to the XI in the directed graph of the valid forwarding data stream.
  • the effective forwarding data flow directed graph includes: X nodes and M directed edges, the M directed edges are bijective to M instruction sequences, and the X nodes are bijected to X tables
  • the M1 stripe directed edge is a subset of the set of the M directed edges, the XI nodes are a subset of the set of the X nodes, and the M and X are positive integers;
  • the next instruction of the exit instruction of the instruction sequence corresponding to the input edge of the node il of the X nodes is one of the instruction sequences of the instruction sequence for implementing the table lookup function of the table corresponding to the node il Is one of the exit instructions of the instruction sequence for implementing the table lookup function of the table corresponding to the node j1, wherein the node il is any one of the X nodes, and the node j1 is the X Any of the nodes.
  • the network>3 ⁇ 4 file processing program further includes a function for supporting the function identifier.
  • the M2 is a positive integer, and the intersection of the set of the M1 instruction sequences and the set of the M2 instruction sequences is an empty set.
  • the network packet processing program further includes X2 instruction sequences for supporting a table lookup function of the XI tables, where the mapping of the X2 instruction sequences and the X2 tables is - corresponding to The X2 tables are a subset of the X tables, and the X2 is a positive integer, wherein an intersection of the set of the XI instruction sequences and the set of the X2 instruction sequences is an empty set.
  • the effective forwarding data flow directed graph is obtained by trimming a node and/or a directed edge in the initial forwarding data flow directed graph; wherein the initial valid forwarding data flow directed graph includes: X0 a node and a M0 stripe edge, wherein the mapping of the M0 stripe edge to the M0 instruction sequence is - corresponding, the mapping of the X0 node and the X0 table is - corresponding, the M strip has The set of edges is a subset of the set of M0 directed edges, the set of X nodes is a subset of the set of X0 nodes, and the M0 and the X0 are positive integers.
  • the processor 401 is further configured to: obtain an application scenario identifier, where the M0 instruction sequence is the M0 instruction sequence identified by the application scenario identifier.
  • the processor 401 is configured to: construct a network processing procedure based on the directed edges and nodes in the directed data flow directed graph.
  • next instruction of the exit instruction of one of the instruction sequences in the M1 instruction sequence is one of the entry instructions of one of the instruction sequences in the XI instruction sequence, and/or the M1 instruction sequence
  • the previous instruction of the entry instruction of one of the instruction sequences is one of the exit instructions of one of the sequences of instructions in the XI instruction sequence.
  • the network>3 ⁇ 4 file processing program further includes M2 instruction sequences for supporting the function implementation of the function identifier, where the M2 is a positive integer, where the M1 instruction sequence is set.
  • An intersection with the set of the M2 instruction sequences is an empty set, wherein a next instruction of an exit point of one of the M2 instruction sequences is one of the instruction sequences in the XI instruction sequence
  • An entry instruction, and/or a previous instruction of an entry instruction of one of the sequence of instructions of the M2 instruction sequence is one of the exit instructions of one of the sequences of instructions in the sequence of XI instructions.
  • the network packet processing program further includes a table lookup function for supporting the XI tables.
  • the X2 instruction sequences are implemented, where the X2 is a positive integer, and the intersection of the set of the XI instruction sequences and the set of the X2 instruction sequences is an empty set;
  • the next instruction of the M1 instruction sequence or the exit instruction of one of the M2 instruction sequences is one of the entry instructions of one of the X2 instruction sequences, and/or
  • the M1 instruction sequence or the previous instruction of the entry instruction of one of the M2 instruction sequences is one of the exit instructions of one of the X2 instruction sequences.
  • management device 400 of this embodiment can be a network management server or an SDN controller or the like.
  • the management device 400 determines, after acquiring the function identifier, an M1 instruction sequence for implementing the function identified by the function identifier, and each instruction in the M1 instruction sequence.
  • the sequence includes a unique entry instruction
  • each of the M1 instruction sequences includes a unique exit instruction, wherein since the program code is divided by the granularity of the instruction sequence, this provides a mechanism for customizing the network message handler.
  • the instruction sequence that satisfies the requirement is filtered, thereby facilitating the construction of a network message processing program with stronger matching with the actual requirement, which is beneficial to improving the instruction execution device and the device.
  • FIG. 5 is another embodiment of the present invention.
  • the packet forwarding device 500 can be configured. Comprising at least one processor 501, at least one network processor 506, at least one network interface 504, memory 505, at least one communication bus 502.
  • the communication bus 502 for implementing communications connections between these components.
  • the message forwarding device 500 optionally includes a user interface 503, including an output device (such as a touch screen, a liquid crystal display, a holographic image or a projection device), and an input device (such as a keyboard and a mouse).
  • a user interface 503 including an output device (such as a touch screen, a liquid crystal display, a holographic image or a projection device), and an input device (such as a keyboard and a mouse).
  • Trackball English: trackball
  • touchpad or touch Touch screen camera, pickup device, etc.
  • the memory 505 can include read only memory and random access memory, and provides instructions and data to the processor 501.
  • a portion of the memory 502 may also include a non-volatile random access memory.
  • the processor 501 can be a central processing unit (English: central processing unit, abbreviated as CPU), or a combination of a CPU and a hardware chip.
  • the above hardware chip may be a combination of one or more of the following: an application-specific integrated circuit (ASIC), a field-programmable gate array (English: field-programmable gate array, abbreviation: FPGA) And complex programmable logic device (English: complex programmable logic device, abbreviation: CPLD).
  • ASIC application-specific integrated circuit
  • FPGA field-programmable gate array
  • CPLD complex programmable logic device
  • the memory 505 is configured to store the program code and transmit the program code to the processor 501.
  • the memory may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviation: RAM); the memory may also include a non-volatile memory (English: non-volatile memory).
  • a volatile memory such as a random access memory (English: random-access memory, abbreviation: RAM)
  • the memory may also include a non-volatile memory (English: non-volatile memory).
  • read-only memory English: read-only memory, abbreviation: ROM
  • flash memory English: flash memory
  • hard disk English: hard disk drive, abbreviation: HDD
  • SSD solid state drive
  • the memory may also include a combination of the above types of memories.
  • Network interface 504 can be implemented by an optical transceiver, an electrical transceiver, a wireless transceiver, or any combination thereof.
  • the optical transceiver can be a small form factor pluggable transceiver (English: small form-factor pluggable transceiver, abbreviation: SFP), and the enhanced small form-factor pluggable (English: enhanced small form-factor pluggable, Abbreviation: SFP+) Transceiver or 10 Gigabit small form-factor pluggable (English: 10 Gigabit small form-factor pluggable, abbreviation: XFP) Transceiver.
  • the electrical transceiver can be an Ethernet (English: Ethernet) network interface controller (English: network interface controller, abbreviation: NIC).
  • the wireless transceiver can be a wireless network interface controller (English: wireless network interface controller, abbreviation: WNIC).
  • the memory 505 is configured to store program code and to the processor.
  • the processor 501 is configured to perform the following steps according to the program code:
  • each of the M1 instruction sequences includes a unique entry instruction, in the M1 instruction sequence
  • Each instruction sequence includes a unique exit instruction, the M1 is a positive integer, and the network message processing program includes the M1 instruction sequences;
  • the network processor 506 is configured to install the network packet processing program, and process the network received from the network interface according to the network message processing program.
  • the processor is further configured to: obtain XI entries, where the mapping of the XI entries to the XI tables is-corresponding to determine XI instructions for implementing the table lookup function of the XI tables. a sequence, the mapping of the XI instruction sequences to the XI tables is - corresponding, wherein the network message processing program further includes the XI instruction sequences, wherein the XI is a positive integer.
  • the M1 instruction sequences are bijected to the M1 directed edges in the directed graph of the effective forwarding data stream, where the XI tables are bijective to the XI in the directed graph of the valid forwarding data stream.
  • the effective forwarding data flow directed graph includes: X nodes and M directed edges, the M directed edges are bijective to M instruction sequences, and the X nodes are bijected to X tables
  • the M1 stripe directed edge is a subset of the set of the M directed edges, the XI nodes are a subset of the set of the X nodes, and the M and X are positive integers;
  • the next instruction of the exit instruction of the instruction sequence corresponding to the input edge of the node il of the X nodes is one of the instruction sequences of the instruction sequence for implementing the table lookup function of the table corresponding to the node il Is one of the exit instructions of the instruction sequence for implementing the table lookup function of the table corresponding to the node j1, wherein the node ii is any one of the X nodes, and the node ji is the X Any of the nodes.
  • the network>3 ⁇ 4 file processing program further includes: M2 is a positive integer for supporting the function identified by the function identifier, and an intersection of the set of the M1 instruction sequences and the set of the M2 instruction sequence is Empty set.
  • the network packet processing program further includes X2 instruction sequences for supporting a table lookup function of the XI tables, where the mapping of the X2 instruction sequences and the X2 tables is - corresponding to ,
  • the X2 tables are a subset of the X tables, and the X2 is a positive integer, wherein an intersection of the set of the XI instruction sequences and the set of the X2 instruction sequences is an empty set.
  • the effective forwarding data flow directed graph is obtained by trimming a node and/or a directed edge in the initial forwarding data flow directed graph; wherein the initial valid forwarding data flow directed graph includes: X0 a node and a M0 stripe edge, wherein the mapping of the M0 stripe edge to the M0 instruction sequence is - corresponding, the mapping of the X0 node and the X0 table is - corresponding, the M strip has The set of edges is a subset of the set of M0 directed edges, the set of X nodes is a subset of the set of X0 nodes, and the M0 and the X0 are positive integers.
  • the processor is further configured to: obtain an application scenario identifier, where the M0 instruction sequences are M0 instruction sequences identified by the application scenario identifier.
  • the processor is configured to: construct a network packet processing program based on the directed edge and the node in the effective forwarding data flow directed graph.
  • next instruction of the exit instruction of one of the instruction sequences in the M1 instruction sequence is one of the entry instructions of one of the instruction sequences in the XI instruction sequence, and/or the M1 instruction sequence
  • the previous instruction of the entry instruction of one of the instruction sequences is one of the exit instructions of one of the sequences of instructions in the XI instruction sequence.
  • the network>3 ⁇ 4 file processing program further includes M2 instruction sequences for supporting the function implementation of the function identifier, where the M2 is a positive integer, where the M1 instruction sequence is set.
  • An intersection with the set of the M2 instruction sequences is an empty set, wherein a next instruction of an exit point of one of the M2 instruction sequences is one of the instruction sequences in the XI instruction sequence
  • An entry instruction, and/or a previous instruction of an entry instruction of one of the sequence of instructions of the M2 instruction sequence is one of the exit instructions of one of the sequences of instructions in the sequence of XI instructions.
  • the network packet processing program further includes X2 instruction sequences for supporting a table lookup function of the XI tables, where the X2 is a positive integer, and the set of the XI instruction sequences is The intersection of the set of X2 instruction sequences is an empty set;
  • the next instruction of the M1 instruction sequence or the exit instruction of one of the M2 instruction sequences is one of the instruction sequences in the X2 instruction sequence.
  • the entry instruction, and/or the previous instruction of the M1 instruction sequence or the entry instruction of one of the M2 instruction sequences, is one of one of the instruction sequences in the X2 instruction sequence Export directive
  • the packet forwarding processing device 500 of this embodiment can be a network switch, a router, or the like.
  • the packet forwarding processing device 500 determines, after acquiring the function identifier, an M1 instruction sequence for implementing the function identified by the function identifier, where the M1 instruction sequence is Each instruction sequence includes a unique entry instruction, and each of the M1 instruction sequences includes a unique exit instruction, wherein since the program code is divided by the granularity of the instruction sequence, this provides a custom network message processing.
  • the mechanism of the program can obtain the instruction sequence that meets the requirements based on the acquisition function identifier (that is, based on the requirement), thereby facilitating the construction of a network message processing program with stronger matching with actual requirements, which is beneficial to improve instruction execution.
  • the degree of matching between the device and the network packet processing program it runs reduces the invalid code in the network file processing program run by the instruction execution device (such as the packet forwarding processing device).
  • an embodiment of the present invention further provides a communication system, which may include:
  • the packet forwarding processing device 610 is configured to send a packet carrying the function identifier.
  • the management device 620 is configured to receive the packet carrying the function identifier, determine M1 instruction sequences for implementing the function identified by the function identifier, construct a network packet processing program, and process the network using the constructed network
  • the program generation program upgrades the patch, and sends the program upgrade patch to the "text forwarding processing device 610; or constructs a network packet processing program and sends the network text processing program to the packet forwarding processing device 610.
  • each of the M1 instruction sequences includes a unique entry instruction (eg, the first instruction of each of the M1 instruction sequences is the only entry instruction of the corresponding instruction sequence)
  • Each of the M1 instruction sequences includes a unique exit instruction (eg, for example, the last instruction of each of the M1 instruction sequences is a corresponding instruction sequence An exit instruction, wherein the M1 is a positive integer.
  • the M1 instruction sequence is a sequence of instructions for processing a network message.
  • the function identifier obtained by the foregoing may identify a function of performing forwarding processing on one or more network protocols.
  • the function identified by the function identifier may include at least one of the following functions: Counting the byte count of the network packet, adding a VLAN tag to the network packet, deleting the VLAN tag in the network packet, and modifying the network packet.
  • the value of the DSCP field in the IP packet header may also include one or more other functions.
  • the message forwarding processing device 610 has a network processor, and the network processor can run the network processing program to process the received network.
  • the management device 620 is further configured to: when acquiring the function identifier, obtain an application scenario identifier, where the application scenario identifier may identify a set of M0 instruction sequences. That is, the full set of instruction sequences can be determined based on the application scenario identification. Among them, different application scene identifiers can identify the complete set of different instruction sequences. The intersection of the two corpora of instruction sequences identified by the two application context identifiers may be an empty set or a non-empty set.
  • the management device 620 can be configured to use the function identifier as an index, and determine, from among the set of M0 instruction sequences identified by the application scenario identifier, the M1 instruction sequences that match the function identifier.
  • the set of M0 instruction sequences is a complete set of instruction sequences for implementing various functions, or the set of M0 instruction sequences is a complete set of instruction sequences for implementing various functions corresponding to a certain application scenario.
  • each of the M0 instruction sequences may be pre-marked with at least one function identifier.
  • At least one function identifier that is marked by a sequence of instructions indicates that the sequence of instructions can be used to implement the functions identified by the at least one function identifier.
  • the management device 620 is further configured to: when acquiring the function identifier, obtain XI items (for example, the instruction carrying the acquired function identifier or the XI carrying the message) Entry), wherein the mapping of the XI entries to the XI table is - corresponding, the XI is a positive integer.
  • XI items for example, the instruction carrying the acquired function identifier or the XI carrying the message
  • the management device 620 is further configured to determine XI instruction sequences for implementing the table lookup function of the XI tables, where the mapping of the XI instruction sequences to the XI tables is - corresponding, where The network message handler also includes the XI instruction sequences. In addition, if the packet is forwarded to the processing device The hardware is used to implement the lookup function of a table in the above XI table, and the network message processing program may not include a sequence of instructions for implementing the table lookup function of the certain table.
  • the first one of the XI entries may include at least one of the following information: an identifier of the first table, the first table, and one of a table lookup function for implementing the first table.
  • the first table and/or one instruction sequence for implementing the table lookup function of the first table may be indexed according to the identifier of the first table.
  • one instruction sequence for implementing the look-up table function of the first table may be indexed according to the first table itself (the first table may or may not include the identifier of the first table).
  • the sequence of instructions for implementing the lookup function of a table may include at least one exit instruction and at least one entry instruction, that is, the sequence of instructions for implementing the lookup function of a table may have at least one point and At least one exit point.
  • the next instruction of the egress instruction of one of the M1 instruction sequences is one of the entry instructions of one of the instruction sequences in the XI instruction sequence
  • the previous instruction of the entry instruction of one of the instruction sequences in the M1 instruction sequence is one of the exit instructions of one of the instruction sequences in the XI instruction sequence.
  • the network packet processing program may further include M2 instruction sequences for supporting the implementation of the function identified by the function identifier.
  • the next instruction of the egress instruction of one of the M2 instruction sequences is one of the entry instructions of one of the instruction sequences in the XI instruction sequence, and/or the M2 instruction sequence
  • the previous instruction of the entry instruction of one of the instruction sequences is one of the exit instructions of one of the sequences of instructions in the XI instruction sequence.
  • some upper-level functions may require some underlying functionality to support.
  • One of the underlying functions may be used to support an upper-level function or multiple upper-level functions.
  • An upper-level function may also require multiple underlying functions to support it. Therefore, when the function identifier is obtained, it may be necessary to determine not only the M1 instruction sequences for implementing the functions identified by the acquired function identifiers, but also the M2 instruction sequences for supporting the functions implemented by the function identifiers.
  • the network processing program may further include X2 instruction sequences for supporting a table lookup function of the XI tables, where the X2 is a positive integer, wherein the M1 instruction sequence or the next instruction of the exit instruction of one of the M2 instruction sequences is one of the entry instructions of one of the X2 instruction sequences, And/or, the M1 instruction sequence or the previous instruction of the entry instruction of one of the M2 instruction sequences is one of the exit instructions of one of the X2 instruction sequences.
  • the correlation between the instruction sequence and the table for implementing the function identified by the function identifier may be reflected by forwarding the data flow directed graph, of course, due to the table and the method for implementing the table.
  • the instruction sequence of the table lookup function is related. Therefore, the forwarded data stream directed graph can also show the instruction sequence for realizing the function identified by the function identifier and the table lookup function for implementing the table to some extent.
  • the initial forwarded data stream directed graph may include an edge corresponding to a sequence of instructions for implementing all functions, and includes a sequence of instructions corresponding to all tables related to all functions, which may be prune by trimming the initial forwarded data stream.
  • Figure you can get a directed graph of the effective forwarding data stream.
  • the M1 instruction sequences are dual-shot to the M1 directed edges in the directed graph of the effective forwarding data stream, where the XI tables are bijective to the effective forwarding.
  • the data stream has XI nodes in the graph.
  • the effective forwarding data flow directed graph includes: X nodes and M strip directed edges, the M strips have bidirectionally directed to M instruction sequences, and the X nodes are bijective to X tables.
  • the set of the M1 directed edges is a subset of the set of the M directed edges, and the set of the XI nodes is a subset of the set of the X nodes, wherein the M and X are A positive integer.
  • the X tables include the XI tables and the X2 tables
  • the M instruction sequences include the M1 instruction sequence and the M2 instruction sequences.
  • the next instruction of the egress instruction of the instruction sequence corresponding to the inbound edge of the node of the X nodes is a table lookup function for implementing a table corresponding to the node.
  • the finger corresponding to the outgoing edge of the node among the X nodes may be one of the exit instructions of the instruction sequence for implementing the look-up table function of the table corresponding to each node.
  • the next instruction of the exit instruction of the instruction sequence corresponding to the input edge of the node il is one of the entry instructions of the instruction sequence for implementing the table lookup function of the table corresponding to the node il, and the node il is the X Any node in the node.
  • the previous instruction of the entry instruction of the instruction sequence corresponding to the outbound edge of the node j1 may be one of the export instructions of the instruction sequence for implementing the table lookup function of the table corresponding to the node j1, where the node j1 is the X Any of the nodes.
  • the packet forwarding processing device may perform the export instruction of the instruction sequence corresponding to the inbound edge of the node i2.
  • the table lookup function for implementing the table corresponding to the node i2 is performed by using corresponding hardware, and the node i2 is any one of the X nodes.
  • the message forwarding processing device may execute an entry instruction of an instruction sequence corresponding to one of the outbound edges of the node j2 after executing the table lookup function for implementing the table corresponding to the node j2 by using the corresponding hardware, where the node j2 is the X Any node in the node.
  • the network processing program may further include M2 instruction sequences for supporting implementation of the function identified by the function identifier, where the M2 instruction sequences are A collection of a subset of the set of M instruction sequences. The intersection of the set of the M1 instruction sequences and the set of the M2 instruction sequences is an empty set.
  • the network processing program further includes X2 instruction sequences for supporting a table lookup function implementation of the XI tables, and the X2 instruction sequences and X2 Table - correspondingly, the set of the X2 tables is a subset of the set of the X tables, and the X2 is a positive integer, wherein the set of the XI instruction sequences and the set of the X2 instruction sequences The intersection is an empty set.
  • the valid forwarding data flow directed graph is obtained by pruning a node and a directed edge in the initial forwarding data flow directed graph, or the effective forwarding data flow directed graph It is obtained by trimming the directed edges of the initial forwarding data stream in the directed graph.
  • the initial valid forwarding data flow directed graph includes: X0 nodes and M0 directed edges, the M0 directed edges correspond to M0 instruction sequences, the X0 nodes and X0 tables— Correspondingly, the set of M directed edges is a subset of the set of M0 directed edges, and the X nodes are subsets of the X0 nodes,
  • the effective forwarding data flow directed graph can be obtained by pruning the invalid node and/or the invalid directed edge in the initial forwarding data flow directed graph, wherein the effective directed edge can be regarded as corresponding to the foregoing instruction sequence.
  • the directed edge, the forwarded data stream is removed from the graph, and the directed edge other than the effective directed edge is considered to be an invalid directed edge, and the sequence of instructions includes the M1 instruction sequence and the ⁇ 2
  • the sequence of instructions, of course M2 may be equal to zero.
  • the valid node may be regarded as a node corresponding to the X tables, and the node that is to be forwarded in the data stream directed graph except the node other than the valid node may be regarded as an invalid node, and the X tables include the XI tables and The X2 tables, of course, X2 may be equal to zero.
  • FIG. 2-c shows an initial forwarding data flow directed graph, wherein it is assumed that the invalid node includes the node corresponding to Table 3, and the invalid edge includes the instruction sequence N6, The instruction sequence N2, the instruction sequence N3 and the directed sequence N4 correspond to the directed edges, so that an initial forwarding data stream directed graph is pruned to obtain a valid forwarding data stream.
  • the directed graph can be as shown in Figure 2-d.
  • the management device 620 is configured to construct a network file handler based on the directed edges and nodes in the valid forwarding data flow directed graph.
  • a network file handler based on the directed edges and nodes in the valid forwarding data flow directed graph.
  • the management device 620 after the management device 620 obtains the function identifier from the packet forwarding processing device 610, determining M1 instruction sequences for implementing the function identified by the function identifier, the M1 commands.
  • Each sequence of instructions in the sequence includes a unique entry instruction
  • each of the sequence of instructions includes a unique exit instruction, wherein, since the program code is divided by the granularity of the sequence of instructions, the management device 620 constructs a network report.
  • the text processing program generates the program upgrade patch by using the constructed network packet processing program, and sends the program upgrade patch to the packet forwarding processing device 610; or the management device 620 constructs a network packet processing program and reports the packet
  • the text forwarding processing device 610 sends the network packet processing program; this provides a mechanism for customizing the network packet processing program, and then can select and obtain the instruction sequence that meets the requirements based on the acquisition function identifier (ie, based on the requirement). In turn, it is beneficial to construct a network text processing program that is more compatible with actual needs. To improve the matching of the packet forwarding processing equipment and its operation network message handler, reducing " ⁇ forwarding processing the invalid network code in the processing network of the device".
  • the apparatus disclosed in the several embodiments provided by the present application can be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or may be Integration into another system, or some features can be ignored or not executed.
  • the components displayed by the unit may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be that each unit exists physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the technical solution of the present invention may be embodied in the form of a software product stored in a storage medium, including a plurality of instructions for causing a computer device (specifically, a computer device)
  • the processor in the process performs all or part of the steps of the method described in various embodiments of the invention.
  • the storage medium is a non-trans i tory medium, which may be a random access memory, a read only memory, a flash memory, a hard disk, a solid state hard disk, or a magnetic tape (English: magne t ic tape). Floppy disk (English: f loppy di sk ), CD (English: opt i ca l di sc ) and any combination thereof.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

一种指令序列确定方法和相关设备及***。其中,一种指令序列确定方法可包括:获取功能标识(101);确定用于实现该功能标识所标识功能的M1个指令序列,其中,该M1个指令序列中的每个指令序列包括唯一的入口指令,该M1个指令序列中的每个指令序列包括唯一的出口指令,其中,该M1为正整数,该M1个指令序列为构建用于对网络报文进行处理的网络报文处理程序的指令序列(102)。该方法和相关设备及***有利于提高报文转发处理设备与其所执行的用于对网络报文进行处理的指令序列的匹配度,减少报文转发处理设备运行的无效代码量。

Description

指令序列确定的方法和相关设备及*** 技术领域
本发明涉及计算机技术领域,
及***。 背景技术
目前, 在报文转发处理设备(例如路由器和网络交换机)中, 通常使用网 络处理器来实现网络 >¾文的转发处理。其中, 网络处理器是指专门用于处理网 络 >¾文的可编程处理器。
其中, 可以使用汇编语言或者高级语言编写网络报文处理程序, 网络处理 器通过执行网络报文处理程序实现网络报文的相关转发处理。例如,在协议无 感知转发中, 通常将网络报文的转发处理过程抽象为一系列 "匹配-动作" 操 作, 这一系列 "匹配-动作" 操作可通过翻译转换为网络报文处理程序, 并在 网络处理器上运行。
其中,在通常的路由器或交换机等报文转发设备中安装运行的网络报文处 理程序需要支持几十甚至上百种不同网络协议的转发处理,而每个网络协议又 可能涉及到多种不同报文转发场景, 需要进行不同报文转发动作,使得通常的 报文转发设备中安装运行的网络报文处理程序变得非常复杂。 然而,通常将网 络报文处理程序设计的非常复杂,使得更容易引入较多程序漏洞,且支持的协 议和功能越多对网络处理器的芯片性能要求也就越高。 发明内容
本发明实施例提供指令序列确定方法和相关设备及***,以期提高报文转 报文转发处理设备运行的无效代码量。
第一方面, 一种指令序列确定方法, 可包括:
获取功能标识;
确定用于实现所述功能标识所标识功能的 Ml个指令序列, 其中, 所述 Ml 个指令序列中的每个指令序列包括唯一的入口指令, 所述 Ml个指令序列中的 每个指令序列包括唯一的出口指令, 其中, 所述 Ml为正整数, 所述 Ml个指令 序列为构建用于对网络报文进行处理的网络报文处理程序的指令序列。
结合第一方面, 在第一方面的第一种可能的实施方式中,
所述方法还包括:
构建网络报文处理程序并利用构建的所述网络报文处理程序生成程序升 级补丁, 向报文转发处理设备发送所述程序升级补丁; 或者构建网络报文处理 程序并向报文转发处理设备发送所述网络报文处理程序;或者构建网络报文处 理程序并安装所述网络>¾文处理程序;
其中, 所述网络报文处理程序包括所述 Ml个指令序列。
结合第一方面的第一种可能的实施方式,在第一方面的第二种可能的实施 方式中,
所述方法还包括: 获取 XI个条目, 所述 XI个条目与 XI个表的映射为—— 对应, 确定用于实现所述 XI个表的查表功能的 XI个指令序列, 所述 XI个指令 序列与所述 XI个表的映射为——对应, 其中, 所述网络报文处理程序还包括 所述 XI个指令序列, 其中, 所述 XI为正整数。
结合第一方面的第二种可能的实施方式,在第一方面的第三种可能的实施 方式中,
第一条目包括如下信息的至少一种: 第一表的标识、所述第一表和用于实 现所述第一表的查表功能的 1个指令序列, 其中, 所述第一条目为所述 XI个条 目中的任意一个条目。
结合第一方面的第二种可能的实施方式或第一方面的第三种可能的实施 方式, 在第一方面的第四种可能的实施方式中, 所述 Ml个指令序列双射到有 效转发数据流有向图中的 Ml条有向边, 其中, 所述 XI个表双射到所述有效转 发数据流有向图中的 XI个节点,
所述有效转发数据流有向图包括: X个节点和 M条有向边, 所述 M条有向 边双射到 M个指令序列, 所述 X个节点双射到 X个表, 所述 Ml条有向边为所述 M条有向边的集合的子集, 所述 XI个节点为所述 X个节点的集合的子集, 所述 M和 X为正整数; 其中, 所述 X个节点中的节点 il的入边所对应的指令序列的出口指令的下 一条指令, 为用于实现所述节点 il所对应表的查表功能的指令序列的其中一个 一条指令, 为用于实现所述节点 j 1所对应表的查表功能的指令序列的其中一个 出口指令, 其中, 节点 il为所述 X个节点中的任意一个节点, 所述节点 jl为所 述 X个节点中的任意一个节点。
结合第一方面的第四种可能的实施方式,在第一方面的第五种可能的实施 方式中,所述网络报文处理程序还包括用于支撑所述功能标识所标识功能实现 中, 所述 M2为正整数, 所述 Ml个指令序列的集合和所述 M2指令序列的集合 的交集为空集。
结合第一方面的第四种可能的实施方式或第一方面的第五种可能的实施 方式, 在第一方面的第六种可能的实施方式中,
所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2 个指令序列, 所述 X2个指令序列与 X2个表的映射为——对应, 所述 X2个表为 所述 X个表的子集, 所述 X2为正整数, 其中, 所述 XI个指令序列的集合和所 述 X2指令序列的集合的交集为空集。
结合第一方面的第四种可能的实施方式或第一方面的第五种可能的实施 方式或第一方面的第六种可能的实施方式,在第一方面的第七种可能的实施方 式中, 所述有效转发数据流有向图是修剪初始转发数据流有向图中的节点和 / 或有向边而得到; 其中, 所述初始有效转发数据流有向图包括: X0个节点和 M0条有向边, 其中, 所述 M0条有向边与 M0个指令序列的映射为——对应, 所述 X0个节点与 X0个表的映射为——对应, 其中, 所述 M条有向边的集合为 所述 M0条有向边的集合的子集, 所述 X个节点的集合为所述 X0个节点的集合 的子集, 所述 M0和所述 X0为正整数。
结合第一方面的第七种可能的实施方式,在第一方面的第八种可能的实施 方式中, 所述确定用于实现所述功能标识所标识功能的 Ml个指令序列包括: 以所述功能标识为索引, 从所述 M0个指令序列之中确定出与所述功能标识匹 配的 Ml个指令序列。
结合第一方面的第七种可能的实施方式或第一方面的第八种可能的实施 方式, 在第一方面的第九种可能的实施方式中,
所述方法还包括: 获取应用场景标识, 其中, 所述 M0个指令序列为所述 应用场景标识所标识的 M0个指令序列。
结合第一方面的第四种可能的实施方式或者第一方面的第五种可能的实 施方式或第一方面的第六种可能的实施方式或者第一方面的第七种可能的实 施方式或第一方面的第八种可能的实施方式或第一方面的第九种可能的实施 方式, 在第一方面的第十种可能的实施方式中,
所述构建网络报文处理程序包括:基于所述有效转发数据流有向图中的有 向边和节点构建网络"¾文处理程序。
结合第一方面的第二种可能的实施方式或者第一方面的第三种可能的实 施方式, 在第一方面的第十一种可能的实施方式中, 所述 Ml指令序列中的其 中一个指令序列的出口指令的下一条指令, 为所述 XI指令序列中的其中一个 指令序列的其中一个入口指令, 和 /或, 所述 Ml指令序列中的其中一个指令序 列的入口指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其 中一个出口指令。
结合第一方面的第十一种可能的实施方式,在第一方面的第十二种可能的 实施方式中,所述网络"¾文处理程序还包括用于支撑所述功能标识所标识功能 实现的 M2个指令序列, 其中, 所述 M2为正整数, 其中, 所述 Ml个指令序列 的集合与所述 M2指令序列的集合的交集为空集, 其中, 所述 M2个指令序列中 的其中一个指令序列的出口点的下一条指令, 为所述 XI指令序列中的其中一 个指令序列的其中一个入口指令, 和 /或所述 M2指令序列中的其中一个指令序 列的入口指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其 中一个出口指令。
结合第一方面的第十二种可能的实施方式,在第一方面的第十三种可能的 实施方式中, 所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能 实现的 X2个指令序列, 其中, 所述 X2为正整数, 所述 XI个指令序列的集合与 所述 X2指令序列的集合的交集为空集;
其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列的 出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中一 个入口指令,和 /或,所述 Ml个指令序列或所述 M2个指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序列 的其中一个出口指令。
第二方面, 一种指令序列确定装置, 包括:
获取单元, 用于获取功能标识;
确定单元,用于确定用于实现所述获取单元获取的所述功能标识所标识功 能的 Ml个指令序列, 其中, 所述 Ml个指令序列中的每个指令序列包括唯一的 入口指令, 所述 Ml个指令序列中的每个指令序列包括唯一的出口指令, 所述 Ml为正整数, 其中, 所述 Ml个指令序列为构建用于对网络报文进行处理的网 络报文处理程序的指令序列。
结合第二方面, 在第二方面的第一种可能的实施方式中,
所述指令序列确定装置还包括:
程序单元,用于构建网络报文处理程序并利用构建的所述网络报文处理程 序生成程序升级补丁, 向报文转发处理设备发送所述程序升级补丁; 或者构建 建网络 文处理程序并安装所述网络 文处理程序;
其中, 所述网络报文处理程序包括所述 Ml个指令序列。
结合第二方面的第一种可能的实施方式,在第二方面的第二种可能的实施 方式中,
所述获取单元还用于获取 XI个条目, 其中, 所述 XI个条目与 XI个表的映 射为——对应;
所述确定单元还用于: 确定用于实现所述 XI个表的查表功能的 XI个指令 序列, 所述 XI个指令序列与所述 XI个表的映射为——对应, 其中, 所述网络 报文处理程序还包括所述 XI个指令序列, 其中, 所述 XI为正整数。
结合第二方面的第二种可能的实施方式,在第二方面的第三种可能的实施 方式中, 所述 Ml个指令序列双射到有效转发数据流有向图中的 Ml条有向边, 其中, 所述 XI个表双射到所述有效转发数据流有向图中的 XI个节点,
所述有效转发数据流有向图包括: X个节点和 M条有向边, 所述 M条有向 边双射到 M个指令序列, 所述 X个节点双射到 X个表, 所述 Ml条有向边为所述 M条有向边的集合的子集, 所述 XI个节点为所述 X个节点的集合的子集, 所述 M和 X为正整数;
其中, 所述 X个节点中的节点 il的入边所对应的指令序列的出口指令的下 一条指令, 为用于实现所述节点 il所对应表的查表功能的指令序列的其中一个 一条指令, 为用于实现所述节点 j 1所对应表的查表功能的指令序列的其中一个 出口指令, 其中, 节点 ii为所述 X个节点中的任意一个节点, 所述节点 ji为所 述 X个节点中的任意一个节点。
结合第二方面的第三种可能的实施方式,在第二方面的第四种可能的实施 方式中,
所述网络报文处理程序还包括用于支撑所述功能标识所标识功能实现的 所述 M2为正整数, 所述 Ml个指令序列的集合和所述 M2指令序列的集合的交 集为空集。
结合第二方面的第三种可能的实施方式或第二方面的第四种可能的实施 方式, 在第二方面的第五种可能的实施方式中,
所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2 个指令序列, 所述 X2个指令序列与 X2个表的映射为——对应, 所述 X2个表为 所述 X个表的子集, 所述 X2为正整数, 其中, 所述 XI个指令序列的集合和所 述 X2指令序列的集合的交集为空集。
结合第二方面的第二种可能的实施方式或第二方面的第三种可能的实施 方式, 在第二方面的第六种可能的实施方式中, 其特征在于, 所述 Ml指令序 列中的其中一个指令序列的出口指令的下一条指令, 为所述 XI指令序列中的 其中一个指令序列的其中一个入口指令, 和 /或, 所述 Ml指令序列中的其中一 个指令序列的入口指令的上一条指令, 为所述 XI指令序列中的其中一个指令 序列的其中一个出口指令。
结合第二方面的第六种可能的实施方式,在第二方面的第七种可能的实施 方式中,
所述网络报文处理程序还包括用于支撑所述功能标识所标识功能实现的
M2个指令序列, 其中, 所述 M2为正整数, 其中, 所述 Ml个指令序列的集合 与所述 M2指令序列的集合的交集为空集, 其中, 所述 M2个指令序列中的其中 一个指令序列的出口点的下一条指令, 为所述 XI指令序列中的其中一个指令 序列的其中一个入口指令, 和 /或所述 M2指令序列中的其中一个指令序列的入 口指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一个 出口指令。
结合第二方面的第七种可能的实施方式,在第二方面的第八种可能的实施 方式中,
所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2 个指令序列, 其中, 所述 X2为正整数, 所述 XI个指令序列的集合与所述 X2指 令序列的集合的交集为空集;
其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列的 出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中一 个入口指令,和 /或,所述 Ml个指令序列或所述 M2个指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序列 的其中一个出口指令。
第三方面, 一种管理设备, 包括:
处理器、 存储器和网络接口, 其中, 所述处理器、 所述存储器和所述网络 接口通过通信总线连接;
所述存储器用于存储程序代码, 并向所述处理器传输所述程序代码; 其中, 所述处理器用于根据所述程序代码, 执行以下步骤:
获取功能标识;确定用于实现所述功能标识所标识功能的 Ml个指令序列, 构建网络报文处理程序并利用构建的所述网络报文处理程序生成程序升级补 丁,通过所述网络接口向报文转发处理设备发送所述程序升级补丁; 或者构建 网络报文处理程序并通过所述网络接口向报文转发处理设备发送所述网络报 文处理程序, 其中, 所述 Ml个指令序列中的每个指令序列包括唯一的入口指 令, 所述 Ml个指令序列中的每个指令序列包括唯一的出口指令, 所述 Ml为正 整数, 其中, 所述网络报文处理程序包括所述 Ml个指令序列。
结合第三方面, 在第三方面的第一种可能的实施方式中,
所述处理器还用于, 获取 XI个条目, 所述 XI个条目与 XI个表的映射为一 一对应, 确定用于实现所述 XI个表的查表功能的 XI个指令序列, 所述 XI个指 令序列与所述 XI个表的映射为——对应, 其中, 所述网络报文处理程序还包 括所述 XI个指令序列, 其中, 所述 XI为正整数。
结合第三方面的第一种可能的实施方式,在第三方面的第二种可能的实施 方式中, 所述 Ml个指令序列双射到有效转发数据流有向图中的 Ml条有向边, 其中, 所述 XI个表双射到所述有效转发数据流有向图中的 XI个节点,
所述有效转发数据流有向图包括: X个节点和 M条有向边, 所述 M条有向 边双射到 M个指令序列, 所述 X个节点双射到 X个表, 所述 Ml条有向边为所述 M条有向边的集合的子集, 所述 XI个节点为所述 X个节点的集合的子集, 所述 M和 X为正整数;
其中, 所述 X个节点中的节点 il的入边所对应的指令序列的出口指令的下 一条指令, 为用于实现所述节点 il所对应表的查表功能的指令序列的其中一个 一条指令, 为用于实现所述节点 j 1所对应表的查表功能的指令序列的其中一个 出口指令, 其中, 节点 il为所述 X个节点中的任意一个节点, 所述节点 jl为所 述 X个节点中的任意一个节点。
结合第三方面的第二种可能的实施方式,在第三方面的第三种可能的实施 方式中 ,所述网络报文处理程序还包括用于支撑所述功能标识所标识功能实现 述 M2为正整数, 所述 Ml个指令序列的集合和所述 M2指令序列的集合的交集 为空集。 结合第三方面的第二种可能的实施方式或第三方面的第三种可能的实施 方式,在第三方面的第四种可能的实施方式中, 所述网络>¾文处理程序还包括 用于支撑所述 XI个表的查表功能实现的 X2个指令序列, 所述 X2个指令序列与 X2个表的映射为——对应, 其中, 所述 X2个表为所述 X个表的子集, 所述 X2 为正整数, 其中, 所述 XI个指令序列的集合和所述 X2指令序列的集合的交集 为空集。
结合第三方面的第二种可能的实施方式或第三方面的第三种可能的实施 方式或第三方面的第四种可能的实施方式,在第三方面的第五种可能的实施方 式中, 所述有效转发数据流有向图是修剪初始转发数据流有向图中的节点和 / 或有向边而得到; 其中, 所述初始有效转发数据流有向图包括: X0个节点和
M0条有向边, 其中, 所述 M0条有向边与 M0个指令序列的映射为——对应, 所述 X0个节点与 X0个表的映射为——对应, 所述 M条有向边的集合为所述 M0 条有向边的集合的子集, 所述 X个节点的集合为所述 X0个节点的集合的子集, 所述 M0和所述 X0为正整数。
结合第三方面的第五种可能的实施方式,在第三方面的第六种可能的实施 方式中, 所述处理器还用于: 获取应用场景标识, 其中, 所述 M0个指令序列 为所述应用场景标识所标识的 M0个指令序列。
结合第三方面的第二种可能的实施方式或第三方面的第三种可能的实施 方式或第三方面的第四种可能的实施方式或第三方面的第五种可能的实施方 式或第三方面的第六种可能的实施方式,在第三方面的第七种可能的实施方式 中, 所述处理器用于: 基于所述有效转发数据流有向图中的有向边和节点构建 网络 4艮文处理程序。
结合第三方面的第一种可能的实施方式,在第三方面的第八种可能的实施 方式中, 所述 Ml指令序列中的其中一个指令序列的出口指令的下一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一个入口指令, 和 /或, 所述
Ml指令序列中的其中一个指令序列的入口指令的上一条指令, 为所述 XI指令 序列中的其中一个指令序列的其中一个出口指令。
结合第三方面的第八种可能的实施方式,在第三方面的第九种可能的实施 方式中 , , 所述网络"¾文处理程序还包括用于支撑所述功能标识所标识功能实 现的 Μ2个指令序列, 其中, 所述 Μ2为正整数, 其中, 所述 Ml个指令序列的 集合与所述 M2指令序列的集合的交集为空集, 其中, 所述 M2个指令序列中的 其中一个指令序列的出口点的下一条指令, 为所述 XI指令序列中的其中一个 指令序列的其中一个入口指令, 和 /或所述 M2指令序列中的其中一个指令序列 的入口指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其中 一个出口指令。
结合第三方面的第九种可能的实施方式,在第三方面的第十种可能的实施 方式中,
所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2 个指令序列, 其中, 所述 X2为正整数, 所述 XI个指令序列的集合与所述 X2指 令序列的集合的交集为空集;
其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列的 出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中一 个入口指令,和 /或,所述 Ml个指令序列或所述 M2个指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序列 的其中一个出口指令。
第四方面, 一种报文转发处理设备, 包括:
处理器、 网络处理器、 存储器和网络接口, 其中, 所述处理器、 所述网络 处理器、 所述存储器和所述网络接口通过通信总线连接;
其中,所述存储器用于存储程序代码,并向所述处理器传输所述程序代码; 所述处理器用于根据所述程序代码, 执行以下步骤: 获取功能标识, 确定 用于实现所述功能标识所标识功能的 Ml个指令序列, 构建网络报文处理程序 并将所述网络报文处理程序安装到所述网络处理器, 所述 Ml个指令序列中的 每个指令序列包括唯一的入口指令, 所述 Ml个指令序列中的每个指令序列包 括唯一的出口指令, 所述 Ml为正整数, 所述网络报文处理程序包括所述 Ml个 指令序列;
所述网络处理器用于安装所述网络报文处理程序,并根据所述网络报文处 理程序处理自所述网络接口接收的网络报文。
结合第四方面, 在第四方面的第一种可能的实施方式中,
所述处理器还用于, 获取 XI个条目, 所述 XI个条目与 XI个表的映射为一 一对应, 确定用于实现所述 XI个表的查表功能的 XI个指令序列, 所述 XI个指 令序列与所述 XI个表的映射为——对应, 其中, 所述网络报文处理程序还包 括所述 XI个指令序列, 其中, 所述 XI为正整数。
结合第四方面的第一种可能的实施方式,在第四方面的第二种可能的实施 方式中, 所述 Ml个指令序列双射到有效转发数据流有向图中的 Ml条有向边, 其中, 所述 XI个表双射到所述有效转发数据流有向图中的 XI个节点,
所述有效转发数据流有向图包括: X个节点和 M条有向边, 所述 M条有向 边双射到 M个指令序列, 所述 X个节点双射到 X个表, 所述 Ml条有向边为所述 M条有向边的集合的子集, 所述 XI个节点为所述 X个节点的集合的子集, 所述 M和 X为正整数;
其中, 所述 X个节点中的节点 il的入边所对应的指令序列的出口指令的下 一条指令, 为用于实现所述节点 il所对应表的查表功能的指令序列的其中一个 一条指令, 为用于实现所述节点 j 1所对应表的查表功能的指令序列的其中一个 出口指令, 其中, 节点 ii为所述 X个节点中的任意一个节点, 所述节点 ji为所 述 X个节点中的任意一个节点。
结合第四方面的第二种可能的实施方式,在第四方面的第三种可能的实施 方式中,所述网络报文处理程序还包括用于支撑所述功能标识所标识功能实现 述 M2为正整数, 所述 Ml个指令序列的集合和所述 M2指令序列的集合的交集 为空集。
结合第四方面的第二种可能的实施方式或第四方面的第三种可能的实施 方式,在第四方面的第四种可能的实施方式中, 所述网络>¾文处理程序还包括 用于支撑所述 XI个表的查表功能实现的 X2个指令序列, 所述 X2个指令序列与 X2个表的映射为——对应, 其中, 所述 X2个表为所述 X个表的子集, 所述 X2 为正整数, 其中, 所述 XI个指令序列的集合和所述 X2指令序列的集合的交集 为空集。
结合第四方面的第二种可能的实施方式或第四方面的第三种可能的实施 方式或第四方面的第四种可能的实施方式,在第四方面的第五种可能的实施方 式中, 所述有效转发数据流有向图是修剪初始转发数据流有向图中的节点和 / 或有向边而得到; 其中, 所述初始有效转发数据流有向图包括: X0个节点和 M0条有向边, 其中, 所述 M0条有向边与 M0个指令序列的映射为——对应, 所述 X0个节点与 X0个表的映射为——对应, 所述 M条有向边的集合为所述 M0 条有向边的集合的子集, 所述 X个节点的集合为所述 X0个节点的集合的子集, 所述 M0和所述 X0为正整数。
结合第四方面的第五种可能的实施方式,在第四方面的第六种可能的实施 方式中, 所述处理器还用于: 获取应用场景标识, 其中, 所述 M0个指令序列 为所述应用场景标识所标识的 M0个指令序列。
结合第四方面的第二种可能的实施方式或第四方面的第三种可能的实施 方式或第四方面的第四种可能的实施方式,在第四方面的第七种可能的实施方 式中,
所述处理器用于:基于所述有效转发数据流有向图中的有向边和节点构建 网络 4艮文处理程序。
结合第四方面的第一种可能的实施方式,在第四方面的第八种可能的实施 方式中, 所述 Ml指令序列中的其中一个指令序列的出口指令的下一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一个入口指令, 和 /或, 所述 Ml指令序列中的其中一个指令序列的入口指令的上一条指令, 为所述 XI指令 序列中的其中一个指令序列的其中一个出口指令。
结合第四方面的第八种可能的实施方式,在第四方面的第九种可能的实施 方式中 ,所述网络报文处理程序还包括用于支撑所述功能标识所标识功能实现 的 M2个指令序列, 其中, 所述 M2为正整数, 其中, 所述 Ml个指令序列的集 合与所述 M2指令序列的集合的交集为空集, 其中, 所述 M2个指令序列中的其 中一个指令序列的出口点的下一条指令, 为所述 XI指令序列中的其中一个指 令序列的其中一个入口指令, 和 /或所述 M2指令序列中的其中一个指令序列的 入口指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一 个出口指令。
结合第四方面的第九种可能的实施方式,在第四方面的第十种可能的实施 方式中,
所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2 个指令序列, 其中, 所述 X2为正整数, 所述 XI个指令序列的集合与所述 X2指 令序列的集合的交集为空集;
其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列的 出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中一 个入口指令,和 /或,所述 Ml个指令序列或所述 M2个指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序列 的其中一个出口指令。
第五方面, 一种通信***, 可包括:
报文转发处理设备, 用于发送携带功能标识的报文;
管理设备, 用于接收所述携带功能标识的报文; 确定用于实现所述功能标 识所标识功能的 Ml个指令序列, 构建网络报文处理程序并利用构建的所述网 络报文处理程序生成程序升级补丁 ,向所述报文转发处理设备发送所述程序升 级补丁; 或者,构建网络报文处理程序并向所述报文转发处理设备发送所述网 络报文处理程序, 其中, 所述 Ml个指令序列中的每个指令序列包括唯一的入 口指令, 所述 Ml个指令序列中的每个指令序列包括唯一的出口指令, 所述 Ml 为正整数, 其中, 所述网络报文处理程序包括所述 Ml个指令序列。
可以看出, 本发明实施例中, 由于是在获取功能标识之后, 确定用于实现 该功能标识所标识功能的 Ml个指令序列, 所述 Ml个指令序列中的每个指令序 列包括唯一的入口指令, 所述 Ml个指令序列中的每个指令序列包括唯一的出 口指令, 由于程序代码被以指令序列的粒度划分, 这就提供了一种定制网络报 文处理程序的机制, 进而可基于获取功能标识来 选获得符合要求的指令序 歹 |J , 进而有利于构建出与实际需求匹配性更强的网络报文处理程序, 这样有利 于提高指令执行设备与其所运行的网络报文处理程序的匹配度,减少指令执行 设备所运行网络报文处理程序中的无效代码。 附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述所需要 使用的附图作简单地介绍,显而易见地, 下面描述中的附图仅仅是本发明的一 些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还 可以根据这些附图获得其他的附图。
图 1是本发明实施例提供的一种指令序列确定方法的流程示意图; 图 2-a是本发明实施例提供的一种指令序列和功能标识的关系示意图; 图 2-b是本发明实施例提供的另一种指令序列和功能标识的关系示意图; 图 2-c是本发明实施例提供的一种初始转发数据流有向图的示意图; 图 2-d是本发明实施例提供的一种有效转发数据流有向图的示意图; 图 3是本发明实施例提供的一种指令序列确定装置的示意图;
图 4是本发明实施例提供的一种管理设备的示意图;
图 5是本发明实施例提供的一种转发处理设备的示意图;
图 6是本发明实施例提供的一种通信***的示意图。 具体实施方式
本发明实施例提供指令序列确定方法和相关设备及***,以期提高报文转 报文转发处理设备运行的无效代码量。
下面通过具体实施例, 分别进行详细的说明。
为使得本发明的发明目的、 特征、优点能更加的明显和易懂, 下面将结合 本发明实施例中的附图,对本发明实施例中的技术方案进行清楚地描述,显然 下面所描述的实施例仅仅是本发明一部分实施例, 而非全部的实施例。
本申请的说明书和权利要求书及附图中的术语 "第一"、 "第二"、 "第三" 和 "第四"等是用于区别不同对象, 而不是用于描述特定顺序。此外,术语 "包 括" 和 "具有" 不是排他的。 例如包括了一系列步骤或单元的过程、 方法、 系 统、产品或设备没有限定于已列出的步骤或单元,还可以包括没有列出的步骤 或单元。
本发明的一个实施例提供了指令序列确定方法。其中, 该指令序列确定方 法可包括: 获取功能标识; 确定用于实现所述功能标识所标识功能的 Ml个指 令序列,其中,所述 Ml个指令序列中的每个指令序列包含唯一的入口指令(例 如所述 Ml个指令序列中的每个指令序列的第一条指令是相应指令序列的唯一 的入口指令 ), 所述 Ml个指令序列中的每个指令序列包含唯一的出口指令(例 如例如所述 Ml个指令序列中的每个指令序列的最后一条指令是相应指令序列 的出口指令, 其中, 所述 Ml为正整数, 其中, 所述 Ml个指令序列为构建用于 对网络 文进行处理的网络 "^文处理程序的指令序列。
请参见图 1 ,图 1为本发明的一个实施例提供的一种指令序列确定方法的流 程示意图。其中, 本发明的一个实施例提供的一种指令序列确定方法可包括以 下内容:
101、 获取功能标识。
102、 确定用于实现所述功能标识所标识功能的 Ml个指令序列。
其中, 所述 Ml个指令序列中的每个指令序列包含唯一的入口指令(例如 所述 Ml个指令序列中的每个指令序列的第一条指令是相应指令序列的唯一的 入口指令 ), 所述 Ml个指令序列中的每个指令序列包含唯一的出口指令(例如 例如所述 Ml个指令序列中的每个指令序列的最后一条指令是相应指令序列的 出口指令其中, 其中, 所述 Ml为正整数。 其中, 所述 Ml个指令序列为构建用 于对网络报文进行处理的网络报文处理程序的指令序列。
其中,执行步骤 101和步骤 102的设备可以是管理设备 (如网络管理服务器 或软件定义网络(英文: software-defined networking, 缩写: SDN )控制器等)。 可以替换的,执行步骤 101和步骤 102的设备也可以是报文转发处理设备 (例如 路由或网络交换机等)。
其中,上述获取的功能标识可以标识对一个或多个网络协议做转发处理的 功能。例如上述获取的功能标识所标识的功能可包括如下功能的至少 1个: 统 计网络报文的字节计数、在网络报文中添加虚拟局域网(英文: virtual local area network, 缩写: VLAN )标签、 删除网络报文中的 VLAN标签、 修改网络 4艮文 的互联网协议(英文: Internet Protocol , 缩写: IP )报文头中的差分服务代码 点 (英文: differentiated services code point, 缩写: DSCP )字段的取值。 当然 所述功能标识所标识的功能也可能包括其他一种或多种功能。
其中, 获取功能标识的方式可能是多种多样的, 例如可能通过网络接口接 收其他设备发送的携带功能标识的报文,也可能是通过用户接口(例如人机交 互接口等)获取功能标识。 也可以通过其他方式获取上述功能标识。 例如, 如 果执行步骤 101的设备为网络管理服务器或 SDN控制器, 则网络管理服务器或 SDN控制器可通过其用户接口获取上述功能标识。 网络管理服务器或者 SDN 控制器也可通过网络接口接收(例如来自报文转发处理设备或者其他第三方设 备的)携带功能标识的报文。 又例如, 如果执行步骤 101的设备为报文转发处 理设备(其中, 该报文转发处理设备例如可为路由器或网络交换机), 则报文 转发处理设备可通过其用户接口获取上述功能标识,或报文转发处理设备可通 过网络接口,接收来自网络管理服务器或 SDN控制器或其他第三方设备的携带 功能标识的报文。
本实施例提供的技术方案中, 由于是在获取功能标识之后,确定用于实现 该功能标识所标识功能的 Ml个指令序列, 所述 Ml个指令序列中的每个指令序 列包括唯一的入口指令, 所述 Ml个指令序列中的每个指令序列包括唯一的出 口指令, 其中, 由于程序代码被以指令序列的粒度划分, 这就提供了一种定制 网络报文处理程序的机制, 进而可基于获取功能标识(即可基于需求 )来筛选 获得符合要求的指令序列,进而有利于构建出与实际需求匹配性更强的网络报 文处理程序,这样有利于提高指令执行设备与其所运行的网络报文处理程序的 匹配度, 减少指令执行设备(如报文转发处理设备 )所运行网络报文处理程序 中的无效代码。
可选的, 在一些可能的实施方式中, 在获取功能标识时, 还可以获取应用 场景标识, 所述应用场景标识可标识 M0个指令序列的集合。 也就是说, 可以 基于应用场景标识来确定指令序列的全集。其中, 不同的应用场景标识可标识 不同的指令序列的全集。两个应用场景标识所标识的指令序列的两个全集的交 集可能是空集或非空集合。例如, 所述确定用于实现所述功能标识所标识功能 的 Ml个指令序列可以包括: 以所述功能标识为索引, 从所述应用场景标识所 标识的 M0个指令序列的集合之中, 确定出与所述功能标识匹配的 Ml个指令序 歹 |J。 其中, M0个指令序列的集合是用于实现各种功能的指令序列的全集, 或 者 M0个指令序列的集合是用于实现对应某个应用场景的各种功能的指令序列 的全集。
可选的, 在一些可能的实施方式中, M0个指令序列中的每个指令序列可 被预先标记至少 1个功能标识。某个指令序列被标记的至少 1个功能标识表示该 指令序列可用于实现该至少 1个功能标识所标识的功能。例如图 2-a和图 2-b示出 了为标记功能标识的两种可能方式。 其中, M0个指令序列中的某些指令序列 可能被标记为可用于实现多个功能, 例如图 2-b所示。 例如, 用于实现功能 al 的指令序列包括指令序列 all、 指令序列 al2和指令序列 al3 , 而用于实现功能 bl的指令序列包括指令序列 all、 指令序列 bll、 指令序列 bl2和指令序列 bl3 , 可见指令序列 al 1的集合为用于实现功能 al的指令序列的集合和用于实现功能 bl的指令序列的集合之间的交集。
可选的,在一些可能的实施方式中, 所述指令序列确定方法还可以进一步 包括: 管理设备 (如网络管理服务器或软件定义网络控制器)构建网络报文处 理程序并利用构建的所述网络报文处理程序生成程序升级补丁,向报文转发处 理设备发送所述程序升级补丁(相应的,报文转发处理设备可以利用该程序升 级补丁升级本地的网络>¾文处理程序,并利用升级后的网络 ^艮文处理程序来处 理接收到的网络报文); 或管理设备(如网络管理服务器或软件定义网络控制 序(相应的,报文转发处理设备在该报文转发处理设备上安装接收到的网络报 文处理程序, 利用安装好的网络报文处理程序来处理接收到的网络报文); 或 者报文转发处理设备可构建网络报文处理程序并在该报文转发处理设备上安 装所述网络报文处理程序(相应的,报文转发处理设备可运行安装好的网络报 文处理程序来处理接收到的网络报文)。 其中, 所述网络报文处理程序包括所 述 Ml个指令序列。 可选的, 在一些可能的实施方式中, 在获取功能标识时, 还可获取 XI个 条目 (例如, 携带所述获取的功能标识的报文中还携带 XI个条目), 其中, 所 述 XI个条目到 XI表个的映射为——对应, 所述 XI为正整数。
其中,基于不同的查找算法,表例如为路由表、入标签映射(英文: incoming label map )表、 转发信息库 (英文: forward information base )表、 媒体接入控 ^'J (英文: media access control )表、 掩码匹西己 (英文: access control list, 简 称: ACL )表、 最长前缀匹配(英文: longest prefix match, 简称: LPM )表、 精确匹配(英文: exact match, 简称: EM )表、 直接访问 (英文: direct )表、 流表(英文: flow table ), 流表可以参考开放流交换机说明书第 1.4.0版(英文: OpenFlow Switch Specification version 1.4.0 )。
其中, 所述指令序列确定方法还可进一步包括: 确定用于实现所述 XI个 表的查表功能的 XI个指令序列, 所述 XI个指令序列到所述 XI个表的映射为一 一对应, 其中, 所述网络报文处理程序还包括所述 XI个指令序列。 此外若报 络报文处理程序也可不包括用于实现该某个表的查表功能的指令序列。
可选的, XI个条目中的第一条目可以包括如下信息中的至少一种: 第一 表的标识、 所述第一表和用于实现所述第一表的查表功能的 1个指令序列, 其 中, 所述第一条目为所述 XI个条目中的的任意一个条目, 所述第一表为所述 XI个表之中的任意一个表。 其中, 在一些具体实现过程中, 可根据第一表的 标识索引到第一表和 /或用于实现所述第一表的查表功能的 1个指令序列。 或者 也可以根据第一表本身(第一表中可包括或不包括第一表的标识)来索引到用 于实现第一表的查表功能的 1个指令序列。
其中,用于实现某个表的查表功能的指令序列可能包括至少一个出口指令 和至少一个入口指令,也就是说, 用于实现某个表的查表功能的指令序列可以 具有至少一个点和至少一个出口点。
可选的, 在另一些可能的实施方式中, 所述 Ml指令序列中的其中一个指 令序列的出口指令的下一条指令, 为所述 XI指令序列中的其中一个指令序列 的其中一个入口指令, 和 /或, 所述 Ml指令序列中的其中一个指令序列的入口 指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一个出 口指令。
可选的,所述网络报文处理程序还可进一步包括用于支撑所述功能标识所 标识功能实现的 M2个指令序列。 其中, 所述 M2个指令序列中的其中一个指令 序列的出口指令的下一条指令, 为所述 XI指令序列中的其中一个指令序列的 其中一个入口指令, 和 /或, 所述 M2指令序列中的其中一个指令序列的入口指 令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一个出口 指令。
举例来说,对于某些上层功能可能需要一些底层功能来做支撑, 其中一个 底层功能可能可用来支撑一个上层功能或多个上层功能,一个上层功能也可能 需要多个底层功能来支撑。 因此当获取到功能标识, 可能不仅需确定用于实现 该获取到的功能标识所标识功能的 Ml个指令序列, 还需要确定用于支撑所述 功能标识所标识功能实现的 M2个指令序列。
又可选的,在另一些可能的实施方式中, 所述网络"¾文处理程序还可以包 括用于支撑所述 XI个表的查表功能实现的 X2个指令序列, 其中, 所述 X2为正 整数。 其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列 的出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中 一个入口指令,和 /或, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个 指令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序 列的其中一个出口指令。
进一步的, 为便于比较直观理解, 可通过转发数据流有向图来体现出用于 实现功能标识所标识功能的指令序列和表之间的相关关系, 当然, 由于表和用 于实现该表的查表功能的指令序列之间是相关的, 因此,转发数据流有向图也 就可在一定程度上现出用于实现功能标识所标识功能的指令序列和用于实现 表的查表功能的指令序列之间的相关关系。其中,转发数据流有向图中的不同 节点与不同的表相对应,转发数据流有向图中的不同边与用于实现功能的不同 指令序列相对应。
其中,初始的转发数据流有向图可能包括用于实现所有功能的指令序列所 对应的边,还包括与所有功能相关的所有表所对应的指令序列,通过修剪初始 的转发数据流有向图, 可以得到有效转发数据流有向图。
可选的, 在一些可能的实施方式中, 所述 Ml个指令序列双射到有效转发 数据流有向图中的 Ml条有向边, 其中, 所述 XI个表双射到所述有效转发数据 流有向图中的 XI个节点。 所述有效转发数据流有向图包括: X个节点和 M条有 向边, 所述 M条有向边双射到 M个指令序列, 所述 X个节点双射到 X个表。 所 述 Ml条有向边的集合为所述 M条有向边的集合的子集, 所述 XI个节点的集合 为所述 X个节点的集合的子集, 其中, 所述 M和 X为正整数。 具体例如, 所述 X 个表包括所述 XI个表和所述 X2个表、 所述 M个指令序列包括所述 Ml指令序列 和所述 M2个指令序列。
可选的, 在一些可能的实施方式中, 所述 X个节点中的节点的入边所对应 的指令序列的出口指令的下一条指令,为用于实现所述节点所对应表的查表功 能的指令序列的其中一个入口指令。 所述 X个节点中的节点的出边所对应的指 令序列的入口指令的上一条指令,可为用于实现所述每个节点所对应表的查表 功能的指令序列的其中一个出口指令。 即, 节点 il的入边所对应的指令序列的 出口指令的下一条指令, 为用于实现该节点 il所对应表的查表功能的指令序列 的其中一个入口指令, 节点 il为所述 X个节点中的任意一个节点。 节点 jl的出 边所对应的指令序列的入口指令的上一条指令, 可为用于实现该节点 jl所对应 表的查表功能的指令序列的其中一个出口指令, 其中, 节点 jl为所述 X个节点 中的任意一个节点。
可选的,在一些可能的实施方式中, 若报文转发处理设备中使用硬件来实 现查表功能, 则报文转发处理设备可在执行节点 i2的入边所对应的指令序列的 出口指令后, 利用相应硬件来执行用于实现节点 i2所对应表的查表功能, 节点 i2为所述 X个节点中的任意一个节点。 报文转发处理设备可在利用相应硬件来 执行用于实现节点 j2所对应表的查表功能之后, 执行节点 j2的其中一条出边所 对应的指令序列的入口指令, 节点 j2为所述 X个节点中的任意一个节点。
可选的,在一些可能的实施方式中, 所述网络 4艮文处理程序还可进一步包 括用于支撑所述功能标识所标识功能实现的 M2个指令序列, 其中, 所述 M2个 指令序列为的集合所述 M个指令序列的集合的子集。 其中, 所述 Ml个指令序 列的集合和所述 M2指令序列的集合的交集为空集。
可选的,在一些可能的实施方式中, 所述网络"¾文处理程序还包括用于支 撑所述 XI个表的查表功能实现的 X2个指令序列,所述 X2个指令序列与 X2个表 ——对应, 所述 X2个表的集合为所述 X个表的集合的子集, 所述 X2为正整数, 其中, 所述 XI个指令序列的集合和所述 X2指令序列的集合的交集为空集。
可选的,在一些可能的实施方式中, 所述有效转发数据流有向图是修剪初 始转发数据流有向图中的节点和有向边而得到,或者所述有效转发数据流有向 图是修剪初始转发数据流有向图中的有向边而得到。其中, 所述初始有效转发 数据流有向图包括: X0个节点和 M0条有向边, 所述 M0条有向边与 M0个指令 序列——对应, 所述 X0个节点与 X0个表——对应, 所述 M条有向边的集合为 所述 M0条有向边的集合的子集, 所述 X个节点为所述 X0个节点的子集, 所述 M0和所述 X0为正整数。
其中, 可通过对初始转发数据流有向图中的无效节点和 /或无效有向边进 行修剪得到有效转发数据流有向图, 其中, 有效有向边可认为是上述 M个指令 序列所对应的有向边,始转发数据流有向图中除去上述有效有向边之外的有向 边可认为是无效有向边, 所述 M个指令序列包括所述 Ml指令序列和所述 M2个 指令序列, 当然 M2可能等于 0。 其中, 有效节点可认为是上述 X个表所对应的 节点, 始转发数据流有向图中除去上述有效节点之外节点的可认为是无效节 点, 所述 X个表包括所述 XI个表和所述 X2个表, 当然 X2可能等于 0。 其中, 参 见图 2-c和图 2-d, 例如图 2-c示出了一种初始转发数据流有向图, 其中, 假设无 效节点包括表 3对应的节点, 无效边包括指令序列 N6、 指令序列 N2、 指令序列 N3和指令序列 N4对应的有向边, 因此对一种初始转发数据流有向图进行修剪 以得到有效转发数据流有向图可如图 2-d所示。
可选的, 在一些可能的实施方式中, 所述构建网络报文处理程序包括: 基 于所述有效转发数据流有向图中的有向边和节点构建网络报文处理程序。 其 中, 由于有效转发数据流有向图中的有向边和节点, 可以体现出用于实现表的 查表功能的指令序列和用于实现功能标识所标识功能的指令序列之间的关联 关系, 因此基于所述有效转发数据流有向图中的有向边和节点,有利于快速的 构建网络>¾文处理程序。
在不釆用本发明实施例方案的通常实现方式中,根据一台报文转发处理设 备所部署的位置,通常只用到该报文转发处理设备所支持全部功能中的一小部 分, 而这一小部分功能的处理逻辑通常使用较少代码即可实现。 即, 通常的报 文转发处理设备上运行网络报文处理程序中包括了大量的无用代码,而这些无 用的代码对报文转发处理设备可能产生如下的一些影响:较多的占用了报文转 发处理设备上有限的处理资源, 可能增加报文转发处理的时间, 降低报文转发 处理的性能; 可能增大报文转发处理设备中硬件芯片的面积和功耗; 更多代码 也容易引入更多的程序漏洞。 除此之外, 近年来网络的发展方向(例如, 软件 定义网络和网络功能虚拟化等等), 及不断制定的新网络协议, 都逐渐要求才艮 文转发处理设备本身能够实现更加灵活的功能配置,通常实现方式报文转发处 理设备中的网络报文处理程序的形成方式并不能满足如此灵活的应用需求。
然而, 本发明实施例提供的技术方案中, 是在获取功能标识之后, 确定用 于实现该功能标识所标识功能的 Ml个指令序列, 程序代码被划分为了指令序 列的粒度, 进而可通过组合指令序列来获得网络报文处理程序, 这就提供了一 种定制网络报文处理程序的机制,进而使得可以根据需求功能来产生符合要求 的网络报文处理程序,进而有利于构建出与实际需求匹配性更强的网络报文处 理程序,这样有利于提高报文转发处理设备与其所运行的网络报文处理程序的
用, 有利于缩短报文转发处理时间, 提升报文转发处理的性能; 有利于减少报 文转发处理设备中硬件芯片的面积和功耗, 有利于降低 I入程序漏洞的可能 性。 同时。 也有利于提高报文转发处理设备功能配置的灵活性, 进而有利于较 好满足目前网络演进的需求。
下面还提供用于实施上述方案的相关装置。
参见图 3 , 本发明实施例提供一种指令序列确定装置 300 , 可包括: 获取单 元 310和确定单元 320。 获取单元 310, 用于接收携带功能标识的指令。
其中, 获取单元 310获取的功能标识可以标识对一个或多网络协议做转发 处理的功能。例如上述获取的功能标识所标识的功能可包括如下功能的至少 1 个: 统计网络报文的字节计数、 在网络报文中添加 VLAN标签、 删除网络报文 中的 VLAN标签、 修改网络报文的 IP报文头中的 DSCP字段的取值。 当然所述 功能标识所标识的功能也可能包括其他一种或多种功能。
其中, 获取单元 310获取功能标识的方式可能是多种多样的, 例如, 获取 单元 310可能通过网络接口接收其他设备发送的携带功能标识的报文, 获取单 元 310也可能是通过用户接口 (例如人机交互接口等)获取功能标识。 获取单 元 310也可以通过其他方式获取上述功能标识。
例如, 假设指令序列确定装置 300为网络管理服务器或 SDN控制器, 获取 单元 310可通过其用户接口获取上述功能标识 ,或获取单元 310也可通过网络接 口接收(例如来自报文转发处理设备或者其他第三方设备的)携带功能标识的 报文。 又例如指令序列确定装置 300为报文转发处理设备(其中, 该报文转发 处理设备例如可为路由器或其交换机),则获取单元 310可通过其用户接口获取 上述功能标识, 或获取单元 310可通过网络接口接收例如来自网络管理服务器 或软件定义网络控制器或其他第三方设备的携带功能标识的报文。
例如, 假设指令序列确定装置 300为网络管理服务器或 SDN控制器, 获取 单元 310可通过其用户接口获取上述功能标识 ,或获取单元 310也可通过网络接 口接收(例如来自报文转发处理设备或者其他第三方设备的)携带功能标识的 报文。 又例如指令序列确定装置 300为报文转发处理设备(其中, 该报文转发 处理设备例如可为路由器或其交换机 ),则获取单元 310可通过其用户接口获取 上述功能标识, 或获取单元 310可通过网络接口接收例如来自网络管理服务器 或软件定义网络控制器或其他第三方设备的携带功能标识的报文。
其中, 确定单元 320 , 用于确定用于实现所述功能标识所标识功能的 Ml 个指令序列。 其中, 所述 Ml个指令序列中的每个指令序列包含唯一的入口指 令(例如所述 Ml个指令序列中的每个指令序列的第一条指令是相应指令序列 的唯一的入口指令),所述 Ml个指令序列中的每个指令序列包含唯一的出口指 令(例如例如所述 Ml个指令序列中的每个指令序列的最后一条指令是相应指 令序列的出口指令其中, 其中, 所述 Ml为正整数。 其中, 所述 Ml个指令序列 为用于对网络报文进行处理的指令序列。
可选的, 在一些可能实施方式中, 获取单元 310还可用于获取应用场景标 识, 其中, 所述应用场景标识可标识 M0个指令序列的集合。 也就是说, 可以 基于应用场景标识来确定指令序列的全集。其中, 不同的应用场景标识可标识 不同的指令序列的全集。两个应用场景标识所标识的指令序列的两个全集的交 集可能是空集或非空集合。 例如, 所述确定单元 320可具体用于: 以所述功能 标识为索引, 从所述应用场景标识所标识的 M0个指令序列的集合之中, 确定 出与所述功能标识匹配的 Ml个指令序列。 其中, M0个指令序列的集合是用于 实现各种功能的指令序列的全集, 或者 M0个指令序列的集合是用于实现对应 某个应用场景的各种功能的指令序列的全集。
可选的, 在一些可能的实施方式中, M0个指令序列中的每个指令序列可 被预先标记至少 1个功能标识。其中, 某个指令序列被标记的至少 1个功能标识 表示该指令序列可用于实现该至少 1个功能标识所标识的功能。 例如图 2-a和图 2-b示出了为标记功能标识的两种可能方式。 其中, M0个指令序列中的某些指 令序列可能被标记为可用于实现多个功能, 例如图 2-b所示。 例如, 用于实现 功能 al的指令序列包括指令序列 all、 指令序列 al2和指令序列 al3 , 而用于实 现功能 bl的指令序列包括指令序列 all、 指令序列 bll、 指令序列 bl2和指令序 列 bl3 ,可见指令序列 al 1的集合为用于实现功能 al的指令序列的集合和用于实 现功能 bl的指令序列的集合之间的交集。
可选的, 在一些可能的实施方式中,
所述指令序列确定装置 300还包括: 程序单元 330, 用于构建网络 文处理 程序并利用构建的所述网络报文处理程序生成程序升级补丁,向报文转发处理 设备发送所述程序升级补丁(相应的,报文转发处理设备可以利用该程序升级 补丁升级本地的网络>¾文处理程序 ,并利用升级后的网络>¾文处理程序来处理 接收到的网络报文); 或者, 程序单元 330, 用于构建网络报文处理程序并向报 文转发处理设备发送所述网络报文处理程序(相应的,报文转发处理设备可本 地安装接收到的网络报文处理程序,利用安装好的网络报文处理程序来处理接 收到的网络 文); 或者程序单元 330,构建网络>¾文处理程序并安装所述网络 来处理接收到的网络报文)。 其中, 所述网络报文处理程序包括有所述 Ml个指 令序列。
可选的, 在一些可能的实施方式中, 所述获取单元 310还用于获取 XI个条 目, 其中, 所述 XI个条目与 XI个表的映射为——对应。
所述确定单元 320还用于:确定用于实现所述 XI个表的查表功能的 XI个指 令序列, 所述 XI个指令序列与所述 XI个表的映射为——对应, 其中, 所述网 络报文处理程序还包括所述 XI个指令序列, 其中, 所述 XI为正整数。
此外, 若报文转发处理设备中使用硬件来实现表的查表功能, 所述网络报 文处理程序也可不包括用于实现该表的查表功能的指令序列。
可选的, 在一些可能的实施方式中, 所述 Ml指令序列中的其中一个指令 序列的出口指令的下一条指令, 为所述 XI指令序列中的其中一个指令序列的 其中一个入口指令, 和 /或, 所述 Ml指令序列中的其中一个指令序列的入口指 令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一个出口 指令。
可选的,在一些可能的实施方式中, 所述网络"¾文处理程序还包括用于支 撑所述功能标识所标识功能实现的 M2个指令序列, 其中, 所述 M2为正整数, 其中, 所述 Ml个指令序列的集合与所述 M2指令序列的集合的交集为空集, 其 中, 所述 M2个指令序列中的其中一个指令序列的出口点的下一条指令, 为所 述 XI指令序列中的其中一个指令序列的其中一个入口指令 ,和 /或所述 M2指令 序列中的其中一个指令序列的入口指令的上一条指令, 为所述 XI指令序列中 的其中一个指令序列的其中一个出口指令。
可选的,在一些可能的实施方式中, 所述网络"¾文处理程序还包括用于支 撑所述 XI个表的查表功能实现的 X2个指令序列, 其中, 所述 X2为正整数, 所 述 XI个指令序列的集合与所述 X2指令序列的集合的交集为空集;
其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列的 出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中一 个入口指令,和 /或,所述 Ml个指令序列或所述 M2个指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序列 的其中一个出口指令。
进一步的, 为便于比较直观理解, 可通过转发数据流有向图来体现出用于 实现功能标识所标识功能的指令序列和表之间的相关关系, 当然, 由于表和用 于实现该表的查表功能的指令序列之间是相关的, 因此,转发数据流有向图也 就可在一定程度上现出用于实现功能标识所标识功能的指令序列和用于实现 表的查表功能的指令序列之间的相关关系。其中,转发数据流有向图中的不同 节点与不同的表相对应,转发数据流有向图中的不同边与用于实现功能的不同 指令序列相对应。
其中,初始的转发数据流有向图可能包括用于实现所有功能的指令序列所 对应的边,还包括与所有功能相关的所有表所对应的指令序列, 可通过修剪初 始的转发数据流有向图, 可以得到有效转发数据流有向图。
可选的, 在一些可能的实施方式中, 所述 Ml个指令序列双射到有效转发 数据流有向图中的 Ml条有向边, 其中, 所述 XI个表双射到所述有效转发数据 流有向图中的 XI个节点,
所述有效转发数据流有向图包括: X个节点和 M条有向边, 所述 M条有向 边双射到 M个指令序列, 所述 X个节点双射到 X个表, 所述 Ml条有向边为所述 M条有向边的集合的子集, 所述 XI个节点为所述 X个节点的集合的子集, 所述 M和 X为正整数;
其中, 所述 X个节点中的节点 il的入边所对应的指令序列的出口指令的下 一条指令, 为用于实现所述节点 il所对应表的查表功能的指令序列的其中一个 一条指令, 为用于实现所述节点 j 1所对应表的查表功能的指令序列的其中一个 出口指令, 其中, 节点 il为所述 X个节点中的任意一个节点, 所述节点 jl为所 述 X个节点中的任意一个节点。
可选的,在一些可能的实施方式中, 所述网络"¾文处理程序还包括用于支 撑所述功能标识所标识功能实现的 M2个指令序列, 其中, 所述 M2个指令序列 为所述 M个指令序列的子集, 其中, 所述 M2为正整数, 所述 Ml个指令序列的 集合和所述 M2指令序列的集合的交集为空集。
可选的,在一些可能的实施方式中, 所述网络"¾文处理程序还包括用于支 撑所述 XI个表的查表功能实现的 X2个指令序列,所述 X2个指令序列与 X2个表 的映射为——对应, 所述 X2个表为所述 X个表的子集, 所述 X2为正整数, 其 中, 所述 XI个指令序列的集合和所述 X2指令序列的集合的交集为空集。
可以理解的是, 本实施例的指令序列确定装置 300的各功能模块的功能可 根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实 施例的相关描述, 此处不再赘述。
可以理解的是, 本实施例指令序列确定装置 300可为网络管理服务器或者 也可能是报文转发处理设备, 或者可能是 SDN控制器, 或者也可能是不同于网 络管理服务器、 报文转发处理设备和 SDN控制器的第三方设备。
由上可见, 本实施例中的指令序列确定装置 300由于是在获取功能标识之 后, 确定用于实现该功能标识所标识功能的 Ml个指令序列, 所述 Ml个指令序 列中的每个指令序列包括唯一的入口指令, Ml个指令序列中的每个指令序列 包括唯一的出口指令, 其中, 由于程序代码被以指令序列的粒度划分, 这就提 供了一种定制网络报文处理程序的机制, 进而可基于获取功能标识 (即可基于 需求)来筛选获得符合要求的指令序列, 进而有利于构建出与实际需求匹配性 更强的网络报文处理程序,这样有利于提高指令执行设备与其所运行的网络报 文处理程序的匹配度, 减少指令执行设备(如报文转发处理设备 )所运行网络 文处理程序中的无效代码。
参见图 4, 图 4本发明的另一个实施例提供的管理设备 400的结构框图。 其 中, 管理设备 400可以包括至少 1个处理器 401 , 至少 1个网络接口 404, 存储器 405, 至少 1个通信总线 402。 通信总线 402用于实现这些组件之间的连接通信。 其中,该管理设备 400可选的包括用户接口 503 , 包括输出设备(例如,触摸屏、 液晶显示器、 全息成像(英文: holographic )或者投影(英文: projector )等)、 输入设备(例如键盘、 鼠标、轨迹球(英文: trackball ), 触感板或者触摸屏等、 摄像头和拾音装置等)。其中,存储器 405可以包括只读存储器和随机存取存储 器, 并向处理器 501提供指令和数据。 其中, 存储器 405中的一部分还可以包括 非易失性随机存取存储器。
处理器 401可以是中央处理器(英文: central processing unit,缩写: CPU ), 也可以是 CPU和硬件芯片的组合。 上述硬件芯片可以是以下一种或多种的组 合: 专用集成电路(英文: application-specific integrated circuit, 缩写: ASIC ), 现场可编程逻辑门阵列 (英文: field-programmable gate array, 缩写: FPGA ) 以及复杂可编程逻辑器件(英文: complex programmable logic device, 缩写: CPLD )。
存储器 405 , 用于存储程序代码, 并将该程序代码传输给处理器 501。 存储 器可以包括易失性存储器(英文: volatile memory ), 例如随机存取存储器(英 文: random-access memory, 缩写: RAM ); 存储器也可以包括非易失性存储 器 (英文: non- volatile memory ), 例如只读存储器 (英文: read-only memory, 缩写: ROM ),快闪存储器(英文: flash memory ),硬盘(英文: hard disk drive, 缩写: HDD )或固态硬盘(英文: solid-state drive, 缩写: SSD ); 存储器还可 以包括上述种类的存储器的组合。
网络接口 404可以由光收发器, 电收发器, 无线收发器或其任意组合实现。 例如, 光收发器可以是小封装可插拔 (英文: small form-factor pluggable transceiver, 缩写: SFP )收发器(英文: transceiver ) , 增强小封装可插拔(英 文: enhanced small form-factor pluggable, 缩写: SFP+ )收发器或 10吉比特小 封装可插拔 (英文: 10 Gigabit small form-factor pluggable, 缩写: XFP ) 收发 器。 电收发器可以是以太网(英文: Ethernet )网络接口控制器(英文: network interface controller, 缩写: NIC )。 无线收发器可以是无线网络接口控制器(英 文: wireless network interface controller, 缩写: WNIC )。
在一些实施方式中, 存储器 405存储了如下的元素, 可执行模块或者数据 结构, 或者他们的子集, 或者他们的扩展集: 操作*** 4051 , 包括各种***程 序, 用于实现各种基础业务以及处理基于硬件的任务。应用程序模块 4052包括 各种应用程序, 用于实现各种应用业务。 在本发明实施例中, 所述存储器 405用于存储程序代码, 并向所述处理器 401传输所述程序代码;
其中, 所述处理器 401用于根据所述程序代码, 执行以下步骤: 获取功能 标识; 确定用于实现所述功能标识所标识功能的 Ml个指令序列, 构建网络报 文处理程序并利用构建的所述网络 文处理程序生成程序升级补丁,通过所述 网络接口向报文转发处理设备发送所述程序升级补丁;或者构建网络报文处理 程序并通过所述网络接口向报文转发处理设备发送所述网络报文处理程序,其 中, 所述 Ml个指令序列中的每个指令序列包括唯一的入口指令, 所述 Ml个指 令序列中的每个指令序列包括唯一的出口指令, 所述 Ml为正整数, 其中, 所 述网络报文处理程序包括所述 Ml个指令序列。
可选的, 所述处理器还用于, 获取 XI个条目, 所述 XI个条目与 XI个表的 映射为——对应, 确定用于实现所述 XI个表的查表功能的 XI个指令序列, 所 述 XI个指令序列与所述 XI个表的映射为——对应, 其中, 所述网络报文处理 程序还包括所述 XI个指令序列, 其中, 所述 XI为正整数。
可选的, 所述 Ml个指令序列双射到有效转发数据流有向图中的 Ml条有向 边, 其中, 所述 XI个表双射到所述有效转发数据流有向图中的 XI个节点, 所述有效转发数据流有向图包括: X个节点和 M条有向边, 所述 M条有向 边双射到 M个指令序列, 所述 X个节点双射到 X个表, 所述 Ml条有向边为所述 M条有向边的集合的子集, 所述 XI个节点为所述 X个节点的集合的子集, 所述 M和 X为正整数;
其中, 所述 X个节点中的节点 il的入边所对应的指令序列的出口指令的下 一条指令, 为用于实现所述节点 il所对应表的查表功能的指令序列的其中一个 一条指令, 为用于实现所述节点 j 1所对应表的查表功能的指令序列的其中一个 出口指令, 其中, 节点 il为所述 X个节点中的任意一个节点, 所述节点 jl为所 述 X个节点中的任意一个节点。
可选的,所述网络>¾文处理程序还包括用于支撑所述功能标识所标识功能 所述 M2为正整数, 所述 Ml个指令序列的集合和所述 M2指令序列的集合的交 集为空集。
可选的, 所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能 实现的 X2个指令序列,所述 X2个指令序列与 X2个表的映射为——对应,其中, 所述 X2个表为所述 X个表的子集, 所述 X2为正整数, 其中, 所述 XI个指令序 列的集合和所述 X2指令序列的集合的交集为空集。
可选的,所述有效转发数据流有向图是修剪初始转发数据流有向图中的节 点和 /或有向边而得到; 其中, 所述初始有效转发数据流有向图包括: X0个节 点和 M0条有向边, 其中, 所述 M0条有向边与 M0个指令序列的映射为——对 应, 所述 X0个节点与 X0个表的映射为——对应, 所述 M条有向边的集合为所 述 M0条有向边的集合的子集, 所述 X个节点的集合为所述 X0个节点的集合的 子集, 所述 M0和所述 X0为正整数。
可选的, 所述处理器 401还用于: 获取应用场景标识, 其中, 所述 M0个指 令序列为所述应用场景标识所标识的 M0个指令序列。
可选的, 所述处理器 401用于: 基于所述有效转发数据流有向图中的有向 边和节点构建网络 ^艮文处理程序。
可选的, 所述 Ml指令序列中的其中一个指令序列的出口指令的下一条指 令, 为所述 XI指令序列中的其中一个指令序列的其中一个入口指令, 和 /或, 所述 Ml指令序列中的其中一个指令序列的入口指令的上一条指令, 为所述 XI 指令序列中的其中一个指令序列的其中一个出口指令。
可选的,所述网络>¾文处理程序还包括用于支撑所述功能标识所标识功能 实现的 M2个指令序列, 其中, 所述 M2为正整数, 其中, 所述 Ml个指令序列 的集合与所述 M2指令序列的集合的交集为空集, 其中, 所述 M2个指令序列中 的其中一个指令序列的出口点的下一条指令, 为所述 XI指令序列中的其中一 个指令序列的其中一个入口指令, 和 /或所述 M2指令序列中的其中一个指令序 列的入口指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其 中一个出口指令。
可选的, 所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能 实现的 X2个指令序列, 其中, 所述 X2为正整数, 所述 XI个指令序列的集合与 所述 X2指令序列的集合的交集为空集;
其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列的 出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中一 个入口指令,和 /或,所述 Ml个指令序列或所述 M2个指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序列 的其中一个出口指令。
可以理解的是, 本实施例的管理设备 400的各功能模块的功能可根据上述 方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相 关描述, 此处不再赘述。
可以理解的是, 本实施例管理设备 400可为网络管理服务器或者是 SDN控 制器等。
由上可见, 本实施例的技术方案中, 由于管理设备 400是在获取功能标识 之后, 确定用于实现该功能标识所标识功能的 Ml个指令序列, 所述 Ml个指令 序列中的每个指令序列包括唯一的入口指令, Ml个指令序列中的每个指令序 列包括唯一的出口指令, 其中, 由于程序代码被以指令序列的粒度划分, 这就 提供了一种定制网络报文处理程序的机制, 进而可基于获取功能标识 (即可基 于需求)来筛选获得符合要求的指令序列, 进而有利于构建出与实际需求匹配 性更强的网络报文处理程序,这样有利于提高指令执行设备与其所运行的网络 报文处理程序的匹配度, 减少指令执行设备(如报文转发处理设备 )所运行网 络"¾文处理程序中的无效代码。 参见图 5, 图 5是本发明的另一个实施例提供的报文转发设备 500的结构框 图。 其中, 报文转发设备 500可以包括至少 1个处理器 501 , 至少 1个网络处理器 506、 至少 1个网络接口 504, 存储器 505 , 至少 1个通信总线 502。 通信总线 502 用于实现这些组件之间的连接通信。
其中, 该报文转发设备 500可选的包括用户接口 503 , 包括输出设备(例如 触摸屏、液晶显示器、全息成像(英文: holographic )或者投影(英文: projector ) 等)、 输入设备(例如键盘、 鼠标、 轨迹球(英文: trackball ), 触感板或者触 摸屏等、摄像头和拾音装置等)。 其中, 存储器 505可以包括只读存储器和随机 存取存储器, 并向处理器 501提供指令和数据。 其中, 存储器 502中的一部分还 可以包括非易失性随机存取存储器。
处理器 501可以是中央处理器(英文: central processing unit,缩写: CPU ), 也可以是 CPU和硬件芯片的组合。 上述硬件芯片可以是以下一种或多种的组 合: 专用集成电路(英文: application-specific integrated circuit, 缩写: ASIC ), 现场可编程逻辑门阵列 (英文: field-programmable gate array, 缩写: FPGA ) 以及复杂可编程逻辑器件(英文: complex programmable logic device, 缩写: CPLD )。
存储器 505 , 用于存储程序代码, 并将该程序代码传输给处理器 501。 存储 器可以包括易失性存储器(英文: volatile memory ), 例如随机存取存储器(英 文: random-access memory, 缩写: RAM ); 存储器也可以包括非易失性存储 器 (英文: non- volatile memory ), 例如只读存储器 (英文: read-only memory, 缩写: ROM ),快闪存储器(英文: flash memory ),硬盘(英文: hard disk drive, 缩写: HDD )或固态硬盘(英文: solid-state drive, 缩写: SSD ); 存储器还可 以包括上述种类的存储器的组合。
网络接口 504可以由光收发器, 电收发器, 无线收发器或其任意组合实现。 例如, 光收发器可以是小封装可插拔 (英文: small form-factor pluggable transceiver, 缩写: SFP )收发器(英文: transceiver ) , 增强小封装可插拔(英 文: enhanced small form-factor pluggable, 缩写: SFP+ )收发器或 10吉比特小 封装可插拔 (英文: 10 Gigabit small form-factor pluggable, 缩写: XFP ) 收发 器。 电收发器可以是以太网(英文: Ethernet )网络接口控制器(英文: network interface controller, 缩写: NIC )。 无线收发器可以是无线网络接口控制器(英 文: wireless network interface controller, 缩写: WNIC )。
在本发明实施例中, 所述存储器 505用于存储程序代码, 并向所述处理器
501传输所述程序代码;
所述处理器 501用于根据所述程序代码, 执行以下步骤:
获取功能标识,确定用于实现所述功能标识所标识功能的 Ml个指令序列, 构建网络报文处理程序并将所述网络报文处理程序安装到所述网络处理器 506, 所述 Ml个指令序列中的每个指令序列包括唯一的入口指令, 所述 Ml个 指令序列中的每个指令序列包括唯一的出口指令, 所述 Ml为正整数, 所述网 络报文处理程序包括所述 Ml个指令序列;
所述网络处理器 506用于安装所述网络报文处理程序, 并根据所述网络报 文处理程序处理自所述网络接口接收的网络 ^艮文。
可选的, 所述处理器还用于, 获取 XI个条目, 所述 XI个条目与 XI个表的 映射为——对应, 确定用于实现所述 XI个表的查表功能的 XI个指令序列, 所 述 XI个指令序列与所述 XI个表的映射为——对应, 其中, 所述网络报文处理 程序还包括所述 XI个指令序列, 其中, 所述 XI为正整数。
可选的, 所述 Ml个指令序列双射到有效转发数据流有向图中的 Ml条有向 边, 其中, 所述 XI个表双射到所述有效转发数据流有向图中的 XI个节点, 所述有效转发数据流有向图包括: X个节点和 M条有向边, 所述 M条有向 边双射到 M个指令序列, 所述 X个节点双射到 X个表, 所述 Ml条有向边为所述 M条有向边的集合的子集, 所述 XI个节点为所述 X个节点的集合的子集, 所述 M和 X为正整数;
其中, 所述 X个节点中的节点 il的入边所对应的指令序列的出口指令的下 一条指令, 为用于实现所述节点 il所对应表的查表功能的指令序列的其中一个 一条指令, 为用于实现所述节点 j 1所对应表的查表功能的指令序列的其中一个 出口指令, 其中, 节点 ii为所述 X个节点中的任意一个节点, 所述节点 ji为所 述 X个节点中的任意一个节点。
可选的,所述网络>¾文处理程序还包括用于支撑所述功能标识所标识功能 所述 M2为正整数, 所述 Ml个指令序列的集合和所述 M2指令序列的集合的交 集为空集。
可选的, 所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能 实现的 X2个指令序列,所述 X2个指令序列与 X2个表的映射为——对应,其中, 所述 X2个表为所述 X个表的子集, 所述 X2为正整数, 其中, 所述 XI个指令序 列的集合和所述 X2指令序列的集合的交集为空集。
可选的,所述有效转发数据流有向图是修剪初始转发数据流有向图中的节 点和 /或有向边而得到; 其中, 所述初始有效转发数据流有向图包括: X0个节 点和 M0条有向边, 其中, 所述 M0条有向边与 M0个指令序列的映射为——对 应, 所述 X0个节点与 X0个表的映射为——对应, 所述 M条有向边的集合为所 述 M0条有向边的集合的子集, 所述 X个节点的集合为所述 X0个节点的集合的 子集, 所述 M0和所述 X0为正整数。
可选的, 所述处理器还用于: 获取应用场景标识, 其中, 所述 M0个指令 序列为所述应用场景标识所标识的 M0个指令序列。
可选的, 所述处理器用于: 基于所述有效转发数据流有向图中的有向边和 节点构建网络报文处理程序。
可选的, 所述 Ml指令序列中的其中一个指令序列的出口指令的下一条指 令, 为所述 XI指令序列中的其中一个指令序列的其中一个入口指令, 和 /或, 所述 Ml指令序列中的其中一个指令序列的入口指令的上一条指令, 为所述 XI 指令序列中的其中一个指令序列的其中一个出口指令。
可选的,所述网络>¾文处理程序还包括用于支撑所述功能标识所标识功能 实现的 M2个指令序列, 其中, 所述 M2为正整数, 其中, 所述 Ml个指令序列 的集合与所述 M2指令序列的集合的交集为空集, 其中, 所述 M2个指令序列中 的其中一个指令序列的出口点的下一条指令, 为所述 XI指令序列中的其中一 个指令序列的其中一个入口指令, 和 /或所述 M2指令序列中的其中一个指令序 列的入口指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其 中一个出口指令。
可选的, 所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能 实现的 X2个指令序列, 其中, 所述 X2为正整数, 所述 XI个指令序列的集合与 所述 X2指令序列的集合的交集为空集;
其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列的 出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中一 个入口指令,和 /或,所述 Ml个指令序列或所述 M2个指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序列 的其中一个出口指令
可以理解的是, 本实施例的报文转发处理设备 500的各功能模块的功能可 根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实 施例的相关描述, 此处不再赘述。
可以理解的是, 本实施例的报文转发处理设备 500可为网络交换机或路由 器等。
由上可见, 本实施例的技术方案中, 由于报文转发处理设备 500是在获取 功能标识之后, 确定用于实现该功能标识所标识功能的 Ml个指令序列, 所述 Ml个指令序列中的每个指令序列包括唯一的入口指令, Ml个指令序列中的每 个指令序列包括唯一的出口指令, 其中, 由于程序代码被以指令序列的粒度划 分, 这就提供了一种定制网络报文处理程序的机制, 进而可基于获取功能标识 (即可基于需求 )来筛选获得符合要求的指令序列, 进而有利于构建出与实际 需求匹配性更强的网络报文处理程序,这样有利于提高指令执行设备与其所运 行的网络报文处理程序的匹配度, 减少指令执行设备(如报文转发处理设备) 所运行网络 文处理程序中的无效代码。
参见图 6, 本发明实施例还提供一种通信***, 可包括:
报文转发处理设备 610, 用于发送携带功能标识的报文。
管理设备 620, 用于接收所述携带功能标识的报文; 确定用于实现所述功 能标识所标识功能的 Ml个指令序列, 构建网络报文处理程序并利用构建的所 述网络 4艮文处理程序生成程序升级补丁, 向所述 "^文转发处理设备 610发送所 述程序升级补丁;或者,构建网络报文处理程序并向所述报文转发处理设备 610 发送所述网络 文处理程序。
其中, 所述 Ml个指令序列中的每个指令序列包含唯一的入口指令(例如 所述 Ml个指令序列中的每个指令序列的第一条指令是相应指令序列的唯一的 入口指令 ), 所述 Ml个指令序列中的每个指令序列包含唯一的出口指令(例如 例如所述 Ml个指令序列中的每个指令序列的最后一条指令是相应指令序列的 出口指令其中, 其中, 所述 Ml为正整数。 其中, 所述 Ml个指令序列为用于对 网络报文进行处理的指令序列。
其中,上述获取的功能标识可以标识对一个或多网络协议做转发处理的功 能。例如上述获取的功能标识所标识的功能可包括如下功能的至少 1个: 统计 网络报文的字节计数、在网络报文中添加 VLAN标签、删除网络报文中的 VLAN 标签、 修改网络报文的 IP报文头中的 DSCP字段的取值。 当然所述功能标识所 标识的功能也可能包括其他一种或多种功能。
例如, 报文转发处理设备 610中具有网络处理器, 网络处理器可运行所述 网络 ^艮文处理程序, 以对接收到的网络 ^艮文进行处理。
可选的, 在一些可能的实施方式中, 管理设备 620还可用于, 在获取功能 标识时, 还可以获取应用场景标识, 所述应用场景标识可标识 M0个指令序列 的集合。 也就是说, 可以基于应用场景标识来确定指令序列的全集。 其中, 不 同的应用场景标识可标识不同的指令序列的全集。两个应用场景标识所标识的 指令序列的两个全集的交集可能是空集或非空集合。 例如, 管理设备 620可用 于以所述功能标识为索引, 从所述应用场景标识所标识的 M0个指令序列的集 合之中, 确定出与所述功能标识匹配的 Ml个指令序列。 其中, M0个指令序列 的集合是用于实现各种功能的指令序列的全集, 或者 M0个指令序列的集合是 用于实现对应某个应用场景的各种功能的指令序列的全集。
可选的, 在一些可能的实施方式中, M0个指令序列中的每个指令序列可 被预先标记至少 1个功能标识。某个指令序列被标记的至少 1个功能标识表示该 指令序列可用于实现该至少 1个功能标识所标识的功能。
可选的, 在一些可能的实施方式中, 管理设备 620还可用于在获取功能标 识时, 还可获取 XI个条目 (例如, 携带所述获取的功能标识的指令或报文中 还携带 XI个条目 ), 其中, 所述 XI个条目到 XI表个的映射为——对应, 所述 XI为正整数。
其中, 管理设备 620还可用于确定用于实现所述 XI个表的查表功能的 XI 个指令序列, 所述 XI个指令序列到所述 XI个表的映射为——对应, 其中, 所 述网络报文处理程序还包括所述 XI个指令序列。 此外若报文转发处理设备中 使用硬件来实现上述 XI表中的某个表的查表功能, 所述网络报文处理程序也 可不包括用于实现该某个表的查表功能的指令序列。
可选的, XI个条目中的第一条目可以包括如下信息中的至少一种: 第一 表的标识、 所述第一表和用于实现所述第一表的查表功能的 1个指令序列, 其 中, 所述第一条目为所述 XI个条目中的的任意一个条目, 所述第一表为所述 XI个表之中的任意一个表。 其中, 在一些具体实现过程中, 可根据第一表的 标识索引到第一表和 /或用于实现所述第一表的查表功能的 1个指令序列。 或者 也可以根据第一表本身(第一表中可包括或不包括第一表的标识)来索引到用 于实现第一表的查表功能的 1个指令序列。
其中,用于实现某个表的查表功能的指令序列可能包括至少一个出口指令 和至少一个入口指令,也就是说, 用于实现某个表的查表功能的指令序列可以 具有至少一个点和至少一个出口点。
可选的, 在另一些可能的实施方式中, 所述 Ml指令序列中的其中一个指 令序列的出口指令的下一条指令, 为所述 XI指令序列中的其中一个指令序列 的其中一个入口指令, 和 /或, 所述 Ml指令序列中的其中一个指令序列的入口 指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一个出 口指令。
可选的,所述网络报文处理程序还可进一步包括用于支撑所述功能标识所 标识功能实现的 M2个指令序列。 其中, 所述 M2个指令序列中的其中一个指令 序列的出口指令的下一条指令, 为所述 XI指令序列中的其中一个指令序列的 其中一个入口指令, 和 /或, 所述 M2指令序列中的其中一个指令序列的入口指 令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一个出口 指令。
举例来说,对于某些上层功能可能需要一些底层功能来做支撑, 其中一个 底层功能可能可用来支撑一个上层功能或多个上层功能,一个上层功能也可能 需要多个底层功能来支撑。 因此当获取到功能标识, 可能不仅需确定用于实现 该获取到的功能标识所标识功能的 Ml个指令序列, 还需要确定用于支撑所述 功能标识所标识功能实现的 M2个指令序列。 又可选的,在另一些可能的实施方式中, 所述网络"¾文处理程序还可以包 括用于支撑所述 XI个表的查表功能实现的 X2个指令序列, 其中, 所述 X2为正 整数。 其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列 的出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中 一个入口指令,和 /或, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个 指令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序 列的其中一个出口指令。
进一步的, 为便于比较直观理解, 可通过转发数据流有向图来体现出用于 实现功能标识所标识功能的指令序列和表之间的相关关系, 当然, 由于表和用 于实现该表的查表功能的指令序列之间是相关的, 因此,转发数据流有向图也 就可在一定程度上现出用于实现功能标识所标识功能的指令序列和用于实现 表的查表功能的指令序列之间的相关关系。其中,转发数据流有向图中的不同 节点与不同的表相对应,转发数据流有向图中的不同边与用于实现功能的不同 指令序列相对应。
其中,初始的转发数据流有向图可能包括用于实现所有功能的指令序列所 对应的边,还包括与所有功能相关的所有表所对应的指令序列, 可通过修剪初 始的转发数据流有向图, 可以得到有效转发数据流有向图。
可选的, 在一些可能的实施方式中, 所述 Ml个指令序列双射到有效转发 数据流有向图中的 Ml条有向边, 其中, 所述 XI个表双射到所述有效转发数据 流有向图中的 XI个节点。 所述有效转发数据流有向图包括: X个节点和 M条有 向边, 所述 M条有向边双射到 M个指令序列, 所述 X个节点双射到 X个表。 所 述 Ml条有向边的集合为所述 M条有向边的集合的子集, 所述 XI个节点的集合 为所述 X个节点的集合的子集, 其中, 所述 M和 X为正整数。 具体例如, 所述 X 个表包括所述 XI个表和所述 X2个表、 所述 M个指令序列包括所述 Ml指令序列 和所述 M2个指令序列。
可选的, 在一些可能的实施方式中, 所述 X个节点中的节点的入边所对应 的指令序列的出口指令的下一条指令,为用于实现所述节点所对应表的查表功 能的指令序列的其中一个入口指令。 所述 X个节点中的节点的出边所对应的指 令序列的入口指令的上一条指令,可为用于实现所述每个节点所对应表的查表 功能的指令序列的其中一个出口指令。 即, 节点 il的入边所对应的指令序列的 出口指令的下一条指令, 为用于实现该节点 il所对应表的查表功能的指令序列 的其中一个入口指令, 节点 il为所述 X个节点中的任意一个节点。 节点 jl的出 边所对应的指令序列的入口指令的上一条指令, 可为用于实现该节点 jl所对应 表的查表功能的指令序列的其中一个出口指令, 其中, 节点 jl为所述 X个节点 中的任意一个节点。
可选的,在一些可能的实施方式中, 若报文转发处理设备中使用硬件来实 现查表功能, 则报文转发处理设备可在执行节点 i2的入边所对应的指令序列的 出口指令后, 利用相应硬件来执行用于实现节点 i2所对应表的查表功能, 节点 i2为所述 X个节点中的任意一个节点。 报文转发处理设备可在利用相应硬件来 执行用于实现节点 j2所对应表的查表功能之后, 执行节点 j2的其中一条出边所 对应的指令序列的入口指令, 节点 j2为所述 X个节点中的任意一个节点。
可选的,在一些可能的实施方式中, 所述网络 4艮文处理程序还可进一步包 括用于支撑所述功能标识所标识功能实现的 M2个指令序列, 其中, 所述 M2个 指令序列为的集合所述 M个指令序列的集合的子集。 其中, 所述 Ml个指令序 列的集合和所述 M2指令序列的集合的交集为空集。
可选的,在一些可能的实施方式中, 所述网络"¾文处理程序还包括用于支 撑所述 XI个表的查表功能实现的 X2个指令序列,所述 X2个指令序列与 X2个表 ——对应, 所述 X2个表的集合为所述 X个表的集合的子集, 所述 X2为正整数, 其中, 所述 XI个指令序列的集合和所述 X2指令序列的集合的交集为空集。
可选的,在一些可能的实施方式中, 所述有效转发数据流有向图是修剪初 始转发数据流有向图中的节点和有向边而得到,或者所述有效转发数据流有向 图是修剪初始转发数据流有向图中的有向边而得到。其中, 所述初始有效转发 数据流有向图包括: X0个节点和 M0条有向边, 所述 M0条有向边与 M0个指令 序列——对应, 所述 X0个节点与 X0个表——对应, 所述 M条有向边的集合为 所述 M0条有向边的集合的子集, 所述 X个节点为所述 X0个节点的子集, 所述
M0和所述 X0为正整数。 其中, 可通过对初始转发数据流有向图中的无效节点和 /或无效有向边进 行修剪得到有效转发数据流有向图, 其中, 有效有向边可认为是上述 Μ个指令 序列所对应的有向边,始转发数据流有向图中除去上述有效有向边之外的有向 边可认为是无效有向边, 所述 Μ个指令序列包括所述 Ml指令序列和所述 Μ2个 指令序列, 当然 M2可能等于 0。 其中, 有效节点可认为是上述 X个表所对应的 节点, 始转发数据流有向图中除去上述有效节点之外节点的可认为是无效节 点, 所述 X个表包括所述 XI个表和所述 X2个表, 当然 X2可能等于 0。 其中, 参 见图 2-c和图 2-d, 例如图 2-c示出了一种初始转发数据流有向图, 其中, 假设无 效节点包括表 3对应的节点, 无效边包括指令序列 N6、 指令序列 N2、 指令序列 N3和指令序列 N4对应的有向边, 因此对一种初始转发数据流有向图进行修剪 以得到有效转发数据流有向图可如图 2-d所示。
可选的, 在一些可能的实施方式中, 管理设备 620用于基于所述有效转发 数据流有向图中的有向边和节点构建网络 文处理程序。 其中, 由于有效转发 数据流有向图中的有向边和节点,可以体现出用于实现表的查表功能的指令序 列和用于实现功能标识所标识功能的指令序列之间的关联关系,因此基于所述 有效转发数据流有向图中的有向边和节点,有利于快速的构建网络 >¾文处理程 序。
本实施例提供的技术方案中, 由于是在管理设备 620是在从报文转发处理 设备 610获取功能标识之后,确定用于实现该功能标识所标识功能的 Ml个指令 序列, 所述 Ml个指令序列中的每个指令序列包括唯一的入口指令, 所述 Ml个 指令序列中的每个指令序列包括唯一的出口指令, 其中, 由于程序代码被以指 令序列的粒度划分, 管理设备 620构建网络报文处理程序并利用构建的所述网 络报文处理程序生成程序升级补丁, 向所述报文转发处理设备 610发送所述程 序升级补丁; 或者管理设备 620构建网络报文处理程序并向所述报文转发处理 设备 610发送所述网络报文处理程序; 这就提供了一种定制网络报文处理程序 的机制, 进而可基于获取功能标识 (即可基于需求 )来筛选获得符合要求的指 令序列, 进而有利于构建出与实际需求匹配性更强的网络 文处理程序, 这样 有利于提高报文转发处理设备与其所运行的网络报文处理程序的匹配度,减少 "^艮文转发处理设备所运行网络"¾文处理程序中的无效代码。
在上述实施例中,对各个实施例的描述都各有侧重, 某个实施例中没有详 述的部分, 可以参见其他实施例的相关描述。
对于前述的各方法实施例, 为了简单描述,故将其都表述为一系列的动作 组合, 但本领域技术人员应该知悉, 本发明并不受所描述的动作顺序的限制, 因为依据本发明, 某些步骤可釆用其他顺序或同时进行。说明书中所描述的实 施例均属于优选实施例, 所涉及的动作和模块并不一定是本发明所必须的。
在本申请所提供的几个实施例中所揭露的装置, 可通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示意性的, 例如所述单元的划分, 仅仅 为一种逻辑功能划分, 实际实现时可以有另外的划分方式, 例如多个单元或者 组件可以结合或者可以集成到另一个***,或者一些特征可以忽略,或不执行。 单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者 也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部 单元来实现本实施例方案的目的。
另外, 在本发明各实施例中的各功能单元可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以釆用硬 件的形式实现, 也可以釆用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售 或使用时, 可以存储在一个计算机可读取存储介质中。基于这样的理解, 本发 明的技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产 品存储在一个存储介质中, 包括若干指令用以使得一台计算机设备 (具体可以 是计算机设备中的处理器)执行本发明各个实施例所述方法的全部或部分步 骤。 其中, 所述存储介质是非短暂性(英文: non-trans i tory )介质, 可以是 随机存取存储器, 只读存储器, 快闪存储器, 硬盘, 固态硬盘, 磁带 (英文: magne t ic tape ), 軟盘 (英文: f loppy di sk ), 光盘 (英文: opt i ca l di sc ) 及其任意组合。
以上所述, 以上实施例仅用以说明本发明的技术方案, 而非对其限制; 尽 管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员依然可 以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行 等同替换; 而这些修改或者替换, 并不使相应技术方案脱离本发明的范围。

Claims

权 利 要 求
1、 一种指令序列确定方法, 其特征在于, 包括:
获取功能标识;
确定用于实现所述功能标识所标识功能的 Ml个指令序列, 其中, 所述 Ml 个指令序列中的每个指令序列包括唯一的入口指令, 所述 Ml个指令序列中的 每个指令序列包括唯一的出口指令, 其中, 所述 Ml为正整数, 所述 Ml个指令 序列为构建用于对网络报文进行处理的网络报文处理程序的指令序列。
2、 根据权利要求 1所述的方法, 其特征在于,
所述方法还包括:
构建网络报文处理程序并利用构建的所述网络报文处理程序生成程序升 级补丁, 向报文转发处理设备发送所述程序升级补丁; 或者构建网络报文处理 程序并向报文转发处理设备发送所述网络报文处理程序;或者构建网络报文处 理程序并安装所述网络>¾文处理程序;
其中, 所述网络报文处理程序包括所述 Ml个指令序列。
3、 根据权利要求 2所述的方法, 其特征在于,
所述方法还包括: 获取 XI个条目, 所述 XI个条目与 XI个表的映射为—— 对应, 确定用于实现所述 XI个表的查表功能的 XI个指令序列, 所述 XI个指令 序列与所述 XI个表的映射为——对应, 其中, 所述网络报文处理程序还包括 所述 XI个指令序列, 其中, 所述 XI为正整数。
4、 根据权利要求 3所述的方法, 其特征在于,
第一条目包括如下信息的至少一种: 第一表的标识、所述第一表和用于实 现所述第一表的查表功能的 1个指令序列, 其中, 所述第一条目为所述 XI个条 目中的任意一个条目。
5、 根据权利要求 3或 4所述的方法, 其特征在于, 所述 Ml个指令序列双射 到有效转发数据流有向图中的 Ml条有向边, 其中, 所述 XI个表双射到所述有 效转发数据流有向图中的 XI个节点,
所述有效转发数据流有向图包括: X个节点和 M条有向边, 所述 M条有向 边双射到 M个指令序列, 所述 X个节点双射到 X个表, 所述 Ml条有向边为所述 M条有向边的集合的子集, 所述 XI个节点为所述 X个节点的集合的子集, 所述 M和 X为正整数;
其中, 所述 X个节点中的节点 il的入边所对应的指令序列的出口指令的下 一条指令, 为用于实现所述节点 il所对应表的查表功能的指令序列的其中一个 一条指令, 为用于实现所述节点 j 1所对应表的查表功能的指令序列的其中一个 出口指令, 其中, 节点 il为所述 X个节点中的任意一个节点, 所述节点 jl为所 述 X个节点中的任意一个节点。
6、 根据权利要求 5所述的方法, 其特征在于, 所述网络报文处理程序还包 括用于支撑所述功能标识所标识功能实现的 M2个指令序列, 其中, 所述 M2个 指令序列为所述 M个指令序列的子集, 其中, 所述 M2为正整数, 所述 Ml个指 令序列的集合和所述 M2指令序列的集合的交集为空集。
7、 根据权利要求 5或 6所述的方法, 其特征在于,
所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2 个指令序列, 所述 X2个指令序列与 X2个表的映射为——对应, 所述 X2个表为 所述 X个表的子集, 所述 X2为正整数, 其中, 所述 XI个指令序列的集合和所 述 X2指令序列的集合的交集为空集。
8、 根据权利要求 5至 7任一项所述的方法, 其特征在于,
所述有效转发数据流有向图是修剪初始转发数据流有向图中的节点和 /或 有向边而得到; 其中, 所述初始有效转发数据流有向图包括: X0个节点和 M0 条有向边, 其中, 所述 M0条有向边与 M0个指令序列的映射为——对应, 所述 X0个节点与 X0个表的映射为——对应, 其中, 所述 M条有向边的集合为所述 M0条有向边的集合的子集, 所述 X个节点的集合为所述 X0个节点的集合的子 集, 所述 M0和所述 X0为正整数。
9、 根据权利要求 8所述的方法, 其特征在于,
所述确定用于实现所述功能标识所标识功能的 Ml个指令序列包括: 以所 述功能标识为索引, 从所述 M0个指令序列之中确定出与所述功能标识匹配的 Ml个指令序列。
10、 根据权利要求 8至 9任一项所述的方法, 其特征在于,
所述方法还包括: 获取应用场景标识, 其中, 所述 M0个指令序列为所述 应用场景标识所标识的 M0个指令序列。
11、 根据权利要求 5至 10任一项所述的方法, 其特征在于,
所述构建网络报文处理程序包括:基于所述有效转发数据流有向图中的有 向边和节点构建网络>¾文处理程序。
12、 根据权利要求 3或 4所述的方法, 其特征在于, 所述 Ml指令序列中的 其中一个指令序列的出口指令的下一条指令, 为所述 XI指令序列中的其中一 个指令序列的其中一个入口指令, 和 /或, 所述 Ml指令序列中的其中一个指令 序列的入口指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的 其中一个出口指令。
13、 根据权利要求 12所述的方法, 其特征在于, 所述网络报文处理程序还 包括用于支撑所述功能标识所标识功能实现的 M2个指令序列, 其中, 所述 M2 为正整数, 其中, 所述 Ml个指令序列的集合与所述 M2指令序列的集合的交集 为空集, 其中, 所述 M2个指令序列中的其中一个指令序列的出口点的下一条 指令, 为所述 XI指令序列中的其中一个指令序列的其中一个入口指令, 和 /或 所述 M2指令序列中的其中一个指令序列的入口指令的上一条指令, 为所述 XI 指令序列中的其中一个指令序列的其中一个出口指令。
14、 根据权利要求 13所述的方法, 其特征在于,
所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2 个指令序列, 其中, 所述 X2为正整数, 所述 XI个指令序列的集合与所述 X2指 令序列的集合的交集为空集;
其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列的 出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中一 个入口指令,和 /或,所述 Ml个指令序列或所述 M2个指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序列 的其中一个出口指令。
15、 一种指令序列确定装置, 其特征在于, 包括: 获取单元, 用于获取功能标识;
确定单元,用于确定用于实现所述获取单元获取的所述功能标识所标识功 能的 Ml个指令序列, 其中, 所述 Ml个指令序列中的每个指令序列包括唯一的 入口指令, 所述 Ml个指令序列中的每个指令序列包括唯一的出口指令, 所述 Ml为正整数, 其中, 所述 Ml个指令序列为构建用于对网络报文进行处理的网 络报文处理程序的指令序列。
16、 根据权利要求 15所述的指令序列确定装置, 其特征在于,
所述指令序列确定装置还包括:
程序单元,用于构建网络报文处理程序并利用构建的所述网络报文处理程 序生成程序升级补丁, 向报文转发处理设备发送所述程序升级补丁; 或者构建 建网络 文处理程序并安装所述网络 文处理程序;
其中, 所述网络报文处理程序包括所述 Ml个指令序列。
17、 根据权利要求 16所述的指令序列确定装置, 其特征在于,
所述获取单元还用于获取 XI个条目, 其中, 所述 XI个条目与 XI个表的映 射为——对应;
所述确定单元还用于: 确定用于实现所述 XI个表的查表功能的 XI个指令 序列, 所述 XI个指令序列与所述 XI个表的映射为——对应, 其中, 所述网络 报文处理程序还包括所述 XI个指令序列, 其中, 所述 XI为正整数。
18、 根据权利要求 17所述的指令序列确定装置, 其特征在于, 所述 Ml个 指令序列双射到有效转发数据流有向图中的 Ml条有向边, 其中, 所述 XI个表 双射到所述有效转发数据流有向图中的 XI个节点,
所述有效转发数据流有向图包括: X个节点和 M条有向边, 所述 M条有向 边双射到 M个指令序列, 所述 X个节点双射到 X个表, 所述 Ml条有向边为所述 M条有向边的集合的子集, 所述 XI个节点为所述 X个节点的集合的子集, 所述 M和 X为正整数;
其中, 所述 X个节点中的节点 il的入边所对应的指令序列的出口指令的下 一条指令, 为用于实现所述节点 il所对应表的查表功能的指令序列的其中一个 一条指令, 为用于实现所述节点 j 1所对应表的查表功能的指令序列的其中一个 出口指令, 其中, 节点 il为所述 X个节点中的任意一个节点, 所述节点 jl为所 述 X个节点中的任意一个节点。
19、 根据权利要求 18所述的指令序列确定装置, 其特征在于,
所述网络报文处理程序还包括用于支撑所述功能标识所标识功能实现的 所述 M2为正整数, 所述 Ml个指令序列的集合和所述 M2指令序列的集合的交 集为空集。
20、 根据权利要求 18或 19所述的指令序列确定装置, 其特征在于, 所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2 个指令序列, 所述 X2个指令序列与 X2个表的映射为——对应, 所述 X2个表为 所述 X个表的子集, 所述 X2为正整数, 其中, 所述 XI个指令序列的集合和所 述 X2指令序列的集合的交集为空集。
21、 根据权利要求 17或 18所述的指令序列确定装置, 其特征在于, 所述
Ml指令序列中的其中一个指令序列的出口指令的下一条指令, 为所述 XI指令 序列中的其中一个指令序列的其中一个入口指令, 和 /或, 所述 Ml指令序列中 的其中一个指令序列的入口指令的上一条指令, 为所述 XI指令序列中的其中 一个指令序列的其中一个出口指令。
22、 根据权利要求 21所述的指令序列确定装置, 其特征在于,
所述网络报文处理程序还包括用于支撑所述功能标识所标识功能实现的 M2个指令序列, 其中, 所述 M2为正整数, 其中, 所述 Ml个指令序列的集合 与所述 M2指令序列的集合的交集为空集, 其中, 所述 M2个指令序列中的其中 一个指令序列的出口点的下一条指令, 为所述 XI指令序列中的其中一个指令 序列的其中一个入口指令, 和 /或所述 M2指令序列中的其中一个指令序列的入 口指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一个 出口指令。
23、 根据权利要求 22所述的指令序列确定装置, 其特征在于, 所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2 个指令序列, 其中, 所述 X2为正整数, 所述 XI个指令序列的集合与所述 X2指 令序列的集合的交集为空集;
其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列的 出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中一 个入口指令,和 /或,所述 Ml个指令序列或所述 M2个指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序列 的其中一个出口指令。
24、 一种管理设备, 其特征在于, 包括:
处理器、 存储器和网络接口, 其中, 所述处理器、 所述存储器和所述网络 接口通过通信总线连接;
所述存储器用于存储程序代码, 并向所述处理器传输所述程序代码; 其中, 所述处理器用于根据所述程序代码, 执行以下步骤:
获取功能标识;确定用于实现所述功能标识所标识功能的 Ml个指令序列, 构建网络 ^艮文处理程序并利用构建的所述网络 ^艮文处理程序生成程序升级补 丁,通过所述网络接口向报文转发处理设备发送所述程序升级补丁; 或者构建 网络报文处理程序并通过所述网络接口向报文转发处理设备发送所述网络报 文处理程序, 其中, 所述 Ml个指令序列中的每个指令序列包括唯一的入口指 令, 所述 Ml个指令序列中的每个指令序列包括唯一的出口指令, 所述 Ml为正 整数, 其中, 所述网络报文处理程序包括所述 Ml个指令序列。
25、 根据权利要求 24所述的管理设备, 其特征在于,
所述处理器还用于, 获取 XI个条目, 所述 XI个条目与 XI个表的映射为一 一对应, 确定用于实现所述 XI个表的查表功能的 XI个指令序列, 所述 XI个指 令序列与所述 XI个表的映射为——对应, 其中, 所述网络报文处理程序还包 括所述 XI个指令序列, 其中, 所述 XI为正整数。
26、 根据权利要求 25所述的管理设备, 其特征在于, 所述 Ml个指令序列 双射到有效转发数据流有向图中的 Ml条有向边, 其中, 所述 XI个表双射到所 述有效转发数据流有向图中的 XI个节点, 所述有效转发数据流有向图包括: X个节点和 M条有向边, 所述 M条有向 边双射到 M个指令序列, 所述 X个节点双射到 X个表, 所述 Ml条有向边为所述 M条有向边的集合的子集, 所述 XI个节点为所述 X个节点的集合的子集, 所述 M和 X为正整数;
其中, 所述 X个节点中的节点 il的入边所对应的指令序列的出口指令的下 一条指令, 为用于实现所述节点 il所对应表的查表功能的指令序列的其中一个 一条指令, 为用于实现所述节点 j 1所对应表的查表功能的指令序列的其中一个 出口指令, 其中, 节点 il为所述 X个节点中的任意一个节点, 所述节点 jl为所 述 X个节点中的任意一个节点。
27、 根据权利要求 26所述的管理设备, 其特征在于, 所述网络报文处理程 序还包括用于支撑所述功能标识所标识功能实现的 M2个指令序列, 所述 M2个 指令序列为所述 M个指令序列的子集, 其中, 所述 M2为正整数, 所述 Ml个指 令序列的集合和所述 M2指令序列的集合的交集为空集。
28、 根据权利要求 26或 27所述的管理设备, 其特征在于, 所述网络报文处 理程序还包括用于支撑所述 XI个表的查表功能实现的 X2个指令序列, 所述 X2 个指令序列与 X2个表的映射为——对应, 其中, 所述 X2个表为所述 X个表的 子集, 所述 X2为正整数, 其中, 所述 XI个指令序列的集合和所述 X2指令序列 的集合的交集为空集。
29、 根据权利要求 26至 28任一项所述的管理设备, 其特征在于, 所述有效转发数据流有向图是修剪初始转发数据流有向图中的节点和 /或 有向边而得到; 其中, 所述初始有效转发数据流有向图包括: X0个节点和 M0 条有向边, 其中, 所述 M0条有向边与 M0个指令序列的映射为——对应, 所述 X0个节点与 X0个表的映射为——对应, 所述 M条有向边的集合为所述 M0条有 向边的集合的子集, 所述 X个节点的集合为所述 X0个节点的集合的子集, 所述 M0和所述 X0为正整数。
30、 根据权利要求 29所述的管理设备, 其特征在于
所述处理器还用于: 获取应用场景标识, 其中, 所述 M0个指令序列为所 述应用场景标识所标识的 MO个指令序列。
31、 根据权利要求 26至 30任一项所述的管理设备, 其特征在于,
所述处理器用于:基于所述有效转发数据流有向图中的有向边和节点构建 网络 4艮文处理程序。
32、 根据权利要求 25所述的管理设备, 其特征在于, 所述 Ml指令序列中 的其中一个指令序列的出口指令的下一条指令, 为所述 XI指令序列中的其中 一个指令序列的其中一个入口指令, 和 /或, 所述 Ml指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 XI指令序列中的其中一个指令序列 的其中一个出口指令。
33、 根据权利要求 32所述的管理设备, 其特征在于, 所述网络报文处理程 序还包括用于支撑所述功能标识所标识功能实现的 M2个指令序列, 其中, 所 述 M2为正整数, 其中, 所述 Ml个指令序列的集合与所述 M2指令序列的集合 的交集为空集, 其中, 所述 M2个指令序列中的其中一个指令序列的出口点的 下一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一个入口指令, 和 /或所述 M2指令序列中的其中一个指令序列的入口指令的上一条指令, 为所 述 XI指令序列中的其中一个指令序列的其中一个出口指令。
34、 根据权利要求 33所述的管理设备, 其特征在于,
所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2 个指令序列, 其中, 所述 X2为正整数, 所述 XI个指令序列的集合与所述 X2指 令序列的集合的交集为空集;
其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列的 出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中一 个入口指令,和 /或,所述 Ml个指令序列或所述 M2个指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序列 的其中一个出口指令。
35、 一种报文转发处理设备, 其特征在于, 包括:
处理器、 网络处理器、 存储器和网络接口, 其中, 所述处理器、 所述网络 处理器、 所述存储器和所述网络接口通过通信总线连接; 其中,所述存储器用于存储程序代码,并向所述处理器传输所述程序代码; 所述处理器用于根据所述程序代码, 执行以下步骤: 获取功能标识, 确定 用于实现所述功能标识所标识功能的 Ml个指令序列, 构建网络报文处理程序 并将所述网络报文处理程序安装到所述网络处理器, 所述 Ml个指令序列中的 每个指令序列包括唯一的入口指令, 所述 Ml个指令序列中的每个指令序列包 括唯一的出口指令, 所述 Ml为正整数, 所述网络报文处理程序包括所述 Ml个 指令序列;
所述网络处理器用于安装所述网络报文处理程序,并根据所述网络报文处 理程序处理自所述网络接口接收的网络报文。
36、 根据权利要求 35所述的报文转发处理设备, 其特征在于,
所述处理器还用于, 获取 XI个条目, 所述 XI个条目与 XI个表的映射为一 一对应, 确定用于实现所述 XI个表的查表功能的 XI个指令序列, 所述 XI个指 令序列与所述 XI个表的映射为——对应, 其中, 所述网络报文处理程序还包 括所述 XI个指令序列, 其中, 所述 XI为正整数。
37、 根据权利要求 36所述的报文转发处理设备, 其特征在于, 所述 Ml个 指令序列双射到有效转发数据流有向图中的 Ml条有向边, 其中, 所述 XI个表 双射到所述有效转发数据流有向图中的 XI个节点,
所述有效转发数据流有向图包括: X个节点和 M条有向边, 所述 M条有向 边双射到 M个指令序列, 所述 X个节点双射到 X个表, 所述 Ml条有向边为所述 M条有向边的集合的子集, 所述 XI个节点为所述 X个节点的集合的子集, 所述 M和 X为正整数;
其中, 所述 X个节点中的节点 il的入边所对应的指令序列的出口指令的下 一条指令, 为用于实现所述节点 il所对应表的查表功能的指令序列的其中一个 一条指令, 为用于实现所述节点 j 1所对应表的查表功能的指令序列的其中一个 出口指令, 其中, 节点 il为所述 X个节点中的任意一个节点, 所述节点 jl为所 述 X个节点中的任意一个节点。
38、 根据权利要求 37所述的报文转发处理设备, 其特征在于, 所述网络报文处理程序还包括用于支撑所述功能标识所标识功能实现的
M2为正整数, 所述 Ml个指令序列的集合和所述 M2指令序列的集合的交集为 空集。
39、 根据权利要求 37或 38所述的报文转发处理设备, 其特征在于, 所述网 络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2个指令序 歹 |J , 所述 X2个指令序列与 X2个表的映射为——对应, 其中, 所述 X2个表为所 述 X个表的子集, 所述 X2为正整数, 其中, 所述 XI个指令序列的集合和所述 X2指令序列的集合的交集为空集。
40、 根据权利要求 37至 39任一项所述的报文转发处理设备, 其特征在于, 所述有效转发数据流有向图是修剪初始转发数据流有向图中的节点和 /或 有向边而得到; 其中, 所述初始有效转发数据流有向图包括: X0个节点和 M0 条有向边, 其中, 所述 M0条有向边与 M0个指令序列的映射为——对应, 所述 X0个节点与 X0个表的映射为——对应, 所述 M条有向边的集合为所述 M0条有 向边的集合的子集, 所述 X个节点的集合为所述 X0个节点的集合的子集, 所述 M0和所述 X0为正整数。
41、 根据权利要求 40所述的报文转发处理设备, 其特征在于,
所述处理器还用于: 获取应用场景标识, 其中, 所述 M0个指令序列为所 述应用场景标识所标识的 M0个指令序列。
42、 根据权利要求 37至 40任一项所述的报文转发处理设备, 其特征在于, 所述处理器用于:基于所述有效转发数据流有向图中的有向边和节点构建 网络 4艮文处理程序。
43、 根据权利要求 36所述的报文转发处理设备, 其特征在于, 所述 Ml指 令序列中的其中一个指令序列的出口指令的下一条指令, 为所述 XI指令序列 中的其中一个指令序列的其中一个入口指令, 和 /或, 所述 Ml指令序列中的其 中一个指令序列的入口指令的上一条指令, 为所述 XI指令序列中的其中一个 指令序列的其中一个出口指令。
44、 根据权利要求 43所述的管理设备, 其特征在于, 所述网络报文处理程 序还包括用于支撑所述功能标识所标识功能实现的 M2个指令序列, 其中, 所 述 M2为正整数, 其中, 所述 Ml个指令序列的集合与所述 M2指令序列的集合 的交集为空集, 其中, 所述 M2个指令序列中的其中一个指令序列的出口点的 下一条指令, 为所述 XI指令序列中的其中一个指令序列的其中一个入口指令, 和 /或所述 M2指令序列中的其中一个指令序列的入口指令的上一条指令, 为所 述 XI指令序列中的其中一个指令序列的其中一个出口指令。
45、 根据权利要求 44所述的报文转发处理设备, 其特征在于,
所述网络报文处理程序还包括用于支撑所述 XI个表的查表功能实现的 X2 个指令序列, 其中, 所述 X2为正整数, 所述 XI个指令序列的集合与所述 X2指 令序列的集合的交集为空集;
其中, 所述 Ml个指令序列或所述 M2个指令序列中的其中一个指令序列的 出口指令的下一条指令, 为所述 X2指令序列中的其中一个指令序列的其中一 个入口指令,和 /或,所述 Ml个指令序列或所述 M2个指令序列中的其中一个指 令序列的入口指令的上一条指令, 为所述 X2指令序列中的其中一个指令序列 的其中一个出口指令。
46、 一种通信***, 其特征在于, 包括:
报文转发处理设备, 用于发送携带功能标识的报文;
管理设备, 用于接收所述携带功能标识的报文; 确定用于实现所述功能标 识所标识功能的 Ml个指令序列, 构建网络报文处理程序并利用构建的所述网 络报文处理程序生成程序升级补丁 ,向所述报文转发处理设备发送所述程序升 级补丁; 或者,构建网络报文处理程序并向所述报文转发处理设备发送所述网 络报文处理程序, 其中, 所述 Ml个指令序列中的每个指令序列包括唯一的入 口指令, 所述 Ml个指令序列中的每个指令序列包括唯一的出口指令, 所述 Ml 为正整数, 其中, 所述网络报文处理程序包括所述 Ml个指令序列。
PCT/CN2014/081272 2014-06-30 2014-06-30 指令序列确定的方法和相关设备及*** WO2016000171A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP14896488.5A EP3147778A4 (en) 2014-06-30 2014-06-30 Instruction sequence determination method and associated device and system
PCT/CN2014/081272 WO2016000171A1 (zh) 2014-06-30 2014-06-30 指令序列确定的方法和相关设备及***
CN201480047145.5A CN105493037A (zh) 2014-06-30 2014-06-30 指令序列确定的方法和相关设备及***
US15/391,627 US20170109173A1 (en) 2014-06-30 2016-12-27 Method for determining instruction sequences, related device, and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/081272 WO2016000171A1 (zh) 2014-06-30 2014-06-30 指令序列确定的方法和相关设备及***

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/391,627 Continuation US20170109173A1 (en) 2014-06-30 2016-12-27 Method for determining instruction sequences, related device, and system

Publications (1)

Publication Number Publication Date
WO2016000171A1 true WO2016000171A1 (zh) 2016-01-07

Family

ID=55018257

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/081272 WO2016000171A1 (zh) 2014-06-30 2014-06-30 指令序列确定的方法和相关设备及***

Country Status (4)

Country Link
US (1) US20170109173A1 (zh)
EP (1) EP3147778A4 (zh)
CN (1) CN105493037A (zh)
WO (1) WO2016000171A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5841656A (en) * 1995-09-07 1998-11-24 Kabushiki Kaisha Toshiba Programming system for sequence control and control unit for executing program for sequence control
CN1588408A (zh) * 2004-09-03 2005-03-02 杭州恒生电子股份有限公司 利用离散单元快速构建业务处理流程的方法及***
CN102070054A (zh) * 2009-11-19 2011-05-25 上海三菱电梯有限公司 电梯运行控制软件自动测试***
CN102779031A (zh) * 2011-05-10 2012-11-14 北京磊友信息科技有限公司 一种生成JavaScript脚本程序的方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103746909B (zh) * 2013-12-23 2017-04-19 华为技术有限公司 报文处理方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5841656A (en) * 1995-09-07 1998-11-24 Kabushiki Kaisha Toshiba Programming system for sequence control and control unit for executing program for sequence control
CN1588408A (zh) * 2004-09-03 2005-03-02 杭州恒生电子股份有限公司 利用离散单元快速构建业务处理流程的方法及***
CN102070054A (zh) * 2009-11-19 2011-05-25 上海三菱电梯有限公司 电梯运行控制软件自动测试***
CN102779031A (zh) * 2011-05-10 2012-11-14 北京磊友信息科技有限公司 一种生成JavaScript脚本程序的方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3147778A4 *

Also Published As

Publication number Publication date
US20170109173A1 (en) 2017-04-20
CN105493037A (zh) 2016-04-13
EP3147778A1 (en) 2017-03-29
EP3147778A4 (en) 2017-06-21

Similar Documents

Publication Publication Date Title
US11394611B2 (en) Programmable protocol parser for NIC classification and queue assignments
US10320664B2 (en) Cloud overlay for operations administration and management
JP6151394B2 (ja) 仮想クラウドインフラストラクチャへの仮想セキュリティ装置アーキテクチャの提供
JP6881861B2 (ja) パケット処理方法および装置
KR101703088B1 (ko) Sdn 기반의 통합 라우팅 방법 및 그 시스템
US9369301B2 (en) Overlay network capable of supporting storage area network (SAN) traffic
CN105229976B (zh) 数据中心使用的低延迟无损交换结构
CN104221331B (zh) 用于以太网交换机的没有查找表的第2层分组交换
EP3751805B1 (en) Method and device for processing multicast data packet
TW201215037A (en) Switch system, switch control method, and non-transitory computer readable storage medium
WO2015101113A1 (zh) 处理报文的方法与设备
CN111147372B (zh) 下行报文发送、转发方法和装置
US9509613B1 (en) Mechanisms for deadlock avoidance support in network fabrics
CN110389711A (zh) 帮助端点设备实现sr-iov功能的方法、设备和计算机程序产品
RU2602333C2 (ru) Сетевая система, способ обработки пакетов и носитель записи
US20200028779A1 (en) Packet processing method and apparatus
US20160119188A1 (en) End host physical connection on a switch port using multiple ethernet frames
US20140112142A1 (en) Method of forwarding packet and apparatus thereof
US9374308B2 (en) Openflow switch mode transition processing
US10719475B2 (en) Method or apparatus for flexible firmware image management in microserver
WO2016000171A1 (zh) 指令序列确定的方法和相关设备及***
US9912581B2 (en) Flow inheritance
WO2015100751A1 (zh) 一种转发报文的方法和装置
US20160094442A1 (en) Protocol independent multicast (pim) register message transmission
US9853885B1 (en) Using packet duplication in a packet-switched network to increase reliability

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201480047145.5

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14896488

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2014896488

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2014896488

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE