CN112910682A - Link detection method and switch controller - Google Patents

Link detection method and switch controller Download PDF

Info

Publication number
CN112910682A
CN112910682A CN202110033038.9A CN202110033038A CN112910682A CN 112910682 A CN112910682 A CN 112910682A CN 202110033038 A CN202110033038 A CN 202110033038A CN 112910682 A CN112910682 A CN 112910682A
Authority
CN
China
Prior art keywords
switch
detected
link
type
connection type
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202110033038.9A
Other languages
Chinese (zh)
Inventor
侯乐
贾宝军
徐雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202110033038.9A priority Critical patent/CN112910682A/en
Publication of CN112910682A publication Critical patent/CN112910682A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/15Interconnection of switching modules

Landscapes

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

Abstract

The application discloses a link detection method and a switch controller, and relates to the technical field of communication. The link detection method comprises the following steps: generating a link detection message according to a preset type table; detecting a link to be detected in the link set according to the link detection message to obtain a switch type corresponding to the switch to be detected, wherein the link to be detected comprises a first switch and the switch to be detected; and determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected. The detection speed of the link to be detected is accelerated through the preset type table, the connection type of the link to be detected is determined according to the preset type table and the switch type corresponding to the switch to be detected, the connection type of the link to be detected can be rapidly determined, repeated detection information is prevented from being sent, waste of network resources is reduced, communication connection in a communication network is conveniently selected, and the communication speed is accelerated.

Description

Link detection method and switch controller
Technical Field
The present application relates to the field of communications technologies, and in particular, to a link detection method and a switch controller.
Background
At present, with the popularization of Software Defined Networking (SDN), SDN has wide application in many aspects such as campus networks, data centers, and wide area networks. In a certain network scenario, a network topology structure in which an SDN switch and a conventional switch are mixedly deployed exists, and for such a network topology structure, an SDN controller generally performs network topology detection in a Link Layer Discovery Protocol (LLDP) and Broadcast packet (BDDP) manner. The method comprises the steps of firstly sending an LDDP message to detect SDN switches directly connected with each other, and then sending a BDDP message to detect the situation that traditional switches exist among the SDN switches. In order to obtain the network topology in the hybrid network scenario, two messages and two detections are required, which results in the waste of network resources.
Disclosure of Invention
Therefore, the application provides a link detection method and a switch controller to solve the problem of how to detect the connection type of a link, further determine the network topology in a hybrid network scene, and avoid the waste of network resources.
In order to achieve the above object, a first aspect of the present application provides a link detection method, including: generating a link detection message according to a preset type table; detecting a link to be detected in the link set according to the link detection message to obtain a switch type corresponding to the switch to be detected, wherein the link to be detected comprises a first switch and the switch to be detected; and determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected.
In some implementations, the preset type table includes a preset switch type, and the preset switch type includes a software defined network SDN switch type and a two-layer switch type; the connection types of the link to be detected include a direct connection type and an indirect connection type.
In some specific implementations, determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected includes: determining that the connection type of the link to be detected is a direct connection type under the condition that the switch type corresponding to the switch to be detected is determined to be the SDN switch type; and under the condition that the switch type corresponding to the switch to be detected is determined to be a two-layer switch type, determining that the connection type of the link to be detected is an indirect connection type.
In some specific implementations, the preset type table further includes a preset time-to-live value, and the preset time-to-live value is a time-to-live value TTL corresponding to the type of the two-layer switch; after determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected, the method further comprises the following steps: acquiring a physical address of a switch to be detected; under the condition that the connection type of the link to be detected is determined to be a direct connection type, generating a first TTL corresponding to the SDN switch type according to a preset survival time value; generating and sending a first report message to a switch controller according to the first TTL and the physical address of the switch to be detected, so that the switch controller can acquire the connection type and the first TTL of the link to be detected; and under the condition that the connection type of the link to be detected is determined to be an indirect connection type, generating and sending a second report message according to the preset survival time value and the physical address of the switch to be detected so that the switch controller can know the connection type of the link to be detected.
In some specific implementations, after detecting the link to be detected in the link set according to the link detection message and obtaining the switch type corresponding to the switch to be detected, the method further includes: determining that the switch to be detected supports data analysis of a protocol of a data link layer in an open system interconnection reference model OSI under the condition that the switch type corresponding to the switch to be detected is determined to be a two-layer switch type; and under the condition that the switch type corresponding to the switch to be detected is determined to be the SDN switch type, determining that the switch to be detected supports data analysis of at least three layers of protocols in OSI.
In some specific implementations, detecting a link to be detected in a link set according to a link detection message to obtain a switch type corresponding to a switch to be detected includes: sending a link detection message to a first switch so that the first switch forwards the link detection message to a switch to be detected; and responding to a link detection response fed back by the switch to be detected, and acquiring the switch type corresponding to the switch to be detected.
In some specific implementations, after determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected, the method further includes: and determining the network topology of the communication network according to the connection type of the link to be detected.
In some implementations, after determining the network topology of the communication network according to the connection type of the link to be detected, the method further includes: identifying a link to be detected as a communication link; the communication links are routed according to the network topology.
In order to achieve the above object, a second aspect of the present application provides a switch controller comprising: the generating module is used for generating a link detection message according to a preset type table; the detection module is used for detecting a link to be detected in the link set according to the link detection message to obtain a switch type corresponding to the switch to be detected, wherein the link to be detected comprises a first switch and the switch to be detected; and the connection type determining module is used for determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected.
In some implementations, the preset type table includes a preset switch type, and the preset switch type includes a software defined network SDN switch type and a two-layer switch type; the connection type of the link to be detected comprises a direct connection type and an indirect connection type; a connection type determination module comprising: the first determining submodule is used for determining that the connection type of the link to be detected is a direct connection type under the condition that the switch type corresponding to the switch to be detected is determined to be the SDN switch type; and the second determining submodule is used for determining that the connection type of the link to be detected is an indirect connection type under the condition that the switch type corresponding to the switch to be detected is determined to be a two-layer switch type.
According to the link detection method and the switch controller, the link detection message is generated through the preset type table, the link detection message comprises the preset type table, the link detection message is simplified, and the subsequent detection of the link to be detected is facilitated; detecting a link to be detected in the link set according to the link detection message to obtain a switch type corresponding to the switch to be detected, wherein the link to be detected is a link between the first switch and the switch to be detected, so that the switch type of the switch to be detected can be quickly obtained, and the detection speed of the link to be detected is accelerated; the connection type of the link to be detected is determined according to the preset type table and the switch type corresponding to the switch to be detected, so that the connection type of the link to be detected can be rapidly determined, repeated detection messages are prevented from being sent, waste of network resources is reduced, communication connection in a communication network is conveniently selected, and the communication speed is increased.
Drawings
The accompanying drawings are included to provide a further understanding of the embodiments of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the principles of the application. The above and other features and advantages will become more apparent to those skilled in the art by describing in detail exemplary embodiments thereof with reference to the attached drawings, in which:
fig. 1 shows a block diagram of a detection system for detecting a communication link based on LLDP according to the present application.
Fig. 2 shows a block diagram of a BDDP-based detection system for detecting a communication link according to the present application.
Fig. 3 is a flowchart illustrating a link detection method in an embodiment of the present application.
Fig. 4 shows a flow chart of a link detection method in a further embodiment of the present application.
Fig. 5 is a flowchart illustrating a link detection method according to still another embodiment of the present application.
Fig. 6 shows a flow chart of a link detection method in another embodiment of the present application.
Fig. 7 shows a block diagram of the components of the switch controller in the embodiment of the present application.
Fig. 8 shows a block diagram of the components of the link detection system in the embodiment of the present application.
Fig. 9 is a flowchart illustrating a method of operating the link detection system in the embodiment of the present application.
Detailed Description
The following detailed description of embodiments of the present application will be made with reference to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present application, are given by way of illustration and explanation only, and are not intended to limit the present application. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present application by illustrating examples thereof.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 shows a block diagram of a detection system for detecting a communication link based on LLDP according to the present application.
As shown in fig. 1, the detection system includes a first Software Defined Network (SDN) switch 101, a second SDN switch 102, and an SDN controller 103, which are connected in sequence. The SDN controller 103 detects a link connection mode between the first SDN switch 101 and the second SDN switch 102 by using an LLDP message. Because the LLDP message only supports one-hop messaging, that is, a detection message based on the LLDP message sent by the first SDN switch 101 can only be sent to the second SDN switch 102 directly connected to the first SDN switch 101, the SDN controller 103 can only detect whether two SDN switches are directly connected.
The specific detection process is as follows: the SDN controller 103 first sends a PACKET _ OUT message to the first SDN switch 101, where the PACKET _ OUT message is a detection message based on an LLDP message; when the first SDN switch 101 receives the PACKET _ OUT message, the PACKET _ OUT message is forwarded through a designated port, so that a switch (e.g., the second SDN switch 102) directly connected to the first SDN switch 101 can obtain the PACKET _ OUT message; when the second SDN switch 102 obtains the PACKET _ OUT message, a PACKET _ IN message (i.e., a detection response message) is fed back to the SDN controller 103, so that the SDN controller 103 knows that the link connection type between the first SDN switch 101 and the second SDN switch 102 is a direct connection. However, the survival time of the LLDP packet in this detection method is only one hop, that is, the detection can only be performed on the link connection type between two adjacent switches, and the detection cannot be performed on the link connection type between non-adjacent switches, which has certain limitations.
Fig. 2 shows a block diagram of a BDDP-based detection system for detecting a communication link according to the present application.
As shown in fig. 2, the detection system includes a first SDN switch 201, a switch to be detected 203, a second SDN switch 202, and an SDN controller 204, which are connected in sequence. The SDN controller 204 detects a link connection mode between the first SDN switch 201 and the second SDN switch 202 by using the BDDP packet. The BDDP message may detect whether a non-SDN switch (e.g., a conventional two-layer switch) exists between the first SDN switch 201 and the second SDN switch 202.
The specific detection process is as follows: firstly, the SDN controller 204 sends a PACKET _ OUT message to the first SDN switch 201, where the PACKET _ OUT message is a first detection message based on an LLDP message, and the first detection message includes a preset port; when receiving the PACKET _ OUT message, the first SDN switch 201 may forward the PACKET _ OUT message by using a preset port; if the PACKET _ OUT message is received by a non-SDN switch (e.g., a conventional layer two switch), the PACKET _ OUT message may be discarded by the conventional layer two switch, resulting IN the SDN controller 204 failing to receive the corresponding PACKET _ IN message. Within a preset time length, if the SDN controller 204 does not receive a PACKET _ IN message, the SDN controller 204 sends a second detection message based on a BDDP message to the first SDN switch 201, and causes the first SDN switch 201 to forward the second detection message using a corresponding port; if the second detection message is received by a non-SDN switch (e.g., a conventional layer two switch) and forwarded to the second SDN switch 202 through the conventional layer two switch, so that the second SDN switch 202 sends a check response message (e.g., a PACKET _ IN message) corresponding to the second detection message to the SDN controller 204, at this time, the SDN controller 204 may determine, according to the check response message: there is a non-SDN switch (i.e., a conventional two-layer switch) between the first SDN switch 201 and the second SDN switch 202. However, in the detection in the hybrid network scenario, at least two detection messages (for example, two detection messages based on an LLDP message and a BDDP message) need to be sent to know whether a non-SDN switch exists between the first SDN switch 201 and the second SDN switch 202, which results in a waste of network resources.
Fig. 3 is a flowchart illustrating a link detection method in an embodiment of the present application. The link detection method is applicable to a switch. As shown in fig. 3, the link detection method includes:
step S301, generating a link detection message according to a preset type table.
The preset type table comprises preset switch types, and the preset switch types comprise an SDN switch type and a two-layer switch type; the connection types of the link to be detected include a direct connection type and an indirect connection type.
It should be noted that the direct connection type indicates that no two-layer switch exists between the current switch and the switch to be connected, the indirect connection type indicates that the current switch is connected with the switch to be connected through the two-layer switch, and the types of the current switch and the switch to be connected are both SDN switch types. The connection condition between the current switch and other switches is represented through the connection types of different links, and the link detection message is generated according to the preset type table comprising the preset switch type, so that the link detection efficiency is improved.
Step S302, detecting the link to be detected in the link set according to the link detection message, and obtaining the switch type corresponding to the switch to be detected.
The link to be detected comprises a first switch and a switch to be detected.
It should be noted that the switch to be detected is a switch directly connected to the first switch, and by obtaining the switch type corresponding to the switch to be detected, the specific function of the switch connected to the first switch can be quickly determined, so that a suitable communication path is conveniently selected for the first switch.
In some specific implementations, detecting a link to be detected in a link set according to a link detection message to obtain a switch type corresponding to a switch to be detected includes: sending a link detection message to a first switch so that the first switch forwards the link detection message to a switch to be detected; and responding to a link detection response fed back by the switch to be detected, and acquiring the switch type corresponding to the switch to be detected.
The link detection message is forwarded through the first switch, the type of the switch corresponding to the switch to be detected and connected with the first switch can be quickly obtained, and the detection efficiency of the link to be detected is improved.
Step S303, determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected.
The type of the switch corresponding to the switch to be detected can be compared with each preset switch type in the preset type table, whether the type of the switch corresponding to the switch to be detected meets the requirements of the preset type table or not is judged, then the connection type of the link to be detected is determined according to the judgment result, the link detection process is simplified, and the detection speed of the link to be detected is increased.
In some specific implementations, determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected includes: determining that the connection type of the link to be detected is a direct connection type under the condition that the switch type corresponding to the switch to be detected is determined to be the SDN switch type; and under the condition that the switch type corresponding to the switch to be detected is determined to be a two-layer switch type, determining that the connection type of the link to be detected is an indirect connection type.
When the switch type corresponding to the switch to be detected is the SDN switch type, the first switch and the switch to be detected are directly connected, and no two-layer switch exists between the first switch and the switch to be detected; when the switch type corresponding to the switch to be detected is determined to be a two-layer switch type, it is described that the first switch is connected with one two-layer switch, and if it is desired that the first switch can communicate with other SDN switches, it is required to perform route conversion through the two-layer switch, so that the first switch can communicate with other SDN switches. By judging the switch type corresponding to the switch to be detected, the topological structure of the communication network corresponding to the first switch can be determined, the communication message passing through the first switch can be conveniently subjected to proper routing, and the communication efficiency is improved.
In the embodiment, the link detection message is generated according to the preset type table, so that the link detection message is simplified, and the subsequent detection of the link to be detected is facilitated; detecting a link to be detected in the link set according to the link detection message to obtain a switch type corresponding to the switch to be detected, wherein the link to be detected is a link between the first switch and the switch to be detected, so that the switch type of the switch to be detected can be quickly obtained, and the detection speed of the link to be detected is accelerated; the connection type of the link to be detected is determined according to the preset type table and the switch type corresponding to the switch to be detected, so that the connection type of the link to be detected can be rapidly determined, repeated detection messages are prevented from being sent, waste of network resources is reduced, communication connection in a communication network is conveniently selected, and the communication speed is increased.
Fig. 4 shows a flow chart of a link detection method in a further embodiment of the present application. The link detection method is applicable to a switch. As shown in fig. 4, the link detection method includes:
step S401, generating a link detection message according to a preset type table.
And step S402, detecting the link to be detected in the link set according to the link detection message to obtain the switch type corresponding to the switch to be detected.
It should be noted that steps S401 to S402 in this embodiment are the same as steps S301 to S302 in the previous embodiment, and are not described again here.
And S403, determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected.
The preset type table includes a preset switch type and a preset Time-To-Live value, where the preset Time-To-Live value is a preset Time-To-Live (TTL) value, and the TTL is used To indicate the maximum number of allowed network segments before a certain packet is discarded by a switch (or a router).
For example, if the TTL in a packet is initially set to 255, the TTL remains 255 unchanged regardless of how many layer two switches the packet passes through; if the data packet passes through one SDN switch, the TTL is automatically reduced by one until the data packet is discarded because a communication path cannot be found. Therefore, the type of switch through which a packet passes can be determined according to the change of the TTL.
Step S404, the physical address of the switch to be detected is obtained.
The physical Address includes any one of a Media Access Control Address (MAC), a hardware Address, an Ethernet Address (Ethernet Address), and a local area network Address (LAN Address). The physical address is used to confirm the location information of the switch to be detected. In a communication network, a physical address is used to uniquely identify a device (e.g., a switch or network card, etc.).
Step S405, under the condition that the connection type of the link to be detected is determined to be the direct connection type, generating a first TTL corresponding to the SDN switch type according to a preset survival time value.
The connection type of the link to be detected is a direct connection type, and the switch type of the first switch is an SDN switch type, the switch type corresponding to the switch to be detected is also an SDN switch type. Therefore, if the preset time-to-live value is set to 255, the first TTL is equal to 255-1 or 254, so as to indicate that all switches in the link to be detected are SDN switches.
And step S406, generating and sending a first report message to the switch controller according to the first TTL and the physical address of the switch to be detected.
After the switch controller receives the first report message, the switch controller can determine that the connection type of the link to be detected is the direct connection type according to the value of the first TTL through analyzing the first report message.
Step S407, under the condition that the connection type of the link to be detected is determined to be an indirect connection type, generating and sending a second report message according to the preset survival time value and the physical address of the switch to be detected.
After the switch controller receives the second report message, the switch controller can know that the preset time-to-live value is not changed through analyzing the second report message, and further determine that the connection type of the link to be detected is an indirect connection type, namely the link to be detected comprises a two-layer switch.
In this embodiment, when the connection type of the link to be detected is a direct connection type, a first TTL corresponding to the SDN switch type is generated through a preset time to live value to represent that all switches in the link to be detected are SDN switches; when the connection type of the link to be detected is an indirect connection type, it can be known that the link to be detected includes a two-layer switch because the preset time-to-live value in the second report message does not change. The switch type in the link to be detected is further determined, the detection precision of the link to be detected is improved, the switch can conveniently control to obtain the accurate connection type of the link to be detected, the network topology is further determined, and the transmission efficiency of communication information is improved.
Fig. 5 is a flowchart illustrating a link detection method according to still another embodiment of the present application. The link detection method is applicable to a switch controller. As shown in fig. 3, the link detection method includes:
step S501, generating a link detection message according to a preset type table.
Step S502, detecting the link to be detected in the link set according to the link detection message, and obtaining the switch type corresponding to the switch to be detected.
Step S503, determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected.
It should be noted that steps S501 to S503 in this embodiment are the same as steps S301 to S303 in an embodiment, and are not repeated herein.
Step S504, under the condition that the switch type corresponding to the switch to be detected is determined to be a two-layer switch type, the switch to be detected is determined to support data analysis of a protocol of a data link layer in the interconnection reference model of the open system.
Among them, the Open System Interconnection (OSI) model is a standard framework proposed by the international organization for standardization in an attempt to Interconnect various computers as a network worldwide. OSI divides the computer network architecture into the following seven layers: a physical layer, a data link layer, a network layer, a transport layer, a session layer, a presentation layer, and an application layer.
Wherein the physical layer is used to convert data into electrical signals that can be transmitted over a physical medium. The data link layer is responsible for network addressing, error detection and error correction, and framing the data. The data link layer may also specify topology and provide hardware addressing. The network layer is used to determine routing and forwarding of data, and adds a network header to the data packet to form a packet. The transport layer is used to provide a reliable connection of the terminal to the terminal. The session layer is used to allow the user to establish a connection using a simple easy to remember name. The presentation layer is used to negotiate the data exchange format. The application layer is used to interface communications between the user's application and the network.
When the type of the switch corresponding to the switch to be detected is determined to be a two-layer switch type, the two-layer switch only supports data analysis of protocols of a data link layer and a physical layer in an OSI (open system interconnection), so that the switch to be detected can only analyze protocol data of the data link layer and the physical layer in received communication information. It is impossible to analyze and analyze the upper layer protocol data above the data link layer.
Step S505, determining that the switch to be detected supports data analysis of at least three layers of protocols in OSI, when it is determined that the switch type corresponding to the switch to be detected is the SDN switch type.
When the switch type corresponding to the switch to be detected is determined to be the SDN switch type, the SDN switch may support data analysis of at least three layers of protocols in OSI, for example, the SDN switch may analyze protocol data of at least three layers of a physical layer, a data link layer, a network layer, a transport layer, a session layer, a presentation layer, and an application layer in communication information, so the switch to be detected may also support analysis of protocol data of at least three layers of a physical layer, a data link layer, a network layer, a transport layer, a session layer, a presentation layer, and an application layer in communication information, which accelerates a processing speed of communication information and improves an accuracy of analyzing communication information.
Fig. 6 shows a flow chart of a link detection method in another embodiment of the present application. The link detection method is applicable to a switch controller. As shown in fig. 6, the link detection method includes:
step S601, generating a link detection message according to the preset type table.
Step S602, detecting the link to be detected in the link set according to the link detection message, and obtaining the switch type corresponding to the switch to be detected.
Step S603, determining a connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected.
It should be noted that steps S601 to S603 in this embodiment are the same as steps S301 to S303 in an embodiment, and are not described herein again.
Step S604, determining the network topology of the communication network according to the connection type of the link to be detected.
For example, a network topology corresponding to a first switch needs to be detected, if the connection type of the link to be detected is a direct connection type, it can be determined that the first switch and the switch to be detected are both SDN switches, and the first switch can directly transmit communication information to the switch to be detected; if the connection type of the link to be detected is an indirect connection type, when the first switch transmits the communication information, the communication information needs to be transmitted to the two-layer switch connected to the first switch, and then the two-layer switch forwards the communication information to the SDN switch of the next node. And determining the network topology structure corresponding to the first switch by different connection types of the detection links. Because the communication network can comprise a plurality of first switches, the network topology of the communication network can be comprehensively determined by detecting the network connection states of a plurality of different first switches, and path selection is provided for the transmission of subsequent communication information.
In some implementations, the network topology includes a link to be detected in the link set, where the link to be detected includes a first switch and a switch to be detected; after determining the network topology of the communication network according to the connection type of the link to be detected, the method further includes: identifying a link to be detected as a communication link; the communication links are routed according to the network topology.
The network topology is used for representing the network connection relation of the links to be detected in the link set, the link set comprises N links to be detected, and N is an integer greater than or equal to 1. The switch controller can determine the network topology of the communication network according to the network connection relation of the links to be detected, and the transmission efficiency of the communication information is improved.
The switch controller can rapidly judge the time required by different communication links for transmitting the communication information through the network topology, and then carries out routing selection on the communication links, selects the communication links with higher transmission efficiency for the transmission of the communication information, and improves the communication efficiency.
Fig. 7 shows a block diagram of the components of the switch in the embodiment of the present application. As shown in fig. 7, the switch specifically includes: a generating module 701, configured to generate a link detection message according to a preset type table; the detection module 702 is configured to detect a link to be detected in the link set according to the link detection message, and obtain a switch type corresponding to a switch to be detected, where the link to be detected includes a first switch and the switch to be detected; the connection type determining module 703 is configured to determine the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected.
In some implementations, the preset type table includes a preset switch type, and the preset switch type includes a software defined network SDN switch type and a two-layer switch type; the connection type of the link to be detected comprises a direct connection type and an indirect connection type; the connection type determining module 703 includes: the first determining submodule is used for determining that the connection type of the link to be detected is a direct connection type under the condition that the switch type corresponding to the switch to be detected is determined to be the SDN switch type; and the second determining submodule is used for determining that the connection type of the link to be detected is an indirect connection type under the condition that the switch type corresponding to the switch to be detected is determined to be a two-layer switch type.
In the embodiment, the link detection message is generated by the generation module according to the preset type table, and the link detection message comprises the preset type table, so that the link detection message is simplified, and the subsequent detection of the link to be detected is facilitated; the detection module is used for detecting the link to be detected in the link set according to the link detection message to obtain the type of the switch corresponding to the switch to be detected, wherein the link to be detected is a link between the first switch and the switch to be detected, so that the type of the switch to be detected can be quickly obtained, and the detection speed of the link to be detected is increased; the connection type of the link to be detected is determined by the connection type determining module according to the preset type table and the switch type corresponding to the switch to be detected, so that the connection type of the link to be detected can be rapidly determined, repeated detection messages are prevented from being sent, waste of network resources is reduced, communication connection in a communication network is conveniently selected, and the communication speed is increased.
It should be noted that each module referred to in this embodiment is a logical module, and in practical applications, one logical unit may be one physical unit, may be a part of one physical unit, and may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present application, a unit that is not so closely related to solving the technical problem proposed by the present application is not introduced in the present embodiment, but it does not indicate that no other unit exists in the present embodiment.
Fig. 8 shows a block diagram of the components of the link detection system in the embodiment of the present application. As shown in fig. 8, the link detection system includes the following devices: a first SDN switch 801, a second SDN switch 802, a third SDN switch 803, a fourth SDN switch 804, an SDN switch controller 805, and a layer two switch 806.
Wherein the SDN switch controller 805 is connected to the first SDN switch 801, the second SDN switch 802, the third SDN switch 803, and the fourth SDN switch 804, respectively; the first SDN switch 801 and the second SDN switch 802 are connected; the second SDN switch 802 and the fourth SDN switch 804 are connected; the third SDN switch 803 and the fourth SDN switch 804 are connected; the first SDN switch 801 and the third SDN switch 803 are indirectly connected through a layer two switch 806; however, the SDN switch controller 805 does not know the connection type of the link between the SDN switches, and needs to perform link detection on the link detection system by using a link detection method, so as to quickly obtain a complete network topology, avoid sending repeated detection messages, reduce waste of network resources, facilitate selection of communication connections in a communication network, and accelerate communication speed.
The SDN switch controller 805 is configured to generate and send a link detection message to the first SDN switch 801 or the fourth SDN switch 804 according to the preset type table, so that the first SDN switch 801 detects a link between the first SDN switch 801 and the second SDN switch 802 and a link between the first SDN switch 801 and the third SDN switch 803 according to the link detection message, and obtains a network topology among the first SDN switch 801, the second SDN switch 802, and the third SDN switch 803; meanwhile, the fourth SDN switch 804 detects a link between the second SDN switch 802 and the fourth SDN switch 804 and a link between the fourth SDN switch 804 and the third SDN switch 803 according to the link detection message, and obtains a network topology among the second SDN switch 802, the fourth SDN switch 804, and the third SDN switch 803.
Wherein the link detect message includes an initial TTL (e.g., the initial TTL may be set to 255), a switch type (e.g., initially set to 0x8999), and a destination MAC address (e.g., set to a broadcast address 0 xFFFFFFFFFFFF). The switch type is used for representing the protocol type which can be supported by the switch to be detected, and further reflecting the switch type of the switch to be detected. For example, when the protocol type is initially set to 0x8999, it is characterized that the initial default switch to be detected is an SDN switch.
It should be noted that, because the conventional two-layer switch can only support data parsing of a protocol of a data link layer in OSI, when receiving a link detection message, the conventional two-layer switch updates the protocol type in the link detection message to be 0x8100, that is, the switch type of the switch to be detected that receives the link detection message is a two-layer switch by using 0x 8100.
Specifically, fig. 9 is a flowchart illustrating a working method of the link detection system in the embodiment of the present application. As shown in fig. 9, taking the first SDN switch 801 as an example, the method for detecting a link corresponding to the first SDN switch 801 specifically includes the following steps.
In step S901, the SDN switch controller 805 generates a link detection message according to the preset type table, and sends the link detection message to the first SDN switch 801.
Wherein the preset type table includes preset switch types including an SDN switch type (e.g., 0x8999) and a two-layer switch type (e.g., 0x 8100). The link detection message not only comprises a preset type table, but also comprises a source MAC address, a destination MAC address, initial TTL and a switch type. In a specific implementation, a source MAC address of the link detection message may be set to a MAC address of the first SDN switch 801, a destination MAC address may be set to 0 xfffffffffffff, an initial TTL may be set to 255, and a switch type may be initialized to 0x 8999.
In one specific implementation, the SDN switch control 805 may further send the preset type table to the communication network by sending a broadcast message, so that each SDN switch can obtain the preset type table. For example, a preset type table is broadcast to each SND switch in the communication network using a Flow pattern (Flow _ mod) in an open Flow table (OpenFlow) protocol.
The OpenFlow protocol is a network communication protocol, and belongs to a data link layer, and the OpenFlow protocol can control a Forwarding Plane (Forwarding Plane) of an SDN switch, and change a communication path corresponding to a network data packet through the Forwarding Plane.
Step S902, after receiving the link detection message, the first SDN switch 801 sends the link detection message to the second SDN switch 802 through a port between the first SDN switch 801 and the second SDN switch 802.
It should be noted that step S905 is executed simultaneously with step S902. The link detection message is forwarded through all ports of the first SDN switch 801 into the communication network to detect the connection type of all links connected with the first SDN switch 801.
Step S903, after the second SDN switch 802 receives the link detection message, because the switch type corresponding to the second SDN switch 802 is an SDN switch, by comparing the switch type in the link detection message with the switch type corresponding to the second SDN switch 802, it is determined that the switch type and the switch type are the same (for example, both are 0x8999), and a destination MAC address of the link detection message is a broadcast address (for example, 0 xffffffffff), and then a first link detection response is generated.
Wherein the first link detection response includes a switch type (e.g., 0x8999) corresponding to the second SDN switch 802. It should be noted that, because the switch type corresponding to the second SDN switch 802 is an SDN switch, the second SDN switch 802 may support data analysis of at least three layers of protocols in OSI, and set the TTL in the first link detection response to 254 by reducing the TTL by one, so as to be different from a conventional two-layer switch.
Step S904, the second SDN switch 802 sends the first link detection response to the SDN switch control 805, so that the SDN switch control 805 knows that the switch type corresponding to the second SDN switch 802 is an SDN switch.
For example, the second SDN switch 802 directly sends the switch type (0x8999) to the SDN switch controller 805 through a report message, so that the SDN switch controller 805 can quickly obtain that the switch type of the second SDN switch 802 is 0x8999, the source MAC address is MAC-1, and the TTL field is 255, and further, the SDN switch controller 805 determines that the connection type of the link between the first SDN switch 801 and the second SDN switch 802 is the direct connection type.
Step S905, the first SDN switch 801 sends the link detection message to the third SDN switch 803 through a port between the first SDN switch 801 and the third SDN switch 803.
It should be noted that, since there is a layer two switch 806 between the first SDN switch 801 and the third SDN switch 803, the link detection message is obtained by the layer two switch 806.
Step S906, after the link detection message is received by the two-layer switch 806, because the switch type corresponding to the two-layer switch 806 is a two-layer switch (that is, the switch type is 0x8100), the switch type (initialized to 0x8999) in the link detection message is compared with the switch type corresponding to the two-layer switch 806, and it is determined that the two are different, and the destination MAC address of the link detection message is a broadcast address (for example, 0 xffffffff), and then a second link detection response is generated according to the switch type (0x8100) corresponding to the two-layer switch 806.
It should be noted that, since the switch type corresponding to the layer two switch 806 is a layer two switch and the layer two switch only supports data analysis of a protocol of a data link layer in the OSI, the TTL in the second link detection response needs to be set to 255, so as to be different from the SDN switch.
In step S907, the layer two switch 806 sends a second link detection response to the SDN switch control 805, so that the SDN switch control 805 knows that the switch type corresponding to the layer two switch 806 is a layer two switch.
Step S908, the SDN switch controller 805 may know that the connection type of the link between the first SDN switch 801 and the second SDN switch 802 is a direct connection type through the obtained first link detection response in step S904; by the obtained second link detection response in step S907, it is known that there is a layer two switch 806 between the first SDN switch 801 and the third SDN switch 803, that is, the connection type of the link between the first SDN switch 801 and the third SDN switch 803 is an indirect connection type.
In step S909, the SDN switch controller 805 determines a network topology corresponding to the first SDN switch 801 according to a connection type of a link between the first SDN switch 801 and the second SDN switch 802 and a connection type of a link between the first SDN switch 801 and the third SDN switch 803.
In one particular implementation, the SDN switch controller 805 takes the MAC address (MAC-2) of the second SDN switch 802 as the source MAC address and sets the TTL to 254, generates a new link detection message (i.e., a second link detection message) that is issued through all ports of the second SDN switch 802 except the port between it and the first SDN switch 801 to test the connection type of the link between the second SDN switch 802 and the other switches.
When detecting the network topology of the fourth SDN switch 804 in fig. 8, the method of steps S902 to S904 may also be adopted to detect and obtain the network topology corresponding to the fourth SDN switch 804 (that is, the connection type of the link between the second SDN switch 802 and the fourth SDN switch 804 is a direct connection type, and the connection type of the link between the fourth SDN switch 804 and the third SDN switch 803 is a direct connection type). The complete network topology of the whole communication network is determined by the above network topology.
In some implementations, after the SDN switch controller 805 obtains a complete network topology of the entire communication network, the SDN switch controller 805 may perform routing on the communication link according to the network topology, so that data in the communication network can be transmitted through a better communication path, and the transmission efficiency of the data in the communication network is improved.
In the embodiment, the link detection message is generated according to the preset type table, and the link detection message comprises the preset type table, so that the link detection message is simplified, and the subsequent detection of the link to be detected is facilitated; detecting a link to be detected in the link set according to the link detection message to obtain a switch type corresponding to the switch to be detected, wherein the link to be detected is a link between the first SDN switch and the switch to be detected, so that the switch type of the switch to be detected can be quickly obtained, and the detection speed of the link to be detected is accelerated; the connection type of the link to be detected is determined according to the preset type table and the switch type corresponding to the switch to be detected, so that the connection type of the link to be detected can be rapidly determined, repeated detection messages are prevented from being sent, waste of network resources is reduced, communication connection in a communication network is conveniently selected, and the communication speed is increased.
It is to be understood that the above embodiments are merely exemplary embodiments that are employed to illustrate the principles of the present application, and that the present application is not limited thereto. It will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the application, and these changes and modifications are to be considered as the scope of the application.

Claims (10)

1. A method of link detection, the method comprising:
generating a link detection message according to a preset type table;
detecting a link to be detected in a link set according to the link detection message to obtain a switch type corresponding to a switch to be detected, wherein the link to be detected comprises a first switch and the switch to be detected;
and determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected.
2. The method of claim 1, wherein the table of preset types comprises preset switch types, the preset switch types comprising a Software Defined Network (SDN) switch type and a layer two switch type;
the connection type of the link to be detected comprises a direct connection type and an indirect connection type.
3. The method according to claim 2, wherein the determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected includes:
determining that the connection type of the link to be detected is the direct connection type under the condition that the switch type corresponding to the switch to be detected is determined to be the SDN switch type;
and determining that the connection type of the link to be detected is the indirect connection type under the condition that the switch type corresponding to the switch to be detected is determined to be the two-layer switch type.
4. The method of claim 2 wherein said predetermined type table further comprises a predetermined time-to-live value, said predetermined time-to-live value being a time-to-live value, TTL, corresponding to said two-layer switch type;
after determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected, the method further includes:
acquiring a physical address of the switch to be detected;
generating a first TTL corresponding to the SDN switch type according to the preset survival time value under the condition that the connection type of the link to be detected is determined to be the direct connection type;
generating and sending a first report message to a switch controller according to the first TTL and the physical address of the switch to be detected, so that the switch controller can acquire the connection type of the link to be detected and the first TTL;
and under the condition that the connection type of the link to be detected is determined to be the indirect connection type, generating and sending a second report message according to the preset survival time value and the physical address of the switch to be detected, so that the switch controller knows the connection type of the link to be detected.
5. The method according to claim 2, wherein after the detecting the link to be detected in the link set according to the link detection message and obtaining the switch type corresponding to the switch to be detected, the method further comprises:
determining that the switch to be detected supports data analysis of a protocol of a data link layer in an open system interconnection reference model OSI under the condition that the switch type corresponding to the switch to be detected is determined to be the two-layer switch type;
and determining that the switch to be detected supports data analysis of at least three layers of protocols in the OSI under the condition that the switch type corresponding to the switch to be detected is determined to be the SDN switch type.
6. The method according to claim 1, wherein the detecting the link to be detected in the link set according to the link detection message to obtain the switch type corresponding to the switch to be detected comprises:
sending the link detection message to the first switch, so that the first switch forwards the link detection message to the switch to be detected;
and responding to the link detection response fed back by the switch to be detected, and acquiring the switch type corresponding to the switch to be detected.
7. The method according to any one of claims 1 to 6, wherein after determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected, the method further includes:
and determining the network topology of the communication network according to the connection type of the link to be detected.
8. The method according to claim 7, wherein after determining the network topology of the communication network according to the connection type of the link to be detected, further comprising:
identifying the link to be detected as a communication link;
and carrying out routing selection on the communication link according to the network topology.
9. A switch controller, comprising:
the generating module is used for generating a link detection message according to a preset type table;
the detection module is used for detecting a link to be detected in a link set according to the link detection message to obtain a switch type corresponding to a switch to be detected, wherein the link to be detected comprises a first switch and the switch to be detected;
and the connection type determining module is used for determining the connection type of the link to be detected according to the preset type table and the switch type corresponding to the switch to be detected.
10. The switch controller according to claim 9, wherein the preset type table comprises preset switch types, the preset switch types comprising Software Defined Network (SDN) switch types and two-layer switch types; the connection type of the link to be detected comprises a direct connection type and an indirect connection type; the connection type determining module includes:
a first determining submodule, configured to determine that a connection type of the link to be detected is the direct connection type when it is determined that the switch type corresponding to the switch to be detected is the SDN switch type;
and the second determining submodule is used for determining that the connection type of the link to be detected is the indirect connection type under the condition that the switch type corresponding to the switch to be detected is determined to be the two-layer switch type.
CN202110033038.9A 2021-01-04 2021-01-04 Link detection method and switch controller Pending CN112910682A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110033038.9A CN112910682A (en) 2021-01-04 2021-01-04 Link detection method and switch controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110033038.9A CN112910682A (en) 2021-01-04 2021-01-04 Link detection method and switch controller

Publications (1)

Publication Number Publication Date
CN112910682A true CN112910682A (en) 2021-06-04

Family

ID=76112426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110033038.9A Pending CN112910682A (en) 2021-01-04 2021-01-04 Link detection method and switch controller

Country Status (1)

Country Link
CN (1) CN112910682A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105337860A (en) * 2014-06-23 2016-02-17 华为技术有限公司 Method and system for determining transmission path of data packet, and apparatuses
US20160057054A1 (en) * 2014-08-25 2016-02-25 Nec Laboratories America, Inc. Path Selection in Hybrid Networks
CN106789387A (en) * 2016-03-16 2017-05-31 新华三技术有限公司 A kind of chain circuit detecting method and device for SDN
WO2017142516A1 (en) * 2016-02-16 2017-08-24 Hewlett Packard Enterprise Development Lp Software defined networking for hybrid networks
US20190068492A1 (en) * 2016-06-29 2019-02-28 New H3C Technologies Co., Ltd. Flow Path Detection
CN110380973A (en) * 2019-06-18 2019-10-25 南京理工大学 Software defined network topological detecting method
CN111698122A (en) * 2020-06-12 2020-09-22 南京北星极网络科技有限公司 Network topology discovery method based on SDN
CN112152862A (en) * 2020-10-16 2020-12-29 中国联合网络通信集团有限公司 Topology acquisition method of hybrid network, SDN controller and SDN switch

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105337860A (en) * 2014-06-23 2016-02-17 华为技术有限公司 Method and system for determining transmission path of data packet, and apparatuses
US20160057054A1 (en) * 2014-08-25 2016-02-25 Nec Laboratories America, Inc. Path Selection in Hybrid Networks
WO2017142516A1 (en) * 2016-02-16 2017-08-24 Hewlett Packard Enterprise Development Lp Software defined networking for hybrid networks
CN106789387A (en) * 2016-03-16 2017-05-31 新华三技术有限公司 A kind of chain circuit detecting method and device for SDN
US20190068492A1 (en) * 2016-06-29 2019-02-28 New H3C Technologies Co., Ltd. Flow Path Detection
CN110380973A (en) * 2019-06-18 2019-10-25 南京理工大学 Software defined network topological detecting method
CN111698122A (en) * 2020-06-12 2020-09-22 南京北星极网络科技有限公司 Network topology discovery method based on SDN
CN112152862A (en) * 2020-10-16 2020-12-29 中国联合网络通信集团有限公司 Topology acquisition method of hybrid network, SDN controller and SDN switch

Similar Documents

Publication Publication Date Title
EP3346661B1 (en) Path detection method and device
US6538997B1 (en) Layer-2 trace method and node
US8406143B2 (en) Method and system for transmitting connectivity fault management messages in ethernet, and a node device
EP3958521A1 (en) Method and apparatus for providing service for service flow
US10623237B2 (en) Method of managing zigbee network in the internet of things
EP1811724B1 (en) Determining data link (L2) network paths
US20030223376A1 (en) Testing network communications
CN106921579B (en) Communication method and device based on Service Function Chain (SFC)
CN108964940B (en) Message sending method and device and storage medium
EP2099180A1 (en) Switching device and method for Layer-2 forwarding of OAM frames with multicast Layer-3 addresses
WO2015143810A1 (en) Node fault detection method and apparatus
US20080298258A1 (en) Information transfer capability discovery apparatus and techniques
US8531974B2 (en) Technique for testing peers in multicast network domain
US9948542B2 (en) Filtering on classes and particulars of a packet destination address at lower-protocol layers in a networked device
CN109412851B (en) Link layer path detection method, device and system
CN112910682A (en) Link detection method and switch controller
EP4184819A1 (en) Route optimization method, physical network device and computer-readable storage medium
CN112152862B (en) Topology acquisition method of hybrid network, SDN controller and SDN switch
EP1921804B1 (en) Method and system for transmitting connectivity fault management messages in ethernet, and a node device
EP1367749A1 (en) Apparatus for testing communications in a network which carries data frames
EP3131344A1 (en) Method and system for discovery of access aggregation points for bonding approaches in a telecommunication network
CN116827861A (en) Message forwarding method and device
CN115695294A (en) Method and equipment for processing message in L3VPN (virtual private network)
CN115776459A (en) Message processing method, node, network, electronic device and storage medium
CN115086105A (en) Message transmission method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210604