The invention relates to an SDN-based
network topology discovery method. The method comprises the following steps: sending a port state request to all connected SDN switches through a controller to obtain state
information data of each SDN switch; packaging a private
Ethernet type 0x9944 message into a Packet-out message of an
OpenFlow standard through the controller, and sending the Packet-out message to all port devices of which the SDN switch port states are open; enabling the SDN switch port to receive the 0x9944 message, reassemble the 0x9944 message, and send the 0x9944 message to an adjacent SDN switch; S3, when the adjacent SDN switches in the step S3 receive the 0x9944 message, packaging the 0x9944 message into an
Openflow standard Packet-in message, and sending the
Openflow standard Packet-in message to the controller; using the packet-in message packaged with the 0x9944 message sent by the SDN switch for obtaining the information of port equipment through which the message passes so as to complete the link discovery of the SDN optical line terminals. According to the technical scheme, the
network topology discovery method based on the SDN is low in message analysis difficulty, high in speed, high in expandability and capable of customizing a topology detection mode, and the discovery efficiency of the
network topology discovery method based on the SDN is greatly improved.