WO2015077976A1 - 一种流表项的下发方法及装置 - Google Patents

一种流表项的下发方法及装置 Download PDF

Info

Publication number
WO2015077976A1
WO2015077976A1 PCT/CN2013/088140 CN2013088140W WO2015077976A1 WO 2015077976 A1 WO2015077976 A1 WO 2015077976A1 CN 2013088140 W CN2013088140 W CN 2013088140W WO 2015077976 A1 WO2015077976 A1 WO 2015077976A1
Authority
WO
WIPO (PCT)
Prior art keywords
switch
mth
data packet
forwarding path
command data
Prior art date
Application number
PCT/CN2013/088140
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 EP13898380.4A priority Critical patent/EP3065351B1/en
Priority to PCT/CN2013/088140 priority patent/WO2015077976A1/zh
Priority to CN201380002433.4A priority patent/CN104919765B/zh
Publication of WO2015077976A1 publication Critical patent/WO2015077976A1/zh
Priority to US15/166,954 priority patent/US10009252B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/64Hybrid switching systems
    • H04L12/6418Hybrid transport
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/036Updating the topology between route computation elements, e.g. between OpenFlow controllers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/26Route discovery packet
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/42Centralised routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/64Routing or path finding of packets in data switching networks using an overlay routing layer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Definitions

  • the present invention relates to the field of network communication technologies, and in particular, to a method and an apparatus for issuing a flow entry. Background technique
  • the switch is mainly used for data forwarding. After the switch receives the data sent by the upper-level device, the switch itself determines the forwarding path for the data, and then forwards the data to the next-level device according to the forwarding path.
  • the switch needs to perform a determining step for the forwarding path, so the amount of data that the switch needs to process during the entire data forwarding process is large.
  • the determined forwarding path is not the optimal forwarding path.
  • Open Flow open data flow
  • a controller is used to control all switches in a network.
  • the switch is only responsible for forwarding data.
  • the forwarding path is determined by the controller. Since the control machine can know the overall topology of the network, a better forwarding path can be determined. Moreover, since the step of determining the forwarding path is performed by the control machine, the workload of the switch can be reduced, and the data forwarding efficiency of the switch is improved.
  • FIG. 1 is a schematic diagram of a command to issue a control in the prior art.
  • the terminal 40 transmits data to the terminal 50 through the network
  • the terminal 40 transmits the data to be transmitted to the switch 20 first; after receiving the data sent by the terminal 40, the switch 20 needs to send the data packet to the control device 10.
  • the control device 10 After receiving the packet in message, the control device 10, after determining the forwarding path for the data to be sent, may send a flow table modification command (Flow mod) to generate a flow entry, and the flow mod includes a forwarding path.
  • Flow mod flow table modification command
  • the Flow mod is then sent in the form of a Packet Out message to all switches involved in the forwarding path.
  • all switches involved in the forwarding path are switch 01 and switch 02.
  • the control unit 10 transmits a packet output message 02 and a packet to the switch 20 and the switch 30, respectively.
  • the switch 30 receives the packet output message 03 for a later time than the switch 20 receives the packet output message 02. However, as soon as the switch 20 receives the packet output message 02, it will immediately transmit the data to the switch 30.
  • the switch 30 since the switch 30 does not receive the packet output message 03 and cannot determine the forwarding path for the received data, the switch 30 also sends a packet entry message 04 to the controller 10, and the controller 10 receives the packet. After entering message 04, a packet output message (not shown in Figure 1) is again sent to switch 30.
  • the switch 30 needs to additionally send the packet entry message 04, and the controller 10 additionally sends a packet to the switch 30. Output a message.
  • These two messages are redundant and increase the amount of data that the controller and switch need to process.
  • the forwarding path in the packet output message sent by the controller 10 to the switch 30 may be inconsistent with the forwarding path in the packet output message 03 of the packet 30 after the delay.
  • the switch 30 also has a logic error, and data forwarding cannot be completed correctly.
  • the method for sending a flow entry in the forwarding path in the prior art once a delay occurs in the sending process, causes the corresponding device to send a redundant message or even a logic error, resulting in a data forwarding process. An error occurred.
  • the present invention provides a method and a device for sending a flow entry to solve the problem that a delay occurs in a process of sending a flow entry in a forwarding path, causing a device to send a redundant message or even a data forwarding process.
  • the specific plan is as follows:
  • the application provides a method for delivering a flow entry, where the method includes:
  • the controller receives the data packet entry message sent by the source switch
  • the first switch of the N switches is the source switch
  • the Nth switch is the target switch of the forwarding path
  • the Mth switch is the Mth hop switch in the forwarding path, 1 ⁇ M ⁇ N
  • the flow entry corresponding to the Mth switch is the Mth flow entry.
  • the Mth control command in the Mth command data packet is used to indicate the Mth switch, save the Mth flow entry, and remove the Mth flow table from the Mth command data packet.
  • the other flow entry and control command other than the Mth control command are encapsulated into the M-1th command data packet and sent to the M-1th switch, so that the M-1th switch is configured according to the
  • the M-1 control instruction in the M-1 command data packet completes the delivery of the remaining M-1 flow entries in the forwarding path, where the M-1th switch is the forwarding The previous hop switch of the Mth switch in the path.
  • the sending the Nth command data packet to the Nth switch includes:
  • the method for generating the Mth control instruction includes:
  • the application provides a method for delivering a flow entry, where the method includes:
  • the Mth switch receives the Mth command data packet, where the Mth command data packet includes at least a first to a Mth total M flow entry and a second to a Mth total M-1 control
  • the command where the Mth switch is the Mth hop switch in the forwarding path, 1 ⁇ MN, the forwarding path is a path determined by the controller for forwarding data to be forwarded, and the forwarding path includes N
  • the control command corresponding to the Mth switch is the Mth control command
  • the flow entry corresponding to the Mth switch is the Mth flow entry;
  • Executing the Mth control instruction, and encapsulating, in the Mth command data packet, the flow entry and the control command except the Mth flow entry and the Mth control instruction into the Mth -1 command data packet is sent to the M-1th switch, so that the M-1th switch completes according to the M-1th control instruction in the M-1th command data packet
  • the Mth switch receives the Mth command data packet, and specifically includes:
  • the Mth switch When the Mth switch is the target switch in the forwarding path, the Mth switch receives the Mth command data packet sent by the controller;
  • the application provides a controller, where the controller includes: a receiving unit, configured to receive a data packet incoming message sent by the source switch;
  • a processing unit configured to determine a forwarding path according to the data packet entry message
  • the processing unit is further configured to generate a corresponding flow entry for each of the switches in the forwarding path, where the first switch of the one switch is a source switch, and the second switch is a The destination switch of the forwarding path, the first switch is the first hop switch in the forwarding path, 1 ⁇ ⁇ ⁇ ⁇ , the flow entry corresponding to the second switch is the third flow entry;
  • the processing unit is further configured to generate a corresponding control command for each of the N-1 switches except the source switch in the forwarding path, where the control command corresponding to the second switch is the second control command ;
  • An encapsulating unit configured to encapsulate the generated one of the flow entry and the N-1 control instructions into the first command data packet
  • a sending unit configured to send the third command data packet to the second switch; wherein, the third control command in the third command data packet is used to indicate that the third switch saves the third flow An entry, and encapsulating, in the third command packet, the flow entry and the control instruction except the second flow entry and the second control instruction into the M-1 command data Sending the packet to the M-1th switch, so that the M-1th switch completes the remaining one of the forwarding paths according to the M-1th control instruction in the M-1th command data packet The delivery of the M-1 flow entries, where the M-1th switch is the previous hop switch of the third switch in the forwarding path.
  • the sending unit specifically includes: a first sending subunit, configured to have a control signaling transmission link between the controller and the third switch Sending the first command data packet directly to the target switch in the first forwarding path;
  • a second sending subunit configured to send, by the source switch, the third command data packet to the controller when there is no control signaling transmission link between the controller and the second switch The third switch.
  • the processing unit includes:
  • a first determining subunit configured to determine the M-1th switch
  • a second determining subunit configured to determine address information of the M-1th switch
  • a third determining subunit configured to determine that the Mth switch sends the Mth to the M-1th switch The port used to command the packet
  • a first control instruction generating subunit configured to generate the Mth control instruction including address information of the M-1th switch and information of the port, so that the Mth switch is according to the Mth Control command encapsulates address information of the M-1th switch in the M-1th command data packet, and sends the M-1th command data packet to the Mth through the port -1 switch.
  • the application provides a switch, where the switch includes:
  • a receiving unit configured to receive an Mth command data packet, where the Mth command data packet includes at least a first to a Mth total M flow entry entries and a second to a Mth total M-1 Controlling the command, wherein the switch is the Mth switch, the Mth switch is the Mth hop switch in the forwarding path, 1 ⁇ M ⁇ N, and the forwarding path is determined by the controller for forwarding to be forwarded a path of the data, where the forwarding path includes N switches, the control command corresponding to the Mth switch is the Mth control command, and the flow entry corresponding to the Mth switch is the Mth flow entry;
  • a processing unit configured to save the Mth flow entry
  • a sending unit configured to execute the Mth control instruction, and replace, in the Mth command data packet, another flow entry and control other than the Mth flow entry and the Mth control instruction
  • the instruction is encapsulated into the M-1th command data packet and sent to the M-1th switch, so that the M-1th switch according to the M-1th in the M-1th command data packet
  • the control command completes the delivery of the remaining M-1 flow entries in the forwarding path, where the M-1th switch is the previous hop switch of the Mth switch in the forwarding path.
  • the receiving unit specifically, includes: a first receiving subunit, configured to: when the Mth switch is a target switch in the forwarding path, M switches receive the Mth command data packet sent by the controller;
  • the application provides a computing node, including: a processor, a communication interface, a memory, and a bus;
  • the processor, the communication interface, the memory completes communication with each other through the bus; the processor is configured to execute a program;
  • the memory is configured to store the program
  • the processor When the computing node is running, the processor is in communication with the memory, and the processor executes the program, the computing node performs the following method:
  • N flow entry and N-1 control instructions are encapsulated into an Nth command data packet; the Nth command data packet is sent to the Nth switch, so that the Nth switch is according to the The Nth control instruction in the Nth command data packet completes delivery of the N flow entry entries in the forwarding path;
  • the Mth control command in the Mth command data packet is used to indicate the Mth switch, save the Mth flow entry, and remove the Mth flow table from the Mth command data packet.
  • the other flow entry and control command other than the Mth control command are encapsulated into the M-1th command data packet and sent to the M-1th switch, so that the M-1th switch is configured according to the
  • the M-1 control instruction in the M-1 command data packet completes the delivery of the remaining M-1 flow entries in the forwarding path, where the M-1th switch is the forwarding a previous hop switch of the Mth switch in the path;
  • the processor executing the program the computing node performs the following method:
  • the Mth switch is the Mth hop switch in the forwarding path, 1 ⁇ MN
  • the forwarding path a path for the controller to forward the data to be forwarded, where the forwarding path includes N switches
  • the control command corresponding to the Mth switch is the Mth control command
  • the flow corresponding to the Mth switch The entry is the Mth flow entry.
  • Executing the Mth control instruction, and encapsulating, in the Mth command data packet, the flow entry and the control command except the Mth flow entry and the Mth control instruction into the Mth -1 command data packet is sent to the M-1th switch, so that the M-1th switch completes according to the M-1th control instruction in the M-1th command data packet
  • the flow entry and the control command corresponding to the other switch in the command data packet are encapsulated into a new command data packet and sent to the previous hop switch in the forwarding path, and the flow entry and the corresponding control command may be forwarded according to the data to be forwarded.
  • the reverse order of the forwarding sequence is sent to each switch in the forwarding path in turn. Since each switch saves the flow entry corresponding to itself, the remaining content in the command packet is in the form of a new command packet. It is sent to the previous hop switch. Therefore, when forwarding data to be forwarded, each switch has a flow entry corresponding to the data to be forwarded, thereby avoiding sending redundant messages and even causing logic errors and preventing data forwarding. The process has gone wrong.
  • FIG. 1 is a schematic diagram of a command for issuing a control in the prior art
  • Embodiment 2 is a flowchart of Embodiment 1 of a method for delivering a flow entry according to the present application;
  • Embodiment 3 is a schematic diagram of Embodiment 2 of a method for delivering a flow entry according to the present application;
  • Embodiment 4 is a schematic diagram of Embodiment 3 of a method for delivering a flow entry according to the present application
  • FIG. 5 is a schematic diagram of Embodiment 4 of a method for delivering a flow entry according to the present application
  • FIG. 6 is a flowchart of another embodiment of a method for delivering a flow entry according to the present application.
  • Figure 7 is a structural diagram of an embodiment of a control machine of the application.
  • FIG. 8 is a structural diagram of an embodiment of a switch applied for
  • FIG. 9 is a structural diagram of a computing node of the present application. detailed description
  • FIG. 2 is a flowchart of Embodiment 1 of a method for delivering a flow entry according to the present application. As shown in Figure 2, the method can include:
  • Step 101 The controller receives a data packet entry message sent by the source switch.
  • the source switch may send a data packet entry message to the controller.
  • the data packet entry message indicates that the source switch receives the data to be forwarded sent by the terminal, and the controller needs to determine a forwarding path for the data to be forwarded.
  • the packet incoming message may be encapsulated in a packet in format.
  • Step 102 Determine a forwarding path according to the data packet entry message.
  • the forwarding path may be a route for forwarding data to be forwarded, and the switch in the subsequent network may forward the data to be forwarded in sequence according to the route.
  • the forwarding path includes a switch involved in forwarding the data to be forwarded, and a first sequence in which the to-be-forwarded data is forwarded between the switches;
  • the manner of determining the forwarding path may be the prior art, and details are not described herein again.
  • Step 103 Generate a corresponding flow entry for each of the N switches in the forwarding path, where the first switch of the N switches is a source switch, and the Nth switch is a target of the forwarding path.
  • the switch, the Mth switch is the Mth hop switch in the forwarding path, 1 ⁇ M ⁇ N, and the flow entry corresponding to the Mth switch is the Mth flow entry;
  • the flow entry is used to indicate a port used by the corresponding switch when forwarding the data to be forwarded.
  • the controller may generate a corresponding flow entry (flow mod) for each switch in the forwarding path.
  • the switch may add the flow entry to the corresponding flow table.
  • the switch may determine, according to the flow entry, which port to use to send the data to be forwarded. Because the ports are connected to different switches, the port specified in the flow entry can be used to send the data to be forwarded to the corresponding switch in the forwarding path.
  • Each of the switches forwards the data to be forwarded according to the flow entry that is stored by the switch, and finally sends the data to be forwarded to the target terminal according to the forwarding path.
  • Step 104 Generate a corresponding control command for each of the N-1 switches in the forwarding path except the source switch, where the control command corresponding to the Mth switch is the Mth control command;
  • all flow entries and control commands may be encapsulated into a command packet in step 105 as a whole.
  • the Mth control command in the Mth command data packet is used to indicate the Mth switch, save the Mth flow entry, and remove the Mth flow table from the Mth command data packet.
  • the other flow entry and control command other than the Mth control command are encapsulated into the M-1th command data packet and sent to the M-1th switch, so that the M-1th switch is configured according to the
  • the M-1 control instruction in the M-1 command data packet completes the delivery of the remaining M-1 flow entries in the forwarding path, where the M-1th switch is the forwarding
  • the control instruction may include address information of a corresponding switch.
  • the address information may specifically be IP information.
  • switch A receives the first data packet and can recognize it from all control commands. Do not issue the same first control instruction as its own IP address and execute it.
  • the process of executing the first control instruction may specifically include:
  • the generating the Mth control instruction may include: determining the M-1th switch;
  • the Mth control instruction including the address information of the M-1th switch and the information of the port, so that the Mth switch performs the M-1 according to the Mth control instruction
  • the address information of the switches is encapsulated in the M-1th command data packet, and the M-1th command data packet is sent to the M-1th switch through the port.
  • Step 105 Encapsulate the generated N flow entries and N-1 control commands into an Nth command data packet.
  • the command data packet may be encapsulated in a packet out format.
  • Step 106 Send the Nth command data packet to the Nth switch, so that the Nth switch completes according to the Nth control instruction in the Nth command data packet. The delivery of the N flow entries in the forwarding path;
  • the order of forwarding of the command data packets between the switches is opposite to the forwarding order of the data to be forwarded in the forwarding path. Therefore, the controller needs to send the Nth command data packet to the target switch in the forwarding path.
  • the target switch is the last switch to which the data to be forwarded is sent in the forwarding path in the forwarding order.
  • a control signaling transmission chain may exist between the controller and the target switch. There may also be no control signaling transmission links.
  • the data packet may be directly sent to a target switch in the forwarding path;
  • the data packet may be sent to the target switch in the forwarding path by the source switch.
  • the source switch sends the data packet to the target switch in the forwarding path, where the source switch sends the Nth command data packet to the forwarding path.
  • the next hop switch of the source switch after receiving the command data packet, the next hop switch forwards the command data packet to the switch that is next hop until forwarding to the target switch.
  • the corresponding switch after generating a control command, the corresponding switch is controlled to identify and save the flow entry corresponding to itself in the received command data packet, and then the flow corresponding to the other switch in the command data packet is The entry and the control command are encapsulated into a new command packet and sent to the previous hop switch in the forwarding path, and the flow entry and the corresponding control command may be sequentially sent to the forwarding path according to the reverse order of the forwarding order of the data to be forwarded.
  • Each switch because each switch saves the flow entry corresponding to itself, sends the remaining content in the command packet to the previous hop switch in the form of a new command packet, thus ensuring forwarding
  • each switch has a flow entry corresponding to the data to be forwarded, thereby avoiding sending redundant messages or even causing logic errors and preventing data forwarding processes from being erroneous.
  • FIG. 3 is a schematic diagram of Embodiment 2 of a method for delivering a flow entry according to the present application.
  • the network structure in Figure 3 is the same as Figure 1.
  • the signaling interaction process between the devices in the network is as shown in FIG. 3, including:
  • Step 302 The controller 10 generates a first data packet including a plurality of flow entry items and a first control instruction, and sends the first data packet to the target switch 30 in the forwarding path.
  • FIG. 4 is a schematic diagram of Embodiment 3 of a method for delivering a flow entry according to the present application.
  • the forwarding path in Figure 4 involves three switches. In actual applications, the number of switches involved in the forwarding path may be more. In this embodiment, only three switches are used for illustration.
  • the data to be forwarded still needs to be sent from the terminal 40 to the terminal 50.
  • the switch 20 is still directly connected to the terminal 40, and the switch 30 is still directly connected to the terminal 50.
  • the signaling interaction process between the devices in the network is as shown in FIG. 4, including:
  • Step 401 The switch 20 sends a data packet entry message to the switch 60.
  • Step 402 The switch 60 forwards the data packet entry message to the controller 10;
  • Step 403 The controller 10 generates a first data packet including a plurality of flow entry entries and a first control command, and sends the first data packet to the target switch 30 in the forwarding path.
  • Step 404 After receiving the first data packet, the switch 30 parses out the flow entry and the control command corresponding to the IP address of the switch 30, and saves the flow entry; and the flow entries of the remaining switches 20 and 60 And the first control instruction is encapsulated into a second data packet and sent to the switch 60.
  • Step 405 After receiving the second data packet, the switch 60 identifies the flow entry corresponding to the IP address of the switch, and encapsulates the flow entry of the remaining switch 20 and the first control command into the second data packet. Sent to switch 20.
  • the switch 20 After receiving the second data packet, the switch 20 identifies and saves the flow entry corresponding to its own IP address, and then forwards the forwarded data.
  • FIG. 5 is a schematic diagram of Embodiment 4 of a method for delivering a flow entry according to the present application.
  • the network structure of Figure 5 and Figure 4 is basically the same, except that there is no control signaling transmission link between the switch 30 and the controller 10 in Figure 5.
  • the signaling interaction process between the devices in the network is as shown in FIG. 5, including:
  • Step 501 The switch 20 sends a data packet entry message to the switch 60.
  • Step 502 The switch 60 forwards the data packet entry message to the controller 10;
  • Step 504 After receiving the first data packet, the switch 60 forwards the first data packet to the switch 30.
  • Step 505 After receiving the first data packet, the switch 30 parses out the flow entry and the control command corresponding to the IP address of the switch 30, and saves the flow entry; and the flow entries of the remaining switches 20 and 60 And the first control instruction is encapsulated into a second data packet and sent to the switch 60.
  • Step 506 After receiving the second data packet, the switch 60 identifies the flow entry corresponding to the IP address of the switch, and then encapsulates the flow entry of the remaining switch 20 and the first control command into the second data packet, and sends the To switch 20.
  • the switch 20 After receiving the second data packet, the switch 20 identifies and saves the flow entry corresponding to its own IP address, and then forwards the forwarded data.
  • FIG. 6 is a flowchart of another embodiment of a method for delivering a flow entry according to the present application. As shown in FIG. 6, the method may include:
  • Step 601 The Mth switch receives the Mth command data packet, where the Mth command data packet includes at least a first to a Mth total M flow entry and a second to a Mth common M- a control command, wherein the Mth switch is the Mth hop switch in the forwarding path, 1 ⁇ MN, and the forwarding path is a path determined by the controller for forwarding data to be forwarded, where the forwarding path is
  • the N switch includes a switch, and the control command corresponding to the Mth switch is the Mth control command, and the flow entry corresponding to the Mth switch is the Mth flow entry.
  • Step 602 Save the Mth flow entry.
  • Step 603 Execute the Mth control instruction, and encapsulate other flow entries and control instructions except the Mth flow entry and the Mth control command in the Mth command data packet. Sending the M-1th command data packet to the M-1th switch, so that the M-1th switch according to the M-1th control instruction in the M-1th command data packet The delivery of the remaining M-1 flow entries in the forwarding path is completed, and the M-1th switch is a previous hop switch of the Mth switch in the forwarding path.
  • the forwarding path is a path that is determined by the controller and used to forward data to be forwarded.
  • the application also discloses a controller.
  • Figure 7 is a block diagram of an embodiment of a controller of the application. As shown in FIG. 7, the controller may include:
  • the receiving unit 701 is configured to receive a data packet entry message sent by the source switch.
  • the processing unit 702 is configured to determine a forwarding path according to the data packet entry message.
  • the processing unit 702 is further configured to generate a corresponding flow entry for each of the N switches in the forwarding path, where the first switch of the N switches is a source switch, and the Nth switch is The destination switch of the forwarding path, the Mth switch is the Mth hop switch in the forwarding path, 1 ⁇ M ⁇ N, and the flow entry corresponding to the Mth switch is the Mth flow table Item
  • the processing unit 702 is further configured to generate a corresponding control command for each of the N-1 switches except the source switch in the forwarding path, where the control command corresponding to the Mth switch is the Mth Control instructions;
  • the encapsulating unit 703 is configured to encapsulate the generated N flow entries and N-1 control commands into the first
  • the sending unit 704 is configured to send the Nth command data packet to the Nth switch, where the Mth control command in the Mth command data packet is used to indicate that the Mth switch saves the Mth a flow entry, and encapsulating, in the Mth command data packet, the flow entry and the control instruction other than the Mth flow entry and the Mth control instruction into the M-1th command Sending the data packet to the M-1th switch, so that the M-1th switch completes the remaining in the forwarding path according to the M-1th control instruction in the M-1th command data packet.
  • the delivery of the M-1 flow entries, the M-1th switch is the previous hop switch of the Mth switch in the forwarding path.
  • the controller in this embodiment can ensure that each switch has a flow entry corresponding to the to-be-forwarded data when forwarding the data to be forwarded, thereby preventing the corresponding device from sending redundant messages or even logical errors. Prevent errors in the data forwarding process.
  • the sending unit 704 may specifically include:
  • a first sending subunit configured to directly send the Nth command data packet to the first forwarding path when a control signaling transmission link exists between the controller and the Nth switch Target switch
  • a second sending subunit configured to send, by the source switch, the Nth command data packet to the device when there is no control signaling transmission link between the controller and the Nth switch The Nth switch.
  • the processing unit 702 may specifically include:
  • a first determining subunit configured to determine the M-1th switch
  • a second determining subunit configured to determine address information of the M-1th switch
  • FIG. 8 is a block diagram of an embodiment of a switch applied for. As shown in FIG. 8, the switch may include:
  • the receiving unit 801 is configured to receive the Mth command data packet, where the Mth command data packet includes at least a first to a Mth total M flow entry and a second to a Mth common M-1
  • the control command wherein the switch is the Mth switch, the Mth switch is the Mth hop switch in the forwarding path, 1 ⁇ MN, and the forwarding path is determined by the controller to forward the data to be forwarded.
  • the path includes: the N switches, the control command corresponding to the Mth switch is the Mth control command, and the flow entry corresponding to the Mth switch is the Mth flow entry;
  • the unit 802 is configured to save the Mth flow entry.
  • a sending unit 803 configured to execute the Mth control instruction, and add, in the Mth command data packet, other flow entries except the Mth flow entry and the Mth control command
  • the control instruction is encapsulated into the M-1th command data packet and sent to the M-1th switch, so that the M-1th switch according to the M-1th in the M-1th command data packet
  • the control command completes the delivery of the remaining M-1 flow entries in the forwarding path, where the M-1th switch is the previous hop switch of the Mth switch in the forwarding path;
  • the forwarding path is a path that is determined by the controller and used to forward data to be forwarded.
  • the switch in this embodiment can ensure that each switch has a flow entry corresponding to the data to be forwarded when forwarding the data to be forwarded, thereby preventing the corresponding device from sending redundant messages and even causing logic errors to prevent There was an error in the data forwarding process.
  • the receiving unit 801 may specifically include:
  • a first receiving subunit configured to: when the Mth switch is a target switch in the forwarding path, the Mth switch receives the Mth command data packet sent by a controller;
  • the embodiment of the present application further provides a computing node, which may be a host server including computing power, or a personal computer PC, or a portable computer or terminal, etc., and the specific embodiment of the present application is not correct.
  • the specific implementation of the compute node is limited.
  • FIG. 9 is a structural diagram of a computing node of the present application.
  • the compute node 700 includes a processor 710, a Communications Interface 720, a memory 730, and a bus 740.
  • the processor 710, the communication interface 720, and the memory 730 complete communication with each other via the bus 740.
  • the processor 710 is configured to execute the program 732.
  • program 732 can include program code, the program code including computer operating instructions.
  • the processor 710 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
  • ASIC Application Specific Integrated Circuit
  • the memory 730 is configured to store the program 732.
  • Memory 730 may contain high speed RAM memory and may also include non-volatile memory, such as at least one disk storage crying port.
  • the processor 710 When the compute node is running, the processor 710 is in communication with the memory 730, and the processor 710 executes the program 732 to cause the compute node to perform the following method:
  • the N switches complete the delivery of the N flow entries in the forwarding path according to the Nth control command in the Nth command data packet;
  • the Mth control command in the Mth command data packet is used to indicate the Mth switch, save the Mth flow entry, and remove the Mth flow table from the Mth command data packet.
  • the other flow entry and control command other than the Mth control command are encapsulated into the M-1th command data packet and sent to the M-1th switch, so that the M-1th switch is configured according to the
  • the M-1 control instruction in the M-1 command data packet completes the delivery of the remaining M-1 flow entries in the forwarding path, where the M-1th switch is the forwarding The previous hop switch of the Mth switch in the path.
  • the processor 710 executes the program 732, so that the computing node performs the following method: receiving the Mth command data packet, where the Mth command data packet includes at least the first to the Mth total M flow entries and the second Up to the Mth M-1 control commands, wherein the Mth switch is the Mth hop switch in the forwarding path, 1 ⁇ MN, and the forwarding path is determined by the controller for forwarding data to be forwarded.
  • the forwarding path includes N switches, and the control command corresponding to the Mth switch is the Mth control command, and the flow entry corresponding to the Mth switch is the Mth flow entry;
  • Executing the Mth control instruction, and encapsulating, in the Mth command data packet, the flow entry and the control command except the Mth flow entry and the Mth control instruction into the Mth -1 command packet is sent to the M-1th switch, so that the M-1th switch completes the M-1 control instruction according to the M-1th command packet in the M-1th command packet.
  • the steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented directly in hardware, a software module executed by a processor, or a combination of both.
  • the software module can be placed in random access memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field. Any other form of storage medium known.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种流表项下发方法及装置。所述方法包括:控制器接收源交换机发送的数据包进入消息;根据所述数据包进入消息,确定转发路径;对于所述转发路径中的N个交换机,分别生成对应的流表项;对于所述转发路径中除所述源交换机之外的N-1个交换机,分别生成一个对应的控制指令;将生成的N个所述流表项和N-1个控制指令封装成第N个命令数据包;将所述第N个命令数据包发送至所述第N个交换机。采用本发明的方法或装置,可以确保在转发待转发数据时,各个交换机都具有与该待转发数据相对应的流表项,进而可以避免发送冗余消息,甚至出现逻辑错误,防止数据转发过程出错。

Description

一种流表项的下发方法及装置 技术领域
本发明涉及网络通信技术领域, 尤其涉及一种流表项的下发方法及装置。 背景技术
随着大数据时代的到来, 用户对于网络的数据传输能力有了更高的要求。 传统的数据传输网络中, 主要采用交换机(Switch ) 负责数据的转发。 交 换机接收到上一级设备发送的数据后,由该交换机自身确定对于该数据的转发 路径, 再按照该转发路径将该数据转发至下一级设备。 但是, 上述转发方式由 于每个交换机都需要执行对于转发路径的确定步骤,所以整个数据转发过程中 交换机需要处理的数据量较大。 此外, 由于各个交换机在确定转发路径时, 无 法获知网络的整体拓朴结构, 所以确定出来的转发路径也不是最优的转发路 径。
为此,现有技术中提出了一种开放数据流( Open Flow )技术。在 Open Flow 技术中,采用了一台控制器(Controller )对一个网络中的全部交换机进行控制。 交换机只负责数据的转发。转发路径由控制机确定。 由于控制机可以获知网络 的整体拓朴结构, 所以可以确定出更优的转发路径。 并且, 由于确定转发路径 的步骤由控制机执行, 所以可以减少交换机的工作量,提高交换机的数据转发 效率。
Open Flow技术中, 控制机在确定出数据的转发路径后, 需要将转发路径 以控制指令的方式下发给转发路径中所涉及到的交换机。图 1为现有技术中下 发控制指令的示意图。如图 1所示,当终端 40通过网络向终端 50发送数据时, 终端 40将需要发送的数据先发送至交换机 20; 交换机 20接收到终端 40发送 的数据后, 需要向控制机 10发送数据包进入(Packet in ) 消息 01 ; 控制机 10 收到 Packet in消息后, 为需要发送的数据确定转发路径后, 可以发送流表修 改命令 ( Flow mod )生成流表项, Flow mod中包含有转发路径信息;再将 Flow mod以数据包输出 (Packet out ) 消息的形式发送给在转发路径中涉及到的全 部交换机。 在图 1中, 转发路径中涉及到的全部交换机为交换机 01和交换机 02。控制机 10分别向交换机 20和交换机 30发送数据包输出消息 02和数据包 输出消息 03。 由于不同的网络连接之间, 通常存在不同的延时, 所以并不能 确保数据包输出消息 02和数据包输出消息 03同时发送到交换机 20和交换机 30。 当交换机 30与控制机 10之间的延时较高时, 交换机 30收到数据包输出 消息 03的时间会晚于交换机 20收到数据包输出消息 02的时间。 然而交换机 20只要接收到数据包输出消息 02, 就会立刻将数据发送给交换机 30。 此时, 由于交换机 30并没有接收到数据包输出消息 03 , 无法确定对于接收到的数据 的转发路径, 所以交换机 30还会向控制机 10发送数据包进入消息 04, 控制 机 10接收到数据包进入消息 04后, 还会再次向交换机 30发送一个数据包输 出消息 (图 1中未示出)。
由上述可知, 一旦控制机 10向交换机 30下发的数据包输出消息 03产生 延时, 则交换机 30需要额外发送一次数据包进入消息 04, 并且控制机 10还 会额外向交换机 30发送一个数据包输出消息。 这两条消息是冗余的, 会增加 控制机和交换机需要处理的数据量。此外,控制机 10额外向交换机 30发送的 数据包输出消息中的转发路径, 与经过延时后到达交换机 30的数据包输出消 息 03中的转发路径,还可能是不一致的。此时,交换机 30还会出现逻辑错误, 无法正确完成数据转发。
综上所述,现有技术中的转发路径中的流表项下发方法,一旦在下发过程 中出现延时, 则会导致相应的设备发送冗余消息, 甚至出现逻辑错误, 导致数 据转发过程出错。 发明内容
有鉴于此, 本发明提供一种流表项的下发方法及装置, 以解决在转发路径 中下发流表项的过程中出现延时导致设备发送冗余消息甚至数据转发过程出 错的问题。 其具体方案如下:
根据本申请的第一方面的第一种可能的实现方式,本申请提供一种流表项 下发方法, 所述方法包括:
控制器接收源交换机发送的数据包进入消息;
根据所述数据包进入消息, 确定转发路径;
对于所述转发路径中的 N个交换机, 分别生成对应的流表项, 其中, 所 述 N个交换机中的第 1个交换机为源交换机, 第 N个交换机为所述转发路径 的目标交换机,第 M个交换机为所述转发路径中的第 M跳交换机, 1 < M < N, 所述第 M个交换机对应的流表项为第 M个流表项;
对于所述转发路径中除所述源交换机之外的 N-1个交换机,分别生成一个 对应的控制指令, 所述第 M个交换机对应的控制指令为第 M个控制指令; 将生成的 N个所述流表项和 N-1个控制指令封装成第 N个命令数据包; 将所述第 N个命令数据包发送至所述第 N个交换机, 以使所述第 N个交 换机根据所述第 N个命令数据包中的所述第 N个控制指令完成所述转发路径 中所述 N个流表项的传递;
其中, 第 M个命令数据包中的第 M个控制指令用于指示第 M个交换机, 保存第 M个流表项, 并将所述第 M个命令数据包中除所述第 M个流表项和 所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个命令数据 包发送至第 M-1个交换机, 以使所述第 M-1个交换机根据所述第 M-1个命令 数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个流表项 的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交换机的前一跳 交换机。
结合第一方面的第二种可能的实现方式, 所述将所述第 N个命令数据包 发送至所述第 N个交换机, 具体包括:
当所述控制器与所述第 N个交换机之间存在控制信令传输链路时, 直接 将所述第 N个命令数据包发送至所述第 N个交换机;
当所述控制器与所述第 N个交换机之间不存在控制信令传输链路时, 通 过所述源交换机将所述第 N个命令数据包发送至所述第 N个交换机。
结合第一方面的两种可能的实现方式中的任意一种, 所述第 M个控制指 令生成的方法, 具体包括:
确定所述第 M-1个交换机;
确定所述第 M-1个交换机的地址信息;
确定所述第 M个交换机向所述第 M-1个交换机发送所述第 M个命令数据 包时采用的端口;
生成包括所述第 M-1 个交换机的地址信息以及所述端口的信息的所述第 M个控制指令, 以便所述第 M个交换机根据所述第 M个控制指令将所述第 M-1 个交换机的地址信息封装在所述第 M-1个命令数据包内, 通过所述端口 将所述第 M-1个命令数据包发送至所述第 M-1个交换机。 根据本申请的第二方面的第一种可能的实现方式,本申请提供一种流表项 下发方法, 所述方法包括:
第 M个交换机接收第 M个命令数据包, 所述第 M个命令数据包中至少 包括第 1个至第 M个共 M个流表项和第 2个至第 M个共 M-1个控制指令, 其中, 所述第 M个交换机为转发路径中的第 M跳交换机, 1 < M N, 所述转 发路径为控制器确定的用于转发待转发数据的路径, 所述转发路径中包括 N 个交换机, 所述第 M个交换机对应的控制指令为第 M个控制指令, 所述第 M 个交换机对应的流表项为第 M个流表项;
保存所述第 M个流表项;
执行所述第 M个控制指令, 将所述第 M个命令数据包中除所述第 M个 流表项和所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个 命令数据包发送至第 M-1个交换机,以使所述第 M-1个交换机根据所述第 M-1 个命令数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个 流表项的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交换机的 前一跳交换机。
结合第二方面的第二种可能的实现方式, 所述第 M个交换机接收第 M个 命令数据包, 具体包括:
当所述第 M个交换机为所述转发路径中的目标交换机时, 所述第 M个交 换机接收所述控制器发送的所述第 M个命令数据包;
当所述第 M个交换机不是所述转发路径中的目标交换机时, 所述第 M个 交换机接收第 M+1个交换机发送的所述第 M个数据包, 所述第 M+1个交换 机为所述转发路径中所述第 M个交换机的下一跳交换机。 根据本申请的第三方面的第一种可能的实现方式, 本申请提供一种控制 器, 所述控制器包括: 接收单元, 用于接收源交换机发送的数据包进入消息;
处理单元, 用于根据所述数据包进入消息, 确定转发路径;
所述处理单元, 还用于对于所述转发路径中的 Ν个交换机, 分别生成对 应的流表项, 其中, 所述 Ν个交换机中的第 1个交换机为源交换机, 第 Ν个 交换机为所述转发路径的目标交换机, 第 Μ个交换机为所述转发路径中的第 Μ跳交换机, 1 < Μ < Ν, 所述第 Μ个交换机对应的流表项为第 Μ 个流表项; 所述处理单元, 还用于对于所述转发路径中除所述源交换机之外的 N-1 个交换机, 分别生成一个对应的控制指令, 所述第 Μ个交换机对应的控制指 令为第 Μ个控制指令;
封装单元, 用于将生成的 Ν个所述流表项和 N-1个控制指令封装成第 Ν 个命令数据包;
发送单元, 用于将所述第 Ν个命令数据包发送至所述第 Ν个交换机; 其中, 第 Μ个命令数据包中的第 Μ个控制指令用于指示第 Μ个交换机 保存第 Μ个流表项, 并将所述第 Μ个命令数据包中除所述第 Μ个流表项和 所述第 Μ个控制指令之外的其他流表项和控制指令封装成第 M-1个命令数据 包发送至第 M-1个交换机, 以使所述第 M-1个交换机根据所述第 M-1个命令 数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个流表项 的传递, 所述第 M-1个交换机为所述转发路径中所述第 Μ个交换机的前一跳 交换机。
结合第三方面的第二种可能的实现方式, 所述发送单元, 具体包括: 第一发送子单元, 用于当所述控制器与所述第 Ν个交换机之间存在控制 信令传输链路时, 直接将所述第 Ν个命令数据包发送至所述第一转发路径中 的目标交换机;
第二发送子单元, 用于当所述控制器与所述第 Ν个交换机之间不存在控 制信令传输链路时, 通过所述源交换机将所述第 Ν个命令数据包发送至所述 第 Ν个交换机。
结合第三方面的两种可能的实现方式中的任意一种, 所述处理单元, 具体 包括:
第一确定子单元, 用于确定所述第 M-1个交换机; 第二确定子单元, 用于确定所述第 M-1个交换机的地址信息; 第三确定子单元, 用于确定所述第 M个交换机向所述第 M-1个交换机发 送所述第 M个命令数据包时采用的端口;
第一控制指令生成子单元, 用于生成包括所述第 M-1 个交换机的地址信 息以及所述端口的信息的所述第 M个控制指令, 以便所述第 M个交换机根据 所述第 M个控制指令将所述第 M-1个交换机的地址信息封装在所述第 M-1个 命令数据包内, 通过所述端口将所述第 M-1 个命令数据包发送至所述第 M-1 个交换机。 根据本申请的第四方面的第一种可能的实现方式, 本申请提供一种交换 机, 所述交换机包括:
接收单元, 用于接收第 M个命令数据包, 所述第 M个命令数据包中至少 包括第 1个至第 M个共 M个流表项和第 2个至第 M个共 M-1个控制指令, 其中, 所述交换机为第 M个交换机, 所述第 M个交换机为转发路径中的第 M 跳交换机, 1 < M < N,所述转发路径为控制器确定的用于转发待转发数据的路 径, 所述转发路径中包括 N个交换机, 所述第 M个交换机对应的控制指令为 第 M个控制指令, 所述第 M个交换机对应的流表项为第 M个流表项;
处理单元, 用于保存所述第 M个流表项;
发送单元, 用于执行所述第 M个控制指令, 将所述第 M个命令数据包中 除所述第 M个流表项和所述第 M个控制指令之外的其他流表项和控制指令封 装成第 M-1个命令数据包发送至第 M-1个交换机, 以使所述第 M-1个交换机 根据所述第 M-1个命令数据包中的所述第 M-1个控制指令完成所述转发路径 中剩余的 M-1个流表项的传递, 所述第 M-1个交换机为所述转发路径中所述 第 M个交换机的前一跳交换机。
结合第四方面的第二种可能的实现方式, 所述接收单元, 具体包括: 第一接收子单元, 用于当所述第 M个交换机为所述转发路径中的目标交 换机时, 所述第 M个交换机接收控制器发送的所述第 M个命令数据包;
第二接收子单元, 用于当所述第 M个交换机不是所述转发路径中的目标 交换机时, 所述第 M个交换机接收第 M+1个交换机发送的所述第 M个数据 包,所述第 M+l个交换机为所述转发路径中所述第 M个交换机的下一跳交换 机。 根据本申请的第五方面的第一种可能的实现方式,本申请提供一种计算节 点, 包括: 处理器, 通信接口, 存储器和总线;
所述处理器,所述通信接口,所述存储器通过所述总线完成相互间的通信; 所述处理器, 用于执行程序;
所述存储器, 用于存放所述程序;
当所述计算节点运行时, 所述处理器与所述存储器通信, 所述处理器执行 所述程序所述计算节点执行如下方法 :
接收源交换机发送的数据包进入消息;
根据所述数据包进入消息, 确定转发路径;
对于所述转发路径中的 N个交换机, 分别生成对应的流表项, 其中, 所 述 N个交换机中的第 1个交换机为源交换机, 第 N个交换机为所述转发路径 的目标交换机,第 M个交换机为所述转发路径中的第 M跳交换机, 1 < M < N, 所述第 M个交换机对应的流表项为第 M 个流表项;
对于所述转发路径中除所述源交换机之外的 N-1个交换机,分别生成一个 对应的控制指令, 所述第 M个交换机对应的控制指令为第 M 个控制指令; 将所述生成的 N个流表项和 N-1个控制指令封装成第 N个命令数据包; 将所述第 N个命令数据包发送至所述第 N个交换机, 以使所述第 N个交 换机根据所述第 N个命令数据包中的所述第 N个控制指令完成所述转发路径 中所述 N个流表项的传递;
其中, 第 M个命令数据包中的第 M个控制指令用于指示第 M个交换机, 保存第 M个流表项, 并将所述第 M个命令数据包中除所述第 M个流表项和 所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个命令数据 包发送至第 M-1个交换机, 以使所述第 M-1个交换机根据所述第 M-1个命令 数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个流表项 的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交换机的前一跳 交换机; 或者所述处理器执行所述程序所述计算节点执行如下方法 :
接收第 M个命令数据包, 所述第 M个命令数据包中至少包括第 1个至第
M个共 M个流表项和第 2个至第 M个共 M-1个控制指令, 其中, 所述第 M 个交换机为转发路径中的第 M跳交换机, 1 < M N, 所述转发路径为控制器 确定的用于转发待转发数据的路径, 所述转发路径中包括 N个交换机, 所述 第 M个交换机对应的控制指令为第 M个控制指令, 所述第 M个交换机对应 的流表项为第 M 个流表项;
保存所述第 M个流表项;
执行所述第 M个控制指令, 将所述第 M个命令数据包中除所述第 M个 流表项和所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个 命令数据包发送至第 M-1个交换机,以使所述第 M-1个交换机根据所述第 M-1 个命令数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个 流表项的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交换机的 前一跳交换机。 从上述的技术方案可以看出, 本申请实施例的流表项下发方法及装置, 通 过生成控制指令,控制相应的交换机识别并保存所接收的命令数据包中与自身 对应的流表项后,将命令数据包中与另外的交换机对应的流表项和控制指令封 装成新的命令数据包发送至转发路径中的前一跳交换机,可以将流表项以及对 应的控制指令按照待转发数据的转发顺序的相反顺序,依次发送至转发路径中 的各个交换机, 由于每个交换机在保存与自身对应的流表项后, 才会将命令数 据包中剩余的内容以新的命令数据包的方式发送到前一跳交换机, 因此, 可以 确保在转发待转发数据时, 各个交换机都具有与该待转发数据相对应的流表 项,进而可以避免发送冗余消息,甚至出现逻辑错误,防止数据转发过程出错。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲,在不付 出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为现有技术中下发控制指令的示意图;
图 2为本申请的流表项下发方法实施例 1的流程图;
图 3为本申请的流表项下发方法实施例 2的示意图;
图 4为本申请的流表项下发方法实施例 3的示意图;
图 5为本申请的流表项下发方法实施例 4的示意图;
图 6为本申请的另一种流表项下发方法实施例的流程图;
图 7为申请的控制机实施例的结构图;
图 8为申请的交换机实施例的结构图;
图 9为本申请的计算节点的结构图。 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有做出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。 图 2为本申请的流表项下发方法实施例 1的流程图。如图 2所示, 该方法 可以包括:
步骤 101 : 控制器接收源交换机发送的数据包进入消息;
所述源交换机在接收到终端 (host )发送的待转发数据后, 可以向控制器 发送数据包进入消息。所述数据包进入消息表示所述源交换机接收到了终端发 送的待转发数据, 需要控制器确定对于待转发数据的转发路径。
在 Open Flow技术中,所述数据包进入消息可以采用 packet in的格式封装。 步骤 102: 根据所述数据包进入消息, 确定转发路径;
所述转发路径可以是转发待转发数据的路由,后续网络中的交换机可以按 照该路由依次转发所述待转发数据。
所述转发路径包括待转发数据在转发过程中涉及到的交换机以及所述待 转发数据在所述交换机之间进行转发的第一顺序; 确定转发路径的方式可以采用现有技术, 此处不再贅述。
步骤 103: 对于所述转发路径中的 N个交换机, 分别生成对应的流表项, 其中, 所述 N个交换机中的第 1个交换机为源交换机, 第 N个交换机为所述 转发路径的目标交换机, 第 M个交换机为所述转发路径中的第 M跳交换机, 1 < M < N, 所述第 M个交换机对应的流表项为第 M个流表项;
所述流表项用于指示对应的交换机在转发所述待转发数据时采用的端口。 在 Open Flow技术中,控制器可以为所述转发路径中的各个交换机, 分别 生成对应的流表项 ( flow mod )。 交换机接收到所述流表项后, 可以将所述流 表项添加到对应的流表( flow table )中。 后续该交换机在接收到前一跳交换机 发送的待转发数据后, 可以根据所述流表项,确定采用哪个端口将待转发数据 发送出去。 因为不同的端口与不同的交换机相连, 所以采用流表项中指定的端 口可以将待转发数据发送到转发路径中对应的交换机。各个交换机按照自身存 储的流表项转发所述待转发数据 ,最终可以将所述待转发数据按照转发路径发 送到目标终端。
步骤 104: 对于所述转发路径中除所述源交换机之外的 N-1个交换机, 分 别生成一个对应的控制指令, 所述第 M个交换机对应的控制指令为第 M个控 制指令;
具体的,全部流表项以及控制指令在步骤 105中可以整体被封装成一个命 令数据包。
其中, 第 M个命令数据包中的第 M个控制指令用于指示第 M个交换机, 保存第 M个流表项, 并将所述第 M个命令数据包中除所述第 M个流表项和 所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个命令数据 包发送至第 M-1个交换机, 以使所述第 M-1个交换机根据所述第 M-1个命令 数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个流表项 的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交换机的前一跳 交换机
所述控制指令可以包含对应的交换机的地址信息。所述地址信息具体可以 是 IP信息。 假设交换机 A接收到第一数据包后, 可以从全部的控制指令中识 别出与自身的 IP地址相同的第一控制指令, 并执行。 执行该第一控制指令的 过程具体可以包括:
将与交换机 A对应的流表项, 添加到对应的流表中进行保存。 从所述第 一数据包中将交换机 A执行过的第一控制指令以及对应的流表项删除, 将剩 余的与另外的交换机对应的所述流表项和所述第一控制指令封装成第二数据 包发送至下一个交换机(即第三交换机)。
结合上述内容, 可以明确所述生成第 M个控制指令, 具体可以包括: 确定所述第 M-1个交换机;
确定所述第 M-1个交换机的地址信息;
确定所述第 M个交换机向所述第 M-1个交换机发送所述第 M个命令数据 包时采用的端口;
生成包括所述第 M-1 个交换机的地址信息以及所述端口的信息的所述第 M个控制指令, 以便所述第 M个交换机根据所述第 M个控制指令将所述第 M-1 个交换机的地址信息封装在所述第 M-1个命令数据包内, 通过所述端口 将所述第 M-1个命令数据包发送至所述第 M-1个交换机。
需要说明的是, 所述命令数据包在交换机中的传输顺序, 与待转发数据在 交换机中的传输顺序是相反的。
步骤 105: 将所述生成的 N个流表项和 N-1个控制指令封装成第 N个命 令数据包;
在 Open Flow技术中, 所述命令数据包可以采用 packet out的格式封装。 步骤 106: 将第 N个所述命令数据包发送至所述第 N个交换机, 以使所 述第 N个交换机根据所述第 N个命令数据包中的所述第 N个控制指令完成所 述转发路径中所述 N个流表项的传递;
由于所述命令数据包在交换机之间的转发顺序与待转发数据在所述转发 路径中的转发顺序相反。 因此, 控制器需要将所述第 N个命令数据包发送至 所述转发路径中的目标交换机。所述目标交换机即待转发数据在所述转发路径 中按照转发顺序被发送到的最后一个交换机。
实际应用中,所述控制器与所述目标交换机之间可能存在控制信令传输链 路, 也可能不存在控制信令传输链路。
当所述控制器与所述目标交换机之间存在控制信令传输链路时,可以直接 将所述数据包发送至所述转发路径中的目标交换机;
当所述控制器与所述目标交换机之间不存在控制信令传输链路时,可以通 过所述源交换机将所述数据包发送至所述转发路径中的目标交换机。
具体的,通过所述源交换机将所述数据包发送至所述转发路径中的目标交 换机可以采用下述方式: 所述源交换机将所述第 N个命令数据包发送至所述 转发路径中所述源交换机的下一跳交换机,所述下一跳交换机在接收到该命令 数据包后,再将该命令数据包转发到再下一跳的交换机, 直至转发至所述目标 交换机为止。
综上所述, 本实施例中, 通过生成控制指令, 控制相应的交换机识别并保 存所接收的命令数据包中与自身对应的流表项后,将命令数据包中与另外的交 换机对应的流表项和控制指令封装成新的命令数据包发送至转发路径中的前 一跳交换机,可以将流表项以及对应的控制指令按照待转发数据的转发顺序的 相反顺序,依次发送至转发路径中的各个交换机, 由于每个交换机在保存与自 身对应的流表项后,才会将命令数据包中剩余的内容以新的命令数据包的方式 发送到前一跳交换机, 因此, 可以确保在转发待转发数据时, 各个交换机都具 有与该待转发数据相对应的流表项, 进而可以避免发送冗余消息,甚至出现逻 辑错误, 防止数据转发过程出错。
另一方面,由于转发路径中除去起始交换机的各个交换机在接收到待转发 数据时,都具有与该待转发数据相对应的流表项, 因此不会触发交换机向控制 器发送数据包进入消息,也就避免了在转发路径下发过程中出现延时导致设备 发送冗余消息的问题。 图 3为本申请的流表项下发方法实施例 2的示意图。图 3中的网络结构与 图 1相同。采用本申请的流表项下发方法后, 网络中的各个设备之间的信令交 互过程如图 3所示, 包括:
步骤 301 : 交换机 20向控制器 10发送数据包进入消息;
步骤 302: 控制器 10生成包括多个流表项和第一控制指令的第一数据包, 将所述第一数据包发送至转发路径中的目标交换机 30; 步骤 303: 交换机 30接收到第一数据包后, 从中解析出与交换机 30的 IP 地址相对应的流表项和控制指令, 保存所述流表项; 将剩余的交换机 20的流 表项和第一控制指令封装成第二数据包, 发送至交换机 20。
交换机 20收到第二数据包后,识别并保存与自身的 IP地址相对应的流表 项后, 就可以对待转发数据进行转发。
可以看出, 本实施例中, 由于交换机 20在获取到对应的流表项之前, 不 会转发所述待转发数据,所以即使控制器 10向交换机 30发送第一数据包时有 延时, 也不会导致交换机 20发送的待转发数据到达交换机 30时, 交换机 30 还没有接收到对应的流表项的情况出现, 因此, 可以确保数据转发过程有序进 行。 图 4为本申请的流表项下发方法实施例 3的示意图。图 4中的转发路径涉 及 3个交换机。 在实际应用中, 转发路径涉及的交换机的数目还可以更多, 本 实施例中只是以 3个交换机的情况进行举例说明。本实施例中,待转发数据仍 然需要从终端 40发送至终端 50。 与终端 40直接相连的仍然是交换机 20, 与 终端 50直接相连的仍然是交换机 30。 采用本申请的流表项下发方法后,网络中的各个设备之间的信令交互过程 如图 4所示, 包括:
步骤 401: 交换机 20向交换机 60发送数据包进入消息;
由于交换机 20与控制器 10之间不存在控制信令传输链路,所以需要将数 据包进入消息发送给交换机 60。 再由交换机 60将数据包进入消息发送给控制 器 10。
步骤 402: 交换机 60向控制器 10转发所述数据包进入消息;
步骤 403: 控制器 10生成包括多个流表项和第一控制指令的第一数据包, 将所述第一数据包发送至转发路径中的目标交换机 30;
步骤 404: 交换机 30接收到第一数据包后, 从中解析出与交换机 30的 IP 地址相对应的流表项和控制指令, 保存所述流表项; 将剩余的交换机 20和 60 的流表项和第一控制指令封装成第二数据包, 发送至交换机 60。
步骤 405: 交换机 60收到第二数据包后, 识别出于自身的 IP地址相对应 的流表项后,将剩余的交换机 20的流表项和第一控制指令封装成第二数据包, 发送至交换机 20。
交换机 20收到第二数据包后,识别并保存与自身的 IP地址相对应的流表 项后, 就可以对待转发数据进行转发。
本实施例中, 由于交换机 30与控制器 10之间存在控制信令传输链路, 所 以步骤 404中, 控制器 10可以将第一数据包直接发送至目标交换机 30。 图 5为本申请的流表项下发方法实施例 4的示意图。图 5与图 4的网络结 构基本相同,区别在于图 5中交换机 30与控制器 10之间不存在控制信令传输 链路。 采用本申请的流表项下发方法后,网络中的各个设备之间的信令交互过程 如图 5所示, 包括:
步骤 501: 交换机 20向交换机 60发送数据包进入消息;
由于交换机 20与控制器 10之间不存在控制信令传输链路,所以需要将数 据包进入消息发送给交换机 60。 再由交换机 60将数据包进入消息发送给控制 器 10。
步骤 502: 交换机 60向控制器 10转发所述数据包进入消息;
步骤 503: 控制器 10生成包括多个流表项和第一控制指令的第一数据包, 将所述第一数据包发送至交换机 60, 以便通过交换机 60发送至转发路径中的 目标交换机 30;
步骤 504: 交换机 60接收到所述第一数据包后, 将所述第一数据包转发 至交换机 30;
步骤 505: 交换机 30接收到第一数据包后, 从中解析出与交换机 30的 IP 地址相对应的流表项和控制指令, 保存所述流表项; 将剩余的交换机 20和 60 的流表项和第一控制指令封装成第二数据包, 发送至交换机 60。
步骤 506: 交换机 60收到第二数据包后, 识别出于自身的 IP地址相对应 的流表项后,将剩余的交换机 20的流表项和第一控制指令封装成第二数据包, 发送至交换机 20。
交换机 20收到第二数据包后,识别并保存与自身的 IP地址相对应的流表 项后, 就可以对待转发数据进行转发。
本实施例中, 由于交换机 30与控制器 10之间不存在控制信令传输链路, 所以步骤 503中, 控制器 10可以将第一数据包发送至交换机 60, 以便通过交 换机 60发送至目标交换机 30。 与前述流表项下发方法相对应, 本申请还公开了另一种流表项下发方法。 该方法的执行主体为转发路径中的交换机。图 6为本申请的另一种流表项下发 方法实施例的流程图。 如图 6所示, 该方法可以包括:
步骤 601 : 第 M个交换机接收第 M个命令数据包, 所述第 M个命令数据 包中至少包括第 1个至第 M个共 M个流表项和第 2个至第 M个共 M-1个控 制指令,其中,所述第 M个交换机为转发路径中的第 M跳交换机, 1 < M N, 所述转发路径为控制器确定的用于转发待转发数据的路径,所述转发路径中包 括 N个交换机, 所述第 M个交换机对应的控制指令为第 M个控制指令, 所述 第 M个交换机对应的流表项为第 M个流表项;
步骤 602: 保存所述第 M个流表项;
步骤 603: 执行所述第 M个控制指令, 将所述第 M个命令数据包中除所 述第 M个流表项和所述第 M个控制指令之外的其他流表项和控制指令封装成 第 M-1个命令数据包发送至第 M-1个交换机, 以使所述第 M-1个交换机根据 所述第 M-1个命令数据包中的所述第 M-1个控制指令完成所述转发路径中剩 余的 M-1个流表项的传递, 所述第 M-1个交换机为所述转发路径中所述第 M 个交换机的前一跳交换机。
其中, 所述转发路径为控制器确定的用于转发待转发数据的路径。 本申请还公开了一种控制器。 图 7为申请的控制器实施例的结构图。如图 7所示, 该控制器可以包括:
接收单元 701 , 用于接收源交换机发送的数据包进入消息;
处理单元 702, 用于根据所述数据包进入消息, 确定转发路径;
所述处理单元 702,还用于对于所述转发路径中的 N个交换机, 分别生成 对应的流表项, 其中, 所述 N个交换机中的第 1个交换机为源交换机, 第 N 个交换机为所述转发路径的目标交换机, 第 M个交换机为所述转发路径中的 第 M跳交换机, 1 < M < N, 所述第 M个交换机对应的流表项为第 M 个流表 项;
所述处理单元 702, 还用于对于所述转发路径中除所述源交换机之外的 N-1 个交换机, 分别生成一个对应的控制指令, 所述第 M个交换机对应的控 制指令为第 M个控制指令;
封装单元 703 ,用于将生成的 N个所述流表项和 N-1个控制指令封装成第
N个命令数据包;
发送单元 704, 用于将所述第 N个命令数据包发送至所述第 N个交换机; 其中, 第 M个命令数据包中的第 M个控制指令用于指示第 M个交换机 保存第 M个流表项, 并将所述第 M个命令数据包中除所述第 M个流表项和 所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个命令数据 包发送至第 M-1个交换机, 以使所述第 M-1个交换机根据所述第 M-1个命令 数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个流表项 的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交换机的前一跳 交换机。
采用本实施例中的控制器, 可以确保在转发待转发数据时,各个交换机都 具有与该待转发数据相对应的流表项, 进而可以避免相应的设备发送冗余消 息, 甚至出现逻辑错误, 防止数据转发过程出错。
实际应用中, 所述发送单元 704, 具体可以包括:
第一发送子单元, 用于当所述控制器与所述第 N个交换机之间存在控制 信令传输链路时, 直接将所述第 N个命令数据包发送至所述第一转发路径中 的目标交换机;
第二发送子单元, 用于当所述控制器与所述第 N个交换机之间不存在控 制信令传输链路时, 通过所述源交换机将所述第 N个命令数据包发送至所述 第 N个交换机。
所述处理单元 702, 具体可以包括:
第一确定子单元, 用于确定所述第 M-1个交换机;
第二确定子单元, 用于确定所述第 M-1个交换机的地址信息;
第三确定子单元, 用于确定所述第 M个交换机向所述第 M-1个交换机发 送所述第 M个命令数据包时采用的端口; 第一控制指令生成子单元, 用于生成包括所述第 M-1 个交换机的地址信 息以及所述端口的信息的所述第 M个控制指令, 以便所述第 M个交换机根据 所述第 M个控制指令将所述第 M-1个交换机的地址信息封装在所述第 M-1个 命令数据包内, 通过所述端口将所述第 M-1 个命令数据包发送至所述第 M-1 个交换机。 本申请还公开了一种交换机。 图 8为申请的交换机实施例的结构图。如图 8所示, 该交换机可以包括:
接收单元 801 , 用于接收第 M个命令数据包, 所述第 M个命令数据包中 至少包括第 1个至第 M个共 M个流表项和第 2个至第 M个共 M-1个控制指 令, 其中, 所述交换机为第 M个交换机, 所述第 M个交换机为转发路径中的 第 M跳交换机, 1 < M N, 所述转发路径为控制器确定的用于转发待转发数 据的路径, 所述转发路径中包括 N个交换机, 所述第 M个交换机对应的控制 指令为第 M个控制指令, 所述第 M个交换机对应的流表项为第 M个流表项; 处理单元 802, 用于保存所述第 M个流表项;
发送单元 803 , 用于执行所述第 M个控制指令, 将所述第 M个命令数据 包中除所述第 M个流表项和所述第 M个控制指令之外的其他流表项和控制指 令封装成第 M-1个命令数据包发送至第 M-1个交换机, 以使所述第 M-1个交 换机根据所述第 M-1个命令数据包中的所述第 M-1个控制指令完成所述转发 路径中剩余的 M-1个流表项的传递, 所述第 M-1个交换机为所述转发路径中 所述第 M个交换机的前一跳交换机;
其中, 所述转发路径为控制器确定的用于转发待转发数据的路径。
采用本实施例中的交换机, 可以确保在转发待转发数据时,各个交换机都 具有与该待转发数据相对应的流表项, 进而可以避免相应的设备发送冗余消 息, 甚至出现逻辑错误, 防止数据转发过程出错。
实际应用中, 所述接收单元 801 , 具体可以包括:
第一接收子单元, 用于当所述第 M个交换机为所述转发路径中的目标交 换机时, 所述第 M个交换机接收控制器发送的所述第 M个命令数据包;
第二接收子单元, 用于当所述第 M个交换机不是所述转发路径中的目标 交换机时, 所述第 M个交换机接收第 M+1个交换机发送的所述第 M个数据 包,所述第 M+1个交换机为所述转发路径中所述第 M个交换机的下一跳交换 机。 另外, 本申请实施例还提供了一种计算节点,计算节点可能是包含计算能 力的主机服务器, 或者是个人计算机 PC, 或者是可携带的便携式计算机或终 端等等, 本申请具体实施例并不对计算节点的具体实现做限定。
图 9为本申请的计算节点的结构图。 如图 9所示, 计算节点 700包括: 处理器(processor ) 710, 通信接口 ( Communications Interface ) 720, 存 储器(memory ) 730, 总线 740。
处理器 710,通信接口 720,存储器 730通过总线 740完成相互间的通信。 处理器 710, 用于执行程序 732。
具体地,程序 732可以包括程序代码,所述程序代码包括计算机操作指令。 处理器 710 可能是一个中央处理器 CPU , 或者是特定集成电路 ASIC ( Application Specific Integrated Circuit ),或者是被配置成实施本申请实施例的 一个或多个集成电路。
存储器 730,用于存放程序 732。存储器 730可能包含高速 RAM存储器, 也可能还包括非易失性存储器( non-volatile memory ), 例如至少一个磁盘存储 哭口。
当计算节点运行时, 处理器 710, 与存储器 730之间通信, 处理器 710 执行程序 732使得计算节点执行如下方法:
接收源交换机发送的数据包进入消息;
根据所述数据包进入消息, 确定转发路径;
对于所述转发路径中的 N个交换机, 分别生成对应的流表项, 其 中, 所述 N个交换机中的第 1 个交换机为源交换机, 第 N个交换机为 所述转发路径的目标交换机, 第 M个交换机为所述转发路径中的第 M 跳交换机 , 1 < M < N , 所述第 M个交换机对应的流表项为第 M 个流表 项;
对于所述转发路径中除所述源交换机之外的 N- 1 个交换机, 分别 生成一个对应的控制指令, 所述第 M个交换机对应的控制指令为第 M 个控制指令;
将所述生成的 N个流表项和 N-1个控制指令封装成第 N个命令数 据包;
将所述第 N个命令数据包发送至所述第 N个交换机, 以使所述第
N个交换机根据所述第 N个命令数据包中的所述第 N个控制指令完成所 述转发路径中所述 N个流表项的传递;
其中, 第 M个命令数据包中的第 M个控制指令用于指示第 M个 交换机, 保存第 M个流表项, 并将所述第 M个命令数据包中除所述第 M个流表项和所述第 M个控制指令之外的其他流表项和控制指令封装 成第 M-1个命令数据包发送至第 M-1个交换机, 以使所述第 M-1个交 换机根据所述第 M-1 个命令数据包中的所述第 M-1 个控制指令完成所 述转发路径中剩余的 M-1 个流表项的传递, 所述第 M-1 个交换机为所 述转发路径中所述第 M个交换机的前一跳交换机。
或者处理器 710执行程序 732使得计算节点执行如下方法 : 接收第 M个命令数据包, 所述第 M个命令数据包中至少包括第 1个至第 M个共 M个流表项和第 2个至第 M个共 M-1个控制指令, 其中, 所述第 M 个交换机为转发路径中的第 M跳交换机, 1 < M N, 所述转发路径为控制器 确定的用于转发待转发数据的路径, 所述转发路径中包括 N个交换机, 所述 第 M个交换机对应的控制指令为第 M个控制指令, 所述第 M个交换机对应 的流表项为第 M个流表项;
保存所述第 M个流表项;
执行所述第 M个控制指令, 将所述第 M个命令数据包中除所述第 M个 流表项和所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个 命令数据包发送至第 M-1 个交换机, 以使所述第 M-1 个交换机根据所述第 M-1 个命令数据包中的所述第 M-1 个控制指令完成所述转发路径中剩余的 M-1个流表项的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交 换机的前一跳交换机。 本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是 与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于 实施例公开的装置而言, 由于其与实施例公开的方法相对应, 所以描述的比较 简单, 相关之处参见方法部分说明即可。
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例 的单元及算法步骤,能够以电子硬件或者电子硬件与计算机软件相结合的方式 来实现。 为了清楚地说明部分硬件和软件的可互换性,在上述说明中已经按照 功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软硬件结 合的方式来执行,取决于技术方案的特定应用和设计约束条件。 专业技术人员 应认为超出本发明的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处 理器执行的软件模块, 或者二者的结合来实施。软件模块可以置于随机存储器 ( RAM )、内存、只读存储器 ( ROM )、电可编程 ROM、电可擦除可编程 ROM, 寄存器、 硬盘、 可移动磁盘、 CD-ROM, 或技术领域内所公知的任意其它形式 的存储介质中。
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本 发明。 对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见 的, 本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下, 在 其它实施例中实现。 因此, 本发明将不会被限制于本文所示的这些实施例, 而 是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims

权 利 要 求
1、 一种流表项下发方法, 其特征在于, 所述方法包括:
控制器接收源交换机发送的数据包进入消息;
根据所述数据包进入消息, 确定转发路径;
对于所述转发路径中的 N个交换机, 分别生成对应的流表项, 其中, 所 述 N个交换机中的第 1个交换机为源交换机, 第 N个交换机为所述转发路径 的目标交换机,第 M个交换机为所述转发路径中的第 M跳交换机, 1 < M < N, 所述第 M个交换机对应的流表项为第 M个流表项;
对于所述转发路径中除所述源交换机之外的 N-1个交换机,分别生成一个 对应的控制指令, 所述第 M个交换机对应的控制指令为第 M个控制指令; 将生成的 N个所述流表项和 N-1个控制指令封装成第 N个命令数据包; 将所述第 N个命令数据包发送至所述第 N个交换机, 以使所述第 N个交 换机根据所述第 N个命令数据包中的所述第 N个控制指令完成所述转发路径 中所述 N个流表项的传递;
其中, 第 M个命令数据包中的第 M个控制指令用于指示第 M个交换机, 保存第 M个流表项, 并将所述第 M个命令数据包中除所述第 M个流表项和 所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个命令数据 包发送至第 M-1个交换机, 以使所述第 M-1个交换机根据所述第 M-1个命令 数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个流表项 的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交换机的前一跳 交换机。
2、 根据权利要求 1所述的方法, 其特征在于, 所述将所述第 N个命令数 据包发送至所述第 N个交换机, 具体包括:
当所述控制器与所述第 N个交换机之间存在控制信令传输链路时, 直接 将所述第 N个命令数据包发送至所述第 N个交换机;
当所述控制器与所述第 N个交换机之间不存在控制信令传输链路时, 通 过所述源交换机将所述第 N个命令数据包发送至所述第 N个交换机。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述第 M个控制指令 生成的方法, 具体包括: 确定所述第 M-l个交换机;
确定所述第 M-1个交换机的地址信息;
确定所述第 M个交换机向所述第 M-1个交换机发送所述第 M个命令数据 包时采用的端口;
生成包括所述第 M-1 个交换机的地址信息以及所述端口的信息的所述第
M个控制指令, 以便所述第 M个交换机根据所述第 M个控制指令将所述第 M-1 个交换机的地址信息封装在所述第 M-1个命令数据包内, 通过所述端口 将所述第 M-1个命令数据包发送至所述第 M-1个交换机。
4、 一种流表项下发方法, 其特征在于, 所述方法包括:
第 M个交换机接收第 M个命令数据包, 所述第 M个命令数据包中至少 包括第 1个至第 M个共 M个流表项和第 2个至第 M个共 M-1个控制指令, 其中, 所述第 M个交换机为转发路径中的第 M跳交换机, 1 < M N, 所述转 发路径为控制器确定的用于转发待转发数据的路径, 所述转发路径中包括 N 个交换机, 所述第 M个交换机对应的控制指令为第 M个控制指令, 所述第 M 个交换机对应的流表项为第 M个流表项;
保存所述第 M个流表项;
执行所述第 M个控制指令, 将所述第 M个命令数据包中除所述第 M个 流表项和所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个 命令数据包发送至第 M-1个交换机,以使所述第 M-1个交换机根据所述第 M-1 个命令数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个 流表项的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交换机的 前一跳交换机。
5、 根据权利要求 4所述的方法, 其特征在于, 所述第 M个交换机接收第 M个命令数据包, 具体包括:
当所述第 M个交换机为所述转发路径中的目标交换机时, 所述第 M个交 换机接收所述控制器发送的所述第 M个命令数据包;
当所述第 M个交换机不是所述转发路径中的目标交换机时, 所述第 M个 交换机接收第 M+1个交换机发送的所述第 M个数据包, 所述第 M+1个交换 机为所述转发路径中所述第 M个交换机的下一跳交换机。
6、 一种控制器, 其特征在于, 所述控制器包括:
接收单元, 用于接收源交换机发送的数据包进入消息;
处理单元, 用于根据所述数据包进入消息, 确定转发路径;
所述处理单元, 还用于对于所述转发路径中的 N个交换机, 分别生成对 应的流表项, 其中, 所述 N个交换机中的第 1个交换机为源交换机, 第 N个 交换机为所述转发路径的目标交换机, 第 M个交换机为所述转发路径中的第
M跳交换机, 1 < M < N, 所述第 M个交换机对应的流表项为第 M 个流表项; 所述处理单元, 还用于对于所述转发路径中除所述源交换机之外的 N-1 个交换机, 分别生成一个对应的控制指令, 所述第 M个交换机对应的控制指 令为第 M个控制指令;
封装单元, 用于将生成的 N个所述流表项和 N-1个控制指令封装成第 N 个命令数据包;
发送单元, 用于将所述第 N个命令数据包发送至所述第 N个交换机; 其中, 第 M个命令数据包中的第 M个控制指令用于指示第 M个交换机 保存第 M个流表项, 并将所述第 M个命令数据包中除所述第 M个流表项和 所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个命令数据 包发送至第 M-1个交换机, 以使所述第 M-1个交换机根据所述第 M-1个命令 数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个流表项 的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交换机的前一跳 交换机。
7、 根据权利要求 6所述的控制器, 其特征在于, 所述发送单元, 具体包 括:
第一发送子单元, 用于当所述控制器与所述第 N个交换机之间存在控制 信令传输链路时, 直接将所述第 N个命令数据包发送至所述第一转发路径中 的目标交换机;
第二发送子单元, 用于当所述控制器与所述第 N个交换机之间不存在控 制信令传输链路时, 通过所述源交换机将所述第 N个命令数据包发送至所述 第 N个交换机。
8、 根据权利要求 6或 7所述的控制器, 其特征在于, 所述处理单元, 具 体包括:
第一确定子单元, 用于确定所述第 M-1个交换机;
第二确定子单元, 用于确定所述第 M-1个交换机的地址信息;
第三确定子单元, 用于确定所述第 M个交换机向所述第 M-1个交换机发 送所述第 M个命令数据包时采用的端口;
第一控制指令生成子单元, 用于生成包括所述第 M-1 个交换机的地址信 息以及所述端口的信息的所述第 M个控制指令, 以便所述第 M个交换机根据 所述第 M个控制指令将所述第 M-1个交换机的地址信息封装在所述第 M-1个 命令数据包内, 通过所述端口将所述第 M-1 个命令数据包发送至所述第 M-1 个交换机。
9、 一种交换机, 其特征在于, 所述交换机包括:
接收单元, 用于接收第 M个命令数据包, 所述第 M个命令数据包中至少 包括第 1个至第 M个共 M个流表项和第 2个至第 M个共 M-1个控制指令, 其中, 所述交换机为第 M个交换机, 所述第 M个交换机为转发路径中的第 M 跳交换机, 1 < M < N,所述转发路径为控制器确定的用于转发待转发数据的路 径, 所述转发路径中包括 N个交换机, 所述第 M个交换机对应的控制指令为 第 M个控制指令, 所述第 M个交换机对应的流表项为第 M个流表项;
处理单元, 用于保存所述第 M个流表项;
发送单元, 用于执行所述第 M个控制指令, 将所述第 M个命令数据包中 除所述第 M个流表项和所述第 M个控制指令之外的其他流表项和控制指令封 装成第 M-1个命令数据包发送至第 M-1个交换机, 以使所述第 M-1个交换机 根据所述第 M-1个命令数据包中的所述第 M-1个控制指令完成所述转发路径 中剩余的 M-1个流表项的传递, 所述第 M-1个交换机为所述转发路径中所述 第 M个交换机的前一跳交换机。
10、 根据权利要求 9所述的交换机, 其特征在于, 所述接收单元, 具体包 括:
第一接收子单元, 用于当所述第 M个交换机为所述转发路径中的目标交 换机时, 所述第 M个交换机接收控制器发送的所述第 M个命令数据包;
第二接收子单元, 用于当所述第 M个交换机不是所述转发路径中的目标 交换机时, 所述第 M个交换机接收第 M+1个交换机发送的所述第 M个数据 包,所述第 M+1个交换机为所述转发路径中所述第 M个交换机的下一跳交换 机。
11、 一种计算节点, 包括: 处理器, 通信接口, 存储器和总线;
所述处理器,所述通信接口,所述存储器通过所述总线完成相互间的通信; 所述处理器, 用于执行程序;
所述存储器, 用于存放所述程序;
当所述计算节点运行时, 所述处理器与所述存储器通信, 其特征在于, 所 述处理器执行所述程序所述计算节点执行如下方法 :
接收源交换机发送的数据包进入消息;
根据所述数据包进入消息, 确定转发路径;
对于所述转发路径中的 N个交换机, 分别生成对应的流表项, 其中, 所 述 N个交换机中的第 1个交换机为源交换机, 第 N个交换机为所述转发路径 的目标交换机,第 M个交换机为所述转发路径中的第 M跳交换机, 1 < M < N, 所述第 M个交换机对应的流表项为第 M 个流表项;
对于所述转发路径中除所述源交换机之外的 N-1个交换机,分别生成一个 对应的控制指令, 所述第 M个交换机对应的控制指令为第 M 个控制指令; 将所述生成的 N个流表项和 N-1个控制指令封装成第 N个命令数据包; 将所述第 N个命令数据包发送至所述第 N个交换机, 以使所述第 N个交 换机根据所述第 N个命令数据包中的所述第 N个控制指令完成所述转发路径 中所述 N个流表项的传递;
其中, 第 M个命令数据包中的第 M个控制指令用于指示第 M个交换机, 保存第 M个流表项, 并将所述第 M个命令数据包中除所述第 M个流表项和 所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个命令数据 包发送至第 M-1个交换机, 以使所述第 M-1个交换机根据所述第 M-1个命令 数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个流表项 的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交换机的前一跳 交换机;
或者所述处理器执行所述程序所述计算节点执行如下方法 : 接收第 M个命令数据包, 所述第 M个命令数据包中至少包括第 1个至第 M个共 M个流表项和第 2个至第 M个共 M-1个控制指令, 其中, 所述第 M 个交换机为转发路径中的第 M跳交换机, 1 < M N, 所述转发路径为控制器 确定的用于转发待转发数据的路径, 所述转发路径中包括 N个交换机, 所述 第 M个交换机对应的控制指令为第 M个控制指令, 所述第 M个交换机对应 的流表项为第 M 个流表项;
保存所述第 M个流表项;
执行所述第 M个控制指令, 将所述第 M个命令数据包中除所述第 M个 流表项和所述第 M个控制指令之外的其他流表项和控制指令封装成第 M-1个 命令数据包发送至第 M-1个交换机,以使所述第 M-1个交换机根据所述第 M-1 个命令数据包中的所述第 M-1个控制指令完成所述转发路径中剩余的 M-1个 流表项的传递, 所述第 M-1个交换机为所述转发路径中所述第 M个交换机的 前一跳交换机。
PCT/CN2013/088140 2013-11-29 2013-11-29 一种流表项的下发方法及装置 WO2015077976A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP13898380.4A EP3065351B1 (en) 2013-11-29 2013-11-29 Method and device for issuing flow entry
PCT/CN2013/088140 WO2015077976A1 (zh) 2013-11-29 2013-11-29 一种流表项的下发方法及装置
CN201380002433.4A CN104919765B (zh) 2013-11-29 2013-11-29 一种流表项的下发方法及装置
US15/166,954 US10009252B2 (en) 2013-11-29 2016-05-27 Flow entry delivery method and communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/088140 WO2015077976A1 (zh) 2013-11-29 2013-11-29 一种流表项的下发方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/166,954 Continuation US10009252B2 (en) 2013-11-29 2016-05-27 Flow entry delivery method and communication system

Publications (1)

Publication Number Publication Date
WO2015077976A1 true WO2015077976A1 (zh) 2015-06-04

Family

ID=53198221

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/088140 WO2015077976A1 (zh) 2013-11-29 2013-11-29 一种流表项的下发方法及装置

Country Status (4)

Country Link
US (1) US10009252B2 (zh)
EP (1) EP3065351B1 (zh)
CN (1) CN104919765B (zh)
WO (1) WO2015077976A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10951520B2 (en) * 2017-03-14 2021-03-16 Huawei Technologies Co., Ltd. SDN, method for forwarding packet by SDN, and apparatus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685006A (zh) * 2012-05-03 2012-09-19 中兴通讯股份有限公司 一种转发数据报文的方法及装置
US20130151685A1 (en) * 2011-12-07 2013-06-13 Citrix Systems, Inc. Controlling A Network Interface Using Virtual Switch Proxying
CN103401726A (zh) * 2013-07-19 2013-11-20 华为技术有限公司 网络路径探测方法及装置、系统
CN103401784A (zh) * 2013-07-31 2013-11-20 华为技术有限公司 一种接收报文的方法及开放流交换机

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5652400B2 (ja) * 2009-10-06 2015-01-14 日本電気株式会社 ネットワークシステムとコントローラ、方法とプログラム
US8897134B2 (en) * 2010-06-25 2014-11-25 Telefonaktiebolaget L M Ericsson (Publ) Notifying a controller of a change to a packet forwarding configuration of a network element over a communication channel
US8676980B2 (en) * 2011-03-22 2014-03-18 Cisco Technology, Inc. Distributed load balancer in a virtual machine environment
JP5994851B2 (ja) * 2011-10-21 2016-09-21 日本電気株式会社 転送装置の制御装置、転送装置の制御方法、通信システムおよびプログラム
JP6007976B2 (ja) * 2011-12-27 2016-10-19 日本電気株式会社 通信システム、コントローラ、通信方法およびプログラム
CN102938794B (zh) * 2012-11-14 2016-01-13 华为技术有限公司 地址解析协议arp消息转发方法、交换机和控制器
CN103036653B (zh) * 2012-12-26 2015-11-18 华中科技大学 一种对OpenFlow网络进行网络编码的方法
US9379973B2 (en) * 2013-02-11 2016-06-28 Cisco Technology, Inc. Binary compatible extension architecture in an openflow compliant network environment
CN103346969A (zh) * 2013-07-05 2013-10-09 中国科学院计算机网络信息中心 基于OpenFlow实现动态组播生成树路径调整的方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130151685A1 (en) * 2011-12-07 2013-06-13 Citrix Systems, Inc. Controlling A Network Interface Using Virtual Switch Proxying
CN102685006A (zh) * 2012-05-03 2012-09-19 中兴通讯股份有限公司 一种转发数据报文的方法及装置
CN103401726A (zh) * 2013-07-19 2013-11-20 华为技术有限公司 网络路径探测方法及装置、系统
CN103401784A (zh) * 2013-07-31 2013-11-20 华为技术有限公司 一种接收报文的方法及开放流交换机

Non-Patent Citations (1)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10951520B2 (en) * 2017-03-14 2021-03-16 Huawei Technologies Co., Ltd. SDN, method for forwarding packet by SDN, and apparatus

Also Published As

Publication number Publication date
CN104919765A (zh) 2015-09-16
CN104919765B (zh) 2018-01-23
EP3065351B1 (en) 2018-05-16
EP3065351A1 (en) 2016-09-07
EP3065351A4 (en) 2016-11-30
US10009252B2 (en) 2018-06-26
US20160277280A1 (en) 2016-09-22

Similar Documents

Publication Publication Date Title
US20220197831A1 (en) System and method for facilitating efficient host memory access from a network interface controller (nic)
US10848442B2 (en) Heterogeneous packet-based transport
RU2540815C2 (ru) Прерывание, по меньшей мере частичное, передачи кадра
WO2016187813A1 (zh) 一种光电混合网络的数据传输方法及装置
CN108833293B (zh) 一种基于软件定义网络sdn的数据中心拥塞控制方法及装置
CN108206753B (zh) 一种检测时延的方法、装置及系统
JP5442129B2 (ja) オンチップネットワークにおける高信頼通信
US9680948B2 (en) System and method for device failure notification
EP2922254A1 (en) Method for establishing control channel, forwarding point and controller
CN106559336A (zh) 应用于sdn中的路径倒换方法和装置
WO2022142813A1 (zh) 一种蓝牙数据传输方法、装置、通信芯片和电子设备
WO2021092760A1 (zh) 数据传输的方法和ble设备
WO2015077976A1 (zh) 一种流表项的下发方法及装置
WO2017173601A1 (zh) 软件定义网络sdn中流量控制方法和设备
JPWO2017199913A1 (ja) 送信装置、方法およびプログラム
WO2010136227A1 (en) System and method for establishing reliable communication in a connection-less environment
JP6740683B2 (ja) 並列処理装置及び通信制御方法
CN112953977B (zh) 系统数据发送方法、系统
WO2022135321A1 (zh) 报文传输方法、设备及系统
JP7027145B2 (ja) 通信装置、通信装置の制御方法およびプログラム
CN111740891A (zh) 基于vxlan的bfd处理方法及装置
JP2020184701A (ja) 車載通信システム、中継装置、及び通信方法
JP2012027671A (ja) 半導体集積回路装置
He et al. The new architecture for high performance signal processing system
WO2016000132A1 (zh) 一种路径检测方法及路径计算单元

Legal Events

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

Ref document number: 13898380

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2013898380

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2013898380

Country of ref document: EP