WO2016041341A1 - 一种获取网络状态的方法及装置 - Google Patents

一种获取网络状态的方法及装置 Download PDF

Info

Publication number
WO2016041341A1
WO2016041341A1 PCT/CN2015/076075 CN2015076075W WO2016041341A1 WO 2016041341 A1 WO2016041341 A1 WO 2016041341A1 CN 2015076075 W CN2015076075 W CN 2015076075W WO 2016041341 A1 WO2016041341 A1 WO 2016041341A1
Authority
WO
WIPO (PCT)
Prior art keywords
trigger
ofs
flow
data packet
packet
Prior art date
Application number
PCT/CN2015/076075
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 华为技术有限公司
Publication of WO2016041341A1 publication Critical patent/WO2016041341A1/zh

Links

Images

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

Definitions

  • the present invention relates to the field of network communication technologies, and in particular, to a method and apparatus for acquiring a network state.
  • the SDN (software-defined network) network is a new type of network architecture with separate control and management.
  • the core technology OpenFlow separates the data forwarding layer and the control layer of the switching device to forward data on the OpenFlow switch and control it on the controller. Data forwarding, thus better control of the network, based on OpenFlow SDN, the separation of software and hardware and the virtualization of the underlying hardware, and the upgrade of network protocols and switching strategies only need to change the control layer, innovation for core networks and applications. Provide a good development platform.
  • applying OpenFlow switches at the connection between the internal network and the external network can enhance the security of the intranet by changing the path of the data stream and rejecting certain data streams.
  • SDN is deployed by a proprietary device to deploy high-level policies. The network device forwards data under the guidance of a high-level policy, reduces network device bearer, and improves network design planning and management flexibility.
  • the controller in the SDN network queries the flow table, port, and other information by sending a data packet, thereby acquiring the network status.
  • the method provided by the prior art cannot meet the requirement of the controller to acquire the network state in real time.
  • the invention provides a method and a device for acquiring a network state, which are used to solve the problem that the open flow controller cannot obtain the network state in real time in the prior art.
  • a first aspect of the present invention provides a method for obtaining a network status, where the method includes:
  • the open flow switch OFS matches the obtained data packet with the multi-level flow table to obtain a matching result, where the multi-level flow table includes an operation instruction and a trigger table, and the trigger table includes a trigger comparison item;
  • the OFS is according to the touch
  • the trigger comparison item in the publication judges the report condition of the data packet, and obtains the result of the judgment
  • the OFS When the result of the determination satisfies the preset trigger reporting condition, the OFS generates network state information according to the result of the determining, and sends the network state information to the OpenFlow controller OFC.
  • the OpenFlow switch OFS before the matching the obtained data packet with the multi-level flow table, further includes:
  • the OFS constructs the multi-level flow table according to the flow table content
  • the OFS constructs the trigger table according to the trigger comparison item
  • the OFS adds the trigger table to the end of the multi-level flow table, and establishes a correspondence between the multi-level flow table and the trigger table.
  • the constructing, by the OFS, the multi-level flow table according to the content of the flow table includes:
  • the OFS divides the flow table content according to a preset matching field to obtain at least two sub-flow tables
  • the OFS combines the sub-flow tables into the multi-level flow table in a preset order.
  • the sending the network state information to the OpenFlow controller OFC specifically includes:
  • the OFS constructs a Packet-in data packet, and adds the network state information to an extension field of the Packet-in data packet;
  • the OFS sends a Packet-in packet that adds the network state information to the OFC.
  • the result of the matching is that the data packet is matched to the multi-level flow table. a flow entry;
  • the constructing the Packet-in data packet also includes:
  • the OFS constructs a Packet-in data packet, and adds the network state information to the Packet-in data packet;
  • the OFS constructs a reanson field as a Warning Packet-in data packet, and adds the network state information to a Packet-in data packet whose reanson field is warning.
  • the method further includes:
  • the OFS updates the current network state and a counter corresponding to the flow entry in the multi-level flow table that matches the data packet.
  • a second aspect of the present invention provides a method for obtaining a network status, where the method includes:
  • the OpenFlow controller OFC constructs a flow table edit message Flow-Mod, where the Flow-Mod includes a flow table content and a trigger comparison item, where the trigger comparison item is a network state trigger threshold set, and is used to determine whether a network status needs to be reported;
  • the OFC sends the Flow-Mod to the OpenFlow switch OFS, so that the OFS constructs a multi-level flow table according to the flow table content and the trigger comparison item, and reports network status information according to the multi-level flow table. ;
  • the OFC receives a network status message sent by the OFS.
  • the method further includes:
  • the OFC updates the trigger comparison item according to the network status message
  • the OFC adds an updated trigger comparison item to the Flow-Mod to obtain an updated Flow-Mod
  • the OFC sends the updated Flow-Mod to the OFS such that the OFS updates the multi-level flow table according to the updated Flow-Mod.
  • a third aspect of the present invention provides an OpenFlow Switch OFS, where the OFS includes:
  • a first execution unit configured to match the acquired data packet with a multi-level flow table, and obtain a matching result, where the multi-level flow table includes an operation instruction and a trigger table, where the trigger table includes a trigger comparison item;
  • a first determining unit configured to determine, according to a result of the matching acquired by the first execution unit, an operation instruction corresponding to the data packet
  • a first determining unit configured to: when the operation instruction corresponding to the data packet is directed to the triggering table, the OFS determines a reporting condition of the data packet according to a trigger comparison item in the triggering table, and obtains a result of the determining ;
  • a second execution unit configured to: when the result of the determining meets a preset trigger reporting condition, the OFS generates network state information according to the result of the determining;
  • the first sending unit is configured to send the network state information to the OpenFlow controller OFC.
  • the OFS further includes:
  • a first receiving unit configured to receive a flow table editing message Flow-Mod sent by the OFC, where the Flow-Mod includes a flow table content and the trigger comparison item;
  • a first configuration unit configured to construct a multi-level flow table according to the flow table content
  • a second configuration unit configured to construct the trigger table according to the trigger comparison item
  • a third execution unit configured to add the trigger table to the end of the multi-level flow table, and establish a correspondence between the multi-level flow table and the trigger table.
  • the first configuration unit specifically includes:
  • a first configuration module configured to divide the content of the flow table according to a preset matching field to obtain at least two sub-flow tables
  • a second configuration module configured to combine the sub-flow tables into the multi-level flow table in a preset order.
  • the second execution unit is specifically configured to: when the result of the determining meets the preset When the triggering condition is triggered, the Packet-in packet is constructed, and the network status information is added to the An extension field of the Packet-in packet;
  • the first sending unit is specifically configured to send, to the OFC, a Packet-in data packet that adds the network state information.
  • the matching result is that the data packet is matched to the multi-level flow A flow entry in the table; the OFS further includes:
  • a second determining unit configured to determine, according to an operation instruction in the flow entry that matches the data packet, whether the Packet-in data packet has been constructed
  • the second execution unit further includes:
  • a third configuration module configured to: when the Packet-in data packet is not configured, construct a Packet-in data packet, and add the network state information to the Packet-in data packet;
  • a fourth configuration module configured to: when the Packet-in data packet has been constructed, the OFS constructs a revenue-in packet of a warming field, and adds the network state information to a packet whose reanson field is warning -in packet.
  • the OFS further includes:
  • an update unit configured to: when the operation instruction corresponding to the data packet points to the trigger table, update a current network state and a counter corresponding to the flow entry in the multi-level flow table that matches the data packet.
  • a fourth aspect of the present invention provides an OpenFlow Controller OFC, where the OFC includes:
  • the first configuration unit is configured to construct a flow table edit message Flow-Mod, where the Flow-Mod includes a flow table content and a trigger comparison item, where the trigger comparison item is a network state trigger threshold set, and is used to determine whether the network needs to be reported. status;
  • a first sending unit configured to send the Flow-Mod to the OpenFlow switch OFS, so that the OFS constructs a multi-level flow table according to the flow table content and the trigger comparison item, and according to the multi-level flow table Report network status information;
  • a receiving unit configured to receive network status information sent by the OFS.
  • the OFC also includes:
  • An update unit configured to update a trigger comparison item according to the network status message
  • a second configuration unit configured to add an updated trigger comparison item to the Flow-Mod to obtain an updated Flow-Mod
  • a second sending unit configured to send the updated Flow-Mod to the OFS, so that the OFS updates the multi-level flow table according to the updated Flow-Mod.
  • the operation instruction corresponding to the data packet is determined, and the operation corresponding to the data packet is performed.
  • the OFS determines a reporting condition of the data packet according to a trigger comparison item in the trigger table, and when the result of the determination is that the preset trigger reporting condition is met, according to the determining As a result, the network status information is generated, and the network status information is sent to the OpenFlow controller OFC, so that the OFC can obtain the current network status information in real time, effectively improve the sensitivity and response speed of the OFC to the network status, and improve the network management. quality.
  • the Flow-Mod is extended by adding a trigger comparison item at the end of the Flow-Mod, so that the preset trigger report is also sent at the same time that the flow table is sent.
  • the condition enables the OFS to construct a new multi-flow table structure according to the Flow-Mod, execute the judgment process of the trigger comparison item to obtain the current network state information, and then report the network status information in time, realizing real-time monitoring of the network and improving Network security and stability.
  • FIG. 1 is a schematic diagram of an embodiment of a method for obtaining a network state according to an embodiment
  • FIG. 2 is a schematic diagram of another embodiment of a method for obtaining a network state according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of another embodiment of a method for obtaining a network state according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of another embodiment of a method for obtaining a network state according to an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of another embodiment of a method for obtaining a network state according to an embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of another embodiment of a method for obtaining a network state according to an embodiment of the present disclosure
  • FIG. 7 is a schematic diagram of another embodiment of a method for obtaining a network state according to the embodiment.
  • FIG. 8 is a schematic diagram of another embodiment of a method for obtaining a network state according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic diagram of an embodiment of an OpenFlow switch OFS in the embodiment.
  • FIG. 10 is a schematic diagram of another embodiment of an OpenFlow switch OFS in the embodiment.
  • FIG. 11 is a schematic diagram of another embodiment of an OpenFlow switch OFS in the embodiment.
  • FIG. 12 is a schematic diagram of another embodiment of an OpenFlow switch OFS in the embodiment.
  • FIG. 13 is a schematic diagram of an embodiment of an OpenFlow controller OFC in the embodiment.
  • FIG. 14 is a schematic diagram of another embodiment of an OpenFlow controller OFC in the embodiment.
  • FIG. 15 is a schematic structural diagram of an extended Flow-Mod in the embodiment.
  • FIG. 16 is a schematic diagram of a physical device of an OpenFlow switch OFS in the embodiment.
  • FIG. 17 is a schematic diagram of a physical device of an OpenFlow controller OFC in the embodiment.
  • Embodiments of the present invention provide a method and an apparatus for acquiring a network state, which are used to solve the prior art.
  • the medium control server cannot obtain the status of the network in real time. The details are described below.
  • the embodiments of the present invention are applied to an OpenFlow network, which includes an OpenFlow controller (OFC) and an OpenFlow switch (OFS). It should be noted that the operations in this document include jumping to a subsequent flow table. Continue to process, modify the data packet and immediately execute the action set corresponding to the data packet.
  • the network status information includes the flow entry matching status, the packet execution port load status, the total number of lost/forwarded/received packets, or the packet TTR is invalid. In the similar situation, any network status that may occur in the network is included, and is not limited in this document.
  • an embodiment of a method for obtaining a network state includes:
  • the OpenFlow switch OFS matches the obtained data packet with the multi-level flow table.
  • the OFS acquires the data packet in the network, parses the data packet, and matches the multi-level flow table to obtain a matching result.
  • the multi-level flow table includes an operation instruction and a trigger table, and the trigger table includes a trigger comparison item;
  • the flow table can jump from small to large in order, but cannot jump from a flow table to a flow table with a smaller number. .
  • the flow entry will be matched with the data packet in the order of priority.
  • the statistics of the counter record corresponding to the flow entry are updated first. The number and the total number of bytes, etc., and then perform corresponding operations according to the instructions in the flow entry (for example, jumping to a subsequent flow table to continue processing, modifying, or immediately executing the action set corresponding to the data packet, etc.).
  • all action instructions in its corresponding Action Set will be executed (for example, forwarding to a port, modifying a certain field of the packet, dropping the packet, etc.).
  • the OFS determines an operation instruction corresponding to the data packet according to the matched result.
  • the OFS determines the reporting condition of the data packet according to the trigger comparison item in the trigger table
  • the OFS When it is determined that the result of the determination is that the preset trigger reporting condition is met, the OFS generates current network state information according to the result of the determining.
  • the OFS sends network status information to the OpenFlow controller OFC.
  • the acquired data packet is matched with the multi-level flow table including the trigger table, and when the operation instruction corresponding to the data packet points to the trigger table, the judgment flow of the trigger comparison item in the trigger table is executed, and the result of the determination is performed.
  • the current network status information is generated; the network status information is sent to the OFC, so that the OFC can obtain the current network status information and monitor the network in real time, thereby improving the network status of the OFC. Sensitivity, speed of response, and quality of network management.
  • an embodiment of a method for obtaining a network state includes:
  • the OFS receives the flow table edit message Flow-Mod sent by the OFC;
  • Flow-Mod includes flow table content and trigger comparison items
  • the OFS constructs a multi-level flow table according to the content of the flow table, and constructs a trigger table according to the trigger comparison item;
  • the OFS divides the content of the flow table according to a preset matching field to obtain at least two sub-flow tables
  • the OFS combines the subflow tables into a multi-level flow table in a preset order.
  • the OFS adds the trigger table to the end of the multi-level flow table, and establishes a correspondence between the multi-level flow table and the trigger table.
  • the trigger table at the end of the multi-level flow table is used to store the alarm message, and the Flow-Mod is stored in the multi-level flow table;
  • each Trigger ID corresponds to a trigger comparison item of the same operation type. It should be noted that the corresponding relationship between the multi-level flow table and the trigger table appearing in this document is implemented in the same manner. No longer repeat them.
  • the OFS matches the obtained data packet with the multi-level flow table.
  • the OFS acquires a data packet in the network, parses the data packet, and matches the multi-level flow table to obtain a matching result.
  • the multi-level flow table includes an operation instruction and a trigger table, and the trigger table includes a trigger comparison item.
  • the OFS determines an operation instruction corresponding to the data packet according to the matched result.
  • the OFS determines the reporting condition of the data packet according to the trigger comparison item in the trigger table.
  • the OFS When it is determined that the result of the judgment is that the preset trigger reporting condition is met, the OFS generates current network state information according to the result of the determining;
  • the flow entry includes a counter and a timeout timer
  • the trigger comparison item specifically includes:
  • the comparison item can be 16-bit Hard_timeout, Flow table status 64-bit Packet Matches, Group status 32-bit Packet Count, Flow entry status 32-bit Duration (seconds), Port status 64-bit Transmitted Packets, Port status 64-bit Receive Overrun Errors, and the like.
  • the check items are not limited in this article.
  • the OFS sends network state information to the OpenFlow controller OFC.
  • Sending network status information to the OFC specifically includes: constructing a Packet-in data packet, adding network status information to an extension field of the Packet-in data packet, and transmitting a Packet-in data packet that adds network status information to the OFC.
  • the Flow-Mod message of the end preset trigger comparison item delivered by the OFC is obtained, and the multi-flow table structure with the trigger table set at the end is configured, so that after matching the corresponding flow entry,
  • the report judgment process is executed, so that when the network status meets the preset trigger report condition, the current
  • the network status information is sent to the OFC, enabling the OFC to timely and effectively process and monitor the current network status, improving the sensitivity, response speed, and network management quality of the OFC to the network status.
  • an embodiment of a method for obtaining a network state includes:
  • the OFS matches the obtained data packet with the multi-level flow table.
  • the OFS acquires the data packet in the network, parses the data packet, and matches the parsed data packet with the multi-level flow table to obtain a matching result.
  • the multi-level flow table includes an operation instruction and a trigger table, and the trigger table includes The comparison item is triggered, and the trigger item is triggered by the comparison item.
  • the trigger table is set at the end of the multi-level flow table, but it can also be set in any of the multiple sub-flow tables in the multi-level flow table, and the specific setting position can achieve multiple levels in this paper.
  • the extended function of the flow meter can be used, and is not limited in this article.
  • the data packet After completing the multi-stage flow table forwarding, the data packet is matched to one flow entry in the multi-level flow table, and the OFS determines that the last operation in the flow entry points to the trigger table, and the OFS jumps the data packet to the touch Published.
  • the OFS performs a process of determining whether the network parameter related to the data packet exceeds a preset value that triggers the comparison item
  • the result of the determination is that the preset trigger report condition is met
  • the result of all the judgments exceeding the preset value in the trigger comparison item is set as the current network state information, wherein, Setting the trigger comparison item with a value of 0 does not perform the judgment process and generates a total judgment result
  • the OFS determines whether the Packet-in data packet has been constructed according to the operation instruction in the flow table entry matching the sub-data packet, and if yes, step 305 is performed; if not, step 306 is performed;
  • the OFS constructs a packet-in packet whose warning field is warning
  • Each operation in the flow entry containing the alarm type corresponds to the trigger operation item in the trigger table
  • the OFS constructs a Packet-in data packet.
  • the OFS sends the Packet-in packet that adds the network status information to the OFC.
  • the trigger operation item corresponding to the operation in the trigger index is executed, and the Packet-in data packet is sent to the OFC.
  • the acquired data packet is matched with the multi-level flow table including the trigger table, and when the operation instruction corresponding to the data packet points to the trigger table, the trigger comparison item in the trigger table is executed.
  • the process when the result of the judgment is that the preset trigger reporting condition is met, the current network state information is generated, and the network state information is added to the Packet-in data packet, and sent to the OFC, so that the OFC can obtain the current state in real time.
  • the network status information and real-time monitoring of the network improve the sensitivity, response speed and network management quality of the OFC to the network status.
  • an embodiment of a method for obtaining a network state includes:
  • the OFS receives the flow table edit message Flow-Mod sent by the OFC.
  • Flow-Mod includes flow table content and trigger comparison items
  • the OFS constructs a multi-level flow table according to the content of the flow table, and constructs a trigger table according to the trigger comparison item;
  • the OFS divides the content of the flow table according to a preset matching field to obtain at least two sub-flow tables
  • the OFS combines the subflow tables into a multi-level flow table in a preset order.
  • the OFS adds the trigger table to the end of the multi-level flow table, and establishes a correspondence between the multi-level flow table and the trigger table.
  • the trigger table is set at the end of the multi-level flow table, but it can also be set in any of the multiple sub-flow tables in the multi-level flow table, and the specific setting position can achieve multiple levels in this paper.
  • the extended function of the flow meter can be used, and is not limited in this article.
  • the trigger table at the end of the multi-level flow table is used to store the alarm message, and the Flow-Mod is stored in the multi-level flow table;
  • Storing the Flow-Mod in the multi-level flow table specifically includes:
  • each Trigger ID corresponds to a trigger comparison item of the same operation type. It should be noted that the corresponding relationship between the multi-level flow table and the trigger table appearing in this document is implemented in the same manner. No longer repeat them;
  • the multi-level flow table 403 and the OFS match the acquired data packet with the multi-level flow table
  • the OFS acquires the data packet in the network, parses the data packet, and matches the multi-level flow table to obtain a matching result.
  • the multi-level flow table includes an operation instruction and a trigger table, and the trigger table includes a trigger comparison item.
  • the flow table can jump from small to large in order, but cannot jump from a flow table to a flow table with a smaller number. .
  • the flow entry will be matched with the data packet in the order of priority.
  • the statistics of the counter record corresponding to the flow entry are updated first. The number and the total number of bytes, etc., and then perform corresponding operations according to the instructions in the flow entry (for example, jumping to a subsequent flow table to continue processing, modifying, or immediately executing the action set corresponding to the data packet, etc.).
  • all action instructions in its corresponding Action Set will be executed (for example, forwarding to a port, modifying a certain field of the packet, dropping the packet, etc.).
  • the OFS After completing the multi-level flow table forwarding, the data packet is matched to one flow entry in the multi-level flow table, and when the last operation in the flow entry is determined to point to the trigger table, the OFS sends the data packet to the touch. Published.
  • the OFS performs a process of determining whether the network parameter related to the data packet exceeds a preset value that triggers the comparison item;
  • the result of the determination is that the preset trigger report condition is satisfied
  • the result of all the judgments exceeding the preset value in the trigger comparison item is set as the current network state.
  • Information, in which the trigger comparison item with a preset value of 0 does not perform the judgment process.
  • the OFS determines whether the Packet-in data packet has been constructed according to the operation in the flow table entry matching the sub-data packet, if yes, step 407 is performed, and if not, step 408 is performed;
  • the OFS constructs a Packet-in data packet whose Reason field is warning
  • Each operation in the flow entry containing the alarm type corresponds to the trigger operation item in the trigger table
  • the OFS constructs a Packet-in data packet.
  • network status information is added to the Packet-in packet.
  • the OFS sends the Packet-in packet that adds the network status information to the OFC.
  • the trigger operation item corresponding to the at least one operation in the at least one trigger index is executed, and the Packet-in data packet is sent to the OFC.
  • the Flow-Mod message of the terminal preset trigger comparison item delivered by the OFC is obtained, and the multi-flow table structure with the trigger table set by the pre-configured end is used, so that the matching is matched
  • the flow entry is determined, when the operation in the flow entry is pointed to the trigger index in the trigger table, the data packet is jumped to the trigger table; and the report judgment process is executed, so that the network state satisfies the preset trigger report condition, and the current
  • the network status information is sent to the OFC, so that the OFC can timely and effectively process the current network status and monitor in real time, which improves the sensitivity, response speed and network management quality of the OFC to the network status.
  • an embodiment of a method for obtaining a network state includes:
  • the OFS receives the flow table edit message Flow-Mod sent by the OFC;
  • Flow-Mod includes flow table content and trigger comparison items
  • the OFS constructs a multi-level flow table according to the content of the flow table, and constructs a trigger table according to the trigger comparison item;
  • the OFS divides the content of the flow table according to a preset matching field to obtain at least two sub-flow tables
  • the OFS combines the subflow tables into a multi-level flow table in a preset order.
  • the OFS adds the trigger table to the end of the multi-level flow table, and establishes a correspondence between the multi-level flow table and the trigger table.
  • each Trigger ID corresponds to a trigger comparison item of the same operation type. It should be noted that the corresponding relationship between the multi-level flow table and the trigger table appearing in this document is implemented in the same manner. No longer repeat them;
  • the trigger table is set at the end of the multi-level flow table, but it can also be set in any of the multiple sub-flow tables in the multi-level flow table, and the specific setting position can achieve multiple levels in this paper.
  • the extended function of the flow meter can be used, and is not limited in this article.
  • the trigger table at the end of the multi-level flow table is used to store the alarm message, and the Flow-Mod is stored in the multi-level flow table;
  • Storing the Flow-Mod in the multi-level flow table specifically includes:
  • the multi-level flow table is split into at least two sub-flow tables according to the matching field feature, and the Flow-Mod is split into at least two sub-data blocks, and at least two sub-data blocks are respectively stored in the corresponding sub-flow table;
  • the OFS matches the obtained data packet with the multi-level flow table.
  • the OFS acquires the data packet in the network, parses the data packet, and matches the multi-level flow table to obtain a matching result.
  • the multi-level flow table includes an operation instruction and a trigger table, and the trigger table includes a trigger comparison item.
  • the flow table can jump from small to large in order, but cannot jump from a flow table to a flow table with a smaller number. .
  • the flow entry will be matched with the data packet in the order of priority.
  • the statistics of the counter record corresponding to the flow entry will be updated first.
  • the data packet is matched to one flow entry in the multi-level flow table.
  • the OFS determines that the last operation in the flow entry points to the trigger table, the OFS jumps the packet to the trigger table;
  • the statistics of the counter record corresponding to the flow entry are not limited in this document, wherein at least two sub-packets follow the matched flow table.
  • the flow entry priority of the entry matches the flow entry from high to low.
  • the last subflow table is executed. All operations in the flow entry in ;
  • the data packet is jumped to the trigger table, and each Trigger ID corresponds to a trigger comparison item of the same operation type.
  • the OFS determines whether the preset trigger reporting condition is met according to whether the network parameter related to the data packet exceeds a preset value of the triggering comparison item, and if yes, executing step 506, and if not, ending;
  • the OFS sets the result of all the judgments that exceed the preset value in the trigger comparison item as the network state information.
  • the flow entry includes a counter and a timeout timer
  • the trigger comparison item specifically includes:
  • the comparison item can be 16-bit Hard_timeout, Flow table status 64-bit Packet Matches, Group status 32-bit Packet Count, Flow entry status 32-bit Duration (seconds), Port status 64-bit Transmitted Packets, Port status 64-bit Receive Overrun Errors, and the like.
  • the check items are not limited in this article.
  • the result of the judgment is that the preset trigger report is satisfied.
  • the result of all the judgments exceeding the preset value in the trigger comparison item is set as the current network state information, wherein the trigger comparison item whose preset value is 0 does not perform the judgment process.
  • the OFS sends the network status information to the OFC.
  • a trigger operation item corresponding to the operation in the trigger index is executed, and the Packet-in packet is sent to the OFC.
  • the Flow-Mod message of the end preset trigger comparison item delivered by the OFC is obtained, and the multi-flow table structure with the trigger table set at the end is configured, so that after matching the corresponding flow entry,
  • the operation in the flow entry indicates that the trigger index is in the trigger table
  • the data packet is sent to the trigger table; and the report judgment process is executed, so that the current network state information is sent to the OFC when the network state meets the preset trigger report condition.
  • the OFC enables timely and effective processing and real-time monitoring of the current network state, and improves the sensitivity, response speed, and network management quality of the OFC to the network state.
  • FIG. 6 another embodiment of a method for obtaining a network state according to an embodiment of the present invention includes:
  • the OFS receives the flow table edit message Flow-Mod sent by the OFC;
  • Flow-Mod includes flow table content and trigger comparison items
  • the OFS constructs a multi-level flow table according to the content of the flow table, and constructs a trigger table according to the trigger comparison item;
  • the OFS divides the content of the flow table according to a preset matching field to obtain n sub-flow tables.
  • the OFS combines the subflow tables into n-level flow tables in a preset order.
  • the Trigger-extension part of the n-level flow table is the extension part of the Flow-Mod in the embodiment of the present invention, that is, the trigger comparison item, as shown in FIG. 15 in the drawing of the specification:
  • the OFS adds a trigger table at the end of the n-level flow table.
  • the OFS adds the trigger table to the end of the n-level flow table, and establishes a correspondence between the n-level flow table and the trigger table.
  • the extended portion of the n-level flow table is the same as the Trigger-extension described in step 601, and details are not described herein.
  • the trigger table at the end of the n-level flow table is used to store the alarm message, and the Flow-Mod is stored in the multi-level flow table;
  • Storing the Flow-Mod in the multi-level flow table specifically includes:
  • the OFS matches the obtained data packet with the n-level flow table.
  • the flow table can jump from small to large in order, but cannot jump from a flow table to a flow table with a smaller number. .
  • the flow entry will be matched with the data packet in the order of priority.
  • the statistics of the counter record corresponding to the flow entry will be updated first.
  • the statistics of the counter record corresponding to the flow entry are not limited in this document, wherein at least two sub-packets follow the matched flow table.
  • the flow entry priority of the entry matches the flow entry from high to low.
  • the matching field of the flow entry is matched with the data packet.
  • the last flow table n is forwarded and it is determined that at least one operation of the flow entry in the flow table n points to the trigger index Trigger ID in the trigger table, the last subflow table is executed. All operations in the flow entry;
  • the data packet is sent to the trigger table, and each Trigger ID corresponds to a trigger comparison item of the same operation type.
  • the OFS performs a process of determining whether the network parameter related to the data packet exceeds a preset value that triggers the comparison item;
  • the Port status 64 bit Transmitted Packets identifies that the data traffic received by the port exceeds a preset value, and determines that the result of the judgment is that the preset trigger reporting condition is met, so the item triggers the comparison item.
  • the result of the judgment is set to the current network status information.
  • the OFS determines whether the Packet-in data packet has been constructed according to the flow entry that matches the sub-data packet, and if yes, proceeds to step 607; if not, proceeds to step 608;
  • the OFS constructs a Packet-in data packet whose Reason field is warning
  • Each action in the flow entry containing the alarm type corresponds to the trigger action item in the trigger table.
  • the OFS adds a trigger table at the end of the Packet-in packet.
  • the trigger table includes the value of the trigger comparison item that exceeds the preset threshold when the judgment flow of the trigger report condition is executed.
  • the OFS adds the network status information to the Packet-in data packet.
  • the OFS sends the Packet-in packet that adds the network status information to the OFC.
  • the trigger operation item corresponding to the at least one operation in the at least one trigger index is executed, and the Packet-in data packet is sent to the OFC.
  • the Flow-Mod message of the end preset trigger comparison item delivered by the OFC is obtained, and the pre-configured multi-flow table structure with the trigger table set at the end is used to make After the corresponding flow entry is matched, it is determined that the operation in the flow entry points to the trigger index in the trigger table, and the data packet is jumped to the trigger table; the reporting judgment process is executed, so that the network state satisfies the preset trigger reporting condition.
  • the OFC can timely and effectively process and monitor the current network status, and improve the sensitivity, response speed, and network management quality of the OFC to the network state.
  • the method for obtaining the network state in the embodiment of the present invention is described above in the perspective of the OpenFlow switch OFS.
  • the following describes the embodiment of the present invention in detail from the perspective of the OpenFlow controller OFC. Referring to FIG. 7, where The disclosure is stored in the OFC, and the triggering table is used to store the information of the flow entry that triggers the comparison item and all the flow tables in the OpenFlow switch OFS.
  • Another embodiment of the method for obtaining the network status in the embodiment of the present invention includes:
  • the open flow controller OFC constructs a flow table edit message Flow-Mod
  • the Flow-Mod includes the flow table content and the trigger comparison item, and the trigger comparison item refers to the network state trigger threshold set, which is used to determine whether the network status needs to be reported;
  • the flow-mod is extended by adding a trigger comparison item at the end of the Flow-Mod, so that the preset trigger reporting condition is also sent at the same time as the flow table is sent;
  • the trigger comparison item is used when the OFS matches the acquired data packet with the multi-level flow table whose end is set with the trigger table, and the data packet matches the last flow entry in the multi-level flow table.
  • the data packet is sent to the trigger table, so that the OFS executes a trigger comparison item corresponding to each trigger index in the trigger table.
  • the judgment process when the result of the judgment is that the preset trigger report condition is satisfied, the current network state information is generated according to the result of the judgment.
  • the OFC sends a Flow-Mod to the OpenFlow switch OFS.
  • the OFS constructs a multi-level flow table according to the flow table content and the trigger comparison item in the Flow-Mod, and adds the trigger table at the end of the multi-level flow table, and the Flow-Mod end Triggering a trigger table in which the comparison item is stored in the multi-level flow table, and setting a last operation of the multi-level flow table to point to a trigger index in the trigger table, so that the OFS will acquire the data packet and the multi-level flow When the table is matched, the data packet is jumped to the trigger table, thereby performing the judgment of the preset trigger reporting condition. Obtain network status information and report it;
  • the OFC receives the network status information sent by the OFS.
  • the OFC After receiving the network status information sent by the OFS, the OFC can monitor the network according to the currently obtained network status information, and can perform effective or timely processing, such as modifying the firewall.
  • the Flow-Mod is extended by adding a trigger comparison item at the end of the Flow-Mod, so that the preset trigger reporting condition is also sent at the same time that the flow table is sent, so that the OFS can be constructed according to the Flow-Mod.
  • the new multi-flow table structure performs the judgment process of triggering the comparison item to obtain the current network status information, and then reports the network status information in time, realizing real-time monitoring of the network, and improving the security and stability of the network.
  • another embodiment of a method for obtaining a network state according to an embodiment of the present invention includes:
  • the open flow controller OFC constructs a flow table edit message Flow-Mod
  • the Flow-Mod includes the flow table content and the trigger comparison item, and the trigger comparison item refers to the network state trigger threshold set, which is used to determine whether the network status needs to be reported;
  • the flow-mod is extended by adding a trigger comparison item at the end of the Flow-Mod, so that the preset trigger reporting condition is also sent at the same time as the flow table is sent;
  • the trigger comparison item is used when the OFS matches the acquired data packet with the multi-level flow table whose end is set with the trigger table, and the data packet matches the last flow entry in the multi-level flow table.
  • the data packet is sent to the trigger table, so that the OFS executes a trigger comparison item corresponding to each trigger index in the trigger table.
  • the judgment process when the result of the judgment is that the preset trigger report condition is satisfied, the current network state information is generated according to the result of the judgment.
  • the OFC sends a Flow-Mod to the OpenFlow switch OFS.
  • the OFS constructs a multi-level flow table according to the flow table content and the trigger comparison item in the Flow-Mod, and adds the trigger table at the end of the multi-level flow table, and the Flow-Mod end Triggering a trigger table in which the comparison item is stored in the multi-level flow table, and setting a last operation of the multi-level flow table to point to a trigger index in the trigger table, so that the OFS will acquire the data packet and the multi-level flow When the table is matched, the data packet is jumped to the trigger table, thereby performing the judgment of the preset trigger reporting condition. Obtain network status information and report it;
  • the OFC receives the network status information sent by the OFS.
  • the OFC After receiving the network status information sent by the OFS, the OFC can monitor the network according to the currently obtained network status information, and can perform effective or timely processing, such as modifying the firewall.
  • the OFC sends the network state trigger threshold set to the OFS.
  • the OFC updates the Flow-Mod according to the network status information.
  • the OFC updates the trigger comparison item according to the network status message, and adds the updated trigger comparison item to the Flow-Mod to obtain the updated Flow-Mod;
  • the OFC sends the updated Flow-Mod to the OFS such that the OFS updates the multi-level flow table according to the updated Flow-Mod.
  • a selected trigger comparison item is added to the end of the Flow-Mod to cause the Flow-Mod to be updated.
  • the Flow-Mod is extended by adding a trigger comparison item at the end of the Flow-Mod, so that the preset trigger reporting condition is also sent at the same time that the flow table is sent, so that the OFS can be constructed according to the Flow-Mod.
  • the new multi-flow table structure performs the judgment process of triggering the comparison item to obtain the current network status information, and then reports the network status information in time, and updates the trigger table according to the received network status information, so as to update and deliver the information according to the needs.
  • Flow-Mod implements real-time monitoring of the network and improves the security and stability of the network.
  • the first execution unit 901 is configured to match the acquired data packet with the multi-level flow table, and obtain a matching result, where the multi-level flow table includes an operation instruction and a trigger table, where the trigger table includes a trigger comparison item;
  • the first determining unit 902 is configured to determine, according to a result of the matching, an operation instruction corresponding to the data packet;
  • the first determining unit 903 is configured to: when the operation instruction corresponding to the data packet is directed to the trigger table, the OFS determines a reporting condition of the data packet according to a trigger comparison item in the trigger table, and obtains a judgment result;
  • the second executing unit 904 is configured to: when the result of the determining meets a preset trigger reporting condition, the OFS generates network state information according to the result of the determining;
  • the first sending unit 905 is configured to send the network state information to the OpenFlow controller OFC.
  • the first execution unit 901 matches the data packet with the multi-level flow table including the trigger table, and when the operation instruction corresponding to the data packet points to the trigger table, the first determining unit 903 executes the trigger comparison item in the trigger table.
  • the judgment process when the result of the judgment is that the preset trigger report condition is met, the current network state information is generated; the first sending unit 904 sends the network state information to the OFC, so that the OFC can obtain the current network state information in real time. And real-time monitoring of the network improves the sensitivity and response speed of the OFC to the network status and improves the quality of network management.
  • FIG. 10 another embodiment of an OpenFlow switch in an embodiment of the present invention includes:
  • the first execution unit 1001 is configured to match the acquired data packet with a multi-level flow table, and obtain a matching result, where the multi-level flow table includes an operation instruction and a trigger table, and the trigger table includes a trigger comparison item;
  • the first determining unit 1002 is configured to determine, according to the result of the matching, an operation instruction corresponding to the data packet;
  • the first determining unit 1003 is configured to: when the operation instruction corresponding to the data packet points to the trigger table, trigger the comparison item in the trigger table to perform a reporting condition judgment on the data packet, and obtain a result of the determining;
  • the second executing unit 1004 is configured to generate network state information according to the result of the determining, when the result of the determining meets the preset trigger reporting condition;
  • the first sending unit 1005 is configured to send network state information to the OpenFlow controller OFC.
  • the OFS further includes:
  • the first receiving unit 1006 is configured to receive a flow table editing message Flow-Mod sent by the OFC, where the Flow-Mod includes a flow table content and a trigger comparison item;
  • a first configuration unit 1007 configured to construct a multi-level flow table according to the content of the flow table
  • a second configuration unit 1008 configured to construct a trigger table according to the trigger comparison item
  • the third execution unit 1009 is configured to add a trigger table to the end of the multi-level flow table, and establish a correspondence between the multi-level flow table and the trigger table.
  • the first configuration unit 1007 specifically includes:
  • the first configuration module 10071 is configured to divide the flow table content according to a preset matching field to obtain at least two sub-flow tables;
  • the second configuration module 10072 is configured to combine the sub-flow tables into a multi-level flow table in a preset order.
  • the first execution unit 1001 matches the data packet with the multi-level flow table including the trigger table, and when the operation instruction corresponding to the data packet points to the trigger table, the first determining unit 1003 executes the trigger comparison item in the trigger table.
  • the judging process, the second executing unit 1004 generates current network state information by the result of the judgment that satisfies the preset trigger reporting condition; the first sending unit 1005 sends the network state information to the OFC, so that the OFC can obtain the current in real time.
  • Network status information and real-time monitoring of the network improve the sensitivity and response speed of the OFC to the network status and improve the quality of network management.
  • FIG. 11 another embodiment of an OpenFlow switch according to an embodiment of the present invention includes:
  • the first execution unit 1101 is configured to match the acquired data packet with the multi-level flow table to obtain a matching result, where the multi-level flow table includes an operation instruction and a trigger table, and the trigger table includes a trigger comparison item;
  • the first determining unit 1102 is configured to determine, according to the result of the matching, an operation instruction corresponding to the data packet;
  • the first determining unit 1103 is configured to: when the operation instruction corresponding to the data packet is directed to the triggering table, perform a reporting condition judgment on the data packet according to the trigger comparison item in the triggering table, and obtain a result of the determining;
  • the second executing unit 1104 is configured to generate network state information according to the result of the determining, when the result of the determining meets the preset trigger reporting condition;
  • the first sending unit 1105 is configured to send network state information to the OpenFlow controller OFC.
  • the OFS further includes:
  • a first receiving unit 1106, configured to receive a flow table editing message Flow-Mod sent by the OFC, where the Flow-Mod includes a flow table content and a trigger comparison item;
  • a first configuration unit 1107 configured to construct a multi-level flow table according to the content of the flow table
  • a second configuration unit 1108, configured to construct a trigger table according to the trigger comparison item
  • the third execution unit 1109 is configured to add a trigger table to the end of the multi-level flow table, and establish a correspondence between the multi-level flow table and the trigger table.
  • the result of the matching is that the data packet is matched to one flow entry in the multi-level flow table
  • the OFS also includes:
  • the second determining unit 1110 is configured to determine, according to an operation instruction in the flow entry that matches the data packet, whether the Packet-in data packet has been constructed;
  • the second execution unit 1104 further includes:
  • a third configuration module 11041 configured to: when the Packet-in data packet is not configured, construct a Packet-in data packet, and add the network state information to the Packet-in data packet;
  • the fourth configuration module 11042 is configured to: when the Packet-in data packet has been constructed, the OFS constructs a reanson field as a Warning Packet-in data packet, and adds the network state information to the reanson field as warning Packet-in packet.
  • the first execution unit 1101 matches the data packet with the multi-level flow table including the trigger table, and the third execution unit 1109 receives the Flow-Mod structure multi-level flow table according to the first receiving unit 1106 and establishes a multi-stage flow table.
  • the first determining unit 1103 performs a judgment flow of the trigger comparison item in the trigger table when the operation instruction corresponding to the data packet points to the trigger table
  • the fourth configuration module 11042 constructs the reanson field as warning Packet-in data packet, and adding the network state information to the Packet-in data packet whose reanson field is warning, ensuring that the network state report can also be completed if the data packet is abnormal;
  • the first sending unit 1105 will include The Packet-in packet of the network status information is sent to the OFC, so that the OFC can obtain the current network status information and real-time monitoring of the network in real time, improve the sensitivity and response speed of the OFC to the network status, and improve the network management quality.
  • FIG. 12 another embodiment of an OpenFlow switch in an embodiment of the present invention includes:
  • the first execution unit 1201 is configured to match the acquired data packet with the multi-level flow table to obtain a matching result, where the multi-level flow table includes an operation instruction and a trigger table, and the trigger table includes a trigger comparison item;
  • the first determining unit 1202 is configured to determine, according to the result of the matching, an operation instruction corresponding to the data packet;
  • the first determining unit 1203 is configured to: when the operation instruction corresponding to the data packet is directed to the trigger table, determine a reporting condition of the data packet according to the trigger comparison item in the trigger table, and obtain a result of the determining;
  • the second executing unit 1204 is configured to generate network state information according to the result of the determining, when the result of the determining meets the preset trigger reporting condition;
  • the first sending unit 1205 is configured to send network state information to the OpenFlow controller OFC.
  • the second executing unit 1204 is specifically configured to: when the result of the determining meets a preset trigger reporting condition, construct a Packet-in data packet, and add the network state information to the Packet-in data packet. no;
  • the first sending unit 1205 is specifically configured to send, to the OFC, a Packet-in data packet that adds the network state information.
  • the OFS further includes:
  • the first receiving unit 1206 is configured to receive a flow table editing message Flow-Mod sent by the OFC, where the Flow-Mod includes a flow table content and a trigger comparison item;
  • a first configuration unit 1207 configured to construct a multi-level flow table according to the content of the flow table
  • a second configuration unit 1208, configured to construct a trigger table according to the trigger comparison item
  • the third execution unit 1209 is configured to add a trigger table to the end of the multi-level flow table, and establish a correspondence between the multi-level flow table and the trigger table.
  • the OFS further includes:
  • the updating unit 1210 is configured to update a current network state and a counter corresponding to the flow entry in the multi-level flow table that matches the data packet when the operation instruction corresponding to the data packet is directed to the trigger table.
  • the first execution unit 1201 matches the data packet with the multi-level flow table including the trigger table
  • the third execution unit 1209 receives the Flow-Mod structure multi-level flow table according to the first receiving unit 1206 and establishes the multi-level flow table.
  • the first determining unit 1203 updates the current network state and the flow table in the multi-level flow table matching the data packet when the operation instruction corresponding to the data packet points to the trigger table.
  • the first sending unit 1204 will include the network status information Packet- The in packet is sent to the OFC, so that the OFC can obtain the current network status information and monitor the network in real time.
  • the sensitivity and response speed of OFC to network status are improved, and the quality of network management is improved.
  • an embodiment of an OpenFlow controller OFC in the embodiment of the present invention includes:
  • the first configuration unit 1301 is configured to construct a flow table edit message Flow-Mod, where the Flow-Mod includes a flow table content and a trigger comparison item, where the trigger comparison item is a network state trigger threshold set, and is used to determine whether a network status needs to be reported;
  • the first sending unit 1302 is configured to send a Flow-Mod to the OpenFlow switch OFS, so that the OFS constructs a multi-level flow table according to the flow table content and the trigger comparison item, and reports network status information according to the multi-level flow table;
  • the receiving unit 1303 is configured to receive network status information sent by the OFS.
  • the first configuration unit 1301 constructs a Flow-Mod that includes the flow table content and the trigger comparison item, and is sent to the OFS by the first sending unit 1302, so that the OFS is in the multi-stage flow of the data packet and the trigger table.
  • the trigger comparison item is judged, and the network status information is generated as a result of the judgment that satisfies the preset trigger reporting condition, and the receiving unit 1303 receives the network status information sent by the OFS. Therefore, according to the current network state information and real-time monitoring of the network, the sensitivity, response speed and network management quality of the OFC to the network state are improved.
  • an embodiment of an OpenFlow controller OFC in the embodiment of the present invention includes:
  • the first configuration unit 1401 is configured to construct a flow table edit message Flow-Mod, where the flow-mod includes a flow table content and a trigger comparison item, where the trigger comparison item is a network state trigger threshold set, and is used to determine whether a network status needs to be reported;
  • the first sending unit 1402 is configured to send a Flow-Mod to the OpenFlow switch OFS, so that the OFS constructs a multi-level flow table according to the flow table content and the trigger comparison item, and reports network status information according to the multi-level flow table;
  • the receiving unit 1403 is configured to receive network status information sent by the OFS.
  • the OFC further includes:
  • the updating unit 1404 is configured to update the trigger comparison item according to the network status message
  • a second configuration unit 1405, configured to add an updated trigger comparison item to the Flow-Mod to obtain an updated Flow-Mod
  • the second sending unit 1406 is configured to send the updated Flow-Mod to the OFS, so that the OFS updates the multi-level flow table according to the updated Flow-Mod.
  • the first configuration unit 1401 constructs a Flow-Mod that includes the flow table content and the trigger comparison item, and is sent to the OFS by the first sending unit 1402, so that the OFS is in the multi-stage flow of the data packet and the trigger table.
  • the trigger comparison item is judged, and the network status information is generated as a result of the judgment that satisfies the preset trigger report condition, and the receiving unit 1403 receives the network status information sent by the OFS. Therefore, according to the current network state information obtained and the real-time monitoring of the network, the sensitivity of the OFC to the network state, the response speed, and the network management quality are improved.
  • the updating unit 1404 updates the trigger comparison item according to the network status message, so that the The two transmitting unit 1406 transmits the Flow-Mod updated by the second configuration unit 1405 to the OFS, so that the OFS updates the multi-level flow table according to the updated Flow-Mod, so that the monitoring of the network status and the device is more flexible and accurate.
  • the field option for extending the data packet and the multi-level flow table is the preset trigger comparison item appearing in this document.
  • these extended field options are Optional as follows:
  • 8-bit flag indicates that if the flow entry is matched, the status information is reported.
  • 16-bit Hard_timeout Indicates the remaining time when the flow entry is matched. If it is less than the preset value, it reports the status message; if it is all 0, it does not detect the item.
  • Flow table status 64-bit Packet Matches If the data packet matching the flow table exceeds the preset value, the status message is reported; if it is all 0, the item is not detected.
  • Flow entry status 64-bit Received Packets If the data packet matching the flow entry exceeds the preset value, the status information is reported. If all packets are 0, the entry is not detected.
  • Port status 64-bit Received Packets: Indicates that the data traffic received by the port exceeds the preset value, and reports the status message; if it is all 0, the item is not detected.
  • Port status 64-bit Transmitted Packets Reports that the data traffic transmitted by the port exceeds the preset value, and reports the status message; if it is all 0, the item is not detected.
  • Port status 64-bit Receive Drops: If the data traffic discarded by the port exceeds the preset value, the status message is reported. If all data is 0, the item is not detected.
  • Queue status64 bit Transmit Packets: If the data traffic received by the queue exceeds the preset value, the status message is reported; if it is all 0, the item is not detected.
  • Group status 32-bit Packet Count If the data traffic received by the group table exceeds the preset value, the status message is reported; if it is all 0, the item is not detected.
  • the complete optional conditions include the following:
  • Flow table status 64-bit Packet Lookups indicates the number of packets that have been found in the current flow table. If the value exceeds the preset value, the status message is reported. The default value is all 0s to detect the item.
  • Flow table status 64-bit Packet Matches Indicates the number of packets matching the current flow table. If the value exceeds the preset value, the status message is reported. The default value is all 0s to detect the item.
  • Flow entry status 64-bit Received Packets Indicates the number of packets received by the current flow entry. If the value exceeds the preset value, the status message is reported. The default value is all 0s.
  • Flow entry status 64-bit Received Bytes Indicates the number of data packets received by the current flow entry. If the value exceeds the preset value, the status message is reported. The default value is all 0s.
  • Port status 8-bit port number indicates the number of ports involved in this flow table. Select the same number of parameters from the following 11 field options according to the number of ports.
  • Port status 64-bit Received Packets indicates the number of packets received by the port. If the number exceeds the preset value, the status message is reported. If the default value is 0, the item is not checked.
  • Port status 64-bit Transmitted Packets indicates the number of packets transmitted by the port. If the value exceeds the preset value, the status message is reported. When the default value is 0, the item is not checked.
  • Port status 64-bit Received Bytes indicates the number of data packets received by the port. If the number exceeds the preset value, the status message is reported. When the default value is 0, the item is not checked.
  • Port status 64-bit Transmitted Bytes indicates the number of data packets transmitted by the port. If the value exceeds the preset value, the status message is reported. When the default value is 0, the item is not checked.
  • Port status 64-bit Receive Drops indicates the number of discarded packets on the port. If the number exceeds the preset value, the status message is reported. When the default value is 0, the item is not checked.
  • Port status 64-bit Transmitted Drops indicates the number of discarded packet bits transmitted by the port. If the value exceeds the preset value, the status message is reported. When the default value is 0, the item is not checked.
  • Port status 64-bit Receive Errors indicates the number of errors received by the port. If the value exceeds the preset value, the status message is reported. When the default value is 0, the item is not checked.
  • Port status 64-bit Transmitted Errors Indicates the number of errors transmitted by the port. If the value exceeds the preset value, the status message will be reported. If the default value is 0, the item will not be checked.
  • Port status 64-bit Receive Frame Alignment Errors Indicates the number of port frame positioning errors. If the preset value is exceeded, the status message will be reported. If the default value is 0, the item will not be checked.
  • Port status 64-bit Receive Overrun Errors indicates the number of overspeed errors on the port. If the value exceeds the preset value, the status message is reported. When the default value is 0, the item is not checked.
  • Port status 64-bit Receive CRC Errors Indicates the number of CRC errors on the port. If the default value is exceeded, the status message will be reported. If the default value is 0, the item will not be checked.
  • Port status 64-bit Collisions indicates the number of port conflicts. If the preset value is exceeded, the status message is reported. When the default value is 0, the item is not checked.
  • Port status 32-bit Duration indicates the port time (nanoseconds). If the preset value is exceeded, the status message is reported. When the default value is 0, the item is not checked.
  • Queue status 8-bit queue number indicates the number of queues involved in this flow table, according to the number of ports. Select the same number of parameters from the following five field options.
  • queue status 64-bit Transmit Packets: If the number of packets received by the queue exceeds the preset value, the status message is reported; if it is all 0, the item is not detected.
  • queue status 64-bit Transmit Bytes If the number of data bits received by the queue exceeds the preset value, the status message is reported; if it is all 0, the item is not detected.
  • queue status 64-bit Transmit Overrun Errors If the number of overspeed transmissions of the queue exceeds the preset value, the status message is reported; if it is all 0, the item is not detected.
  • queue status 32-bit Duration indicates the queue time (nanoseconds). If the preset value is exceeded, the status message is reported. When the default value is 0, the item is not checked.
  • Group status 32-bit Reference Count indicates the number of flow entries related to the current group. If the preset value is exceeded, the status message is reported. When the default value is 0, the item is not checked.
  • Group status 64-bit Packet Count indicates the current number of packets in the group. If the preset value is exceeded, the status message is reported. When the default value is 0, the item is not checked.
  • Group status 64-bit Byte Count indicates the current number of group bits. If the preset value is exceeded, the status message is reported. When the default value is 0, the item is not checked.
  • Group status 32-bit Duration indicates the current group time (nanoseconds). If the preset value is exceeded, the status message is reported. When the default value is 0, the item is not checked.
  • Group Bucket status 64-bit Packet Count which indicates the current number of bucket packets. If the preset value is exceeded, the status message is reported. When the default value is 0, the item is not checked.
  • Group Bucket status 64-bit Byte Count, indicating the current number of bucket bits. If the preset value is exceeded, the status message is reported. When the default value is 0, the item is not checked.
  • FIG. 16 is another structural diagram of an OpenFlow switch OFS according to an embodiment of the present invention.
  • at least one processor 1601 eg, CPU, Central Processing Unit
  • at least one network interface or other communication interface memory 1602, receiving device 1603, transmitting device 1604, and at least one communication bus may be included for implementing the devices Communication between the connections.
  • the processor 1601 is configured to execute an executable module, such as a computer program, stored in a memory.
  • the memory 1602 may include a high speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory.
  • the communication connection between the system gateway and at least one other network element is implemented by at least one network interface (which may be wired or wireless), and an Internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
  • program instructions are stored in the memory 1602, and the program instructions may be executed by the processor 1601.
  • the processor 1601 specifically performs the following steps:
  • the multi-level flow table includes an operation instruction and a trigger table, and the trigger table includes a trigger comparison item;
  • the report condition is judged according to the trigger comparison item in the trigger table, and the result of the judgment is obtained;
  • the network state information is generated according to the result of the judgment, and the network state information is sent to the OpenFlow controller OFC.
  • the processor 1601 can also perform the following steps:
  • the Flow-Mod includes a flow table content and a trigger comparison item
  • the processor 1601 can also perform the following steps:
  • the flow table content is divided according to a preset matching field to obtain at least two sub-flow tables
  • the subflow tables are combined into a multi-level flow table in a preset order.
  • the processor 1601 can also perform the following steps:
  • a Packet-in packet that adds network status information is sent to the OFC.
  • the processor 1601 can also perform the following steps:
  • the Packet-in packet When the Packet-in packet is not constructed, the Packet-in packet is constructed, and the network status information is added to the Packet-in packet;
  • the packet-in packet with the reanson field being warning is constructed, and the network status information is added to the Packet-in packet with the reanson field being warning.
  • the processor 1601 can also perform the following steps:
  • FIG. 17 is another schematic structural diagram of an OpenFlow controller OFC according to an embodiment of the present invention, where at least one processor 1701 (eg, CPU, Central Processing Unit), at least one network interface or other communication interface may be included.
  • the memory 1702, the receiving device 1703, the transmitting device 1704, and at least one communication bus are used to implement connection communication between the devices.
  • the processor 1701 is configured to execute an executable module, such as a computer program, stored in a memory.
  • the memory 1702 may include a high speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory.
  • the communication connection between the system gateway and at least one other network element is implemented by at least one network interface (which may be wired or wireless), and an Internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
  • program instructions are stored in the memory 1702, and the program instructions may be executed by the processor 1701.
  • the processor 1701 specifically performs the following steps:
  • the flow table edit message Flow-Mod is configured, and the flow-mod includes the flow table content and the trigger comparison item, and the trigger comparison item refers to the network state trigger threshold set, which is used to determine whether the network status needs to be reported;
  • the processor 1701 can also perform the following steps:
  • the trigger comparison item is updated according to the network status message
  • the updated Flow-Mod is sent to the OFS such that the OFS updates the multi-level flow table according to the updated Flow-Mod.
  • the disclosed system, apparatus, and method may 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, at least two units or components may be combined. Or it can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to at least two network units. . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist 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.
  • the technical solution of the present invention is essentially or a part contributing to the prior art or all of the technical solution.
  • a portion may be embodied in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform various embodiments of the present invention. All or part of the steps of the method described.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

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

Abstract

本发明公开了一种获取网络状态的方法及装置,所述方法包括:开放流交换机OFS将获取到的数据包与包含操作指令和触发表的多级流表进行匹配;所述OFS根据匹配的结果,确定所述数据包对应的操作指令;当所述数据包对应的操作指令指向所述触发表时,所述OFS根据所述触发表中的触发比较项对所述数据包进行上报条件判断;当获取的判断的结果满足预置的触发上报条件时,所述OFS根据所述判断的结果生成网络状态信息,并向开放流控制器OFC发送所述网络状态信息,使OFC可以实时获取到当前的网络状态信息和对网络进行实时监控,提高了OFC对网络状态的敏感度、反应速度以及网络管理质量。

Description

一种获取网络状态的方法及装置 技术领域
本发明涉及网络通信技术领域,尤其涉及的是一种获取网络状态的方法及装置。
背景技术
SDN(software-defined network)网络是一种控制与管理分离的新型网络架构,其核心技术OpenFlow通过将交换设备的数据转发层和控制层分离,实现在OpenFlow交换机上转发数据,在控制器上控制数据的转发,从而更好的控制网络,基于OpenFlow的SDN,实现了软硬件的分离以及底层硬件的虚拟化,并且网络协议和交换策略的升级只需要改动控制层,为核心网络及应用的创新提供良好的发展平台,另外,在内部网络和外网的连接处应用OpenFlow交换机可以通过更改数据流的路径以及拒绝某些数据流来增强企业内网的安全性。SDN由专有设备来部署高层策略,网络设备在高层策略指导下进行数据转发,减少网络设备承载,提高网络设计规划和管理的灵活性。
现有技术中,SDN网络中的控制器通过下发数据包查询流表、端口等信息,从而获取网络状态。
从上可知,现有技术提供的方法不能满足控制器实时获取网络状态的需要。
发明内容
本发明提供了一种获取网络状态的方法及装置,用于解决现有技术中开放流控制器无法实时获取网络状态的问题。
本发明第一方面提供一种获取网络状态的方法,所述方法包括:
开放流交换机OFS将获取到的数据包与多级流表进行匹配,获取匹配的结果,所述多级流表包含操作指令和触发表,所述触发表包含触发比较项;
所述OFS根据所述匹配的结果,确定所述数据包对应的操作指令;
当所述数据包对应的操作指令指向所述触发表时,所述OFS根据所述触 发表中的触发比较项对所述数据包进行上报条件判断,获取判断的结果;
当所述判断的结果满足预置的触发上报条件时,所述OFS根据所述判断的结果生成网络状态信息,并向开放流控制器OFC发送所述网络状态信息。
结合本发明第一方面,本发明第一方面的第一种实现方式中,所述开放流交换机OFS将获取到的数据包与多级流表进行匹配之前还包括:
所述OFS接收所述OFC发送的流表编辑消息Flow-Mod,所述Flow-Mod包括流表内容和所述触发比较项;
所述OFS根据所述流表内容构造所述多级流表;
所述OFS根据所述触发比较项构造所述触发表;
所述OFS将所述触发表添加到所述多级流表末端,并建立所述多级流表与所述触发表的对应关系。
结合本发明第一方面及第一方面的第一种实现方式,本发明第一方面的第二种实现方式中,所述OFS根据所述流表内容构造多级流表包括:
所述OFS按照预设的匹配字段将所述流表内容进行划分,以获得至少两个子流表;
所述OFS按照预设顺序将所述子流表组合成所述多级流表。
结合本发明第一方面、第一方面的第一至第二种实现方式,本发明第一方面的第三种实现方式中,所述向开放流控制器OFC发送所述网络状态信息具体包括:
所述OFS构造Packet-in数据包,并将所述网络状态信息添加到所述Packet-in数据包的扩展字段;
所述OFS向所述OFC发送添加所述网络状态信息的Packet-in数据包。
结合本发明第一方面及第一方面的第三种实现方式,本发明第一方面的第四种实现方式中,所述匹配的结果为所述数据包匹配到所述多级流表中的一条流表项;
所述构造Packet-in数据包之前还包括:
所述OFS根据与所述数据包相匹配的流表项中的操作指令,判断是否已构造Packet-in数据包;
所述构造Packet-in数据包,并将所述网络状态信息添加到所述Packet-in数据包的扩展字段具体包括:
当没有构造所述Packet-in数据包时,则所述OFS构造Packet-in数据包,并将所述网络状态信息添加到所述Packet-in数据包;
当已经构造所述Packet-in数据包时,则所述OFS构造reanson字段为warning的Packet-in数据包,并将所述网络状态信息添加到reanson字段为warning的Packet-in数据包。
结合本发明第一方面、第一方面的第一至第四种实现方式,本发明第一方面的第五种实现方式中,所述方法还包括:
当所述数据包对应的操作指令指向所述触发表时,所述OFS更新当前的网络状态以及与所述数据包匹配的多级流表中的流表项对应的计数器。
本发明第二方面提供一种获取网络状态的方法,所述方法包括:
开放流控制器OFC构建流表编辑消息Flow-Mod,所述Flow-Mod包括流表内容和触发比较项,所述触发比较项是指网络状态触发阈值集合,用于判断是否需要上报网络状态;
所述OFC向开放流交换机OFS发送所述Flow-Mod,以使得所述OFS根据所述流表内容和所述触发比较项构建多级流表,并根据所述多级流表上报网络状态信息;
所述OFC接收所述OFS发送的网络状态消息。
结合本发明第二方面,本发明第二方面的第一种实现方式中,所述OFC接收所述OFS发送的网络状态消息之后还包括:
所述OFC根据所述网络状态消息更新触发比较项;
所述OFC将更新的触发比较项添加到所述Flow-Mod,以获得更新的Flow-Mod;
所述OFC向所述OFS发送所述更新的Flow-Mod,以使得所述OFS根据所述更新的Flow-Mod更新多级流表。
本发明第三方面提供一种开放流交换机OFS,所述OFS包括:
第一执行单元,用于将获取到的数据包与多级流表进行匹配,获取匹配的结果,所述多级流表包含操作指令和触发表,所述触发表包含触发比较项;
第一确定单元,用于根据所述第一执行单元获取的匹配的结果,确定所述数据包对应的操作指令;
第一判断单元,用于当所述数据包对应的操作指令指向所述触发表时,所述OFS根据所述触发表中的触发比较项对所述数据包进行上报条件判断,获取判断的结果;
第二执行单元,用于当所述判断的结果满足预置的触发上报条件时,所述OFS根据所述判断的结果生成网络状态信息;
第一发送单元,用于向开放流控制器OFC发送所述网络状态信息。
结合本发明第三方面,本发明第三方面的第一种实现方式中,其特征在于,所述OFS还包括:
第一接收单元,用于接收所述OFC发送的流表编辑消息Flow-Mod,所述Flow-Mod包括流表内容和所述触发比较项;
第一配置单元,用于根据所述流表内容构造多级流表;
第二配置单元,用于根据所述触发比较项构造所述触发表;
第三执行单元,用于将所述触发表添加到所述多级流表末端,并建立所述多级流表与所述触发表的对应关系。
结合本发明第三方面及第三方面的第一种实现方式,本发明第三方面的第二种实现方式中,所述第一配置单元具体包括:
第一配置模块,用于按照预设的匹配字段将所述流表内容进行划分,以获得至少两个子流表;
第二配置模块,用于按照预设顺序将所述子流表组合成所述多级流表。
结合本发明第三方面及第三方面的第一至第二种实现方式,本发明第三方面的第三种实现方式中,第二执行单元,具体用于当所述判断的结果满足预置的触发上报条件时,构造Packet-in数据包,并将所述网络状态信息添加到所 述Packet-in数据包的扩展字段;
第一发送单元,具体用于向所述OFC发送添加所述网络状态信息的Packet-in数据包。
结合本发明第三方面及第三方面的第一至第三种实现方式,本发明第三方面的第四种实现方式中,所述匹配的结果为所述数据包匹配到所述多级流表中的一条流表项;所述OFS还包括:
第二判断单元,用于根据与所述数据包相匹配的流表项中的操作指令,判断是否已构造Packet-in数据包;
进一步所述第二执行单元还包括:
第三配置模块,用于当没有构造所述Packet-in数据包时,构造Packet-in数据包,并将所述网络状态信息添加到所述Packet-in数据包;
第四配置模块,用于当已经构造所述Packet-in数据包时,则所述OFS构造reanson字段为warning的Packet-in数据包,并将所述网络状态信息添加到reanson字段为warning的Packet-in数据包。
结合本发明第三方面及第三方面的第一至第四种实现方式,本发明第三方面的第五种实现方式中,所述OFS还包括:
更新单元,用于当所述数据包对应的操作指令指向所述触发表时,更新当前的网络状态以及与所述数据包匹配的多级流表中的流表项对应的计数器。
本发明第四方面提供一种开放流控制器OFC,所述OFC包括:
第一配置单元,用于构建流表编辑消息Flow-Mod,所述Flow-Mod包括流表内容和触发比较项,所述触发比较项是指网络状态触发阈值集合,用于判断是否需要上报网络状态;
第一发送单元,用于向开放流交换机OFS发送所述Flow-Mod,以使得所述OFS根据所述流表内容和所述触发比较项构建多级流表,并根据所述多级流表上报网络状态信息;
接收单元,用于接收所述OFS发送的网络状态信息。
结合本发明第四方面,本发明第四方面的第一种实现方式中,所述OFC 还包括:
更新单元,用于根据所述网络状态消息更新触发比较项;
第二配置单元,用于将更新的触发比较项添加到所述Flow-Mod,以获得更新的Flow-Mod;
第二发送单元,用于向所述OFS发送所述更新的Flow-Mod,以使得所述OFS根据所述更新的Flow-Mod更新多级流表。
根据第一方面和第三方面的本发明实施例的描述,在将获取到的数据包与多级流表进行匹配时,确定所述数据包对应的操作指令,当所述数据包对应的操作指令指向所述触发表时,所述OFS根据所述触发表中的触发比较项对所述数据包进行上报条件判断,当判断的结果为满足预置的触发上报条件时,根据所述判断的结果生成网络状态信息,并向开放流控制器OFC发送所述网络状态信息,以使OFC可以实时获取到当前的网络状态信息,有效提高OFC对网络状态的敏感度和反应速度,提高了网络管理质量。
根据第二方面和第四方面的本发明实施例的描述,通过在Flow-Mod的末端添加触发比较项对Flow-Mod进行扩展,使得在下发流表的同时也下发了预置的触发上报条件,使OFS可以根据Flow-Mod构造新的多流表结构,执行触发比较项的判断流程得到当前的网络状态信息,然后及时的将网络状态信息上报,实现了对网络的实时监控,提高了网络的安全性与稳定性。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本实施例中一种获取网络状态的方法的一个实施例示意图;
图2为本实施例中一种获取网络状态的方法的另一实施例示意图;
图3为本实施例中一种获取网络状态的方法的另一实施例示意图;
图4为本实施例中一种获取网络状态的方法的另一实施例示意图;
图5为本实施例中一种获取网络状态的方法的另一实施例示意图;
图6为本实施例中一种获取网络状态的方法的另一实施例示意图;
图7为本实施例中一种获取网络状态的方法的另一实施例示意图;
图8为本实施例中一种获取网络状态的方法的另一实施例示意图;
图9为本实施例中一种开放流交换机OFS的一个实施例示意图;
图10为本实施例中一种开放流交换机OFS的另一实施例示意图;
图11为本实施例中一种开放流交换机OFS的另一实施例示意图;
图12为本实施例中一种开放流交换机OFS的另一实施例示意图;
图13为本实施例中一种开放流控制器OFC的一个实施例示意图;
图14为本实施例中一种开放流控制器OFC的另一实施例示意图;
图15为本实施例中一种扩展的Flow-Mod结构示意图;
图16为本实施例中一种开放流交换机OFS的实体装置示意图;
图17为本实施例中一种开放流控制器OFC的实体装置示意图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
本发明实施例提供了一种获取网络状态的方法及装置,用于解决现有技术 中控制服务器无法实时获取网络状态的问题。以下进行详细说明。
本发明实施例应用于Openflow网络,Openflow网络包括开放流控制器(Openflow controller,OFC)、开放流交换机(Openflow switch,OFS),需要说明的是,本文中操作包括跳转至后续的某一流表继续处理、修改数据包和立即执行数据包对应的动作集合等,网络状态信息包括流表项匹配状态、数据包执行端口负载状态、丢失/转发/收到数据包的总数量或数据包TTR失效等类似情况,只要是网络中可能出现的任何网络状态都包括在内,本文中均不作限定。
请参照图1,本发明实施例中一种获取网络状态的方法一个实施例包括:
101、开放流交换机OFS将获取到的数据包与多级流表进行匹配;
OFS获取网络中的数据包,并对该数据包进行解析,并与多级流表进行匹配,获取匹配的结果,多级流表包含操作指令和触发表,触发表包含触发比较项;
其中,当数据包进入交换机后,将从流表0开始依次匹配,在后续处理中流表可以按次序从小到大越级跳转,但不能从某一流表向前跳转至编号更小的流表。流表项将以优先级高低的顺序与数据包进行匹配,当数据包成功匹配到一条流表项后,会首先更新该流表项对应的计数器记录的统计数据(例如发生成功匹配的数据包数量和总字节数等),然后根据流表项中的指令进行相应操作(例如跳转至后续的某一流表继续处理、修改或者立即执行该数据包对应的动作集合等)。当数据包已经处于最后一个流表时,其对应的动作集合(Action Set)中的所有动作指令将被执行(例如转发至某一端口、修改数据包某一字段、丢弃数据包等)。
102、OFS根据匹配的结果,确定数据包对应的操作指令;
103、当数据包对应的操作指令指向触发表时,OFS根据触发表中的触发比较项对数据包进行上报条件判断;
执行触发表中所有触发比较项的判断流程,完成所有的触发比较项的判断后,获取判断的结果;
104、当确定判断的结果为满足预置的触发上报条件时,OFS根据判断的结果生成当前的网络状态信息。
105、OFS向开放流控制器OFC发送网络状态信息。
本发明实施例中,将获取的数据包与包含触发表的多级流表进行匹配,数据包对应的操作指令指向触发表时,执行触发表中的触发比较项的判断流程,当判断的结果为满足预置的触发上报条件时,生成当前的网络状态信息;将网络状态信息发送给OFC,以使OFC可以实时获取到当前的网络状态信息和对网络进行实时监控,提高了OFC对网络状态的敏感度、反应速度以及网络管理质量。
请参照图2,本发明实施例中一种获取网络状态的方法一个实施例包括:
201、OFS接收OFC发送的流表编辑消息Flow-Mod;
Flow-Mod包括流表内容和触发比较项;
OFS根据流表内容构造多级流表,并根据触发比较项构造触发表;
其中,具体构造多级流表实现方式如下:
OFS按照预设的匹配字段将流表内容进行划分,以获得至少两个子流表;
OFS按照预设顺序将子流表组合成多级流表。
202、OFS将触发表添加到多级流表末端,并建立多级流表与触发表的对应关系;
多级流表末端的触发表用于存储告警消息,将Flow-Mod存储在多级流表中;
本文中,该对应关系为:
将多级流表的最后一项操作设置为指向触发表中的触发索引,具体实现方式如下:
根据流表项中的操作执行相应的操作,当完成转发最后一个子流表,并确定最后一个子流表中流表项的任一操作指向触发表中触发索引Trigger ID时,执行最后一个子流表中的流表项中的所有操作;
将所述数据包发送至触发表,每个Trigger ID对应相同操作类型的触发比较项,需要说明的是,本文中出现的多级流表与触发表的对应关系的实现方式与此处相同,均不再赘述。
203、OFS将获取的数据包与多级流表进行匹配;
OFS获取网络中的数据包,并对该数据包进行解析,并与多级流表进行匹配,获取匹配的结果,该多级流表包含操作指令和触发表,该触发表包含触发比较项。
204、OFS根据匹配的结果,确定数据包对应的操作指令。
205、当数据包对应的操作指令指向触发表时,OFS根据触发表中的触发比较项对数据包进行上报条件判断;
执行触发表中所有触发比较项的判断流程,完成所有的触发比较项的判断后,获取判断的结果。
206、当确定判断的结果为满足预置的触发上报条件时,OFS根据判断的结果生成当前的网络状态信息;
其中,流表项包括计数器和超时定时器,触发比较项具体包括:
根据计数器对匹配数据包的计数超过预设数值时,确定满足预置的触发上报条件;
当超时定时器存在的最大空闲时间超过预设时间阈值或最大剩余时间低于预设时间阈值中至少一个时,确定满足预置的触发上报条件,需要说明的是,本文中出现的预设触发比较项可以是16位Hard_timeout、Flow table status 64位Packet Matches、Group status 32位Packet Count、Flow entry status 32位Duration(seconds)、Port status 64位Transmitted Packets、Port status 64位Receive Overrun Errors等等类似的检查项,对此,本文中均不作限定。
207、OFS向开放流控制器OFC发送网络状态信息;
将网络状态信息发送至OFC具体包括:构造Packet-in数据包,并将网络状态信息添加到Packet-in数据包的扩展字段,并向OFC发送添加网络状态信息的Packet-in数据包。
本发明实施例中,获取OFC下发的末端预设触发比较项的Flow-Mod消息,并使用预先构造的末端设置有触发表的多流表结构,使得在匹配到相应的流表项后,确定流表项中的操作指向触发表中触发索引时,将数据包跳转至触发表;执行上报判断流程,使得网络状态满足预置的触发上报条件时,将当前 的网络状态信息发送给OFC,使得OFC能够对当前网络状态做出及时有效的处理和实时监控,提高了OFC对网络状态的敏感度、反应速度以及网络管理质量。
请参照图3,本发明实施例中一种获取网络状态的方法一个实施例包括:
301、OFS将获取到的数据包与多级流表进行匹配;
OFS获取网络中的数据包,并对该数据包进行解析,并将解析后的数据包与多级流表进行匹配,获取匹配的结果,多级流表包含操作指令和触发表,触发表包含触发比较项,触发比较项对应触发索引。
需要说明的是,一般情况下将触发表设置在多级流表末端,但也可以设置在多级流表中多个子流表中的任何一个地方,具体设置位置只要能实现本文中对多级流表的扩展功能即可,本文中均不作限定。
302、当完成多级流表转发后,数据包匹配到多级流表中的一条流表项,OFS确定流表项中的最后一项操作指向触发表时,OFS将数据包跳转至触发表。
303、OFS执行判断与数据包相关的网络参数是否超出触发比较项的预设值的流程;
在完成触发比较项的判断流程后,确定判断的结果为满足预置的触发上报条件时,将超出触发比较项中的预设值的所有判断的结果设为当前的网络状态信息,其中,预设值为0的触发比较项不执行判断过程,并生成一个总的判断的结果;
304、OFS根据与子数据包相匹配的流表项中的操作指令,判断是否已构造Packet-in数据包,若是,则执行步骤305,若否,则执行步骤306;
305、OFS构造reanson字段为warning的Packet-in数据包;
将告警类型添加至Packet-in数据包的Reason域中;
将满足触发上报条件的触发比较项添加到Reason域中;
每条包含告警类型的流表项中的操作都对应触发表中的触发操作项;
将网络状态信息添加到reanson字段为warning的Packet-in数据包中。
306、OFS构造一条Packet-in数据包;
构造一条Packet-in数据包后,将网络状态信息添加到Packet-in数据包。
307、OFS将添加网络状态信息的Packet-in数据包发送给OFC;
执行触发索引中与该操作对应的触发操作项,将Packet-in数据包发送给OFC。
本发明实施例中,本发明实施例中,将获取的数据包与包含触发表的多级流表进行匹配,数据包对应的操作指令指向触发表时,执行触发表中的触发比较项的判断流程,当判断的结果为满足预置的触发上报条件时,生成当前的网络状态信息,并将网络状态信息添加到Packet-in数据包中,并发送给OFC,以使OFC可以实时获取到当前的网络状态信息和对网络进行实时监控,提高了OFC对网络状态的敏感度、反应速度以及网络管理质量。
请参照图4,本发明实施例中一种获取网络状态的方法一个实施例包括:
401、OFS接收OFC发送的流表编辑消息Flow-Mod;
Flow-Mod包括流表内容和触发比较项;
OFS根据流表内容构造多级流表,并根据触发比较项构造触发表;
其中,具体构造多级流表实现方式如下:
OFS按照预设的匹配字段将流表内容进行划分,以获得至少两个子流表;
OFS按照预设顺序将子流表组合成多级流表。
402、OFS将触发表添加到多级流表末端,并建立多级流表与触发表的对应关系;
需要说明的是,一般情况下将触发表设置在多级流表末端,但也可以设置在多级流表中多个子流表中的任何一个地方,具体设置位置只要能实现本文中对多级流表的扩展功能即可,本文中均不作限定。
多级流表末端的触发表用于存储告警消息,将Flow-Mod存储在多级流表中;
将Flow-Mod存储在多级流表中具体包括:
将多级流表按照匹配字段特征拆分为至少两个子流表,并将Flow-Mod进行拆分至少两个子数据块,以使得至少两个子数据块分别存储在相应的子流表 中;
本文中,该对应关系为:将多级流表的最后一项操作设置为指向触发表中的触发索引,具体实现方式如下:
根据所述流表项中的操作执行相应的操作,当完成转发最后一个子流表,并确定最后一个子流表中流表项的任一操作指向触发表中触发索引Trigger ID时,执行最后一个子流表中的流表项中的所有操作;
将所述数据包发送至触发表,每个Trigger ID对应相同操作类型的触发比较项,需要说明的是,本文中出现的多级流表与触发表的对应关系的实现方式与此处相同,均不再赘述;
多级流表403、OFS将获取的数据包与多级流表进行匹配;
OFS获取网络中的数据包,并对该数据包进行解析,并与多级流表进行匹配,获取匹配的结果,多级流表包含操作指令和触发表,触发表包含触发比较项。
其中,当数据包进入交换机后,将从流表0开始依次匹配,在后续处理中流表可以按次序从小到大越级跳转,但不能从某一流表向前跳转至编号更小的流表。流表项将以优先级高低的顺序与数据包进行匹配,当数据包成功匹配到一条流表项后,会首先更新该流表项对应的计数器记录的统计数据(例如发生成功匹配的数据包数量和总字节数等),然后根据流表项中的指令进行相应操作(例如跳转至后续的某一流表继续处理、修改或者立即执行该数据包对应的动作集合等)。当数据包已经处于最后一个流表时,其对应的动作集合(Action Set)中的所有动作指令将被执行(例如转发至某一端口、修改数据包某一字段、丢弃数据包等)。
404、当完成多级流表转发后,数据包匹配到多级流表中的一条流表项,确定该流表项中的最后一项操作指向触发表时,OFS将该数据包发送至触发表。
405、OFS执行判断与数据包相关的网络参数是否超出触发比较项的预设值的流程;
在完成触发比较项的判断流程后,确定判断的结果为满足预置的触发上报条件时,将超出触发比较项中的预设值的所有判断的结果设为当前的网络状态 信息,其中,预设值为0的触发比较项不执行判断过程。
406、OFS根据与子数据包相匹配的流表项中的操作判断是否已构造Packet-in数据包,若是,则执行步骤407,若否,则执行步骤408;
407、OFS构造一条Reason字段为warning的Packet-in数据包;
将告警类型添加至Packet-in数据包的Reason域中;
将满足触发上报条件的触发比较项添加到Reason域中;
每条包含告警类型的流表项中的操作都对应触发表中的触发操作项;
将网络状态信息添加到reanson字段为warning的Packet-in数据包中。
408、OFS构造一条Packet-in数据包;
构造一条Packet-in数据包后,将网络状态信息添加到所述Packet-in数据包。
409、OFS将添加网络状态信息的Packet-in数据包发送给OFC;
执行至少一个触发索引中与至少一个操作对应的触发操作项,将Packet-in数据包发送给OFC。
本发明实施例中,本发明实施例中,获取OFC下发的末端预设触发比较项的Flow-Mod消息,并使用预先构造的末端设置有触发表的多流表结构,使得在匹配到相应的流表项后,确定流表项中的操作指向触发表中触发索引时,将数据包跳转至触发表;执行上报判断流程,使得网络状态满足预置的触发上报条件时,将当前的网络状态信息发送给OFC,使得OFC能够对当前网络状态做出及时有效的处理以及实时的监控,提高了OFC对网络状态的敏感度、反应速度以及网络管理质量。
请参照图5,本发明实施例中一种获取网络状态的方法一个实施例包括:
501、OFS接收OFC发送的流表编辑消息Flow-Mod;
Flow-Mod包括流表内容和触发比较项;
OFS根据流表内容构造多级流表,并根据触发比较项构造触发表;
其中,具体构造多级流表实现方式如下:
OFS按照预设的匹配字段将流表内容进行划分,以获得至少两个子流表;
OFS按照预设顺序将子流表组合成多级流表。
502、OFS将触发表添加到多级流表末端,并建立多级流表与触发表的对应关系;
本文中,该对应关系为:将多级流表的最后一项操作设置为指向触发表中的触发索引,具体实现方式如下:
根据所述流表项中的操作执行相应的操作,当完成转发最后一个子流表,并确定最后一个子流表中流表项的任一操作指向触发表中触发索引Trigger ID时,执行最后一个子流表中的流表项中的所有操作;
将所述数据包发送至触发表,每个Trigger ID对应相同操作类型的触发比较项,需要说明的是,本文中出现的多级流表与触发表的对应关系的实现方式与此处相同,均不再赘述;
需要说明的是,一般情况下将触发表设置在多级流表末端,但也可以设置在多级流表中多个子流表中的任何一个地方,具体设置位置只要能实现本文中对多级流表的扩展功能即可,本文中均不作限定。
多级流表末端的触发表用于存储告警消息,将Flow-Mod存储在多级流表中;
将Flow-Mod存储在多级流表中具体包括:
将多级流表按照匹配字段特征拆分为至少两个子流表,将Flow-Mod进行拆分至少两个子数据块,至少两个子数据块分别存储在相应的子流表中;
将多级流表的最后一项操作设置为指向触发表中的触发索引。
503、OFS将获取的数据包与多级流表进行匹配;
OFS获取网络中的数据包,并对该数据包进行解析,并与多级流表进行匹配,获取匹配的结果,多级流表包含操作指令和触发表,触发表包含触发比较项。
其中,当数据包进入交换机后,将从流表0开始依次匹配,在后续处理中流表可以按次序从小到大越级跳转,但不能从某一流表向前跳转至编号更小的流表。流表项将以优先级高低的顺序与数据包进行匹配,当数据包成功匹配到一条流表项后,会首先更新该流表项对应的计数器记录的统计数据。
504、当完成多级流表转发后,数据包匹配到多级流表中的一条流表项, OFS确定流表项中的最后一项操作指向触发表时,OFS将数据包跳转至触发表;
依次将数据包与子流表中的流表项进行匹配;
当该数据包匹配到一条流表项时,更新与流表项对应的计数器记录的统计数据,比如counter信息,对此本文中均不作限定,其中,至少两个子数据包按照匹配到的流表项的流表项优先级从高到低与流表项进行匹配;
根据流表项中的操作进行操作,当完成转发最后一个子流表,并确定最后一个子流表中流表项的最后一项操作指向触发表中触发索引Trigger ID时,执行最后一个子流表中的流表项中的所有操作;
将数据包跳转至触发表,每个Trigger ID对应相同操作类型的触发比较项。
505、OFS根据与数据包相关的网络参数是否超出触发比较项的预设值的判断的结果判断是否满足预置的触发上报条件,若是,则执行步骤506,若否,则结束;
执行触发表中所有触发索引对应的触发比较项的判断流程;
完成所有的触发比较项的判断后,获取判断的结果.
506、OFS将超出触发比较项中的预设值的所有判断的结果设为网络状态信息;
其中,流表项包括计数器和超时定时器,触发比较项具体包括:
根据计数器对匹配数据包的计数超过预设数值时,确定满足预置的触发上报条件;
当超时定时器存在的最大空闲时间超过预设时间阈值或最大剩余时间低于预设时间阈值中至少一个时,确定满足预置的触发上报条件,需要说明的是,本文中出现的预设触发比较项可以是16位Hard_timeout、Flow table status 64位Packet Matches、Group status 32位Packet Count、Flow entry status 32位Duration(seconds)、Port status 64位Transmitted Packets、Port status 64位Receive Overrun Errors等等类似的检查项,对此,本文中均不作限定。
执行判断与数据包相关的网络参数是否超出触发比较项的预设值的流程;
在完成触发比较项的判断流程后,确定判断的结果为满足预置的触发上报 条件时,将超出触发比较项中的预设值的所有判断的结果设为当前的网络状态信息,其中,预设值为0的触发比较项不执行判断过程。
507、OFS将网络状态信息发送给OFC;
执行触发索引中与该操作对应的触发操作项,并将Packet-in数据包发送给OFC。
本发明实施例中,获取OFC下发的末端预设触发比较项的Flow-Mod消息,并使用预先构造的末端设置有触发表的多流表结构,使得在匹配到相应的流表项后,确定流表项中的操作指向触发表中触发索引时,将数据包发送至触发表;执行上报判断流程,使得网络状态满足预置的触发上报条件时,将当前的网络状态信息发送给OFC,使得OFC能够对当前网络状态做出及时有效的处理和实时监控,提高了OFC对网络状态的敏感度、反应速度以及网络管理质量。
为便于理解,下面以一具体应用场景对本发明实施例进行详细说明,请参阅图6,本发明实施例一种获取网络状态的方法另一实施例包括:
601、OFS接收OFC发送的流表编辑消息Flow-Mod;
Flow-Mod包括流表内容和触发比较项;
OFS根据流表内容构造多级流表,并根据触发比较项构造触发表;
其中,具体构造多级流表实现方式如下:
OFS按照预设的匹配字段将流表内容进行划分,以获得n个子流表;
OFS按照预设顺序将子流表组合成n级流表。
n级流表中的Trigger-extension部分为本发明实施例中对Flow-Mod的扩展部分即触发比较项,如说明书附图中的图15所示:
602、OFS在n级流表末端添加触发表;
OFS将触发表添加到n级流表末端,并建立n级流表与触发表的对应关系,该n级流表的扩展部分和步骤601中所描述的Trigger-extension相同,此处不再赘述,n级流表末端的触发表用于存储告警消息,将Flow-Mod存储在多级流表中;
该对应关系为:
将多级流表的最后一项操作设置为指向触发表中的触发索引Trigger ID,具体实现方式如下:
根据流表项中的操作执行相应的操作,当完成转发最后一个子流表,并确定最后一个子流表中流表项的任一操作指向触发表中触发索引Trigger ID时,执行最后一个子流表中的流表项中的所有操作;
将Flow-Mod存储在多级流表中具体包括:
将n级流表按照预设的匹配字段特征拆分为至少两个子流表,并将Flow-Mod进行拆分至少两个子数据块,至少两个子数据块分别存储在相应的子流表中;
将多级流表的最后一项操作设置为指向触发表中的触发索引。
603、OFS将获取的数据包与n级流表进行匹配;
其中,当数据包进入交换机后,将从流表0开始依次匹配,在后续处理中流表可以按次序从小到大越级跳转,但不能从某一流表向前跳转至编号更小的流表。流表项将以优先级高低的顺序与数据包进行匹配,当数据包成功匹配到一条流表项后,会首先更新该流表项对应的计数器记录的统计数据。
当该数据包匹配到一条流表项时,更新与流表项对应的计数器记录的统计数据,比如counter信息,对此本文中均不作限定,其中,至少两个子数据包按照匹配到的流表项的流表项优先级从高到低与流表项进行匹配;
其中,具体通过流表项的匹配域与数据包进行匹配。
604、当数据包匹配到n级流表中的流表项,OFS确定Flow entry1中的最后一项操作action指向Trigger ID 2时,OFS将数据包发送至Trigger Table;
根据流表项中的操作进行操作,当完成转发最后一个流表n,并确定流表n中流表项的至少一个操作指向触发表中的触发索引Trigger ID时,执行最后一个子流表中的流表项中的所有操作;
将数据包发送至触发表,每个Trigger ID对应相同操作类型的触发比较项。
在该数据包执行完Flow table 1、Flow table 2……Flow table n后,解析数据包中的Trigger-extension,将Flow table n的最后一项操作设置为转向触发表 中的Trigger ID,具体如下表所示:
Figure PCTCN2015076075-appb-000001
605、OFS执行判断与数据包相关的网络参数是否超出触发比较项的预设值的流程;
在完成触发比较项的判断流程中,Port status64位Transmitted Packets标识该端口收到的数据流量超过预设值,则确定判断的结果为满足预置的触发上报条件,故将该项触发比较项的判断的结果设为当前的网络状态信息。
606、OFS根据与子数据包相匹配的流表项判断是否已构造Packet-in数据包,若是,则进行步骤607,若否,则进行步骤608;
607、OFS构造一条Reason字段为warning的Packet-in数据包;
将告警类型添加至Packet-in数据包的Reason域中;
将满足触发比较项添加到Reason域中;
在确定触发比较项中至少存在一项触发比较项的值超过预设阈值时,将Packet域添加到Packet-in数据包末端;
每条包含告警类型的流表项中的操作都对应触发表中的触发操作项。
608、OFS在Packet-in数据包末端添加触发表;
该触发表中包含在执行触发上报条件的判断流程时,超过预设阈值的触发比较项的数值。
609、OFS将网络状态信息添加到Packet-in数据包中;
610、OFS将添加网络状态信息的Packet-in数据包发送给OFC;
执行至少一个触发索引中与至少一个操作对应的触发操作项,将Packet-in数据包发送给OFC。
本发明实施例中,本发明实施例中,获取OFC下发的末端预设触发比较项的Flow-Mod消息,并使用预先构造的末端设置有触发表的多流表结构,使 得在匹配到相应的流表项后,确定流表项中的操作指向触发表中触发索引时,将数据包跳转至触发表;执行上报判断流程,使得网络状态满足预置的触发上报条件时,将当前的网络状态信息发送给OFC,使得OFC能够对当前网络状态做出及时有效的处理和实时监控,提高了OFC对网络状态的敏感度、反应速度以及网络管理质量。
上面以开放流交换机OFS的角度对本发明实施例中一种获取网络状态的方法进行了描述,下面以开放流控制器OFC的角度对本发明实施例进行详细的说明,请参阅图7,其中,触发表保存在OFC中,触发表用于存储触发比较项和开放流交换机OFS中所有流表的流表项的信息,本发明实施例中一种获取网络状态的方法的另一实施例包括:
701、开放流控制器OFC构建流表编辑消息Flow-Mod;
Flow-Mod包括流表内容和触发比较项,触发比较项是指网络状态触发阈值集合,用于判断是否需要上报网络状态;
通过在Flow-Mod的末端添加触发比较项对Flow-Mod进行扩展,使得在下发流表的同时也下发了预置的触发上报条件;
其中,该触发比较项用于当OFS将获取到的数据包与末端设置有所述触发表的多级流表进行匹配,并且该数据包匹配到该多级流表中的最后一条流表项,确定流表项中的最后一项操作指向所述触发表时,将所述数据包发送至所述触发表,以使所述OFS执行所述触发表中所有触发索引各自对应的触发比较项的判断流程,当判断的结果为满足预置的触发上报条件时,根据判断的结果生成当前的网络状态信息。
702、OFC向开放流交换机OFS发送Flow-Mod;
将该Flow-Mod发送至OFS,以使OFS根据该Flow-Mod中的流表内容和触发比较项构建多级流表,并在多级流表末端添加该触发表,将Flow-Mod末端的触发比较项存储在多级流表中的触发表,并将多级流表的最后一项操作设置为指向所述触发表中的触发索引,以使OFS将获取的数据包与该多级流表进行匹配时,将数据包跳转至触发表,从而执行预设的触发上报条件的判断, 以获得网络状态信息,并进行上报;
703、OFC接收OFS发送的网络状态信息。
在接受到OFS发送的网络状态信息后,OFC可以根据当前获取的网络状态信息对网络实施的监控、可以进行有效或及时的处理,比如修改防火墙等。
本发明实施例中,通过在Flow-Mod的末端添加触发比较项对Flow-Mod进行扩展,使得在下发流表的同时也下发了预置的触发上报条件,使OFS可以根据Flow-Mod构造新的多流表结构,执行触发比较项的判断流程得到当前的网络状态信息,然后及时的将网络状态信息上报,实现了对网络的实时监控,提高了网络的安全性与稳定性。
请参阅图8,本发明实施例中一种获取网络状态的方法的另一实施例包括:
801、开放流控制器OFC构建流表编辑消息Flow-Mod;
Flow-Mod包括流表内容和触发比较项,触发比较项是指网络状态触发阈值集合,用于判断是否需要上报网络状态;
通过在Flow-Mod的末端添加触发比较项对Flow-Mod进行扩展,使得在下发流表的同时也下发了预置的触发上报条件;
其中,该触发比较项用于当OFS将获取到的数据包与末端设置有所述触发表的多级流表进行匹配,并且该数据包匹配到该多级流表中的最后一条流表项,确定流表项中的最后一项操作指向所述触发表时,将所述数据包发送至所述触发表,以使所述OFS执行所述触发表中所有触发索引各自对应的触发比较项的判断流程,当判断的结果为满足预置的触发上报条件时,根据判断的结果生成当前的网络状态信息。
802、OFC向开放流交换机OFS发送Flow-Mod;
将该Flow-Mod发送至OFS,以使OFS根据该Flow-Mod中的流表内容和触发比较项构建多级流表,并在多级流表末端添加该触发表,将Flow-Mod末端的触发比较项存储在多级流表中的触发表,并将多级流表的最后一项操作设置为指向所述触发表中的触发索引,以使OFS将获取的数据包与该多级流表进行匹配时,将数据包跳转至触发表,从而执行预设的触发上报条件的判断, 以获得网络状态信息,并进行上报;
803、OFC接收OFS发送的网络状态信息。
在接受到OFS发送的网络状态信息后,OFC可以根据当前获取的网络状态信息对网络实施的监控、可以进行有效或及时的处理,比如修改防火墙等。
804、OFC将网络状态触发阈值集合下发到OFS;
将网络状态触发阈值集合下发到所述OFS,以使OFS根据比较结果更新流表项中计数器记录的统计数据,并将该网络状态触发阈值集合进行比较;
805、OFC根据网络状态信息更新Flow-Mod;
OFC根据所述网络状态消息更新触发比较项,并将更新的触发比较项添加到Flow-Mod,以获得更新的Flow-Mod;
OFC向OFS发送更新的Flow-Mod,以使得OFS根据更新的Flow-Mod更新多级流表。
其中,OFC根据所述网络状态消息更新触发比较项具体实现方式如下:
根据当前网络状态和设备的信息及更新后的流表项,从触发表中选择需要的触发比较项,并将其余触发比较项置0;
将选择的触发比较项添加到所述Flow-Mod的末端,以使Flow-Mod更新。
本发明实施例中,通过在Flow-Mod的末端添加触发比较项对Flow-Mod进行扩展,使得在下发流表的同时也下发了预置的触发上报条件,使OFS可以根据Flow-Mod构造新的多流表结构,执行触发比较项的判断流程得到当前的网络状态信息,然后及时的将网络状态信息上报,并根据接收到的网络状态信息更新触发表,以使根据需要更新下发的Flow-Mod,实现了对网络的实时监控,提高了网络的安全性与稳定性。
以上对本发明实施例的一种网络状态获取的方法进行了举例说明,下面以装置角度对本发明实施例中一种开放流交换机OFS进行说明,请参阅图9,本发明实施例中一种开放流交换机的一个实施例包括:
第一执行单元901,用于将获取到的数据包与多级流表进行匹配,获取匹配的结果,所述多级流表包含操作指令和触发表,所述触发表包含触发比较项;
第一确定单元902,用于所述匹配的结果,确定所述数据包对应的操作指令;
第一判断单元903,用于当所述数据包对应的操作指令指向所述触发表时,所述OFS根据所述触发表中的触发比较项对所述数据包进行上报条件判断,获取判断的结果;
第二执行单元904、用于当所述判断的结果满足预置的触发上报条件时,所述OFS根据所述判断的结果生成网络状态信息;
第一发送单元905,用于向开放流控制器OFC发送所述网络状态信息。
本发明实施例中,第一执行单元901将数据包与包含触发表的多级流表进行匹配,数据包对应的操作指令指向触发表时,第一判断单元903执行触发表中的触发比较项的判断流程,当判断的结果为满足预置的触发上报条件时,生成当前的网络状态信息;第一发送单元904将网络状态信息发送给OFC,以使OFC可以实时获取到当前的网络状态信息和对网络进行实时监控,提高了OFC对网络状态的敏感度和反应速度,提高了网络管理质量。
请参阅图10,本发明实施例中一种开放流交换机另一实施例包括:
第一执行单元1001,用于将获取到的数据包与多级流表进行匹配,获取匹配的结果,该多级流表包含操作指令和触发表,触发表包含触发比较项;
第一确定单元1002,用于根据匹配的结果,确定数据包对应的操作指令;
第一判断单元1003,用于当数据包对应的操作指令指向所述触发表时,触发表中的触发比较项对数据包进行上报条件判断,获取判断的结果;
第二执行单元1004、用于当判断的结果满足预置的触发上报条件时,根据判断的结果生成网络状态信息;
第一发送单元1005,用于向开放流控制器OFC发送网络状态信息。
可选的,该OFS还包括:
第一接收单元1006,用于接收OFC发送的流表编辑消息Flow-Mod,该Flow-Mod包括流表内容和触发比较项;
第一配置单元1007,用于根据流表内容构造多级流表;
第二配置单元1008,用于根据触发比较项构造触发表;
第三执行单元1009,用于将触发表添加到多级流表末端,并建立多级流表与触发表的对应关系。
其中,第一配置单元1007具体包括:
第一配置模块10071,用于按照预设的匹配字段将所述流表内容进行划分,以获得至少两个子流表;
第二配置模块10072,用于按照预设顺序将所述子流表组合成多级流表。
本发明实施例中,第一执行单元1001将数据包与包含触发表的多级流表进行匹配,数据包对应的操作指令指向触发表时,第一判断单元1003执行触发表中的触发比较项的判断流程,第二执行单元1004将满足预置的触发上报条件的判断的结果生成当前的网络状态信息;第一发送单元1005将网络状态信息发送给OFC,以使OFC可以实时获取到当前的网络状态信息和对网络进行实时监控,提高了OFC对网络状态的敏感度和反应速度,提高了网络管理质量。
请参阅图11,本发明实施例中一种开放流交换机另一实施例包括:
第一执行单元1101,用于将获取到的数据包与多级流表进行匹配,获取匹配的结果,多级流表包含操作指令和触发表,触发表包含触发比较项;
第一确定单元1102,用于根据匹配的结果,确定数据包对应的操作指令;
第一判断单元1103,用于当数据包对应的操作指令指向触发表时,根据触发表中的触发比较项对数据包进行上报条件判断,获取判断的结果;
第二执行单元1104、用于当判断的结果满足预置的触发上报条件时,根据判断的结果生成网络状态信息;
第一发送单元1105,用于向开放流控制器OFC发送网络状态信息。
可选的,该OFS还包括:
第一接收单元1106,用于接收OFC发送的流表编辑消息Flow-Mod,该Flow-Mod包括流表内容和触发比较项;
第一配置单元1107,用于根据流表内容构造多级流表;
第二配置单元1108,用于根据触发比较项构造触发表;
第三执行单元1109,用于将触发表添加到多级流表末端,并建立多级流表与触发表的对应关系。
可选的,匹配的结果为数据包匹配到该多级流表中的一条流表项;
该OFS还包括:
第二判断单元1110,用于根据与所述数据包相匹配的流表项中的操作指令,判断是否已构造Packet-in数据包;
进一步,第二执行单元1104还包括:
第三配置模块11041,用于当没有构造所述Packet-in数据包时,构造Packet-in数据包,并将所述网络状态信息添加到所述Packet-in数据包;
第四配置模块11042,用于当已经构造所述Packet-in数据包时,则所述OFS构造reanson字段为warning的Packet-in数据包,并将所述网络状态信息添加到reanson字段为warning的Packet-in数据包。
本发明实施例中,第一执行单元1101将数据包与包含触发表的多级流表进行匹配,第三执行单元1109根据第一接收单元1106接收到Flow-Mod构造多级流表以及建立多级流表与触发表的对应关系,使得第一判断单元1103在数据包对应的操作指令指向触发表时,执行触发表中的触发比较项的判断流程,第四配置模块11042构造reanson字段为warning的Packet-in数据包,并将所述网络状态信息添加到reanson字段为warning的Packet-in数据包,保证在数据包不正常情况下也可以完成网络状态的上报;第一发送单元1105将包含网络状态信息的Packet-in数据包发送给OFC,以使OFC可以实时获取到当前的网络状态信息和对网络进行实时监控,提高了OFC对网络状态的敏感度和反应速度,提高了网络管理质量。
请参阅图12,本发明实施例中一种开放流交换机另一实施例包括:
第一执行单元1201,用于将获取到的数据包与多级流表进行匹配,获取匹配的结果,多级流表包含操作指令和触发表,触发表包含触发比较项;
第一确定单元1202,用于根据匹配的结果,确定数据包对应的操作指令;
第一判断单元1203,用于当数据包对应的操作指令指向触发表时,根据触发表中的触发比较项对数据包进行上报条件判断,获取判断的结果;
第二执行单元1204、用于当判断的结果满足预置的触发上报条件时,根据判断的结果生成网络状态信息;
第一发送单元1205,用于向开放流控制器OFC发送网络状态信息。
其中,第二执行单元1204,具体用于当所述判断的结果满足预置的触发上报条件时,构造Packet-in数据包,并将所述网络状态信息添加到所述Packet-in数据包的扩展字段;
第一发送单元1205,具体用于向所述OFC发送添加所述网络状态信息的Packet-in数据包。
可选的,该OFS还包括:
第一接收单元1206,用于接收OFC发送的流表编辑消息Flow-Mod,该Flow-Mod包括流表内容和触发比较项;
第一配置单元1207,用于根据流表内容构造多级流表;
第二配置单元1208,用于根据触发比较项构造触发表;
第三执行单元1209,用于将触发表添加到多级流表末端,并建立多级流表与触发表的对应关系。
可选的,该OFS还包括:
更新单元1210,用于当数据包对应的操作指令指向所述触发表时,更新当前的网络状态以及与数据包匹配的多级流表中的流表项对应的计数器。
本发明实施例中,第一执行单元1201将数据包与包含触发表的多级流表进行匹配,第三执行单元1209根据第一接收单元1206接收到Flow-Mod构造多级流表以及建立多级流表与触发表的对应关系,使得第一判断单元1203在数据包对应的操作指令指向触发表时,更新单元1210更新当前的网络状态以及与数据包匹配的多级流表中的流表项对应的计数器,并执行触发表中的触发比较项的判断流程,并将满足预置的触发上报条件的判断的结果生成当前的网络状态信息;第一发送单元1204将包含网络状态信息Packet-in数据包发送给OFC,以使OFC可以实时获取到当前的网络状态信息和对网络进行实时监控, 提高了OFC对网络状态的敏感度和反应速度,提高了网络管理质量。
请参阅图13,本发明实施例中一种开放流控制器OFC的一个实施例包括:
第一配置单元1301,用于构建流表编辑消息Flow-Mod,Flow-Mod包括流表内容和触发比较项,该触发比较项是指网络状态触发阈值集合,用于判断是否需要上报网络状态;
第一发送单元1302,用于向开放流交换机OFS发送Flow-Mod,以使得OFS根据流表内容和触发比较项构建多级流表,并根据多级流表上报网络状态信息;
接收单元1303,用于接收OFS发送的网络状态信息。
本发明实施例中,第一配置单元1301构建包括流表内容和触发比较项的Flow-Mod,通过第一发送单元1302下发给OFS,使得OFS在将数据包与包含触发表的多级流表进行匹配,且对应的操作指令指向触发表时,对触发比较项进行判断,并将满足预置的触发上报条件的判断的结果生成网络状态信息,接收单元1303接收OFS发送的网络状态信息,从而根据获取到当前的网络状态信息和对网络进行实时监控,提高了OFC对网络状态的敏感度、反应速度以及网络管理质量。
请参阅图14,本发明实施例中一种开放流控制器OFC的一个实施例包括:
第一配置单元1401,用于构建流表编辑消息Flow-Mod,Flow-Mod包括流表内容和触发比较项,该触发比较项是指网络状态触发阈值集合,用于判断是否需要上报网络状态;
第一发送单元1402,用于向开放流交换机OFS发送Flow-Mod,以使得OFS根据流表内容和触发比较项构建多级流表,并根据多级流表上报网络状态信息;
接收单元1403,用于接收OFS发送的网络状态信息。
可选的,本发明实施例中,OFC还包括:
更新单元1404,用于根据网络状态消息更新触发比较项;
第二配置单元1405,用于将更新的触发比较项添加到Flow-Mod,以获得更新的Flow-Mod;
第二发送单元1406,用于向OFS发送更新的Flow-Mod,以使得OFS根据更新的Flow-Mod更新多级流表。
本发明实施例中,第一配置单元1401构建包括流表内容和触发比较项的Flow-Mod,通过第一发送单元1402下发给OFS,使得OFS在将数据包与包含触发表的多级流表进行匹配,且对应的操作指令指向触发表时,对触发比较项进行判断,并将满足预置的触发上报条件的判断的结果生成网络状态信息,接收单元1403接收OFS发送的网络状态信息,从而根据获取到当前的网络状态信息和对网络进行实时监控,提高了OFC对网络状态的敏感度、反应速度以及网络管理质量,另外,更新单元1404根据网络状态消息更新触发比较项,以使第二发送单元1406将第二配置单元1405更新的Flow-Mod发送至OFS,以使得OFS根据更新的Flow-Mod更新多级流表,使得对网络状态和设备的监控更加灵活和准确。
补充说明,如图15所示,本发明实施例中,对数据包和多级流表进行扩展的字段选项即为本文中所出现的预设触发比较项,具体操作时,这些扩展的字段选项可选如下:
8位flag:标识若该流表项被匹配到,则上报状态信息。
16位Hard_timeout:标识匹配到该流表项时的剩余时间,若小于预设值,则上报状态消息;为全0则不检测该项。
Flow table status 64位Packet Matches:标识匹配到该流表的数据包超过预设值,则上报状态消息;为全0则不检测该项。
Flow entry status 64位Received Packets:标识匹配到该流表项的数据包超过预设值,则上报状态信息;为全0则不检测该项。
Port status64位Received Packets:标识该端口收到的数据流量超过预设值,则上报状态消息;为全0则不检测该项。
Port status64位Transmitted Packets:标识该端口传输的数据流量超过预设值,则上报状态消息;为全0则不检测该项。
Port status64位Receive Drops:标识该端口丢弃的数据流量超过预设值,则上报状态消息;为全0则不检测该项。
Queue status64位Transmit Packets:标识该队列收到的数据流量超过预设值,则上报状态消息;为全0则不检测该项。
Group status 32位Packet Count:标识该组表收到的数据流量超过预设值,则上报状态消息;为全0则不检测该项。
因此上述列举的各项字段选项仅为可选条件的一部分,完整的可选条件包括如下:
Flow table status 64位Packet Lookups:表示查找到当前流表的数据包数量,超过预设值则上报状态消息,预设值为全0是检测该项。
Flow table status 64位Packet Matches:表示匹配到当前流表的数据包数量,超过预设值则上报状态消息,预设值为全0是检测该项。
Flow entry status 64位Received Packets:表示当前流表项收到的数据包数量,超过预设值则上报状态消息,预设值为全0是检测该项。
Flow entry status 64位Received Bytes:表示当前流表项收到的数据包比特数量,超过预设值则上报状态消息,预设值为全0是检测该项。
Flow entry status 32位Duration(seconds):表示当前流表项的持续时间(秒),超过预设值则上报状态消息,预设值为全0是检测该项。
Flow entry status 32位Duration(nanoseconds):表示当前流表项的持续时间(纳秒),超过预设值则上报状态消息,预设值为全0是检测该项。
Port status 8位port number:表示本条流表涉及的端口数量,根据端口数量从下列11种字段选项中选择相同的参数数量。
1、Port status 64位Received Packets:表示端口收到的数据包数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
2、Port status 64位Transmitted Packets:表示端口传输过的数据包数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
3、Port status 64位Received Bytes:表示端口收到的数据包比特数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
4、Port status 64位Transmitted Bytes:表示端口传输过的的数据包比特数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
5、Port status 64位Receive Drops:表示端口收到丢弃的数据包数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
6、Port status 64位Transmitted Drops:表示端口传输的丢弃数据包比特数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
7、Port status 64位Receive Errors:表示端口收到的错误数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
8、Port status 64位Transmitted Errors:表示端口传输的错误数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
9、Port status 64位Receive Frame Alignment Errors:表示端口帧定位错误数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
10、Port status 64位Receive Overrun Errors:表示端口超速错误数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
11、Port status 64位Receive CRC Errors:表示端口CRC错误数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
12、Port status 64位Collisions:表示端口冲突数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
13、Port status 32位Duration(seconds):表示端口时间,超过预设值则上报状态消息,预设值为0时候不检查该项。
14、Port status 32位Duration(nanoseconds):表示端口时间(纳秒),超过预设值则上报状态消息,预设值为0时候不检查该项。
Queue status 8位queue number:表示本条流表涉及的队列数量,根据端口数量 从下列5种字段选项中选择相同的参数数量。
1、queue status 64位Transmit Packets:标识该队列收到的数据包数量超过预设值,则上报状态消息;为全0则不检测该项。
2、queue status 64位Transmit Bytes:标识该队列收到的数据比特数量超过预设值,则上报状态消息;为全0则不检测该项。
3、queue status 64位Transmit Overrun Errors:标识该队列超速传输数量超过预设值,则上报状态消息;为全0则不检测该项。
4、queue status 32位Duration(seconds):表示队列时间,超过预设值则上报状态消息,预设值为0时候不检查该项。
5、queue status 32位Duration(nanoseconds):表示队列时间(纳秒),超过预设值则上报状态消息,预设值为0时候不检查该项。
Group status 32位Reference Count(flow entries):表示当前组相关的流表项数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
Group status 64位Packet Count:表示当前组数据包数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
Group status 64位Byte Count:表示当前组比特数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
Group status 32位Duration(seconds):表示当前组时间,超过预设值则上报状态消息,预设值为0时候不检查该项。
Group status 32位Duration(nanoseconds):表示当前组时间(纳秒),超过预设值则上报状态消息,预设值为0时候不检查该项。
Group Bucket status 64位Packet Count,表示当前bucket数据包数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
Group Bucket status 64位Byte Count,表示当前bucket比特数量,超过预设值则上报状态消息,预设值为0时候不检查该项。
请参考图16,图16为本发明实施例提供的开放流交换机OFS另一结构示 意图,其中,可包括至少一个处理器1601(例如CPU,Central Processing Unit),至少一个网络接口或者其它通信接口,存储器1602,接收装置1603、发送装置1604和至少一个通信总线,用于实现这些装置之间的连接通信。所述处理器1601用于执行存储器中存储的可执行模块,例如计算机程序。所述存储器1602可能包含高速随机存取存储器(RAM,Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个网络接口(可以是有线或者无线)实现该系统网关与至少一个其它网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等。
如图16所示,在一些实施方式中,存储器1602中存储了程序指令,程序指令可以被处理器1601执行,处理器1601具体执行以下步骤:
将获取到的数据包与多级流表进行匹配,获取匹配的结果,多级流表包含操作指令和触发表,触发表包含触发比较项;
根据匹配的结果,确定数据包对应的操作指令;
当数据包对应的操作指令指向该触发表时,根据触发表中的触发比较项对数据包进行上报条件判断,获取判断的结果;
当判断的结果满足预置的触发上报条件时,根据判断的结果生成网络状态信息,并向开放流控制器OFC发送网络状态信息。
在一些实施方式中,处理器1601还可以执行以下步骤:
接收OFC发送的流表编辑消息Flow-Mod,Flow-Mod包括流表内容和触发比较项;
根据流表内容构造多级流表;
根据触发比较项构造触发表;
将触发表添加到多级流表末端,并建立多级流表与触发表的对应关系。
在一些实施方式中,处理器1601还可以执行以下步骤:
按照预设的匹配字段将流表内容进行划分,以获得至少两个子流表;
按照预设顺序将子流表组合成多级流表。
在一些实施方式中,处理器1601还可以执行以下步骤:
构造Packet-in数据包,并将网络状态信息添加到Packet-in数据包的扩展 字段;
向OFC发送添加网络状态信息的Packet-in数据包。
在一些实施方式中,处理器1601还可以执行以下步骤:
根据与数据包相匹配的流表项中的操作指令,判断是否已构造Packet-in数据包;
当没有构造Packet-in数据包时,则构造Packet-in数据包,并将网络状态信息添加到Packet-in数据包;
当已经构造Packet-in数据包时,则构造reanson字段为warning的Packet-in数据包,并将网络状态信息添加到reanson字段为warning的Packet-in数据包。
在一些实施方式中,处理器1601还可以执行以下步骤:
当数据包对应的操作指令指向触发表时,更新当前的网络状态以及与数据包匹配的多级流表中的流表项对应的计数器。
请参考图17,图17为本发明实施例提供的开放流控制器OFC另一结构示意图,其中,可包括至少一个处理器1701(例如CPU,Central Processing Unit),至少一个网络接口或者其它通信接口,存储器1702、接收装置1703、发送装置1704,和至少一个通信总线,用于实现这些装置之间的连接通信。所述处理器1701用于执行存储器中存储的可执行模块,例如计算机程序。所述存储器1702可能包含高速随机存取存储器(RAM,Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个网络接口(可以是有线或者无线)实现该系统网关与至少一个其它网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等。
如图17所示,在一些实施方式中,存储器1702中存储了程序指令,程序指令可以被处理器1701执行,处理器1701具体执行以下步骤:
构建流表编辑消息Flow-Mod,Flow-Mod包括流表内容和触发比较项,触发比较项是指网络状态触发阈值集合,用于判断是否需要上报网络状态;
向开放流交换机OFS发送Flow-Mod,以使OFS根据流表内容和触发比较项构建多级流表,并根据多级流表上报网络状态信息;
接收OFS发送的网络状态消息。
在一些实施方式中,所述处理器1701还可以执行以下步骤:
根据网络状态消息更新触发比较项;
将更新的触发比较项添加到Flow-Mod,以获得更新的Flow-Mod;
向OFS发送更新的Flow-Mod,以使得OFS根据更新的Flow-Mod更新多级流表。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如至少两个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到至少两个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部 或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上对本发明所提供的一种运动目标检测的方法及装置进行了详细介绍,对于本领域的一般技术人员,依据本发明实施例的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims (16)

  1. 一种获取网络状态的方法,其特征在于,所述方法包括:
    开放流交换机OFS将获取到的数据包与多级流表进行匹配,获取匹配的结果,所述多级流表包含操作指令和触发表,所述触发表包含触发比较项;
    所述OFS根据所述匹配的结果,确定所述数据包对应的操作指令;
    当所述数据包对应的操作指令指向所述触发表时,所述OFS根据所述触发表中的触发比较项对所述数据包进行上报条件判断,获取判断的结果;
    当所述判断的结果满足预置的触发上报条件时,所述OFS根据所述判断的结果生成网络状态信息,并向开放流控制器OFC发送所述网络状态信息。
  2. 根据权利要求1所述的方法,其特征在于,所述开放流交换机OFS将获取到的数据包与多级流表进行匹配之前还包括:
    所述OFS接收所述OFC发送的流表编辑消息Flow-Mod,所述Flow-Mod包括流表内容和所述触发比较项;
    所述OFS根据所述流表内容构造所述多级流表;
    所述OFS根据所述触发比较项构造所述触发表;
    所述OFS将所述触发表添加到所述多级流表末端,并建立所述多级流表与所述触发表的对应关系。
  3. 根据权利要求2所述的方法,其特征在于,所述OFS根据所述流表内容构造多级流表包括:
    所述OFS按照预设的匹配字段将所述流表内容进行划分,以获得至少两个子流表;
    所述OFS按照预设顺序将所述子流表组合成所述多级流表。
  4. 根据权利要求1至3任一所述的方法,其特征在于,所述向开放流控制器OFC发送所述网络状态信息具体包括:
    所述OFS构造Packet-in数据包,并将所述网络状态信息添加到所述Packet-in数据包的扩展字段;
    所述OFS向所述OFC发送添加所述网络状态信息的Packet-in数据包。
  5. 根据权利要求4所述的方法,其特征在于,所述匹配的结果为所述数据包匹配到所述多级流表中的一条流表项;
    所述构造Packet-in数据包之前还包括:
    所述OFS根据与所述数据包相匹配的流表项中的操作指令,判断是否已构造Packet-in数据包;
    所述构造Packet-in数据包,并将所述网络状态信息添加到所述Packet-in数据包的扩展字段具体包括:
    当没有构造所述Packet-in数据包时,则所述OFS构造Packet-in数据包,并将所述网络状态信息添加到所述Packet-in数据包;
    当已经构造所述Packet-in数据包时,则所述OFS构造reanson字段为warning的Packet-in数据包,并将所述网络状态信息添加到reanson字段为warning的Packet-in数据包。
  6. 根据权利要求1至5任一所述的方法,其特征在于,所述方法还包括:
    当所述数据包对应的操作指令指向所述触发表时,所述OFS更新当前的网络状态以及与所述数据包匹配的多级流表中的流表项对应的计数器。
  7. 一种获取网络状态的方法,其特征在于,所述方法包括:
    开放流控制器OFC构建流表编辑消息Flow-Mod,所述Flow-Mod包括流表内容和触发比较项,所述触发比较项是指网络状态触发阈值集合,用于判断是否需要上报网络状态;
    所述OFC向开放流交换机OFS发送所述Flow-Mod,以使得所述OFS根据所述流表内容和所述触发比较项构建多级流表,并根据所述多级流表上报网络状态信息;
    所述OFC接收所述OFS发送的网络状态消息。
  8. 如权利要求7所述的方法,其特征在于,所述OFC接收所述OFS发送的网络状态消息之后还包括:
    所述OFC根据所述网络状态消息更新触发比较项;
    所述OFC将更新的触发比较项添加到所述Flow-Mod,以获得更新的Flow-Mod;
    所述OFC向所述OFS发送所述更新的Flow-Mod,以使得所述OFS根据所述更新的Flow-Mod更新多级流表。
  9. 一种开放流交换机OFS,其特征在于,所述OFS包括:
    第一执行单元,用于将获取到的数据包与多级流表进行匹配,获取匹配的结果,所述多级流表包含操作指令和触发表,所述触发表包含触发比较项;
    第一确定单元,用于根据所述第一执行单元获取的匹配的结果,确定所述数据包对应的操作指令;
    第一判断单元,用于当所述数据包对应的操作指令指向所述触发表时,所述OFS根据所述触发表中的触发比较项对所述数据包进行上报条件判断,获取判断的结果;
    第二执行单元,用于当所述判断的结果满足预置的触发上报条件时,所述OFS根据所述判断的结果生成网络状态信息;
    第一发送单元,用于向开放流控制器OFC发送所述网络状态信息。
  10. 根据权利要求9所述的OFS,其特征在于,所述OFS还包括:
    第一接收单元,用于接收所述OFC发送的流表编辑消息Flow-Mod,所述Flow-Mod包括流表内容和所述触发比较项;
    第一配置单元,用于根据所述流表内容构造所述多级流表;
    第二配置单元,用于根据所述触发比较项构造所述触发表;
    第三执行单元,用于将所述触发表添加到所述多级流表末端,并建立所述多级流表与所述触发表的对应关系。
  11. 根据权利要求10所述的OFS,其特征在于,所述第一配置单元具体包括:
    第一配置模块,用于按照预设的匹配字段将所述流表内容进行划分,以获得至少两个子流表;
    第二配置模块,用于按照预设顺序将所述子流表组合成所述多级流表。
  12. 根据权利要求9至11任一所述的OFS,其特征在于,
    所述第二执行单元,具体用于当所述判断的结果满足预置的触发上报条件时,构造Packet-in数据包,并将所述网络状态信息添加到所述Packet-in数据包的扩展字段;
    所述第一发送单元,具体用于向所述OFC发送添加所述网络状态信息的Packet-in数据包。
  13. 根据权利要求12所述的OFS,其特征在于,所述匹配的结果为所述 数据包匹配到所述多级流表中的一条流表项;
    所述OFS还包括:
    第二判断单元,用于根据与所述数据包相匹配的流表项中的操作指令,判断是否已构造Packet-in数据包;
    进一步所述第二执行单元还包括:
    第三配置模块,用于当没有构造所述Packet-in数据包时,构造Packet-in数据包,并将所述网络状态信息添加到所述Packet-in数据包;
    第四配置模块,用于当已经构造所述Packet-in数据包时,则所述OFS构造reanson字段为warning的Packet-in数据包,并将所述网络状态信息添加到reanson字段为warning的Packet-in数据包。
  14. 根据权利要求13所述的OFS,其特征在于,所述OFS还包括:
    更新单元,用于当所述数据包对应的操作指令指向所述触发表时,更新当前的网络状态以及与所述数据包匹配的多级流表中的流表项对应的计数器。
  15. 一种开放流控制器OFC,其特征在于,包括:
    第一配置单元,用于构建流表编辑消息Flow-Mod,所述Flow-Mod包括流表内容和触发比较项,所述触发比较项是指网络状态触发阈值集合,用于判断是否需要上报网络状态;
    第一发送单元,用于向开放流交换机OFS发送所述Flow-Mod,以使得所述OFS根据所述流表内容和所述触发比较项构建多级流表,并根据所述多级流表上报网络状态信息;
    接收单元,用于接收所述OFS发送的网络状态信息。
  16. 根据权利要求15所述的OFC,其特征在于,所述OFC还包括:
    更新单元,用于根据所述网络状态消息更新触发比较项;
    第二配置单元,用于将更新的触发比较项添加到所述Flow-Mod,以获得更新的Flow-Mod;
    第二发送单元,用于向所述OFS发送所述更新的Flow-Mod,以使得所述OFS根据所述更新的Flow-Mod更新多级流表。
PCT/CN2015/076075 2014-09-17 2015-04-08 一种获取网络状态的方法及装置 WO2016041341A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410474867.0 2014-09-17
CN201410474867.0A CN105490827B (zh) 2014-09-17 2014-09-17 一种获取网络状态的方法及装置

Publications (1)

Publication Number Publication Date
WO2016041341A1 true WO2016041341A1 (zh) 2016-03-24

Family

ID=55532508

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/076075 WO2016041341A1 (zh) 2014-09-17 2015-04-08 一种获取网络状态的方法及装置

Country Status (2)

Country Link
CN (1) CN105490827B (zh)
WO (1) WO2016041341A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109525495A (zh) * 2018-12-24 2019-03-26 广东浪潮大数据研究有限公司 一种数据处理装置、方法和fpga板卡
US10833995B2 (en) * 2018-06-20 2020-11-10 Beijing University Of Posts And Telecommunications Method and apparatus for datacenter congestion control based on software defined network

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108156078B (zh) * 2016-12-02 2021-05-07 中国移动通信有限公司研究院 一种流表构建方法及系统
CN113645137B (zh) * 2021-08-02 2022-05-31 清华大学 一种软件定义网络多级流表压缩方法及系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103747026A (zh) * 2013-10-29 2014-04-23 盛科网络(苏州)有限公司 openflow流表的告警方法及告警装置
CN103856417A (zh) * 2012-11-30 2014-06-11 中兴通讯股份有限公司 软件定义网络报文转发方法和系统
CN104022910A (zh) * 2014-06-25 2014-09-03 杭州华三通信技术有限公司 一种参数协商方法及其装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014067055A1 (zh) * 2012-10-29 2014-05-08 华为技术有限公司 流表刷新的方法及装置
CN102957603A (zh) * 2012-11-09 2013-03-06 盛科网络(苏州)有限公司 基于多级流表的Openflow报文转发方法及系统
CN103401783A (zh) * 2013-07-26 2013-11-20 盛科网络(苏州)有限公司 实现Openflow多级流表的方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103856417A (zh) * 2012-11-30 2014-06-11 中兴通讯股份有限公司 软件定义网络报文转发方法和系统
CN103747026A (zh) * 2013-10-29 2014-04-23 盛科网络(苏州)有限公司 openflow流表的告警方法及告警装置
CN104022910A (zh) * 2014-06-25 2014-09-03 杭州华三通信技术有限公司 一种参数协商方法及其装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10833995B2 (en) * 2018-06-20 2020-11-10 Beijing University Of Posts And Telecommunications Method and apparatus for datacenter congestion control based on software defined network
CN109525495A (zh) * 2018-12-24 2019-03-26 广东浪潮大数据研究有限公司 一种数据处理装置、方法和fpga板卡

Also Published As

Publication number Publication date
CN105490827B (zh) 2018-12-04
CN105490827A (zh) 2016-04-13

Similar Documents

Publication Publication Date Title
US11792046B2 (en) Method for generating forwarding information, controller, and service forwarding entity
CN107342952B (zh) 业务链路选择控制方法以及设备
US20190245772A1 (en) Flow entry configuration method, apparatus, and system
US9819590B2 (en) Method and apparatus for notifying network abnormality
EP3226508B1 (en) Attack packet processing method, apparatus, and system
WO2015074451A1 (zh) 恶意攻击的检测方法和装置
WO2016041341A1 (zh) 一种获取网络状态的方法及装置
US10003537B2 (en) Egress port overload protection for network packet forwarding systems
US11368357B2 (en) Service fault locating method and apparatus
WO2015062291A1 (zh) 一种冲突检测及解决的方法、装置
CN108353022A (zh) 一种数据报文的处理方法、装置及系统
US10230647B2 (en) Data packet processing method and device
WO2017030531A1 (en) Implementing forwarding behavior based on communication activity between a controller and a network device
US20200304520A1 (en) Slow Protocol Packet Processing Method and Related Apparatus
US9124524B2 (en) System and method for priority based flow control between nodes
CN107528929A (zh) Arp条目的处理方法及装置
CN109951397B (zh) 报文处理的方法和设备
JP6365663B2 (ja) 通信装置、制御装置、通信システム、受信パケットの処理方法、通信装置の制御方法及びプログラム
KR102048862B1 (ko) 네트워크 장치의 혼잡 제어 방법 및 장치
JP2015095768A (ja) 情報伝送装置、及びプログラム
JP2020039075A (ja) 情報処理システム

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: 15842822

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15842822

Country of ref document: EP

Kind code of ref document: A1