WO2016070679A1 - Network state synchronizing method and apparatus - Google Patents

Network state synchronizing method and apparatus Download PDF

Info

Publication number
WO2016070679A1
WO2016070679A1 PCT/CN2015/088980 CN2015088980W WO2016070679A1 WO 2016070679 A1 WO2016070679 A1 WO 2016070679A1 CN 2015088980 W CN2015088980 W CN 2015088980W WO 2016070679 A1 WO2016070679 A1 WO 2016070679A1
Authority
WO
WIPO (PCT)
Prior art keywords
forwarding device
network
state information
network state
forwarding
Prior art date
Application number
PCT/CN2015/088980
Other languages
French (fr)
Chinese (zh)
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 WO2016070679A1 publication Critical patent/WO2016070679A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Definitions

  • the network formed by the operator may include a first forwarding device and a second forwarding device that support different private routing protocols.
  • the first forwarding device and the second forwarding device perform network state synchronization based on the respective private routing protocols
  • the first forwarding device and the second forwarding device need to negotiate the private routing protocol.
  • the second forwarding device may learn the meaning of the TLV representation in the private routing protocol adopted by the first forwarding device by performing a private routing protocol negotiation with the first forwarding device, so that the parsing is obtained based on the first Network status information sent by a private routing protocol of the forwarding device.
  • the first forwarding device may negotiate the private routing protocol with the second forwarding, and learn the meaning of the TLV representation in the private routing protocol adopted by the second forwarding device, so as to parse and obtain the private based on the second forwarding device.
  • Network status information sent by the routing protocol In this way, the scheme of network state synchronization based on protocol negotiation limits the efficiency of synchronizing network states.
  • the method for synchronizing network status, the first forwarding device, and the network device provided by the embodiments of the present invention help improve the efficiency of synchronizing network states.
  • a method for synchronizing network status comprising:
  • the first forwarding device receives the control packet, where the control packet includes network state information represented by a file format, where the network state information is used to indicate an attribute of the second forwarding device;
  • the first forwarding device obtains the network status information from the control message.
  • the first possible implementation of the first aspect is provided, and further includes:
  • a second possible implementation of the first aspect is also provided, where the file format is Extensible Markup Language (English: Extensible Markup Language, referred to as: XML) format or Javascript Object Notation (JSON) format.
  • the file format is Extensible Markup Language (English: Extensible Markup Language, referred to as: XML) format or Javascript Object Notation (JSON) format.
  • a third possible implementation of the first aspect is further provided in combination with the first aspect, the first possible implementation of the first aspect, and the second possible implementation of the first aspect,
  • the network status information is described by another next-generation (Yet Another Next Generation, YANG) language.
  • the first forwarding device obtains the network status information from the control message, including:
  • the first forwarding device parses the control packet by using a network configuration (English: Network Configuration, Netconf) protocol to obtain the network state information.
  • a network configuration English: Network Configuration, Netconf
  • the receiving, by the first forwarding device, the control packet includes: the first forwarding device receiving the control packet from the controller; or the first forwarding device receiving the control packet The control packet of the second forwarding device.
  • a method for synchronizing network status comprising:
  • the network device obtains network status information, where the network status information is used to indicate an attribute that the second forwarding device has;
  • the network device sends the control packet to the first forwarding device.
  • the file format being an XML format or a JSON format.
  • the network device describes the network state information in a YANG language.
  • the network device is a controller or the second forwarding device.
  • a first forwarding device where the first forwarding device includes:
  • a receiving unit configured to receive a control message, where the control message includes network state information represented by a file format, where the network state information is used to indicate an attribute of the second forwarding device;
  • an obtaining unit configured to obtain the network state information from the control message received by the receiving unit.
  • the first possible implementation manner of the third aspect is provided, and further includes:
  • an update unit configured to update the network state information library saved by the first forwarding device by using the network state information obtained by the obtaining unit.
  • a second possible implementation of the third aspect is also provided, where the file format is an XML format or a JSON format.
  • a third possible implementation of the third aspect is further provided
  • the network status information is described in YANG language.
  • the obtaining unit is specifically configured to use the Netconf protocol to parse the control packet received by the receiving unit to obtain the network state information.
  • the receiving unit has the control message for receiving the controller, or the receiving unit is specifically configured to receive the Control messages.
  • a network device where the network device includes:
  • a first obtaining unit configured to obtain network state information, where the network state information is used to indicate an attribute that the second forwarding device has;
  • a second obtaining unit configured to encode the network state information obtained by the first obtaining unit into a file format, to obtain a control message, where the control message includes the network state information represented by the file format ;
  • a sending unit configured to send the control packet to the first forwarding device.
  • the file format is an XML format or a JSON format.
  • a second possible implementation manner of the fourth aspect is further provided, where the second obtaining unit is specifically configured to describe the network state information by using a YANG language .
  • a first forwarding device in a fifth aspect, includes: a processor, a memory, and a communication interface;
  • the memory for storing program instructions and data
  • the processor is configured to read program instructions and data stored in the memory, and perform the following operations:
  • control packet receives, by the processor, the control packet, where the control packet includes network state information represented by a file format, where the network state information is used to indicate an attribute of the second forwarding device;
  • the processor obtains the network status information from the control message.
  • the method further includes:
  • the processor updates the network state information library saved by the first forwarding device by using the network state information.
  • a second possible implementation manner of the fifth aspect is further provided, where the file format is an XML format or a JSON format.
  • a third possible implementation manner of the fifth aspect is further provided.
  • the network status information is described in the YANG language, and the obtaining, by the processor, the network status information from the control message includes:
  • the processor configures the Netconf protocol by using a network, parses the control packet, and obtains the network state information.
  • a network device in a sixth aspect, includes: a processor, a memory, and a communication interface;
  • the memory for storing program instructions and data
  • the processor is configured to read program instructions and data stored in the memory, and perform the following operations:
  • the processor encodes the network status information into a file format, and obtains a control message, where the control message includes the network status information represented by the file format;
  • the processor sends the control message to the first forwarding device by using the communication interface.
  • the file format is an XML format or a JSON format.
  • the processor encoding the network state information into a file format, including:
  • the processor describes the network status information in a YANG language.
  • the network device is a controller or the second forwarding device.
  • the method and device for synchronizing the network state in the embodiment of the present invention when synchronizing the network state information of the second forwarding device to other forwarding devices in the network, for example, synchronizing to the first forwarding device,
  • the second forwarding device or the controller may encode the network state information of the second forwarding device into a file format, and send the network state information represented by the file format to the first forwarding device by using the control packet.
  • the first forwarding device can obtain the network state information in the file format from the control packet, and then obtain the network state information, and synchronize the network state information of the second forwarding device to the first forwarding device.
  • the process of synchronizing the network state between the first forwarding device and the second forwarding device does not depend on the negotiation result of the routing protocol, and helps improve the efficiency of synchronizing the network state.
  • FIG. 1 is a flow chart of a method for synchronizing network states according to an embodiment of the present invention
  • FIG. 2 is a flow chart of another method for synchronizing network states according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a network device according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of hardware of a first forwarding device according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram showing the hardware structure of a network device according to an embodiment of the present invention.
  • a typical network may include forwarding devices that support different private routing protocols.
  • the private routing protocol may be a routing protocol developed by a certain vendor, and the private routing protocol may not be a standard routing protocol.
  • the private routing protocol may be a protocol in which a specific TLV is set based on the standard routing protocol. For example, in the network formed by the operator, the first forwarding device supports the first private routing protocol, and the second forwarding device supports the second private routing protocol, and the first private routing protocol is different from the second private routing protocol.
  • the first private routing protocol may be a protocol in which the first TLV format is registered in the Internet Assigned Numbers Authority (IANA). Second private road The agreement may be a protocol in which the second TLV format is registered with IANA.
  • IANA Internet Assigned Numbers Authority
  • the first forwarding device may generate a first control message according to the requirement of the first TLV format.
  • the first control message includes the first network state information.
  • the first network status information is an identifier of the first forwarding device and a port of the first forwarding device.
  • the second forwarding device may generate a second control packet according to the requirement of the second TLV format.
  • the second control message includes the second network state information.
  • the second network state information includes an identifier of the second forwarding device and a port of the second forwarding device.
  • the first forwarding device performs a routing protocol negotiation with the second forwarding device, so that the first forwarding device learns the second TLV format, and the second forwarding device learns the first TLV format.
  • the first forwarding device parses the second control packet to obtain the second network state information.
  • the second forwarding device parses the first control packet to obtain the first network state information. In this way, synchronization of the network state is completed between the first forwarding device and the second forwarding device.
  • the first forwarding device needs to synchronize network status with multiple forwarding devices in the network, the first forwarding device needs to negotiate with each forwarding device of the multiple forwarding devices to determine The TLV format adopted by each forwarding device increases the complexity of the synchronization process. If the routing protocol used by a forwarding device changes, such as updating a routing protocol or developing a new routing protocol, it needs to re-apply to IANA to register, making the routing protocol less scalable and less efficient.
  • embodiments of the present invention propose a solution that helps improve the efficiency of synchronizing network states.
  • the solution is that the second forwarding device can obtain the control packet from the second forwarding device or the controller in the process of synchronizing the network state information with the first forwarding device.
  • the control message includes the network status information represented in a file format.
  • the network status information is an attribute of the second forwarding device.
  • the first forwarding device parses the control packet to obtain the network state information, so that the first forwarding device does not need to negotiate with a private routing protocol with the second forwarding device, which helps improve the synchronization network.
  • This solution can be implemented by the following embodiments.
  • the forwarding device for synchronizing the network state in the embodiment of the present invention may be a device having a forwarding function, such as a router or a switch, which is not specifically limited in this embodiment of the present invention; the control packet in the embodiment of the present invention is used for the transmission and forwarding device.
  • Network status information any network that can be used to transmit forwarding devices
  • the message or message of the network status information belongs to the category of the control message in the embodiment of the present invention.
  • the control packet in the embodiment of the present invention is described by taking the network state information of the second forwarding device as an example.
  • the control packet in the embodiment of the present invention may also carry multiple network state information, and each network state information corresponds to A forwarding device is not illustrated in this embodiment of the present invention.
  • a method for synchronizing network states may include:
  • the first forwarding device receives a control packet, where the control packet includes network state information represented by a file format, where the network state information is used to indicate an attribute of the second forwarding device.
  • control message provided by the embodiment of the present invention is different from the first control message or the second control message.
  • the payload portion of the control message provided by the embodiment of the present invention includes a file.
  • the file may be a file in an XML format or a file in a JSON format.
  • the file may also use other text formats, which are not illustrated here.
  • the first forwarding device can negotiate the routing protocol with other forwarding devices, and the first forwarding device can parse the file format included in the control packet to implement the synchronous network state.
  • the first forwarding device may obtain the control packet including the network state information by using the following manner: the first forwarding device may receive the control packet sent by the controller (English: Controller). Alternatively, the first forwarding device may receive the control packet sent by the second forwarding device.
  • the network status information is a network status of the second forwarding device.
  • the network status of the second forwarding device may be an attribute of the second forwarding device.
  • the attribute includes at least one of an intrinsic attribute of the second forwarding device, an attribute related to network protocol operation supported by the second forwarding device, and an attribute related to connection of the second forwarding device with another forwarding device.
  • the network status information may not be specifically limited in the embodiment of the present invention.
  • the network protocol running related attributes supported by the second forwarding device may include: the second forwarding device is in an on state, the second forwarding device is in an off state, and the second forwarding device is in an overload state. At least one of the states.
  • the attributes related to the connection of the second forwarding device to other devices may include: whether the connection is reachable, the cost required for the connection to reach, the connection is in an open state, the connection is in a closed state, and the connection is in an initialized state. at least one.
  • the eigenvalue of the second forwarding device may include: the identity of the second forwarding device and the second forwarding device At least one of an autonomous system path (English: autonomous system path, AS-PATH for short). This embodiment of the present invention does not specifically limit this.
  • the first forwarding device obtains the network state information from the control packet.
  • the network state information may be parsed from the control packet according to a file format adopted by the network state information. If the network status information is in an XML format, the first forwarding device may parse the control message by using an XML Simple Application Programming Interface (XML: SAX). If the network status information adopts a JSON format, the first forwarding device may parse the control message by using a JSON parsing function (parseJSON) provided in a JavaScript library (jQuery) of a browser.
  • the embodiment of the present invention may not specifically limit the manner in which the control message is parsed.
  • the YANG data model language can describe the information in an XML format or a JSON format
  • the Netconf protocol can parse the information described by the YANG data model language. If the network status information is encoded in the XML format or the JSON format by using the YANG data model language, the first forwarding device may use the Netconf protocol to parse the control message to obtain the network status information, that is, obtain the The attribute that the second forwarding device has.
  • the method for synchronizing network status provided by the embodiment of the present invention further includes:
  • the first forwarding device stores a network information information base (English: State Information Base, SIB for short).
  • the network status information base may include a network status of a forwarding device capable of communicating with the first forwarding device for calculating a route of the first network device and other forwarding devices.
  • the forwarding device capable of communicating with the first forwarding device includes a forwarding device in the same AS, and may also include a forwarding device in different ASs.
  • the first forwarding device updates the network status information database, including: the first forwarding device determines whether the network status information database includes a first entry, and the first entry is used to record the previous time The attribute that the second forwarding device obtained when the network state is synchronized. If the network status information database includes the first entry, the first forwarding device replaces the attribute of the second forwarding device obtained when the previous network state synchronization is used by using the network status information. For example, the previous network state synchronization is relative to the current network state synchronization. That is, the network status information is an attribute of the second forwarding device obtained when the network status is synchronized.
  • the updating, by the first forwarding device, the network status information database includes: the first forwarding device overwriting information recorded in the first entry by using the network state information, that is, recording in the updated first entry
  • the first forwarding device updates the network status information database, where the first forwarding device creates a location according to the network status information.
  • the first entry is described, that is, the network state information is written into the first entry.
  • the method shown in FIG. 1 shows a process in which the first forwarding device parses and obtains network state information from the control packet provided by the embodiment of the present invention.
  • the method shown in FIG. 2 shows that the network device encodes network state information.
  • the process of generating a control message provided by the embodiment of the present invention is generated.
  • the corresponding embodiment of FIG. 2 is a description of a method provided by an embodiment of the present invention from a device side that sends a network state.
  • the device that sends the network status is the network device in FIG. 2.
  • the network device may be a second forwarding device or a controller.
  • the second forwarding device is capable of communicating with the first forwarding device Mutual equipment.
  • the controller is a device capable of interacting with the second forwarding device and the first forwarding device.
  • the network device obtains network state information, where the network state information is used to indicate an attribute that the second forwarding device has.
  • the network device is the Controller or the second forwarding device.
  • the second forwarding device may obtain network state information according to the information configured on the second forwarding device, where the information configured on the second forwarding device may include the second forwarding The properties that the device has.
  • the attributes of the second forwarding device are the same as those of the second forwarding device in the embodiment corresponding to FIG. 1, and details are not described herein again.
  • the Controller may interact with the second forwarding device to obtain the network state information represented by a file format from the second forwarding device.
  • the file format is the same as the file format in the embodiment corresponding to FIG. 1, and details are not described herein again.
  • the controller may obtain the information configured on the second forwarding device in the process of configuring the second forwarding device, and obtain the network state information.
  • the network device encodes the network state information into a file format, and obtains a control packet, where the control packet includes the network state information represented by the file format.
  • the network device obtains the network state information of the second forwarding device when the network state is synchronized, and encodes the network state information into a file format, which is carried in the payload of the control packet. That is, the payload portion of the control message includes the network status information represented in the file format.
  • the network device describes the network state information in a YANG language, and encodes the network state information into an XML format or a JSON format.
  • the Controller may obtain a control message according to the network status information represented by the second forwarding device in a file format.
  • the controller obtains the network status information, and encodes the network status information into a file format, such as an XML format or a JSON format.
  • the controller carries the generated network state information represented by the file format in the control packet, such as the payload carried in the control packet.
  • the second forwarding device encodes the network state information into a file format, such as an XML format or a JSON format.
  • the second forwarding device carries the generated network state information represented by the file format in the control packet, such as the payload carried in the control packet.
  • the network device sends the control packet to the first forwarding device.
  • the secure shell protocol (English: Secure Shell, referred to as SSH)
  • the secure transport layer protocol (English: Transport Layer Security, TLS for short) or the transmission control
  • the protocol (English: Transmission Control Protocol, referred to as TCP) sends the control message to the first forwarding device.
  • the manner in which the network device sends the control packet to the first forwarding device may be any one of the following manners.
  • the network device sends the control packet to the first forwarding device in a point-to-point manner.
  • the first forwarding device can obtain the control packet, and the other devices in the network do not receive the control packet sent by the network device. .
  • the network device sends a control packet to the at least one designated forwarding device in a point-to-multipoint manner, where the at least one designated forwarding device includes the first forwarding device. In this way, the at least one designated forwarding device can obtain the control message.
  • the development of the private routing protocol may be: setting the content of the network state information as needed.
  • the first forwarding device and the second forwarding device may be the same AS, and the first forwarding device and the second forwarding device may support the same private routing protocol, where the first forwarding is performed.
  • the device and the second forwarding device can also support different private routing protocols.
  • An embodiment of the present invention is described by using the second forwarding device to send the attributes of the second forwarding device to other forwarding devices in the network. Any one of the forwarding devices in the network, such as the first forwarding device.
  • the method provided by the embodiment of the present invention can be used to synchronize the attributes that it has.
  • the network status information may include the following attributes: an identity of the second forwarding device, an identifier of a port belonging to the second forwarding device, and the second forwarding. ID of the link corresponding to the device.
  • the network status information may include the following attributes: the identity of the first forwarding device, belonging to The identifier of the port of the first forwarding device and the identifier of the link corresponding to the first forwarding device.
  • the identity of the link can be the name of the link and/or the link code.
  • the network status information may include the following attributes: an identity of the second forwarding device, an identifier of a port belonging to the second forwarding device, and the second forwarding.
  • the working status of the device If the first forwarding device supports the fourth private routing protocol, the network status information may include the following attributes: an identity of the first forwarding device, an identifier of a port that belongs to the first forwarding device, and the first forwarding.
  • the working status of the device For example, the working state may be one of startup (English: up), shutdown (English: down), overload (English: overload), and initialization (English: init).
  • the identifier of the second forwarding device and the working state of the second forwarding device are leaf nodes, that is, the identifier of the port and the working state may be located at the same level in a tree structure. If the fourth private protocol supported by the second forwarding device is updated, that is, updated to the fifth private routing protocol, the layer relationship between the attributes included in the network state information includes: the second forwarding device The identity of the second forwarding device is represented by a leaf node of the port of the second forwarding device, and the working state of the second forwarding device is a leaf node of the port identifier.
  • the affiliation relationship between the attributes included in the network state information includes: the identity of the first forwarding device is a root node, and belongs to the The identifier of the port of the first forwarding device is the leaf node of the identity of the first forwarding device, and the working state of the first forwarding device is the leaf node of the identifier of the port, that is, the identifier of the port and the work
  • the states are at different levels in the tree structure.
  • setting a layer relationship between the attributes may include setting a position of the attribute in the tree structure; or setting a layer relationship between the attributes may include creating a new tree shape. structure.
  • the network state information includes the same attribute.
  • the network status information includes attributes between The affiliation relationship includes: the identity of the device is the root node, and the identifier of the port belonging to the device and the identifier of the link corresponding to the device are leaf nodes, that is, the hierarchical relationship between the attributes is represented by a tree structure. .
  • the device is a device that supports the third private routing protocol.
  • the identifier of the port that belongs to the second forwarding device is a leaf node in the first tree structure, and the link identifier corresponding to the second forwarding device is a root node in the second tree structure, the chain
  • the port identifiers of the devices at both ends of the road are leaf nodes in the second tree structure.
  • the devices at both ends of the link include the second forwarding device.
  • the multiple forwarding devices belong to the same AS, and the multiple forwarding devices include the first forwarding device and the second forwarding device.
  • the network status information may further include the following attributes: a rate of the port. Speed), the observed rate of the port (English: observed-speed), the maximum available bandwidth of the link (English: Max-Link-Bandwidth), the maximum remaining bandwidth of the link (English: Max-Resv-Link- BW), the weight of the link, the maximum transmission unit (MTU) of the link, and the like, which are not specifically limited in this embodiment of the present invention.
  • the network status information of a forwarding device can be described as:
  • the identity of the forwarding device can be described as:
  • the identifier of the port belonging to the forwarding device can be described as:
  • the network state information is encoded into a file format.
  • the attributes included in the network state information may be updated. For example, updating the sixth private routing protocol, updating the identifier of the link to the leaf node of the identifier of the port in the first tree structure, and modifying the description for the link accordingly.
  • the sixth private routing protocol is updated, and new attributes are added, such as increasing the attribution of the forwarding device, and correspondingly adding a leaf node describing the attribution to the tree structure.
  • the home location of the forwarding device may be a leaf node of the identity of the forwarding device, and if the home location of the forwarding device is a global positioning system of the forwarding device (English: Global Positioning System, referred to as: GPS) coordinates, the attribution of the forwarding device can be described as:
  • GPS Global Positioning System
  • the embodiment of the present invention encodes network state information into a file format, and also helps improve the flexibility of developing a private routing protocol.
  • the carrier network has the characteristics of wide coverage and complete functions.
  • the developed private routing protocols are mostly adapted to the characteristics of the carrier network, and the routing protocol conforming to the characteristics of the carrier network is applied to the data center network. Many of the functions implemented by the protocol may not be required by the data center network, resulting in a waste of functionality.
  • the data center network may introduce unnecessary devices, causing waste of the device, increasing the complexity of the data center network, and possibly reducing the routing. The calculated forwarding path is reasonable.
  • the enterprise network (English: Enterprise Network) client can use the solution of the embodiment of the present invention to develop a private routing protocol that conforms to the characteristics of the data center network, thereby helping to avoid function waste and device waste, and improve routing calculation. Sex.
  • the embodiment of the present invention further provides a first forwarding device, and the first forwarding device may be disposed on a forwarding device such as a router or a switch, which is not specifically limited in this embodiment of the present invention.
  • the first forwarding device may perform the method provided by the embodiment corresponding to FIG. 1. Referring to the schematic diagram shown in FIG. 3, the first forwarding device may include:
  • the receiving unit 301 is configured to receive a control packet, where the control packet includes network state information represented by a file format, where the network state information is used to indicate an attribute that the second forwarding device has;
  • the obtaining unit 302 is configured to obtain the network state information from the control message received by the receiving unit.
  • the first forwarding device may further include:
  • the updating unit 303 is configured to update the network state information library saved by the first forwarding device by using the network state information obtained by the obtaining unit.
  • the file format is an XML format or a JSON format.
  • the network state information is described in the YANG language, and the obtaining unit is specifically configured to use the network configuration Netconf protocol to parse the control packet received by the receiving unit to obtain the network state information.
  • the receiving unit is configured to receive the control message from the controller; or the receiving unit is specifically configured to receive the control message from the second forwarding device.
  • the first forwarding device provided by the embodiment of the present invention can support the encoding mode of the network state information.
  • the network state of different forwarding devices can be obtained by the parsing method.
  • the process of negotiating private routing protocols between forwarding devices is omitted.
  • the success or failure of the synchronization network state is no longer dependent on the result of routing protocol negotiation. Improve the efficiency of synchronizing network status.
  • the embodiment of the present invention further provides a network device, where the network device can be located on a device such as a controller, a router, or a switch, and the network device can also be disposed on the second forwarding device.
  • the specific form of the network device is not specifically limited in this embodiment of the present invention.
  • the network device may perform the method provided by the embodiment corresponding to FIG. 2. Referring to the schematic diagram shown in FIG. 4, the network device may include:
  • the first obtaining unit 401 is configured to obtain network state information, where the network state information is used to indicate an attribute that the second forwarding device has.
  • the first obtaining unit 401 can obtain network status information by using the method in the corresponding embodiment of FIG. 2, and details are not described herein again.
  • the attributes of the second forwarding device are the same as those of the second forwarding device in the corresponding embodiment of FIG. 2, and details are not described herein again.
  • a second obtaining unit 402 configured to encode the network state information obtained by the first obtaining unit into a file format, to obtain a control packet, where the control packet includes the network state represented by the file format information.
  • the second obtaining unit 402 can obtain the control message by using the method in the corresponding embodiment of FIG. 2, and details are not described herein again.
  • the control packet is the same as the control packet in the corresponding embodiment of FIG. 2, and details are not described herein again.
  • the sending unit 403 is configured to send the control packet to the first forwarding device.
  • the sending unit may send the control packet to the first forwarding device by using the method in the corresponding embodiment of FIG. 2, and details are not described herein again.
  • the file format is an XML format or a JSON format.
  • the second obtaining unit is specifically configured to describe the network state information by using another next-generation YANG language.
  • the embodiment of the present invention further provides a first forwarding device, and the first forwarding device may be disposed on a forwarding device such as a router or a switch, which is not specifically limited in this embodiment of the present invention.
  • the first forwarding device may perform the method provided by the embodiment corresponding to FIG. 1.
  • the first forwarding device may include: a processor 501, a memory 502, and a communication interface 503.
  • the processor 501, the memory 502, and the communication interface 503 can be connected through a communication bus 504.
  • the memory 502 is for storing a program, and the processor 501 executes executable instructions according to the program read from the memory 502. Perform specific actions.
  • the receiving unit 301 in FIG. 3 may be implemented by the communication interface 503 in FIG. 5.
  • the obtaining unit 302 and the updating unit 303 in FIG. 3 may be implemented by the processor 501 in FIG. 5 according to executable instructions stored in the memory 502.
  • Processor 501 can include at least one physical processor.
  • FIG. 3 is a physical point of view showing content included in a first forwarding device.
  • Figure 5 shows the content of a first forwarding device from a logical point of view.
  • the processor 501 is configured to read instructions and data stored in the memory 502, and perform the following operations:
  • the processor 501 obtains the network status information from the control message.
  • the processor 501 further updates the network state information library saved by the first forwarding device by using the network state information.
  • the file format is an XML format or a JSON format.
  • the network status information is described in the YANG language, and the obtaining, by the processor 501, the network status information from the control message includes:
  • the processor 501 configures the Netconf protocol by using a network, parses the control packet, and obtains the network state information.
  • the receiving, by the processor 501, the control packet by using the communication interface 503 includes:
  • the processor 501 receives the control message from the second forwarding device through the communication interface 503.
  • the embodiment of the present invention further provides a network device, which may be disposed on a device such as a controller, a router, or a switch, and is not specifically limited in this embodiment of the present invention.
  • the network device may perform the method provided by the embodiment corresponding to FIG. 2.
  • the network device may include a processor 601, a memory 602, and a communication interface 603. Wherein, the processor 601 and the memory 602 And communication interface 603 can be connected by communication bus 604.
  • the memory 602 is for storing programs, and the processor 601 performs specific operations in accordance with executable instructions included in the program read from the memory 602.
  • the first obtaining unit 401 and the transmitting unit 403 in FIG. 4 may be implemented by the communication interface 603 in FIG. 6, and the second obtaining unit 402 in FIG. 4 may be stored by the processor 601 in FIG. 6 according to the memory 602.
  • the instructions are implemented, and the processor 601 can include at least one physical processor.
  • FIG. 4 shows the content included in one network device from a physical point of view
  • FIG. 6 A logically represented content of a network device is included.
  • the processor 601 is configured to read instructions and data stored in the memory 602, and perform the following operations:
  • the processor 601 obtains network status information by using the communication interface 603, where the network status information is used to indicate an attribute that the second forwarding device has;
  • the processor 601 encodes the network status information into a file format, and obtains a control message, where the control message includes the network status information represented by the file format;
  • the processor 601 sends the control packet to the first forwarding device through the communication interface 603.
  • the file format is an XML format or a JSON format.
  • the processor 601 encoding the network state information into a file format includes: the processor 601 describing the network state information in a YANG language.
  • the network device is a controller or the second forwarding device.

Abstract

Embodiments of the present invention provide a network state synchronizing method and apparatus. The method comprises: a first forwarding device receives a control packet, wherein the control packet comprises network state information presented in a file format, and the network state information is used for indicating the property of a second forwarding device; and the first forwarding device acquires the network state information from the control packet. This solution does not rely on a negotiation result based on a routing protocol, and improves the network state synchronizing efficiency.

Description

用于同步网络状态的方法及装置Method and device for synchronizing network status
本申请要求于2014年11月6日提交中国专利局、申请号为CN 201410623562.1、发明名称为“用于同步网络状态的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application, filed on Nov. 6, 2014, to the Chinese Patent Office, Application No. CN 201410623562.1, entitled "Method and Apparatus for Synchronizing Network Status", the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本发明涉及通信技术领域,具体涉及一种用于同步网络状态的方法、第一转发设备和网络设备。The present invention relates to the field of communications technologies, and in particular, to a method for synchronizing network status, a first forwarding device, and a network device.
背景技术Background technique
通常,路由指的是指导数据包转发的路径信息,路由协议指的是在路由指导数据包转发过程中事先约定好的规定和标准。举例来说,路由协议可以为数据包格式,如,数据包格式为类型-长度-值(英文:Type-length-value,简称:TLV)。Generally, routing refers to the path information that guides packet forwarding. The routing protocol refers to the pre-agreed rules and standards in the routing guide packet forwarding process. For example, the routing protocol may be in a data packet format. For example, the data packet format is a type-length-value (English: Type-length-value, or TLV).
运营商组建的网络可包括支持不同私有路由协议的第一转发设备和第二转发设备。在所述第一转发设备和所述第二转发设备基于各自的私有路由协议,进行网络状态同步时,需要所述第一转发设备与所述第二转发设备之间进行私有路由协议的协商。举例来说,所述第二转发设备可通过与所述第一转发设备进行私有路由协议协商,获知所述第一转发设备采用的私有路由协议中TLV表示的含义,以便解析获得基于所述第一转发设备的私有路由协议发送的网络状态信息。所述第一转发设备可通过与所述第二转发进行私有路由协议协商,获知所述第二转发设备采用的私有路由协议中TLV表示的含义,以便解析获得基于所述第二转发设备的私有路由协议发送的网络状态信息。这样,基于协议协商进行网络状态同步的方案,限制了同步网络状态的效率。The network formed by the operator may include a first forwarding device and a second forwarding device that support different private routing protocols. When the first forwarding device and the second forwarding device perform network state synchronization based on the respective private routing protocols, the first forwarding device and the second forwarding device need to negotiate the private routing protocol. For example, the second forwarding device may learn the meaning of the TLV representation in the private routing protocol adopted by the first forwarding device by performing a private routing protocol negotiation with the first forwarding device, so that the parsing is obtained based on the first Network status information sent by a private routing protocol of the forwarding device. The first forwarding device may negotiate the private routing protocol with the second forwarding, and learn the meaning of the TLV representation in the private routing protocol adopted by the second forwarding device, so as to parse and obtain the private based on the second forwarding device. Network status information sent by the routing protocol. In this way, the scheme of network state synchronization based on protocol negotiation limits the efficiency of synchronizing network states.
发明内容Summary of the invention
本发明实施例提供的用于用于同步网络状态的方法、第一转发设备和网络设备,有助于提高同步网络状态的效率。 The method for synchronizing network status, the first forwarding device, and the network device provided by the embodiments of the present invention help improve the efficiency of synchronizing network states.
为此,本发明实施例提供如下技术方案:To this end, the embodiments of the present invention provide the following technical solutions:
第一方面,提供了一种用于同步网络状态的方法,所述方法包括:In a first aspect, a method for synchronizing network status is provided, the method comprising:
第一转发设备接收控制报文,所述控制报文包括以文件格式表示的网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;The first forwarding device receives the control packet, where the control packet includes network state information represented by a file format, where the network state information is used to indicate an attribute of the second forwarding device;
所述第一转发设备从所述控制报文中获得所述网络状态信息。The first forwarding device obtains the network status information from the control message.
结合第一方面,提供了第一方面的第一种可能的实现方式,还包括:In combination with the first aspect, the first possible implementation of the first aspect is provided, and further includes:
所述第一转发设备利用所述网络状态信息,更新所述第一转发设备保存的网络状态信息库。The first forwarding device updates the network state information library saved by the first forwarding device by using the network state information.
结合第一方面或第一方面的第一种可能的实现方式,还提供了第一方面的第二种可能的实现方式,所述文件格式为可扩展标记语言(英文:Extensible Markup Language,简称:XML)格式或者爪哇脚本对象标记语言(英文:JavaScript Object Notation,简称:JSON)格式。In conjunction with the first aspect or the first possible implementation of the first aspect, a second possible implementation of the first aspect is also provided, where the file format is Extensible Markup Language (English: Extensible Markup Language, referred to as: XML) format or Javascript Object Notation (JSON) format.
结合第一方面、第一方面的第一种可能的实现方式和第一方面的第二种可能的实现方式中的任意一个,还提供了第一方面的第三种可能的实现方式,所述网络状态信息采用另一个下一代(英文:Yet Another Next Generation,简称:YANG)语言描述,所述第一转发设备从所述控制报文中获得所述网络状态信息包括:A third possible implementation of the first aspect is further provided in combination with the first aspect, the first possible implementation of the first aspect, and the second possible implementation of the first aspect, The network status information is described by another next-generation (Yet Another Next Generation, YANG) language. The first forwarding device obtains the network status information from the control message, including:
所述第一转发设备利用网络配置(英文:Network Configuration,简称:Netconf)协议,解析所述控制报文,获得所述网络状态信息。The first forwarding device parses the control packet by using a network configuration (English: Network Configuration, Netconf) protocol to obtain the network state information.
结合第一方面、第一方面的第一种可能的实现方式、第一方面的第二种可能的实现方式和第一方面的第三种可能的实现方式中的任意一个,还提供了第一方面的第四种可能的实现方式,所述第一转发设备接收控制报文包括:所述第一转发设备接收来自控制器的所述控制报文;或者,所述第一转发设备接收来自所述第二转发设备的所述控制报文。In combination with the first aspect, the first possible implementation of the first aspect, the second possible implementation of the first aspect, and any of the third possible implementations of the first aspect, a first In a fourth possible implementation manner, the receiving, by the first forwarding device, the control packet includes: the first forwarding device receiving the control packet from the controller; or the first forwarding device receiving the control packet The control packet of the second forwarding device.
第二方面,提供了一种用于同步网络状态的方法,所述方法包括:In a second aspect, a method for synchronizing network status is provided, the method comprising:
网络设备获得网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;The network device obtains network status information, where the network status information is used to indicate an attribute that the second forwarding device has;
所述网络设备将所述网络状态信息编码为文件格式,获得控制报文,所述控制报文中包括以所述文件格式表示的所述网络状态信息; The network device encodes the network state information into a file format, and obtains a control packet, where the control packet includes the network state information represented by the file format;
所述网络设备向第一转发设备发送所述控制报文。The network device sends the control packet to the first forwarding device.
结合第二方面,提供了第二方面的第一种可能的实现方式,所述文件格式为XML格式或者JSON格式。In conjunction with the second aspect, a first possible implementation of the second aspect is provided, the file format being an XML format or a JSON format.
结合第二方面或第二方面的第一种可能的实现方式,还提供了第二方面的第二种可能的实现方式,所述网络设备将所述网络状态信息编码为文件格式包括:With the second aspect or the first possible implementation of the second aspect, the second possible implementation manner of the second aspect is further provided, the network device encoding the network state information into a file format, including:
所述网络设备采用YANG语言描述所述网络状态信息。The network device describes the network state information in a YANG language.
结合第二方面、第二方面的第一种可能的实现方式和第二方面的第二种可能的实现方式中的任意一个,还提供了第二方面的第三种可能的实现方式,所述网络设备为控制器或者所述第二转发设备。In conjunction with the second aspect, the first possible implementation of the second aspect, and the second possible implementation of the second aspect, a third possible implementation of the second aspect is further provided The network device is a controller or the second forwarding device.
第三方面,提供了一种第一转发设备,所述第一转发设备包括:In a third aspect, a first forwarding device is provided, where the first forwarding device includes:
接收单元,用于接收控制报文,所述控制报文包括以文件格式表示的网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;a receiving unit, configured to receive a control message, where the control message includes network state information represented by a file format, where the network state information is used to indicate an attribute of the second forwarding device;
获得单元,用于从所述接收单元接收的所述控制报文中获得所述网络状态信息。And an obtaining unit, configured to obtain the network state information from the control message received by the receiving unit.
结合第三方面,提供了第三方面的第一种可能的实现方式,还包括:In combination with the third aspect, the first possible implementation manner of the third aspect is provided, and further includes:
更新单元,用于利用所述获得单元获得的所述网络状态信息,更新所述第一转发设备保存的网络状态信息库。And an update unit, configured to update the network state information library saved by the first forwarding device by using the network state information obtained by the obtaining unit.
结合第三方面或第三方面的第一种可能的实现方式,还提供了第三方面的第二种可能的实现方式,所述文件格式为XML格式或者JSON格式。In conjunction with the third aspect or the first possible implementation of the third aspect, a second possible implementation of the third aspect is also provided, where the file format is an XML format or a JSON format.
结合第三方面、第三方面的第一种可能的实现方式和第三方面的第二种可能的实现方式中的任意一个,还提供了第三方面的第三种可能的实现方式,所述网络状态信息采用YANG语言描述,In conjunction with the third aspect, the first possible implementation of the third aspect, and the second possible implementation of the third aspect, a third possible implementation of the third aspect is further provided The network status information is described in YANG language.
所述获得单元具体用于利用Netconf协议,解析所述接收单元接收的所述控制报文,获得所述网络状态信息。The obtaining unit is specifically configured to use the Netconf protocol to parse the control packet received by the receiving unit to obtain the network state information.
结合第三方面、第三方面的第一种可能的实现方式、第三方面的第二种可能的实现方式和第三方面的第三种可能的实现方式中的任意一个,还提供了第三方面的第四种可能的实现方式,所述接收单元具有用于接收来自控制器的所述控制报文;或者,所述接收单元具体用于接收来自所述第二转发设备的所述 控制报文。In combination with the third aspect, the first possible implementation of the third aspect, the second possible implementation of the third aspect, and the third possible implementation of the third aspect, a third is also provided A fourth possible implementation of the aspect, the receiving unit has the control message for receiving the controller, or the receiving unit is specifically configured to receive the Control messages.
第四方面,提供了一种网络设备,所述网络设备包括:In a fourth aspect, a network device is provided, where the network device includes:
第一获得单元,用于获得网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;a first obtaining unit, configured to obtain network state information, where the network state information is used to indicate an attribute that the second forwarding device has;
第二获得单元,用于将所述第一获得单元获得的所述网络状态信息编码为文件格式,获得控制报文,所述控制报文中包括以所述文件格式表示的所述网络状态信息;a second obtaining unit, configured to encode the network state information obtained by the first obtaining unit into a file format, to obtain a control message, where the control message includes the network state information represented by the file format ;
发送单元,用于向第一转发设备发送所述控制报文。And a sending unit, configured to send the control packet to the first forwarding device.
结合第四方面,提供了第四方面的第一种可能的实现方式,所述文件格式为XML格式或者JSON格式。In conjunction with the fourth aspect, a first possible implementation of the fourth aspect is provided, where the file format is an XML format or a JSON format.
结合第四方面或第四方面的第一种可能的实现方式,还提供了第四方面的第二种可能的实现方式,所述第二获得单元具体用于采用YANG语言描述所述网络状态信息。With reference to the fourth aspect or the first possible implementation manner of the fourth aspect, a second possible implementation manner of the fourth aspect is further provided, where the second obtaining unit is specifically configured to describe the network state information by using a YANG language .
第五方面,提供了一种第一转发设备,所述第一转发设备包括:处理器、存储器和通信接口;In a fifth aspect, a first forwarding device is provided, where the first forwarding device includes: a processor, a memory, and a communication interface;
所述存储器,用于存储程序指令和数据;The memory for storing program instructions and data;
所述处理器,用于读取所述存储器中存储的程序指令和数据,执行以下操作:The processor is configured to read program instructions and data stored in the memory, and perform the following operations:
所述处理器通过所述通信接口接收控制报文,所述控制报文包括以文件格式表示的网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;Receiving, by the processor, the control packet, where the control packet includes network state information represented by a file format, where the network state information is used to indicate an attribute of the second forwarding device;
所述处理器从所述控制报文中获得所述网络状态信息。The processor obtains the network status information from the control message.
结合第五方面,提供了第五方面的第一种可能的实现方式,还包括:With reference to the fifth aspect, the first possible implementation manner of the fifth aspect is provided, and the method further includes:
所述处理器利用所述网络状态信息,更新所述第一转发设备保存的网络状态信息库。The processor updates the network state information library saved by the first forwarding device by using the network state information.
结合第五方面或第五方面的第一种可能的实现方式,还提供了第五方面的第二种可能的实现方式,所述文件格式为XML格式或者JSON格式。In conjunction with the fifth aspect or the first possible implementation manner of the fifth aspect, a second possible implementation manner of the fifth aspect is further provided, where the file format is an XML format or a JSON format.
结合第五方面、第五方面的第一种可能的实现方式和第五方面的第二种可能的实现方式中的任意一个,还提供了第五方面的第三种可能的实现方式,所 述网络状态信息采用YANG语言描述,所述处理器从所述控制报文中获得所述网络状态信息包括:In combination with the fifth aspect, the first possible implementation manner of the fifth aspect, and the second possible implementation manner of the fifth aspect, a third possible implementation manner of the fifth aspect is further provided. The network status information is described in the YANG language, and the obtaining, by the processor, the network status information from the control message includes:
所述处理器利用网络配置Netconf协议,解析所述控制报文,获得所述网络状态信息。The processor configures the Netconf protocol by using a network, parses the control packet, and obtains the network state information.
结合第五方面、第五方面的第一种可能的实现方式、第五方面的第二种可能的实现方式或第五方面的第三种可能的实现方式中的任意一个,还提供了第五方面的第四种可能的实现方式,所述处理器通过所述通信接口接收控制报文包括:所述处理器通过所述通信接口接收来自控制器的所述控制报文;或者,所述处理器通过所述通信接口接收来自所述第二转发设备的所述控制报文。In combination with the fifth aspect, the first possible implementation manner of the fifth aspect, the second possible implementation manner of the fifth aspect, or any one of the third possible implementation manners of the fifth aspect, A fourth possible implementation manner of the aspect, the receiving, by the processor, the control message by using the communication interface, that: the processor receives the control message from the controller by using the communication interface; or the processing The device receives the control message from the second forwarding device through the communication interface.
第六方面,提供了一种网络设备,所述网络设备包括:处理器、存储器和通信接口;In a sixth aspect, a network device is provided, where the network device includes: a processor, a memory, and a communication interface;
所述存储器,用于存储程序指令和数据;The memory for storing program instructions and data;
所述处理器,用于读取所述存储器中存储的程序指令和数据,执行以下操作:The processor is configured to read program instructions and data stored in the memory, and perform the following operations:
所述处理器通过所述通信接口获得获得网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;Obtaining, by the processor, the obtained network status information by using the communication interface, where the network status information is used to indicate an attribute that the second forwarding device has;
所述处理器将所述网络状态信息编码为文件格式,获得控制报文,所述控制报文中包括以所述文件格式表示的所述网络状态信息;The processor encodes the network status information into a file format, and obtains a control message, where the control message includes the network status information represented by the file format;
所述处理器通过所述通信接口向第一转发设备发送所述控制报文。The processor sends the control message to the first forwarding device by using the communication interface.
结合第六方面,提供了第六方面的第一种可能的实现方式,所述文件格式为XML格式或者JSON格式。With reference to the sixth aspect, a first possible implementation manner of the sixth aspect is provided, where the file format is an XML format or a JSON format.
结合第六方面或第六方面的第一种可能的实现方式,还提供了第六方面的第二种可能的实现方式,所述处理器将所述网络状态信息编码为文件格式包括:With reference to the sixth aspect, or the first possible implementation manner of the sixth aspect, the second possible implementation manner of the sixth aspect is further provided, the processor encoding the network state information into a file format, including:
所述处理器采用YANG语言描述所述网络状态信息。The processor describes the network status information in a YANG language.
结合第六方面、第六方面的第一种可能的实现方式和第六方面的第二种可能的实现方式中的任意一个,还提供了第六方面的第三种可能的实现方式,所述网络设备为控制器或者所述第二转发设备。With reference to the sixth aspect, the first possible implementation manner of the sixth aspect, and the second possible implementation manner of the sixth aspect, the third possible implementation manner of the sixth aspect is further provided The network device is a controller or the second forwarding device.
本发明实施例的用于同步网络状态的方法及装置,在将第二转发设备的网络状态信息同步到网络中的其它转发设备时,比如同步到第一转发设备上,第 二转发设备或控制器可将第二转发设备的网络状态信息编码为文件格式,通过控制报文发送以文件格式表示的网络状态信息至第一转发设备。第一转发设备接收到控制报文后,可从控制报文中获得以文件格式表示的网络状态信息,进而解析获得网络状态信息,实现第二转发设备的网络状态信息同步至第一转发设备。第一转发设备和第二转发设备间同步网络状态的过程不赖于路由协议协商结果,有助于提高同步网络状态的效率。The method and device for synchronizing the network state in the embodiment of the present invention, when synchronizing the network state information of the second forwarding device to other forwarding devices in the network, for example, synchronizing to the first forwarding device, The second forwarding device or the controller may encode the network state information of the second forwarding device into a file format, and send the network state information represented by the file format to the first forwarding device by using the control packet. After receiving the control packet, the first forwarding device can obtain the network state information in the file format from the control packet, and then obtain the network state information, and synchronize the network state information of the second forwarding device to the first forwarding device. The process of synchronizing the network state between the first forwarding device and the second forwarding device does not depend on the negotiation result of the routing protocol, and helps improve the efficiency of synchronizing the network state.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only These are some of the embodiments described in this application, and other figures can be obtained from those of ordinary skill in the art in view of these drawings.
图1是本发明实施例一种用于同步网络状态的方法的的流程图;1 is a flow chart of a method for synchronizing network states according to an embodiment of the present invention;
图2是本发明实施例另一种用于同步网络状态的方法的流程图;2 is a flow chart of another method for synchronizing network states according to an embodiment of the present invention;
图3是本发明实施例一种第一转发设备的示意图;3 is a schematic diagram of a first forwarding device according to an embodiment of the present invention;
图4为本发明实施例一种网络设备的示意图;4 is a schematic diagram of a network device according to an embodiment of the present invention;
图5是本发明实施例一种第一转发设备的硬件构成示意图;FIG. 5 is a schematic structural diagram of hardware of a first forwarding device according to an embodiment of the present invention; FIG.
图6是本发明实施例一种网络设备的硬件构成示意图。FIG. 6 is a schematic diagram showing the hardware structure of a network device according to an embodiment of the present invention.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和实施方式对本发明实施例作进一步的详细说明。The embodiments of the present invention are further described in detail below with reference to the drawings and embodiments.
通常的网络可包括支持不同私有路由协议的转发设备。私有路由协议可以是某一厂商开发的路由协议,所述私有路由协议可以不是标准路由协议。所述私有路由协议可以是在所述标准路由协议的基础上,设置有特定的TLV的协议。例如:运营商组建的网络中,第一转发设备支持第一私有路由协议,第二转发设备支持第二私有路由协议,第一私有路由协议不同于第二私有路由协议。第一私有路由协议可以是在互联网数字分配机构(英文:The Internet Assigned Numbers Authority,简称:IANA)注册了第一TLV格式的协议。第二私有路 由协议可以是在IANA注册了第二TLV格式的协议。这样,所述第一转发设备可按照所述第一TLV格式的要求,生成第一控制报文。所述第一控制报文包括所述第一网络状态信息。举例来说,所述第一网络状态信息为所述第一转发设备的标识和所述第一转发设备的端口。所述第二转发设备可按照所述第二TLV格式的要求,生成第二控制报文。所述第二控制报文包括所述第二网络状态信息。举例来说,所述第二网络状态信息包括所述第二转发设备的标识和所述第二转发设备的端口。所述第一转发设备与所述第二转发设备进行路由协议协商,使得所述第一转发设备获知所述第二TLV格式,所述第二转发设备获知所述第一TLV格式。所述第一转发设备与所述第二转发设备进行网络状态的同步时,所述第一转分设备解析所述第二控制报文,获得所述第二网络状态信息。所述第二转发设备解析所述第一控制报文,获得所述第一网络状态信息。这样,所述第一转发设备和所述第二转发设备间完成网络状态的同步。A typical network may include forwarding devices that support different private routing protocols. The private routing protocol may be a routing protocol developed by a certain vendor, and the private routing protocol may not be a standard routing protocol. The private routing protocol may be a protocol in which a specific TLV is set based on the standard routing protocol. For example, in the network formed by the operator, the first forwarding device supports the first private routing protocol, and the second forwarding device supports the second private routing protocol, and the first private routing protocol is different from the second private routing protocol. The first private routing protocol may be a protocol in which the first TLV format is registered in the Internet Assigned Numbers Authority (IANA). Second private road The agreement may be a protocol in which the second TLV format is registered with IANA. In this way, the first forwarding device may generate a first control message according to the requirement of the first TLV format. The first control message includes the first network state information. For example, the first network status information is an identifier of the first forwarding device and a port of the first forwarding device. The second forwarding device may generate a second control packet according to the requirement of the second TLV format. The second control message includes the second network state information. For example, the second network state information includes an identifier of the second forwarding device and a port of the second forwarding device. The first forwarding device performs a routing protocol negotiation with the second forwarding device, so that the first forwarding device learns the second TLV format, and the second forwarding device learns the first TLV format. When the first forwarding device synchronizes with the second forwarding device, the first forwarding device parses the second control packet to obtain the second network state information. The second forwarding device parses the first control packet to obtain the first network state information. In this way, synchronization of the network state is completed between the first forwarding device and the second forwarding device.
若所述第一转发设备需要与所述网络中的多台转发设备同步网络状态,则所述第一转发设备需要与所述多台转发设备中的每一台转发设备进行协商,以确定所述每一台转发设备所采用的TLV格式,增加了同步过程的复杂性。若某一转发设备采用的路由协议发生改变,如更新路由协议或开发新的路由协议,都需要重新向IANA申请注册,使得路由协议的可扩展性差,开发效率较低。If the first forwarding device needs to synchronize network status with multiple forwarding devices in the network, the first forwarding device needs to negotiate with each forwarding device of the multiple forwarding devices to determine The TLV format adopted by each forwarding device increases the complexity of the synchronization process. If the routing protocol used by a forwarding device changes, such as updating a routing protocol or developing a new routing protocol, it needs to re-apply to IANA to register, making the routing protocol less scalable and less efficient.
针对上述问题,本发明实施例提出了有助于提高同步网络状态的效率的解决方法。该解决方法是第二转发设备向第一转发设备同步网络状态信息的过程中,所述第一转发设备可从所述第二转发设备或控制器获得控制报文。所述控制报文包括以文件格式表示的所述网络状态信息。所述网络状态信息为所述第二转发设备的属性。所述第一转发设备对所述控制报文进行解析,获得所述网络状态信息,使得所述第一转发设备无需与所述第二转发设备进行私有路由协议的协商,有助于提高同步网络状态的效率。该解决方法可通过以下几种实施例实现。In view of the above problems, embodiments of the present invention propose a solution that helps improve the efficiency of synchronizing network states. The solution is that the second forwarding device can obtain the control packet from the second forwarding device or the controller in the process of synchronizing the network state information with the first forwarding device. The control message includes the network status information represented in a file format. The network status information is an attribute of the second forwarding device. The first forwarding device parses the control packet to obtain the network state information, so that the first forwarding device does not need to negotiate with a private routing protocol with the second forwarding device, which helps improve the synchronization network. The efficiency of the state. This solution can be implemented by the following embodiments.
本发明实施例中用于同步网络状态的转发设备可以是路由器或者交换机等具有转发功能的设备,本发明实施例对此可不做具体限定;本发明实施例中的控制报文用于传输转发设备的网络状态信息,凡是能够用来传输转发设备的网 络状态信息的报文或消息属于本发明实施例中控制报文的范畴。本发明实施例中的控制报文是以携带了第二转发设备的网络状态信息为例进行说明,本发明实施例中的控制报文还可携带多条网络状态信息,每条网络状态信息对应一台转发设备,本发明实施例不在对这种方式进行举例说明。The forwarding device for synchronizing the network state in the embodiment of the present invention may be a device having a forwarding function, such as a router or a switch, which is not specifically limited in this embodiment of the present invention; the control packet in the embodiment of the present invention is used for the transmission and forwarding device. Network status information, any network that can be used to transmit forwarding devices The message or message of the network status information belongs to the category of the control message in the embodiment of the present invention. The control packet in the embodiment of the present invention is described by taking the network state information of the second forwarding device as an example. The control packet in the embodiment of the present invention may also carry multiple network state information, and each network state information corresponds to A forwarding device is not illustrated in this embodiment of the present invention.
图1对应的实施例是从第一转发设备的角度对本发明提供的方法进行说明。所述第一转发设备是接收其它转发设备的网络状态的设备。参见图1,本发明实施例提供的用于同步网络状态的方法,可包括:The corresponding embodiment of Figure 1 illustrates the method provided by the present invention from the perspective of a first forwarding device. The first forwarding device is a device that receives network status of other forwarding devices. Referring to FIG. 1, a method for synchronizing network states according to an embodiment of the present invention may include:
101,所述第一转发设备接收控制报文,所述控制报文包括以文件格式表示的网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性。The first forwarding device receives a control packet, where the control packet includes network state information represented by a file format, where the network state information is used to indicate an attribute of the second forwarding device.
举例来说,本发明实施例提供的控制报文不同于所述第一控制报文或所述第二控制报文。本发明实施例提供的所述控制报文的载荷部分包括一个文件。举例来说,所述文件可以为XML格式的文件或者JSON格式的文件。所述文件还可采用其它的文本格式,在此不在逐一举例说明。这样,第一转发设备可无需与其它转发设备进行路由协议协商,第一转发设备能够解析所述控制报文中包括的文件格式就可实现同步网络状态。For example, the control message provided by the embodiment of the present invention is different from the first control message or the second control message. The payload portion of the control message provided by the embodiment of the present invention includes a file. For example, the file may be a file in an XML format or a file in a JSON format. The file may also use other text formats, which are not illustrated here. In this way, the first forwarding device can negotiate the routing protocol with other forwarding devices, and the first forwarding device can parse the file format included in the control packet to implement the synchronous network state.
本发明实施例中,第一转发设备至少可通过以下方式,获得包括网络状态信息的控制报文:所述第一转发设备可以接收控制器(英文:Controller)发送的所述控制报文。或者,所述第一转发设备可以接收所述第二转发设备发送的所述控制报文。In the embodiment of the present invention, the first forwarding device may obtain the control packet including the network state information by using the following manner: the first forwarding device may receive the control packet sent by the controller (English: Controller). Alternatively, the first forwarding device may receive the control packet sent by the second forwarding device.
举例来说,所述网络状态信息为第二转发设备的网络状态。所述第二转发设备的网络状态可以为所述第二转发设备具有的属性。所述属性包括所述第二转发设备的本征属性、所述第二转发设备所支持的网络协议运行相关的属性和所述第二转发设备与其它转发设备的连接相关的属性中的至少一个。本发明实施例对网络状态信息可不做具体限定。For example, the network status information is a network status of the second forwarding device. The network status of the second forwarding device may be an attribute of the second forwarding device. The attribute includes at least one of an intrinsic attribute of the second forwarding device, an attribute related to network protocol operation supported by the second forwarding device, and an attribute related to connection of the second forwarding device with another forwarding device. . The network status information may not be specifically limited in the embodiment of the present invention.
举例来说,所述第二转发设备所支持的网络协议运行相关的属性可包括:所述第二转发设备处于开启状态、所述第二转发设备处于关闭状态和所述第二转发设备处于过载状态中的至少一个。For example, the network protocol running related attributes supported by the second forwarding device may include: the second forwarding device is in an on state, the second forwarding device is in an off state, and the second forwarding device is in an overload state. At least one of the states.
举例来说,所述第二转发设备与其它设备的连接相关的属性可包括:连接是否可达、连接可达所需的开销、连接处于开启状态、连接处于关闭状态和连接处于初始化状态中的至少一个。 For example, the attributes related to the connection of the second forwarding device to other devices may include: whether the connection is reachable, the cost required for the connection to reach, the connection is in an open state, the connection is in a closed state, and the connection is in an initialized state. at least one.
举例来说,若所述第一转发设备和所述第二转发设备属于相同自治系统(英文:autonomous system,简称:AS),则所述第二转发设备的本征属性可包括:所述第二转发设备的身份标识和属于所述第二转发设备的至少一个端口(英文:interface)的标识。举例来说,所述第二转发设备的身份标识可包括所述第二转发设备的名字和所述第二转发设备的地址中的至少一个。所述第二转发设备的地址可以为网络之间互连的协议(英文:Internet Protocol,简称:IP)地址或介质访问控制(英文:Media Access Control,简称:MAC)地址。所述端口的标识可包括所述端口的名字和端口号中的至少一个。本发明实施例对此可不做具体限定。若所述第一转发设备和所述第二转发设备属于不同AS,则所述第二转发设备的本征属性可包括:所述第二转发设备的身份标识和所述第二转发设备对应的自治系统路径(英文:autonomous system path,简称:AS-PATH)中的至少一个。本发明实施例对此可不做具体限定。For example, if the first forwarding device and the second forwarding device belong to the same autonomous system (English: autonomous system, abbreviated as AS), the intrinsic attributes of the second forwarding device may include: An identity of the second forwarding device and an identifier of at least one port (English: interface) belonging to the second forwarding device. For example, the identity of the second forwarding device may include at least one of a name of the second forwarding device and an address of the second forwarding device. The address of the second forwarding device may be an Internet Protocol (IP) address or a Medium Access Control (MAC) address. The identification of the port may include at least one of a name and a port number of the port. This embodiment of the present invention does not specifically limit this. If the first forwarding device and the second forwarding device belong to different ASs, the eigenvalue of the second forwarding device may include: the identity of the second forwarding device and the second forwarding device At least one of an autonomous system path (English: autonomous system path, AS-PATH for short). This embodiment of the present invention does not specifically limit this.
102,所述第一转发设备从所述控制报文中获得所述网络状态信息。102. The first forwarding device obtains the network state information from the control packet.
举例来说,所述第一转发设备获得所述控制报文后,可根据所述网络状态信息采用的文件格式,从所述控制报文中解析获得所述网络状态信息。如果所述网络状态信息采用XML格式,所述第一转发设备可采用XML的简易应用程序接口(英文:Simple Application Programming Interface for XML,简称:SAX)解析所述控制报文。如果所述网络状态信息采用JSON格式,所述第一转发设备可采用跨浏览器的JavaScript库(jQuery)中提供的JSON解析函数(parseJSON)来解析所述控制报文。本发明实施例可不对解析控制报文的方式做具体限定。For example, after the first forwarding device obtains the control packet, the network state information may be parsed from the control packet according to a file format adopted by the network state information. If the network status information is in an XML format, the first forwarding device may parse the control message by using an XML Simple Application Programming Interface (XML: SAX). If the network status information adopts a JSON format, the first forwarding device may parse the control message by using a JSON parsing function (parseJSON) provided in a JavaScript library (jQuery) of a browser. The embodiment of the present invention may not specifically limit the manner in which the control message is parsed.
可选地,YANG数据模型语言可以用XML格式或JSON格式描述信息,Netconf协议可以解析YANG数据模型语言描述的信息。若所述网络状态信息是采用YANG数据模型语言编码为XML格式或JSON格式的信息,所述第一转发设备可利用Netconf协议,解析所述控制报文,获得所述网络状态信息,即获得所述第二转发设备具有的属性。Optionally, the YANG data model language can describe the information in an XML format or a JSON format, and the Netconf protocol can parse the information described by the YANG data model language. If the network status information is encoded in the XML format or the JSON format by using the YANG data model language, the first forwarding device may use the Netconf protocol to parse the control message to obtain the network status information, that is, obtain the The attribute that the second forwarding device has.
可选地,102之后,本发明实施例提供的用于同步网络状态的方法,还包括:Optionally, after 102, the method for synchronizing network status provided by the embodiment of the present invention further includes:
103,所述第一转发设备利用所述网络状态信息,更新所述第一转发设备保存的网络状态信息库。 103. The first forwarding device updates the network state information database saved by the first forwarding device by using the network state information.
举例来说,所述第一转发设备存储有网络状态信息库(英文:State Information Base,简称:SIB)。所述网络状态信息库可包括能够与所述第一转发设备通信的转发设备的网络状态,供计算所述第一网络设备与其它转发设备的路由。所述能够与所述第一转发设备通信的转发设备包括处于同一AS中的转发设备,还可包括处于不同AS中的转发设备。For example, the first forwarding device stores a network information information base (English: State Information Base, SIB for short). The network status information base may include a network status of a forwarding device capable of communicating with the first forwarding device for calculating a route of the first network device and other forwarding devices. The forwarding device capable of communicating with the first forwarding device includes a forwarding device in the same AS, and may also include a forwarding device in different ASs.
举例来说,所述第一转发设备更新所述网络状态信息库包括:所述第一转发设备确定所述网络状态信息库是否包括第一表项,所述第一表项用于记录前一次网络状态同步时获得的所述第二转发设备具有的属性。如果所述网络状态信息库包括所述第一表项,所述第一转发设备利用所述网络状态信息替换所述前一次网络状态同步时获得的所述第二转发设备具有的属性。举例来说,所述前一次网络状态同步是相对于本次网络状态同步来说的。即所述网络状态信息为本次网络状态同步时获得的所述第二转发设备具有的属性。所述第一转发设备更新所述网络状态信息库包括:所述第一转发设备利用所述网络状态信息覆盖所述第一表项中记录的信息,即,更新后的第一表项中记录的是本次网络状态同步所获得的第二转发设备具有的属性。如此,就完成了本发明实施例同步第二转发设备的网络状态的过程。For example, the first forwarding device updates the network status information database, including: the first forwarding device determines whether the network status information database includes a first entry, and the first entry is used to record the previous time The attribute that the second forwarding device obtained when the network state is synchronized. If the network status information database includes the first entry, the first forwarding device replaces the attribute of the second forwarding device obtained when the previous network state synchronization is used by using the network status information. For example, the previous network state synchronization is relative to the current network state synchronization. That is, the network status information is an attribute of the second forwarding device obtained when the network status is synchronized. The updating, by the first forwarding device, the network status information database includes: the first forwarding device overwriting information recorded in the first entry by using the network state information, that is, recording in the updated first entry The attribute that the second forwarding device obtained by the current network state synchronization has. Thus, the process of synchronizing the network state of the second forwarding device in the embodiment of the present invention is completed.
可选地,如果所述网络状态信息库不包括所述第一表项,所述第一转发设备更新所述网络状态信息库包括:所述第一转发设备根据所述网络状态信息,创建所述第一表项,即将所述网络状态信息写入所述第一表项中。Optionally, if the network status information database does not include the first entry, the first forwarding device updates the network status information database, where the first forwarding device creates a location according to the network status information. The first entry is described, that is, the network state information is written into the first entry.
本发明实施例提供的用于同步网络状态的方法中,第一转发设备能够支持与网络状态信息的编码方式对应的解析方式,就可实现获取不同转发设备的网络状态,省略了各转发设备之间进行私有路由协议协商的过程,同步网络状态的成败亦不再依赖于路由协议协商的结果,有助于提高同步网络状态的效率。In the method for synchronizing the network state provided by the embodiment of the present invention, the first forwarding device can support the parsing manner corresponding to the encoding mode of the network state information, so that the network state of different forwarding devices can be obtained, and the forwarding devices are omitted. During the negotiation of the private routing protocol, the success or failure of the synchronization network state is no longer dependent on the result of the negotiation of the routing protocol, which helps to improve the efficiency of synchronizing the network state.
图1所示方法,示出了第一转发设备从本发明实施例提供的控制报文中,解析获得网络状态信息的过程,图2所示方法,示出了网络设备对网络状态信息编码,生成本发明实施例提供的控制报文的过程。The method shown in FIG. 1 shows a process in which the first forwarding device parses and obtains network state information from the control packet provided by the embodiment of the present invention. The method shown in FIG. 2 shows that the network device encodes network state information. The process of generating a control message provided by the embodiment of the present invention is generated.
图2对应的实施例是从发送网络状态的设备侧对本发明实施例提供的方法进行说明。所述发送网络状态的设备即图2中的网络设备。所述网络设备可以为第二转发设备或Controller。所述第二转发设备是能够与所述第一转发设备交 互的设备。所述控制器是能够与所述第二转发设备和所述第一转发设备交互的设备。参见图2,本发明实施例提供的用于同步网络状态的方法,包括:The corresponding embodiment of FIG. 2 is a description of a method provided by an embodiment of the present invention from a device side that sends a network state. The device that sends the network status is the network device in FIG. 2. The network device may be a second forwarding device or a controller. The second forwarding device is capable of communicating with the first forwarding device Mutual equipment. The controller is a device capable of interacting with the second forwarding device and the first forwarding device. Referring to FIG. 2, a method for synchronizing network status according to an embodiment of the present invention includes:
201,所述网络设备获得网络状态信息,所述网络状态信息用于表示所述第二转发设备具有的属性。201. The network device obtains network state information, where the network state information is used to indicate an attribute that the second forwarding device has.
举例来说,所述网络设备为所述Controller或所述第二转发设备。若所述网络设备为所述第二转发设备,则所述第二转发设备可根据其上配置的信息,获得网络状态信息,所述第二转发设备上配置的信息可包括所述第二转发设备具有的属性。所述第二转发设备具有的属性与图1对应的实施例中的第二转发设备具有的属性相同,在此不再赘述。若所述网络设备为所述Controller,所述Controller可与所述第二转发设备交互,从所述第二转发设备获得以文件格式表示的所述网络状态信息。所述文件格式与图1对应的实施例中的文件格式相同,在此不再赘述。或者所述Controller可在对所述第二转发设备进行配置的过程中,获得所述第二转发设备上配置的信息,进而获得所述网络状态信息。For example, the network device is the Controller or the second forwarding device. If the network device is the second forwarding device, the second forwarding device may obtain network state information according to the information configured on the second forwarding device, where the information configured on the second forwarding device may include the second forwarding The properties that the device has. The attributes of the second forwarding device are the same as those of the second forwarding device in the embodiment corresponding to FIG. 1, and details are not described herein again. If the network device is the Controller, the Controller may interact with the second forwarding device to obtain the network state information represented by a file format from the second forwarding device. The file format is the same as the file format in the embodiment corresponding to FIG. 1, and details are not described herein again. Or the controller may obtain the information configured on the second forwarding device in the process of configuring the second forwarding device, and obtain the network state information.
202,所述网络设备将所述网络状态信息编码为文件格式,获得控制报文,所述控制报文中包括以所述文件格式表示的所述网络状态信息。202. The network device encodes the network state information into a file format, and obtains a control packet, where the control packet includes the network state information represented by the file format.
举例来说,所述网络设备获得本次网络状态同步时所述第二转发设备的网络状态信息,并将所述网络状态信息编码为文件格式,携带于所述控制报文的载荷中。即,所述控制报文的载荷部分包括以所述文件格式表示的所述网络状态信息。For example, the network device obtains the network state information of the second forwarding device when the network state is synchronized, and encodes the network state information into a file format, which is carried in the payload of the control packet. That is, the payload portion of the control message includes the network status information represented in the file format.
举例来说,所述网络设备采用YANG语言描述所述网络状态信息,将所述网络状态信息编码为XML格式或JSON格式。For example, the network device describes the network state information in a YANG language, and encodes the network state information into an XML format or a JSON format.
举例来说,若所述网络设备为所述Controller,则所述Controller可根据来自所述第二转发设备的以文件格式表示的所述网络状态信息,获得控制报文。或者所述Controller获得所述网络状态信息,将所述网络状态信息编码为文件格式,比如XML格式或JSON格式。所述Controller将生成的以文件格式表示的所述网络状态信息携带于所述控制报文中,比如携带在所述控制报文的载荷。For example, if the network device is the Controller, the Controller may obtain a control message according to the network status information represented by the second forwarding device in a file format. Or the controller obtains the network status information, and encodes the network status information into a file format, such as an XML format or a JSON format. The controller carries the generated network state information represented by the file format in the control packet, such as the payload carried in the control packet.
举例来说,若所述网络设备为所述第二转发设备,所述第二转发设备将所述网络状态信息编码为文件格式,比如XML格式或JSON格式。所述第二转发设备将生成的以文件格式表示的所述网络状态信息携带于所述控制报文中,比如携带在所述控制报文的载荷。 For example, if the network device is the second forwarding device, the second forwarding device encodes the network state information into a file format, such as an XML format or a JSON format. The second forwarding device carries the generated network state information represented by the file format in the control packet, such as the payload carried in the control packet.
203,所述网络设备向所述第一转发设备发送所述控制报文。203. The network device sends the control packet to the first forwarding device.
举例来说,所述网络设备生成所述控制报文后,可采用安全外壳协议(英文:Secure Shell,简称:SSH)、安全传输层协议(英文:Transport Layer Security,简称:TLS)或者传输控制协议(英文:Transmission Control Protocol,简称:TCP,向所述第一转发设备发送所述控制报文。For example, after the network device generates the control packet, the secure shell protocol (English: Secure Shell, referred to as SSH), the secure transport layer protocol (English: Transport Layer Security, TLS for short) or the transmission control may be adopted. The protocol (English: Transmission Control Protocol, referred to as TCP) sends the control message to the first forwarding device.
举例来说,所述网络设备向所述第一转发设备发送所述控制报文的方式可以为下述任意一种方式。For example, the manner in which the network device sends the control packet to the first forwarding device may be any one of the following manners.
方式一,所述网络设备以点对点方式,向所述第一转发设备发送所述控制报文。这样,所述第一转发设备能获得所述控制报文,网络中的其它设备未接收到所述网络设备发送的所述控制报文。。In a first mode, the network device sends the control packet to the first forwarding device in a point-to-point manner. In this way, the first forwarding device can obtain the control packet, and the other devices in the network do not receive the control packet sent by the network device. .
方式二,所述网络设备以点对多点方式,向至少一个指定转发设备发送控制报文,所述至少一个指定转发设备包括所述第一转发设备。这样,所述至少一个指定转发设备均可获得所述控制报文。In a second mode, the network device sends a control packet to the at least one designated forwarding device in a point-to-multipoint manner, where the at least one designated forwarding device includes the first forwarding device. In this way, the at least one designated forwarding device can obtain the control message.
方式三,所述网络设备向网络中的转发设备广播所述控制报文,所述控制报文可被发送至所述网络中的所述第一转发设备。这样,除所述第一转发设备之外,所述网络中的其它转发设备也可获得所述控制报文。采用广播的方式发送所述控制报文,有助于进一步提高同步网络状态的效率。Manner 3: The network device broadcasts the control packet to a forwarding device in the network, where the control packet may be sent to the first forwarding device in the network. In this way, in addition to the first forwarding device, other forwarding devices in the network can also obtain the control message. Sending the control message in a broadcast manner helps to further improve the efficiency of synchronizing the network state.
基于本发明实施例提供的将网络状态信息编码为文件格式的方法,开发私有路由协议可以为:根据需要设置网络状态信息的内容。举例来说,以所述第一转发设备和所述第二转发设备属于相同AS为例,所述第一转发设备和所述第二转发设备可支持相同的私有路由协议,所述第一转发设备和所述第二转发设备也可支持不同的私有路由协议。本发明实施例是以所述第二转发设备向网络中的其它转发设备发送所述第二转发设备具有的属性为例进行说明,所述网络中的任意一台转发设备,比如第一转发设备,均可采用本发明实施例提供的方法,同步其自身具有的属性。Based on the method for encoding the network state information into the file format provided by the embodiment of the present invention, the development of the private routing protocol may be: setting the content of the network state information as needed. For example, the first forwarding device and the second forwarding device may be the same AS, and the first forwarding device and the second forwarding device may support the same private routing protocol, where the first forwarding is performed. The device and the second forwarding device can also support different private routing protocols. An embodiment of the present invention is described by using the second forwarding device to send the attributes of the second forwarding device to other forwarding devices in the network. Any one of the forwarding devices in the network, such as the first forwarding device. The method provided by the embodiment of the present invention can be used to synchronize the attributes that it has.
若所述第二转发设备支持第三私有路由协议,则网络状态信息可包括如下属性:所述第二转发设备的身份标识、属于所述第二转发设备的端口的标识和所述第二转发设备对应的链路的标识。若所述第一转发设备支持第三私有路由协议,则网络状态信息可包括如下属性:所述第一转发设备的身份标识、属于 所述第一转发设备的端口的标识和所述第一转发设备对应的链路的标识。举例来说,所述链路的标识可以为链路的名字和/或链路编码。If the second forwarding device supports the third private routing protocol, the network status information may include the following attributes: an identity of the second forwarding device, an identifier of a port belonging to the second forwarding device, and the second forwarding. ID of the link corresponding to the device. If the first forwarding device supports the third private routing protocol, the network status information may include the following attributes: the identity of the first forwarding device, belonging to The identifier of the port of the first forwarding device and the identifier of the link corresponding to the first forwarding device. For example, the identity of the link can be the name of the link and/or the link code.
若所述第二转发设备支持第四私有路由协议,则网络状态信息可包括如下属性:所述第二转发设备的身份标识、属于所述第二转发设备的端口的标识和所述第二转发设备的工作状态。若所述第一转发设备支持第四私有路由协议,则网络状态信息可包括如下属性:所述第一转发设备的身份标识、属于所述第一转发设备的端口的标识和所述第一转发设备的工作状态。举例来说,所述工作状态可为启动(英文:up)、关闭(英文:down)、过载(英文:overload)和初始化(英文:init)中的一种。If the second forwarding device supports the fourth private routing protocol, the network status information may include the following attributes: an identity of the second forwarding device, an identifier of a port belonging to the second forwarding device, and the second forwarding. The working status of the device. If the first forwarding device supports the fourth private routing protocol, the network status information may include the following attributes: an identity of the first forwarding device, an identifier of a port that belongs to the first forwarding device, and the first forwarding. The working status of the device. For example, the working state may be one of startup (English: up), shutdown (English: down), overload (English: overload), and initialization (English: init).
举例来说,基于YANG数据模型语言编码网络状态信息的方法,网络状态信息可呈树状结构,故,本发明实施例中,开发私有路由协议可以为:根据需要设置网络状态信息包括的属性间的层属关系。举例来说,第四私有路由协议和第五私有路由协议中,网络状态信息包括相同的属性。若所述第二转发设备支持第四私有路由协议,则网络状态信息包括的属性间的层属关系包括:所述第二转发设备的身份标识为根节点,属于所述第二转发设备的端口的标识和所述第二转发设备的工作状态为叶子节点,即,所述端口的标识与所述工作状态在树状结构中可位于相同层级。若对所述第二转发设备支持的所述第四私有协议进行更新,即更新为所述第五私有路由协议,则网络状态信息包括的属性间的层数关系包括:所述第二转发设备的身份表示为根节点,属于所述第二转发设备的端口的表示为所述第二转发设备的身份表示的叶子节点,所述第二转发设备的工作状态为端口的标识的叶子节点。For example, based on the YANG data model language encoding network state information, the network state information may be in a tree structure. Therefore, in the embodiment of the present invention, the development of the private routing protocol may be: setting the network state information including the attributes according to requirements. The affiliation. For example, in the fourth private routing protocol and the fifth private routing protocol, the network state information includes the same attribute. If the second forwarding device supports the fourth private routing protocol, the affiliation between the attributes included in the network status information includes: the identity of the second forwarding device is a root node, and the port belongs to the second forwarding device. The identifier of the second forwarding device and the working state of the second forwarding device are leaf nodes, that is, the identifier of the port and the working state may be located at the same level in a tree structure. If the fourth private protocol supported by the second forwarding device is updated, that is, updated to the fifth private routing protocol, the layer relationship between the attributes included in the network state information includes: the second forwarding device The identity of the second forwarding device is represented by a leaf node of the port of the second forwarding device, and the working state of the second forwarding device is a leaf node of the port identifier.
举例来说,若所述第一转发设备支持所述第五私有路由协议,则网络状态信息包括的属性间的层属关系包括:所述第一转发设备的身份标识为根节点,属于所述第一转发设备的端口的标识为所述第一转发设备的身份标识的叶子节点,所述第一转发设备的工作状态为端口的标识的叶子节点,即,所述端口的标识与所述工作状态在树状结构中位于不同层级。For example, if the first forwarding device supports the fifth private routing protocol, the affiliation relationship between the attributes included in the network state information includes: the identity of the first forwarding device is a root node, and belongs to the The identifier of the port of the first forwarding device is the leaf node of the identity of the first forwarding device, and the working state of the first forwarding device is the leaf node of the identifier of the port, that is, the identifier of the port and the work The states are at different levels in the tree structure.
举例来说,本发明实施例中,设置各属性之间的层属关系可包括设置属性在树状结构中的位置;或者,设置各属性之间的层属关系可包括创建一个新的树状结构。举例来说,第三私有路由协议和第六私有路由协议中,网络状态信息包括相同的属性。所述第三私有路由协议中,网络状态信息包括的属性间的 层属关系包括:设备的身份标识为根节点,属于所述设备的端口的标识和所述设备对应的链路的标识为叶子节点,即,通过一个树状结构表示各属性间的层属关系。所述设备为支持所述第三私有路由协议的设备。For example, in the embodiment of the present invention, setting a layer relationship between the attributes may include setting a position of the attribute in the tree structure; or setting a layer relationship between the attributes may include creating a new tree shape. structure. For example, in the third private routing protocol and the sixth private routing protocol, the network state information includes the same attribute. In the third private routing protocol, the network status information includes attributes between The affiliation relationship includes: the identity of the device is the root node, and the identifier of the port belonging to the device and the identifier of the link corresponding to the device are leaf nodes, that is, the hierarchical relationship between the attributes is represented by a tree structure. . The device is a device that supports the third private routing protocol.
所述第六私有路由协议中,网络状态信息包括的属性间的层属关系为:设备的身份标识在第一树状结构中为根节点,属于所述设备的端口的标识在所述第一树状结构中为叶子节点,所述设备对应的链路标识在第二树状结构中为根节点,所述链路两端的设备的端口标识在所述第二树状结构中为叶子节点。所述链路两端的设备包括所述设备。以所述第二转发设备支持所述第六私有路由协议为例,网络状态信息包括的属性间的层属关系为:所述第二转发设备的身份标识在第一树状结构中为根节点,属于所述第二转发设备的端口的标识在所述第一树状结构中为叶子节点,所述第二转发设备对应的链路标识在第二树状结构中为根节点,所述链路两端的设备的端口标识在所述第二树状结构中为叶子节点。所述链路两端的设备包括所述第二转发设备。In the sixth private routing protocol, the affiliation relationship between the attributes included in the network state information is: the identity of the device is a root node in the first tree structure, and the identifier of the port belonging to the device is in the first The leaf structure is a leaf node, and the link identifier corresponding to the device is a root node in the second tree structure, and the port identifier of the device at both ends of the link is a leaf node in the second tree structure. The devices at both ends of the link include the device. For example, the second forwarding device supports the sixth private routing protocol, and the layer relationship between the attributes included in the network state information is: the identity of the second forwarding device is a root node in the first tree structure. The identifier of the port that belongs to the second forwarding device is a leaf node in the first tree structure, and the link identifier corresponding to the second forwarding device is a root node in the second tree structure, the chain The port identifiers of the devices at both ends of the road are leaf nodes in the second tree structure. The devices at both ends of the link include the second forwarding device.
可选地,多个转发设备属于相同AS场景下,所述多个转发设备包括所述第一转发设备和所述第二转发设备,网络状态信息还可包括如下属性:端口的速率(英文:speed)、所述端口的观察速率(英文:observed-speed)、链路的最大可用带宽(英文:Max-Link-Bandwidth)、所述链路的最大剩余带宽(英文:Max-Resv-Link-BW)、所述链路的权重、所述链路的最大传输单元(英文:Maximum Transmission Unit,简称:MTU)等等,本发明实施例对此可不做具体限定。Optionally, the multiple forwarding devices belong to the same AS, and the multiple forwarding devices include the first forwarding device and the second forwarding device. The network status information may further include the following attributes: a rate of the port. Speed), the observed rate of the port (English: observed-speed), the maximum available bandwidth of the link (English: Max-Link-Bandwidth), the maximum remaining bandwidth of the link (English: Max-Resv-Link- BW), the weight of the link, the maximum transmission unit (MTU) of the link, and the like, which are not specifically limited in this embodiment of the present invention.
以YANG数据模型语言编码网络状态信息为例,针对第六私有路由协议,某一转发设备的网络状态信息可描述为:Taking the YANG data model language encoding network status information as an example, for the sixth private routing protocol, the network status information of a forwarding device can be described as:
所述转发设备的身份标识可描述为:The identity of the forwarding device can be described as:
Figure PCTCN2015088980-appb-000001
Figure PCTCN2015088980-appb-000001
Figure PCTCN2015088980-appb-000002
Figure PCTCN2015088980-appb-000002
属于所述转发设备的端口的标识可描述为:The identifier of the port belonging to the forwarding device can be described as:
Figure PCTCN2015088980-appb-000003
Figure PCTCN2015088980-appb-000003
所述转发设备对应的链路的标识可描述为:The identifier of the link corresponding to the forwarding device can be described as:
Figure PCTCN2015088980-appb-000004
Figure PCTCN2015088980-appb-000004
Figure PCTCN2015088980-appb-000005
Figure PCTCN2015088980-appb-000005
基于本发明实施例将网络状态信息编码为文件格式的方案,更新私有路由协议时,可以更新网络状态信息包括的属性。举例来说,更新第六私有路由协议,将链路的标识更新为第一树状结构中端口的标识的叶子节点,相应地修改针对所述链路的描述即可。举例来说,更新第六私有路由协议,增加新的属性,比如增加所述转发设备的归属地,相应地在树状结构中增加一个描述所述归属地的叶子节点即可。举例来说,所述转发设备的归属地可以为所述转发设备的身份标识的叶子节点,若所述转发设备的归属地为所述转发设备的全球定位系统(英文:Global Positioning System,简称:GPS)坐标,则所述转发设备的归属地可描述为:According to the embodiment of the present invention, the network state information is encoded into a file format. When the private routing protocol is updated, the attributes included in the network state information may be updated. For example, updating the sixth private routing protocol, updating the identifier of the link to the leaf node of the identifier of the port in the first tree structure, and modifying the description for the link accordingly. For example, the sixth private routing protocol is updated, and new attributes are added, such as increasing the attribution of the forwarding device, and correspondingly adding a leaf node describing the attribution to the tree structure. For example, the home location of the forwarding device may be a leaf node of the identity of the forwarding device, and if the home location of the forwarding device is a global positioning system of the forwarding device (English: Global Positioning System, referred to as: GPS) coordinates, the attribution of the forwarding device can be described as:
Figure PCTCN2015088980-appb-000006
Figure PCTCN2015088980-appb-000006
综上所述,本发明实施例将网络状态信息编码为文件格式,还有助于提高开发私有路由协议的灵活性。In summary, the embodiment of the present invention encodes network state information into a file format, and also helps improve the flexibility of developing a private routing protocol.
通常,运营商网络具有覆盖范围广、功能齐全等特点,开发的私有路由协议大多是为了适应所述运营商网络的特点,将这种符合所述运营商网络特点的路由协议应用于数据中心网络时,协议实现的很多功能可能并不是所述数据中心网络需要的,造成了功能的浪费。另外,为了适应这种符合所述运营商网络特点的路由协议,数据中心网络还可能会引入一些不必要的设备,造成了设备的浪费,提高了数据中心网络的复杂度,甚至可能会降低路由计算出的转发路径的合理性。针对这种场景,企业网(英文:Enterprise Network)客户可以采用本发明实施例方案,开发符合所述数据中心网络特点的私有路由协议,有助于避免功能浪费和设备浪费,提高路由计算的合理性。Generally, the carrier network has the characteristics of wide coverage and complete functions. The developed private routing protocols are mostly adapted to the characteristics of the carrier network, and the routing protocol conforming to the characteristics of the carrier network is applied to the data center network. Many of the functions implemented by the protocol may not be required by the data center network, resulting in a waste of functionality. In addition, in order to adapt to such a routing protocol that conforms to the characteristics of the carrier network, the data center network may introduce unnecessary devices, causing waste of the device, increasing the complexity of the data center network, and possibly reducing the routing. The calculated forwarding path is reasonable. For this scenario, the enterprise network (English: Enterprise Network) client can use the solution of the embodiment of the present invention to develop a private routing protocol that conforms to the characteristics of the data center network, thereby helping to avoid function waste and device waste, and improve routing calculation. Sex.
本发明实施例还提供了一种第一转发设备,所述第一转发设备可设于路由器或交换机等转发设备上,本发明实施例对此可不做具体限定。所述第一转发设备可执行图1对应的实施例提供的方法。参见图3所示示意图,所述第一转发设备可包括:The embodiment of the present invention further provides a first forwarding device, and the first forwarding device may be disposed on a forwarding device such as a router or a switch, which is not specifically limited in this embodiment of the present invention. The first forwarding device may perform the method provided by the embodiment corresponding to FIG. 1. Referring to the schematic diagram shown in FIG. 3, the first forwarding device may include:
接收单元301,用于接收控制报文,所述控制报文包括以文件格式表示的网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;The receiving unit 301 is configured to receive a control packet, where the control packet includes network state information represented by a file format, where the network state information is used to indicate an attribute that the second forwarding device has;
获得单元302,用于从所述接收单元接收的所述控制报文中获得所述网络状态信息。The obtaining unit 302 is configured to obtain the network state information from the control message received by the receiving unit.
可选地,所述第一转发设备还可包括:Optionally, the first forwarding device may further include:
更新单元303,用于利用所述获得单元获得的所述网络状态信息,更新所述第一转发设备保存的网络状态信息库。The updating unit 303 is configured to update the network state information library saved by the first forwarding device by using the network state information obtained by the obtaining unit.
可选地,所述文件格式为XML格式或者JSON格式。Optionally, the file format is an XML format or a JSON format.
可选地,所述网络状态信息采用YANG语言描述,所述获得单元具体用于利用网络配置Netconf协议,解析所述接收单元接收的所述控制报文,获得所述网络状态信息。Optionally, the network state information is described in the YANG language, and the obtaining unit is specifically configured to use the network configuration Netconf protocol to parse the control packet received by the receiving unit to obtain the network state information.
可选地,所述接收单元具有用于接收来自控制器的所述控制报文;或者,所述接收单元具体用于接收来自所述第二转发设备的所述控制报文。Optionally, the receiving unit is configured to receive the control message from the controller; or the receiving unit is specifically configured to receive the control message from the second forwarding device.
本发明实施例提供的第一转发设备能够支持与网络状态信息的编码方式对 应的解析方式,就可实现获取不同转发设备的网络状态,省略了各转发设备之间进行私有路由协议协商的过程,同步网络状态的成败亦不再依赖于路由协议协商的结果,有助于提高同步网络状态的效率。The first forwarding device provided by the embodiment of the present invention can support the encoding mode of the network state information. The network state of different forwarding devices can be obtained by the parsing method. The process of negotiating private routing protocols between forwarding devices is omitted. The success or failure of the synchronization network state is no longer dependent on the result of routing protocol negotiation. Improve the efficiency of synchronizing network status.
本发明实施例还提供了一种网络设备,所述网络设备可设于Controller、路由器或交换机等设备上,所述网络设备还可设于第二转发设备上。本发明实施例对网络设备的具体形式不做具体限定。所述网络设备可执行图2对应的实施例提供的方法。参见图4所示示意图,所述网络设备可包括:The embodiment of the present invention further provides a network device, where the network device can be located on a device such as a controller, a router, or a switch, and the network device can also be disposed on the second forwarding device. The specific form of the network device is not specifically limited in this embodiment of the present invention. The network device may perform the method provided by the embodiment corresponding to FIG. 2. Referring to the schematic diagram shown in FIG. 4, the network device may include:
第一获得单元401,用于获得网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性。举例来说,所述第一获得单元401可采用图2对应实施例中的方法,获得网络状态信息,在此不再赘述。所述第二转发设备具有的属性与图2对应实施例中所述第二转发设备具有的属性相同,在此不再赘述。The first obtaining unit 401 is configured to obtain network state information, where the network state information is used to indicate an attribute that the second forwarding device has. For example, the first obtaining unit 401 can obtain network status information by using the method in the corresponding embodiment of FIG. 2, and details are not described herein again. The attributes of the second forwarding device are the same as those of the second forwarding device in the corresponding embodiment of FIG. 2, and details are not described herein again.
第二获得单元402,用于将所述第一获得单元获得的所述网络状态信息编码为文件格式,获得控制报文,所述控制报文中包括以所述文件格式表示的所述网络状态信息。举例来说,所述第二获得单元402可采用图2对应实施例中的方法,获得控制报文,在此不再赘述。所述控制报文与图2对应实施例中的控制报文相同,在此不再赘述。a second obtaining unit 402, configured to encode the network state information obtained by the first obtaining unit into a file format, to obtain a control packet, where the control packet includes the network state represented by the file format information. For example, the second obtaining unit 402 can obtain the control message by using the method in the corresponding embodiment of FIG. 2, and details are not described herein again. The control packet is the same as the control packet in the corresponding embodiment of FIG. 2, and details are not described herein again.
发送单元403,用于向第一转发设备发送所述控制报文。举例来说,所述发送单元可采用图2对应实施例中的方法,向所述第一转发设备发送所述控制报文,在此不再赘述。The sending unit 403 is configured to send the control packet to the first forwarding device. For example, the sending unit may send the control packet to the first forwarding device by using the method in the corresponding embodiment of FIG. 2, and details are not described herein again.
可选地,所述文件格式为XML格式或者JSON格式。Optionally, the file format is an XML format or a JSON format.
可选地,所述第二获得单元具体用于采用另一个下一代YANG语言描述所述网络状态信息。Optionally, the second obtaining unit is specifically configured to describe the network state information by using another next-generation YANG language.
对应地,本发明实施例还提供了一种第一转发设备,所述第一转发设备可设于路由器或交换机等转发设备上,本发明实施例对此可不做具体限定。所述第一转发设备可执行图1对应的实施例提供的方法。参见图5所示示意图,所述第一转发设备可包括:处理器501、存储器502和通信接口503。其中,处理器501、存储器502和通信接口503可通过通信总线504连接。存储器502用于存储程序,处理器501根据从存储器502中读取的程序所包括的可执行指令 执行具体操作。Correspondingly, the embodiment of the present invention further provides a first forwarding device, and the first forwarding device may be disposed on a forwarding device such as a router or a switch, which is not specifically limited in this embodiment of the present invention. The first forwarding device may perform the method provided by the embodiment corresponding to FIG. 1. Referring to the schematic diagram shown in FIG. 5, the first forwarding device may include: a processor 501, a memory 502, and a communication interface 503. The processor 501, the memory 502, and the communication interface 503 can be connected through a communication bus 504. The memory 502 is for storing a program, and the processor 501 executes executable instructions according to the program read from the memory 502. Perform specific actions.
可选地,图3中的接收单元301可由图5中的通信接口503实现,图3中的获得单元302和更新单元303可由图5中的处理器501根据存储器502存储的可执行指令实现,处理器501可以包括至少一个物理处理器。Alternatively, the receiving unit 301 in FIG. 3 may be implemented by the communication interface 503 in FIG. 5. The obtaining unit 302 and the updating unit 303 in FIG. 3 may be implemented by the processor 501 in FIG. 5 according to executable instructions stored in the memory 502. Processor 501 can include at least one physical processor.
需要说明的是,图3所示的第一转发设备和图5所示的第一转发设备可以是同一个设备,可以认为,图3是从物理的角度显示了一个第一转发设备包括的内容,而图5则是从逻辑的角度显示了一个第一转发设备包括的内容。It should be noted that the first forwarding device shown in FIG. 3 and the first forwarding device shown in FIG. 5 may be the same device. It can be considered that FIG. 3 is a physical point of view showing content included in a first forwarding device. Figure 5 shows the content of a first forwarding device from a logical point of view.
图5所示第一转发设备中,所述处理器501,用于读取存储器502中存储的指令和数据,执行以下操作:In the first forwarding device shown in FIG. 5, the processor 501 is configured to read instructions and data stored in the memory 502, and perform the following operations:
所述处理器501通过所述通信接口503接收控制报文,所述控制报文包括以文件格式表示的网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;The processor 501 receives, by using the communication interface 503, a control packet, where the control packet includes network state information represented by a file format, where the network state information is used to indicate an attribute of the second forwarding device;
所述处理器501从所述控制报文中获得所述网络状态信息。The processor 501 obtains the network status information from the control message.
可选地,所述处理器501还利用所述网络状态信息,更新所述第一转发设备保存的网络状态信息库。Optionally, the processor 501 further updates the network state information library saved by the first forwarding device by using the network state information.
举例来说,所述文件格式为XML格式或者JSON格式。For example, the file format is an XML format or a JSON format.
可选地,所述网络状态信息采用YANG语言描述,所述处理器501从所述控制报文中获得所述网络状态信息包括:Optionally, the network status information is described in the YANG language, and the obtaining, by the processor 501, the network status information from the control message includes:
所述处理器501利用网络配置Netconf协议,解析所述控制报文,获得所述网络状态信息。The processor 501 configures the Netconf protocol by using a network, parses the control packet, and obtains the network state information.
可选地,所述处理器501通过所述通信接口503接收控制报文包括:Optionally, the receiving, by the processor 501, the control packet by using the communication interface 503 includes:
所述处理器501通过所述通信接口503接收来自控制器的所述控制报文;或者,The processor 501 receives the control message from the controller through the communication interface 503; or
所述处理器501通过所述通信接口503接收来自所述第二转发设备的所述控制报文。The processor 501 receives the control message from the second forwarding device through the communication interface 503.
本发明实施例还提供了一种网络设备,所述网络设备可设于Controller、路由器或交换机等设备上,本发明实施例对此可不做具体限定。所述网络设备可执行图2对应的实施例提供的方法。参见图6所示示意图,所述网络设备可包括:处理器601、存储器602和通信接口603。其中,处理器601、存储器602 和通信接口603可通过通信总线604连接。存储器602用于存储程序,处理器601根据从存储器602中读取的程序所包括的可执行指令执行具体操作。The embodiment of the present invention further provides a network device, which may be disposed on a device such as a controller, a router, or a switch, and is not specifically limited in this embodiment of the present invention. The network device may perform the method provided by the embodiment corresponding to FIG. 2. Referring to the schematic diagram shown in FIG. 6, the network device may include a processor 601, a memory 602, and a communication interface 603. Wherein, the processor 601 and the memory 602 And communication interface 603 can be connected by communication bus 604. The memory 602 is for storing programs, and the processor 601 performs specific operations in accordance with executable instructions included in the program read from the memory 602.
可选地,图4中的第一获得单元401和发送单元403可由图6中的通信接口603实现,图4中的第二获得单元402可由图6中的处理器601根据存储器602存储的可执行指令实现,处理器601可以包括至少一个物理处理器。Alternatively, the first obtaining unit 401 and the transmitting unit 403 in FIG. 4 may be implemented by the communication interface 603 in FIG. 6, and the second obtaining unit 402 in FIG. 4 may be stored by the processor 601 in FIG. 6 according to the memory 602. The instructions are implemented, and the processor 601 can include at least one physical processor.
需要说明的是,图4所示的网络设备和图6所示的网络设备可以是同一个设备,可以认为,图4是从物理的角度显示了一个网络设备包括的内容,而图6则是从逻辑的角度显示了一个网络设备包括的内容。It should be noted that the network device shown in FIG. 4 and the network device shown in FIG. 6 may be the same device. It can be considered that FIG. 4 shows the content included in one network device from a physical point of view, and FIG. 6 A logically represented content of a network device is included.
图6所示网络设备中,所述处理器601,用于读取存储器602中存储的指令和数据,执行以下操作:In the network device shown in FIG. 6, the processor 601 is configured to read instructions and data stored in the memory 602, and perform the following operations:
所述处理器601通过所述通信接口603获得网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;The processor 601 obtains network status information by using the communication interface 603, where the network status information is used to indicate an attribute that the second forwarding device has;
所述处理器601将所述网络状态信息编码为文件格式,获得控制报文,所述控制报文中包括以所述文件格式表示的所述网络状态信息;The processor 601 encodes the network status information into a file format, and obtains a control message, where the control message includes the network status information represented by the file format;
所述处理器601通过所述通信接口603向第一转发设备发送所述控制报文。The processor 601 sends the control packet to the first forwarding device through the communication interface 603.
举例来说,所述文件格式为XML格式或者JSON格式。For example, the file format is an XML format or a JSON format.
可选地,所述处理器601将所述网络状态信息编码为文件格式包括:所述处理器601采用YANG语言描述所述网络状态信息。Optionally, the processor 601 encoding the network state information into a file format includes: the processor 601 describing the network state information in a YANG language.
可选地,所述网络设备为控制器或者所述第二转发设备。Optionally, the network device is a controller or the second forwarding device.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到上述实施例方法中的全部或部分可借助软件加通用硬件平台的方式来实现。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者诸如媒体网关等网络通信设备)执行本发明各个实施例或者实施例的某些部分所述的方法。It can be clearly understood by those skilled in the art that all or part of the above embodiments can be implemented by means of software plus a general hardware platform. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product, which may be stored in a storage medium such as a ROM/RAM or a disk. An optical disk or the like includes instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway) to perform the methods described in various embodiments of the present invention or portions of the embodiments.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于设备及系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以 上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。It is to be noted that the various embodiments in the present specification are described in a progressive manner, and the same similar parts between the various embodiments may be referred to each other, and each embodiment focuses on different embodiments from other embodiments. At the office. In particular, for the device and the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment. Take The apparatus and system embodiments described above are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without any creative effort.
以上所述仅是本发明的可选实施方式,并非用于限定本发明的保护范围。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。 The above description is only an alternative embodiment of the present invention and is not intended to limit the scope of the present invention. It should be noted that a number of modifications and refinements may be made by those skilled in the art without departing from the principles of the invention, and such modifications and modifications are also considered to be within the scope of the invention.

Claims (15)

  1. 一种用于同步网络状态的方法,其特征在于,所述方法包括:A method for synchronizing network status, the method comprising:
    第一转发设备接收控制报文,所述控制报文包括以文件格式表示的网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;The first forwarding device receives the control packet, where the control packet includes network state information represented by a file format, where the network state information is used to indicate an attribute of the second forwarding device;
    所述第一转发设备从所述控制报文中获得所述网络状态信息。The first forwarding device obtains the network status information from the control message.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    所述第一转发设备利用所述网络状态信息,更新所述第一转发设备保存的网络状态信息库。The first forwarding device updates the network state information library saved by the first forwarding device by using the network state information.
  3. 根据权利要求1或2所述的方法,其特征在于,所述文件格式为可扩展标记语言XML格式或者爪哇脚本对象标记语言JSON格式。The method according to claim 1 or 2, wherein the file format is an Extensible Markup Language (XML) format or a Javascript Object Markup Language (JSON) format.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述网络状态信息采用另一个下一代YANG语言描述,所述第一转发设备从所述控制报文中获得所述网络状态信息包括:The method according to any one of claims 1 to 3, wherein the network state information is described in another next-generation YANG language, and the first forwarding device obtains the network state from the control message. Information includes:
    所述第一转发设备利用网络配置Netconf协议,解析所述控制报文,获得所述网络状态信息。The first forwarding device uses the network configuration Netconf protocol to parse the control packet to obtain the network state information.
  5. 根据权利要求1至4任一项所述的方法,其特征在于,所述第一转发设备接收控制报文包括:The method according to any one of claims 1 to 4, wherein the receiving, by the first forwarding device, the control message comprises:
    所述第一转发设备接收来自控制器的所述控制报文,或者所述第一转发设备接收来自所述第二转发设备的所述控制报文。The first forwarding device receives the control message from the controller, or the first forwarding device receives the control message from the second forwarding device.
  6. 一种用于同步网络状态的方法,其特征在于,所述方法包括:A method for synchronizing network status, the method comprising:
    网络设备获得网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;The network device obtains network status information, where the network status information is used to indicate an attribute that the second forwarding device has;
    所述网络设备将所述网络状态信息编码为文件格式,获得控制报文,所述控制报文中包括以所述文件格式表示的所述网络状态信息;The network device encodes the network state information into a file format, and obtains a control packet, where the control packet includes the network state information represented by the file format;
    所述网络设备向第一转发设备发送所述控制报文。The network device sends the control packet to the first forwarding device.
  7. 根据权利要求6所述的方法,其特征在于,所述文件格式为可扩展标记语言XML格式或者爪哇脚本对象标记语言JSON格式。The method of claim 6, wherein the file format is an Extensible Markup Language (XML) format or a Javascript Object Markup Language (JSON) format.
  8. 根据权利要求6或7所述的方法,其特征在于,所述网络设备将所述网络状态信息编码为文件格式包括:The method according to claim 6 or 7, wherein the encoding, by the network device, the network status information into a file format comprises:
    所述网络设备采用另一个下一代YANG语言描述所述网络状态信息。 The network device describes the network status information in another next-generation YANG language.
  9. 根据权利要求6至8任一项所述的方法,其特征在于,所述网络设备为控制器或者所述第二转发设备。The method according to any one of claims 6 to 8, wherein the network device is a controller or the second forwarding device.
  10. 一种第一转发设备,其特征在于,所述第一转发设备包括:A first forwarding device, where the first forwarding device includes:
    接收单元,用于接收控制报文,所述控制报文包括以文件格式表示的网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;a receiving unit, configured to receive a control message, where the control message includes network state information represented by a file format, where the network state information is used to indicate an attribute of the second forwarding device;
    获得单元,用于从所述接收单元接收的所述控制报文中获得所述网络状态信息。And an obtaining unit, configured to obtain the network state information from the control message received by the receiving unit.
  11. 根据权利要求10所述的第一转发设备,其特征在于,所述第一转发设备还包括:The first forwarding device according to claim 10, wherein the first forwarding device further comprises:
    更新单元,用于利用所述获得单元获得的所述网络状态信息,更新所述第一转发设备保存的网络状态信息库。And an update unit, configured to update the network state information library saved by the first forwarding device by using the network state information obtained by the obtaining unit.
  12. 根据权利要求10或11所述的第一转发设备,其特征在于,所述网络状态信息采用另一个下一代YANG语言描述,The first forwarding device according to claim 10 or 11, wherein the network state information is described by another next-generation YANG language.
    所述获得单元具体用于利用网络配置Netconf协议,解析所述接收单元接收的所述控制报文,获得所述网络状态信息。The obtaining unit is specifically configured to configure the Netconf protocol by using a network, and parse the control packet received by the receiving unit to obtain the network state information.
  13. 根据权利要求10至12任一所述的第一转发设备,其特征在于,A first forwarding device according to any one of claims 10 to 12, characterized in that
    所述接收单元具体用于接收来自控制器的所述控制报文,或者所述接收单元具体用于接收来自所述第二转发设备的所述控制报文。The receiving unit is specifically configured to receive the control message from the controller, or the receiving unit is specifically configured to receive the control message from the second forwarding device.
  14. 一种网络设备,其特征在于,所述网络设备包括:A network device, where the network device includes:
    第一获得单元,用于获得网络状态信息,所述网络状态信息用于表示第二转发设备具有的属性;a first obtaining unit, configured to obtain network state information, where the network state information is used to indicate an attribute that the second forwarding device has;
    第二获得单元,用于将所述第一获得单元获得的所述网络状态信息编码为文件格式,获得控制报文,所述控制报文中包括以所述文件格式表示的所述网络状态信息;a second obtaining unit, configured to encode the network state information obtained by the first obtaining unit into a file format, to obtain a control message, where the control message includes the network state information represented by the file format ;
    发送单元,用于向第一转发设备发送所述控制报文。And a sending unit, configured to send the control packet to the first forwarding device.
  15. 根据权利要求13或14所述的网络设备,其特征在于,A network device according to claim 13 or 14, wherein
    所述第二获得单元具体用于采用另一个下一代YANG语言描述所述网络状态信息。 The second obtaining unit is specifically configured to describe the network state information by using another next-generation YANG language.
PCT/CN2015/088980 2014-11-06 2015-09-06 Network state synchronizing method and apparatus WO2016070679A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410623562.1 2014-11-06
CN201410623562.1A CN105635223A (en) 2014-11-06 2014-11-06 Method and device of synchronizing network state

Publications (1)

Publication Number Publication Date
WO2016070679A1 true WO2016070679A1 (en) 2016-05-12

Family

ID=55908535

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/088980 WO2016070679A1 (en) 2014-11-06 2015-09-06 Network state synchronizing method and apparatus

Country Status (2)

Country Link
CN (1) CN105635223A (en)
WO (1) WO2016070679A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144489B (en) * 2017-06-16 2021-11-05 上海赛特斯信息科技股份有限公司 State data processing method based on Yang language model
CN110855459B (en) 2018-08-20 2021-07-09 华为技术有限公司 Network configuration method, device and system
CN113079099B (en) * 2021-06-04 2021-09-10 军事科学院系统工程研究院网络信息研究所 Method and system for synchronizing network state by adopting consensus protocol stack

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101453414A (en) * 2007-11-30 2009-06-10 华为技术有限公司 Head node protection method, system and equipment for point to multiple points label switch path
CN103036797A (en) * 2011-09-28 2013-04-10 阿瓦雅公司 Method to route multicast data in SPB network by establishing the virtual PIM adjacency across the SPB networks in a single PIM domain
CN103229482A (en) * 2010-09-29 2013-07-31 捷讯研究有限公司 Methods and apparatus to discover network capabilities available via wireless networks
US20140280711A1 (en) * 2013-03-15 2014-09-18 Cisco Technology, Inc. Local reroute protection for multicast multiprotocol label switching

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101296124B (en) * 2008-06-27 2012-04-04 华为技术有限公司 Method for acquiring equipment information

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101453414A (en) * 2007-11-30 2009-06-10 华为技术有限公司 Head node protection method, system and equipment for point to multiple points label switch path
CN103229482A (en) * 2010-09-29 2013-07-31 捷讯研究有限公司 Methods and apparatus to discover network capabilities available via wireless networks
CN103036797A (en) * 2011-09-28 2013-04-10 阿瓦雅公司 Method to route multicast data in SPB network by establishing the virtual PIM adjacency across the SPB networks in a single PIM domain
US20140280711A1 (en) * 2013-03-15 2014-09-18 Cisco Technology, Inc. Local reroute protection for multicast multiprotocol label switching

Also Published As

Publication number Publication date
CN105635223A (en) 2016-06-01

Similar Documents

Publication Publication Date Title
JP6434611B2 (en) Interworking lightweight machine-to-machine protocol using device management protocol
US10575153B2 (en) Enhanced operations between service layer and management layer in an M2M system by allowing the execution of a plurality of commands on a plurality of devices
US7849495B1 (en) Method and apparatus for passing security configuration information between a client and a security policy server
US10819659B2 (en) Direct replying actions in SDN switches
CN110971438A (en) Method and device for configuring data
EP3611877A1 (en) Information notification method and device
CN105591798B (en) The method, apparatus of OAM Information is transmitted in DCN
US11863454B2 (en) Systems and methods for scalable validation of multiple paths in a network using segment routing
WO2016070679A1 (en) Network state synchronizing method and apparatus
CN115379010B (en) Container network construction method, device, equipment and storage medium
US20120300777A1 (en) Supporting multiple iec-101/iec-104 masters on an iec-101/iec-104 translation gateway
CN103581353B (en) The method of automatic configuration and system of gateway device
US9633131B2 (en) HTML network service tags used with web browsers for controlling network elements
WO2015070763A1 (en) Self-establishing method and apparatus for x2 interface
CN110995705B (en) Method for remotely and safely accessing virtual machine
US10454715B1 (en) Virtual private wire service interworking
WO2016197836A1 (en) Method, apparatus and system for announcing uni tunnel state
CN110771117B (en) Session layer communication using ID-oriented network
US10298454B2 (en) Communication path switching apparatus, method for controlling communication path switching apparatus, and computer program product
WO2016184025A1 (en) Device management method and apparatus
Venkataram et al. Communication protocol Engineering
WO2017023979A1 (en) Service elements
Dean et al. Client/server messaging protocols in serverless environments
CN109889384A (en) A method of NAT, which is carried out, using snmp protocol passes through managing intranet equipment
WO2016062085A1 (en) Virtual network realization method, nve and nva device and system

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

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

Country of ref document: EP

Kind code of ref document: A1