Disclosure of Invention
Embodiments of the present invention provide a router discovery method, an SDN controller, a router, and a network system, which are capable of discovering a router in an SDN network.
In a first aspect, a router discovery method is provided, including:
the SDN controller issues a feature flow table to the SDN switch, wherein the feature flow table is used for indicating the SDN switch to send a feature message sent by the router to the SDN controller; the method comprises the steps that an SDN switch receives a feature message sent by a router, and forwards the feature message to an SDN controller according to a feature flow table, wherein the feature message carries router feature information, and the router feature information comprises feature codes for identifying the router; the SDN controller acquires an ARP message sent by a router through an SDN switch; the SDN controller acquires node information of the router according to the characteristic message and the ARP message, wherein the node information of the router comprises: IP address, router characteristic information.
In a second aspect, an SDN controller is provided, comprising:
a sending unit, configured to issue a feature flow table to an SDN switch, where the feature flow table is used to instruct the SDN switch to send a feature packet sent by a router to the SDN controller; a receiving unit, configured to receive a feature packet sent by the router and forwarded by the SDN switch according to the feature flow table, where the feature packet carries router feature information, and the router feature information includes a feature code that identifies the router; the receiving unit is further used for acquiring an ARP message sent by the router through an SDN switch; a processing unit, configured to obtain node information of a router according to the feature packet and the ARP packet received by the receiving unit, where the node information of the router includes: IP address, router name feature information.
In a third aspect, a router is provided, including:
a sending unit, configured to send a feature packet to an SDN controller through an SDN switch, where the feature packet carries router feature information; the sending unit is further configured to send an ARP packet to the SDN controller through the SDN switch.
In a fourth aspect, a network system is provided, which includes any one of the SDN controllers, at least one SDN switch, and any one of the routers described above; wherein the SDN controller is configured to control data forwarding of the at least one SDN switch, any SDN switch of the at least one SDN switch is connected to an end host, and any SDN switch of the at least one SDN switch is connected to the router.
In the scheme, the SDN controller issues a feature flow table to the SDN switch, wherein the feature flow table is used for indicating the SDN switch to send a feature message sent by the router to the SDN controller; the method comprises the steps that an SDN switch receives a feature message sent by a router, and forwards the feature message to an SDN controller according to a feature flow table, wherein the feature message carries router feature information, and the router feature information comprises feature codes for identifying the router; the SDN controller acquires an ARP message sent by a router through an SDN switch; the SDN controller acquires node information of the router according to the characteristic message and the ARP message, wherein the node information of the router comprises: IP address, router characteristic information. By the method, the SDN controller can finally acquire the node information of the router, so that the SDN controller can find the router in the SDN network, the topology display of the SDN controller can accurately reflect the real physical network topology, and convenience is provided for network service deployment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The system architecture and the service scenario described in the embodiment of the present invention are for more clearly illustrating the technical solution of the embodiment of the present invention, and do not form a limitation on the technical solution provided in the embodiment of the present invention, and it can be known by those skilled in the art that the technical solution provided in the embodiment of the present invention is also applicable to similar technical problems along with the evolution of the system architecture and the appearance of a new service scenario.
The above method is described in detail with reference to specific examples. Referring to fig. 1, an embodiment of the present invention is applied to a network system including: an SDN controller and at least one SDN switch and router; wherein the SDN controller is configured to control data forwarding of at least one SDN switch, any SDN switch of the at least one SDN switch is connected to an end host (e.g., a personal computer PC), and any SDN switch of the at least one SDN switch is connected to a router. Only two SDN switches are shown in fig. 1, it can be understood that an SDN controller may also control data forwarding between multiple SDN switches, and thus the network system may also include multiple SDN switches, and in a specific application scenario, an end host and a router may connect the same SDN switch or different SDN switches.
Based on the network system, the basic principle of the application is as follows: a router accessing the SDN network configures a real IP address and turns on a neighbor discovery function of the router, for example: the NDSP (Neighbor Device search Protocol) or the CDP (Cisco Discovery Protocol) identifies the current Device as a router by carrying a feature code for agreeing to identify the router in the feature information of the router. The method comprises the steps that a characteristic flow table is issued to an SDN switch by an SDN controller to obtain an NDSP or CDP characteristic message sent by a router, the characteristic message is identified and analyzed to obtain router characteristic information carried by the characteristic message, the router characteristic information and an ARP message sent by the router are integrated to finally form a node of the router, and the information is written into a background database of the SDN controller, so that the router is discovered and identified. In addition, the SDN controller can send a probe packet to the target router to discover that a link where the target router is located is abnormal, or discover that the target router is an abnormal network node to perform aging processing on the target router. In the scheme, the neighbor discovery function (NDSP or CDP) of the router is adopted, and the accurate discovery of the router can be completed without additionally adding a new function or protocol on the router.
Referring to fig. 2, an embodiment of the present invention provides a router discovery method, and referring to fig. 2, the method includes the following steps:
s101, the SDN controller issues a feature flow table to the SDN switch, wherein the feature flow table is used for indicating the SDN switch to send a feature message sent by the router to the SDN controller.
S102, the router sets the IP address of the router and starts a neighbor discovery function to generate a characteristic message, wherein the characteristic message is an NDSP message or a CDP message.
The feature packet carries Router feature information, for example, the Router feature information includes a feature code identifying a Router, for example, the feature code is "Router", and the SDN controller may identify the Router through the identifier code. The feature information of the router may further include a router name, a MAC address, and a router access port number, and the feature information of the router is not limited in the present invention as long as the SDN controller can identify the router and perform topology discovery and control management on the router.
S103, the SDN switch receives the feature message sent by the router and forwards the feature message to the SDN controller according to the feature flow table.
S104, the SDN controller acquires an ARP message sent by the router through the SDN switch.
And S105, the SDN controller acquires the node information of the router according to the feature message and the ARP message.
The SDN controller may obtain the feature information of the router according to the feature packet, and obtain the IP address of the router according to the ARP packet. Therefore, the SDN controller acquires the node information of the router according to the feature message and the ARP message. The node information of the router includes an IP address of the router and feature information of the router.
After step S105, the SDN controller stores node information of the router in a database, thereby completing a discovery function for the router. Furthermore, since the SDN switch may have a router log-out or re-release or information change (for example, a router IP address change, a router name change, a router access port change, etc.), the method further includes, after step S105: and after a preset time interval, the SDN controller updates the node information of the router. Here, the updating of the node information of the router by the SDN controller means that the processes of the steps S101 to S105 are re-executed to complete the node information of the newly accessed router.
In the scheme, the SDN controller issues a feature flow table to the SDN switch, wherein the feature flow table is used for indicating the SDN switch to send a feature message sent by the router to the SDN controller; the SDN switch receives a feature message sent by a router, and forwards the feature message to an SDN controller according to a feature flow table, wherein the feature message carries router feature information; the SDN controller acquires an ARP message sent by a router through an SDN switch; and the SDN controller acquires the node information of the router according to the characteristic message and the ARP message. By the method, the SDN controller can finally obtain the node information of the router, and because the router characteristic information contains the characteristic code for identifying the router, the SDN controller can find the router in the SDN network, the topology display of the SDN controller can accurately reflect the real physical network topology, and convenience is provided for network service deployment.
In addition, referring to fig. 3, after completing the discovery process of the router, an embodiment of the present invention further provides a method for detecting a router, including the following steps:
s201, the SDN controller obtains a target IP address of the target router from a database.
S202, the SDN controller sends a detection message to the target router according to the target IP address.
The SDN controller can periodically acquire a target IP address of the target router from the database, and periodically send a detection message to the target router in a packet-out mode according to the target IP address.
And S203, if the SDN controller receives the response of the target router to the detection message, acquiring the timestamp information of the target router according to the response.
And S204, if the SDN controller determines that the time interval between the timestamp information and the current time exceeds a time threshold, determining that the target router is an abnormal network node.
Thus, when determining that the target router is an abnormal network node, the SDN controller may further determine whether the target router satisfies an aging condition, for example: and when the time delay of the router exceeds a preset value, deleting the router or updating the related information of the router. Otherwise, the SDN controller determines that the time interval between the timestamp information and the current time does not exceed the time threshold, and then determines that the target router is normal.
And S205, if the SDN controller does not receive the response of the target router to the detection message, determining that the link of the target router is abnormal.
The detection of the router is realized through the steps S201-205, which provides convenience for network service deployment.
Referring to fig. 4, an embodiment of the present invention provides an SDN controller for implementing the above method embodiment, where the SDN controller includes:
a sending unit 41, configured to issue a feature flow table to an SDN switch, where the feature flow table is used to instruct the SDN switch to send a feature packet sent by a router to the SDN controller;
a receiving unit 42, configured to receive a feature packet sent by the router and forwarded by the SDN switch according to the feature flow table, where the feature packet carries router feature information, and the router feature information includes a feature code that identifies the router;
the receiving unit 42 is further configured to obtain an ARP packet sent by the router through the SDN switch;
a processing unit 43, configured to obtain node information of the router according to the feature packet and the ARP packet received by the receiving unit 42, where the node information of the router includes: IP address, router characteristic information.
The processing unit 43 may obtain the feature information of the router according to the feature packet, and obtain the IP address of the router according to the ARP packet.
Optionally, the processing unit 43 is further configured to update the node information of the router after a predetermined time interval.
The node information of the router is stored in a database; the SDN controller further comprises: an obtaining unit 44, configured to obtain a target IP address of the target router in the database; the sending unit 41 is further configured to send a detection packet to the target router according to the target IP address acquired by the acquiring unit 44; the processing unit 43 is further configured to, if the receiving unit 42 receives a response to the detection packet from the target router, obtain timestamp information of the target router according to the response; the processing unit 43 is further configured to determine that the target router is an abnormal network node if it is determined that the time interval between the timestamp information and the current time exceeds the time threshold.
Optionally, the processing unit 43 is further configured to determine that a link of the target router is abnormal if the receiving unit 42 does not receive the response of the target router to the detection packet.
Referring to fig. 5, an embodiment of the present invention provides a router for implementing the above method embodiment, where the router includes:
a sending unit 51, configured to send a feature packet to an SDN controller through an SDN switch, where the feature packet carries router feature information, and a router name includes a feature code identifying a router;
the sending unit 51 is further configured to send an ARP packet to the SDN controller through the SDN switch.
Optionally, the processing unit 52 is further configured to set an own IP address and start a neighbor discovery function, and generate a feature message, where the feature message is: NDSP messages or CDP messages.
In the scheme, the SDN controller issues a feature flow table to the SDN switch, wherein the feature flow table is used for indicating the SDN switch to send a feature message sent by the router to the SDN controller; the SDN switch receives a feature message sent by a router, and forwards the feature message to an SDN controller according to a feature flow table, wherein the feature message carries router feature information; the SDN controller acquires an ARP message sent by a router through an SDN switch; and the SDN controller acquires the node information of the router according to the characteristic message and the ARP message. By the method, the SDN controller can finally acquire the node information of the router, and because the router characteristic information contains the identification code for identifying the router, the SDN controller can find the router in the SDN network, the topology display of the SDN controller can accurately reflect the real physical network topology, and convenience is provided for network service deployment.
Additionally, a computer-readable medium (or media) is also provided, comprising computer-readable instructions that when executed perform the operations of the method in the above-described embodiments.
Additionally, a computer program product is also provided, comprising the above-described computer-readable medium (or media).
It should be understood that, in various embodiments of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.