CN107547240B - Link detection method and device - Google Patents

Link detection method and device Download PDF

Info

Publication number
CN107547240B
CN107547240B CN201710330153.6A CN201710330153A CN107547240B CN 107547240 B CN107547240 B CN 107547240B CN 201710330153 A CN201710330153 A CN 201710330153A CN 107547240 B CN107547240 B CN 107547240B
Authority
CN
China
Prior art keywords
detection
storage
detection section
port
end point
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.)
Active
Application number
CN201710330153.6A
Other languages
Chinese (zh)
Other versions
CN107547240A (en
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.)
New H3C Cloud Technologies Co Ltd
Original Assignee
New H3C Cloud Technologies 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 New H3C Cloud Technologies Co Ltd filed Critical New H3C Cloud Technologies Co Ltd
Priority to CN201710330153.6A priority Critical patent/CN107547240B/en
Publication of CN107547240A publication Critical patent/CN107547240A/en
Application granted granted Critical
Publication of CN107547240B publication Critical patent/CN107547240B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application provides a link detection method and a device, the method is applied to a storage client, and a storage link of the storage client connected with a storage server is divided into a plurality of detection sections; the starting point of each detection segment is a port of the storage link corresponding to the storage client, and the end point of each detection segment is a port of the switch or a port of the storage server through which the storage link passes. The method comprises the following steps: executing detection operation aiming at least one detection section, and integrating detection results to determine a fault point; the detection operation is as follows: configuring loopback attribute at the end point of the detection section to be detected; sending a detection stream with a destination address as a storage server side through a detection section to be detected; if receiving the detection stream looped back from the end point of the detection section to be detected, redirecting the received detection stream to a logic storage unit on a storage client; when the detection stream is successfully processed by the logic storage unit, determining that the detection section to be detected is normal; and if the detection flow looped back from the end point of the detection section to be detected is not received, determining that the detection section to be detected is abnormal.

Description

Link detection method and device
Technical Field
The present disclosure relates to Storage Area Network (SAN) technologies, and in particular, to a link detection method and apparatus.
Background
SAN is a dedicated network that is specifically established for storage, independent of Transmission Control Protocol and Internet Protocol (TCP/IP) networks. A SAN may generally include storage clients, switches, and storage servers, with the path between a storage client and a storage server referred to as a storage link. And the storage service end connected to the storage client end treats the storage client end as a directly connected storage device.
In actual service operation, a situation that the storage server cannot access due to storage link failure may occur. Current storage link detection methods are generally unable to locate which node in the SAN is experiencing the problem.
Disclosure of Invention
In view of the above, the present application provides a link detection method and apparatus, which are used to detect a storage link between a storage client and a storage server and locate a failure point on the storage link.
Specifically, the method is realized through the following technical scheme:
in a first aspect of the present application, a link detection method is provided, where the method may be applied to a storage client, and a storage link connecting the storage client to a storage server is divided into a plurality of detection segments; the starting point of each detection section is a port corresponding to the storage link on the storage client, and the end point of each detection section is a port of a switch or a port of a storage server through which the storage link passes; the method comprises the following steps:
performing a detection operation for at least one detection segment of the plurality of detection segments, respectively;
determining a fault point according to the detection result of the at least one detection section;
wherein the detecting operation is:
configuring loopback attribute at the end point of the detection section to be detected; the configured loopback attribute is used for indicating the equipment where the end point of the detection section to be detected is located to loop the stream back to the storage client when the stream with the destination address of the storage server is detected;
sending a detection stream with a destination address as a storage server side through the detection section to be detected;
if the detection flow looped back from the end point of the detection section to be detected is received, the received detection flow is redirected to a logic storage unit on the storage client side for processing; when the detection stream is successfully processed by the logic storage unit, determining that the detection section to be detected is normal;
and if the detection flow looped back from the end point of the detection section to be detected is not received, determining that the detection section to be detected is abnormal.
In a second aspect of the present application, a link detection apparatus is provided, where the apparatus may be applied to a storage client, where a storage link of the storage client connected to a storage server is divided into a plurality of detection segments; the starting point of each detection section is a port corresponding to the storage link on the storage client, and the end point of each detection section is a port of a switch or a port of a storage server through which the storage link passes; the device has the function of realizing the method, and the function can be realized by hardware or by executing corresponding software by hardware. The hardware or software includes one or more modules or units corresponding to the above functions.
In one possible implementation, the apparatus includes:
a detection unit configured to perform a detection operation for at least one detection section of the plurality of detection sections, respectively; wherein the detecting operation is: configuring loopback attribute at the end point of the detection section to be detected; the configured loopback attribute is used for indicating the equipment where the end point of the detection section to be detected is located to loop the stream back to the storage client when the stream with the destination address of the storage server is detected; sending a detection stream with a destination address as a storage server side through the detection section to be detected; if the detection flow looped back from the end point of the detection section to be detected is received, the received detection flow is redirected to a logic storage unit on the storage client side for processing; when the detection stream is successfully processed by the logic storage unit, determining that the detection section to be detected is normal; if the detection flow looped back from the end point of the detection section to be detected is not received, determining that the detection section to be detected is abnormal;
and the fault positioning unit is used for determining a fault point according to the detection result of the at least one detection section.
In another possible implementation manner, the apparatus includes a processor, a memory, a communication interface, and a bus, where the processor, the memory, and the communication interface are connected to each other through the bus; the processing executes the link detection method of the first aspect of the present application by reading the logic instructions stored in the memory.
By the method, the storage link is divided into a plurality of detection sections, the loopback attribute is configured at the port corresponding to the end point of each detection section, the detection stream is sent from the starting point of each detection section and then looped back to the logic storage unit which is pre-deployed on the storage client through the end point of each detection section, so that the access to the storage server is converted into the access to the logic storage unit on the storage client, whether the detection sections are normal or not is judged according to whether the detection stream can be successfully processed by the logic storage unit, and finally the detection result of at least one detection section is synthesized to determine the fault point on the storage link.
Drawings
FIG. 1 is a networking schematic of a SAN shown in an exemplary embodiment of the present application;
FIG. 2 is a flow chart illustrating a method of link detection in accordance with an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram illustrating a segment partitioning for detection of a three node memory link in accordance with an exemplary embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a detection segment partitioning of a four node storage link according to an exemplary embodiment of the present application;
FIG. 5 is a schematic diagram illustrating an inner loop and an outer loop in accordance with an exemplary embodiment of the present application;
FIG. 6 is a schematic diagram of an IP-SAN networking shown in an exemplary embodiment of the present application;
FIG. 7 is a schematic diagram of a FC-SAN networking shown in an exemplary embodiment of the present application;
FIG. 8 is a functional block diagram of a link detection apparatus according to an exemplary embodiment of the present application;
fig. 9 is a hardware architecture diagram of a link detection apparatus according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The technical scheme of the application is described in the following with the accompanying drawings and various embodiments of the specification.
Currently, when detecting whether a storage link in a SAN is normal, a storage client may directly access a storage server, for example, through a ping method, an Internet Small Computer System Interface (iSCSI) instruction set, and the like, and determine whether the storage link is normal according to an access result. However, this approach has at least the following drawbacks:
1. it can only be determined whether the storage link is faulty, and it cannot be determined which node of the storage link has a problem.
2. The conventional ping method and iSCSI instruction set are applicable only to IP-SAN and not to FC-SAN.
The method comprises the steps of dividing a storage link into a plurality of detection sections, configuring a loopback attribute at a port corresponding to an end point of each detection section, enabling a detection stream to loop back to a logic storage unit which is pre-deployed on a storage client through the end point of each detection section after being sent from a starting point of each detection section, converting access to a storage service end into access to the logic storage unit on the storage client, judging whether the detection sections are normal according to the fact that whether the detection stream can be successfully processed by the logic storage unit, and finally integrating detection results of at least one detection section to determine a fault point on the storage link.
Referring to fig. 1, a networking diagram of a SAN is shown, which includes a storage client, a switch, and a storage server.
The storage server is used for providing storage services, and may be a storage device such as a Redundant Array of Independent Disks (RAID) system.
And the storage client is connected with the storage server, can regard the storage server as a directly connected storage device, and reads and writes the storage server. In the application, a logic storage unit is also pre-deployed on the storage client, and the logic storage unit can be regarded as an analog storage server; the storage client configures a loopback link on a storage path and configures a corresponding Network Address Translation (NAT) rule or a Translation module on the storage client, so that the storage client can convert the access to the actual storage server into the access to the analog storage server.
Because the storage client and the logic storage unit are positioned on the same physical host, the storage client and the logic storage unit are communicated with each other, so that the storage client and the logic storage unit do not need to be connected, and the existing line configuration is changed for detection.
The path between the storage client and the storage server is a storage link. On a carrier medium, the storage link may be a wired medium such as an optical fiber, coaxial cable, network cable, or the like; or may be a wireless medium such as millimeter waves, microwaves, etc.
The storage client side to the storage server side can have one or more storage links; under the condition that a plurality of storage links exist, the plurality of storage links can be mutually active and standby links or mutually load balancing links.
Each storage link between the storage client and the storage server can adopt the method provided by the application to detect and locate the fault. The link detection method provided by the present application is described below with reference to fig. 2.
Referring to fig. 2, fig. 2 is a flow chart of a method provided by the present application. As shown in fig. 2, the method may include the steps of:
step 201: the storage client divides a storage link of the client connected with the storage server into a plurality of detection sections; the starting point of each detection segment is a port of the storage link corresponding to the storage client, and the end point of each detection segment is a port of a switch or a port of a storage server through which the storage link passes.
In the present application, a plurality of detection segments obtained by dividing a memory link have the same starting point and different ending points.
For example, referring to fig. 3, when a storage link includes three nodes, i.e., a storage client, a switch, and a storage server, the ports through which the storage link passes are: a port A of a storage client, a port B and a port C of a switch and a port D of a storage server; the storage link can be divided into 3 detection segments, which are: the path from port a to port B, the path from port a to port C, and the path from port a to port D.
Similarly, referring to fig. 4, when four nodes are included in a storage link, the ports through which the storage link passes include: a port A of a storage client, a port B and a port C of a switch 1, a port D and a port E of a switch 2 and a port F of a storage server; the storage link can be divided into 5 detection segments, which are respectively: the path from port a to port B, the path from port a to port C, the path from port a to port D, the path from port a to port E, and the path from port a to port F.
Optionally, the operation of dividing the storage link into a plurality of detection segments in step 201 may also be performed manually, and the storage client may directly perform steps 202 and 203 based on the manually input detection segment division result.
Step 202: the storage client executes detection operation aiming at least one detection segment in the plurality of detection segments respectively; wherein the detecting operation is:
1) configuring a loopback attribute at the end point of the detection section to be detected, wherein the configured loopback attribute is used for indicating the equipment where the end point of the detection section to be detected is located to loop the stream back to the storage client when the stream with the destination address as the storage server is detected;
for example, the storage client may log in to the switch or the storage server through Secure Shell (SSH), and set the loopback attribute of the port.
The loopback properties may include an inner loopback property and an outer loopback property. As shown in fig. 5, if the inner loop attribute is configured for port a, the inner loop is executed to flow into the network element device after the detection flow reaches port a; if the outer loop attribute is configured for the port B, the outer loop is executed to flow to the outside of the network element equipment after the detection flow reaches the port B.
Taking the storage link shown in fig. 3 as an example, if the detection section from the port a to the port B is detected, the port B of the switch may be configured as the outer-loop attribute, and the other ports are not configured; when the detection flow sent out from the port A passes through the port B, the outer loop is executed to flow back to the outside of the switch and return to the port A. Similarly, if the detection section from the port a to the port C is detected, the port C of the switch may be configured as an inner loop attribute, and the rest ports are not configured; when the detection flow sent out from the port A passes through the port C, the inner loop is executed to flow back to the inside of the switch, and then the detection flow flows out from the port B and returns to the port A.
As to what type of loopback attribute is configured at the end of the detection segment in particular, there can be generally, but not limited to, the following ways:
in the first mode, the storage client can be determined according to the preset mapping relationship between the port and the loopback attribute type.
In a second mode, the storage client may determine, according to an ingress/egress port condition of a locally-issued stream on the switch or the storage server, if a port corresponding to an end point of a certain detection segment is an ingress port of the locally-issued stream on the switch or the storage server, the outer loop attribute may be configured at the end point of the detection segment, and if a port corresponding to an end point of a certain detection segment is an egress port of the locally-issued stream on the switch, the inner loop attribute may be configured at the end point of the detection segment.
The destination of the stream sent from the storage client is the storage server, so the stream sent from the storage client has only an ingress port and no egress port on the storage server.
2) Sending a detection stream with a destination address as a storage server side through the detection section to be detected;
3) if the detection flow looped back from the end point of the detection section to be detected is received, the received detection flow is redirected to the logic storage unit on the storage client side for processing; when the detection stream is successfully processed by the logic storage unit, determining that the detection section to be detected is normal;
4) and if the detection flow looped back from the end point of the detection section to be detected is not received, determining that the detection section to be detected is abnormal.
The logical memory unit can be regarded as an analog memory server. According to the embodiment of the application, the detection stream is converted from the actual storage server access to the analog storage server access, so that whether the detection section is normal or not can be judged according to whether the detection stream can be successfully read and written by the analog storage server.
The process of establishing the logical storage unit can be briefly described as follows: the storage client selects a block device or a file on the belonging physical host, creates a Logical storage Unit through the block device or the file, assigns a Logical Unit Number (LUN) to the Logical storage Unit when creating the Logical storage Unit, and assigns an address (when the storage client is located in the IP-SAN) or a virtual port (when the storage client is located in the FC-SAN) to the Logical storage Unit.
When a plurality of storage links from the storage client to the storage server exist, the plurality of storage links can share one logic storage unit to realize the link detection.
How to redirect the detection stream to the logical storage unit is described below, and will not be described in detail.
In addition, it should be noted that, each time the storage client detects one detection segment, the loopback attribute configured at the end point of the detection segment needs to be cancelled first, and then the next detection segment needs to be detected.
Step 203: and the storage client determines a fault point according to the detection result of the at least one detection section.
For example, if there is a first detection section in the at least one detection section in which the detection operation is performed, the detection result of the first detection section is abnormal, and the first detection section is the shortest detection section among a plurality of detection sections obtained by dividing the storage link, the storage client may determine that the failure point is located between the start point and the end point of the first detection section.
Taking fig. 3 as an example, the detection segment 1 from the port a to the port B is the shortest detection segment among the 3 detection segments obtained by dividing; if the detection segment 1 is found to be failed through detection, it can be directly determined that the failure point is located between the starting point and the end point of the detection segment 1, i.e., on the path from the port a to the port B.
For another example, if there are a second detection segment and a third detection segment in the at least one detection segment in which the over-detection operation is performed, the detection result of the second detection segment is normal, the detection result of the third detection segment is abnormal, and there is no other port between the end point of the second detection segment and the end point of the third detection segment, the storage client may determine that the failure point is located between the end point of the second detection segment and the end point of the third detection segment.
Still taking fig. 3 as an example, there is no other port between the end of detection segment 1 and the end of detection segment 2, and there is also port C at the end of detection segment 1 and the end of detection segment 3. If the detection section 1 is found to be normal through detection, the detection section 3 is in fault, and because a port C is arranged between the detection section 1 and the detection section 3, a fault point can only be roughly determined to be positioned between an end point (port B) of the detection section 1 and an end point (port D) of the detection section 3, and a more accurate positioning result can be obtained only by further detecting the detection section 2; if the detection section 2 is detected to be faulty, it can be determined that the fault point is located between the end point (port B) of the detection section 1 and the end point (port C) of the detection section 2, i.e. on the switch.
It should be noted that the present application does not limit the detection order of each detection segment. For example, the storage client may detect each detection segment in the order from short to long or from long to short; or randomly extracting detection sections from the undetected detection sections for detection; and other detection sequences are also possible.
Taking the storage link shown in fig. 3 as an example, if the detection segments are in the order from short to long, the detection order is: the detection section from the port A to the port B is detected firstly, then the detection section from the port A to the port C is detected, and finally the detection section from the port A to the port D is detected.
In the application, all detection sections obtained by dividing the same storage link are different only in end point and the same in starting point, so that a certain shorter detection section is necessarily a part of a certain longer detection section; so that if a shorter detection segment is detected to find a fault, a longer detection segment is also necessarily not available. Therefore, in order to improve the detection efficiency, when the storage client finds that a detection section is in fault, other residual detection sections longer than the detection section do not need to be detected.
Currently, common SANs include IP-SAN and Fibre Channel (FC) -SAN. In the IP-SAN, a storage client uses an Ethernet card to access a storage server through an Ethernet switch (namely an IP switch); in FC-SAN, a storage client accesses a storage server through an FC switch using a Host Bus Adapter (HBA) card.
The process of detecting flows when the storage client is located in an IP-SAN or an FC-SAN is explained below by means of fig. 6 and 7, respectively.
Referring to fig. 6, a detection flow processing procedure when the storage client is located in the IP-SAN will be described by taking a detection segment of detecting port a to port B as an example. In IP-SAN, the detection flow consists of detection packets.
The detection unit in the storage client generates a detection message, wherein the source address of the detection message is the address IP1 of the storage client, the destination address is the address IP2 of the storage server, the source port is the port A of the storage client, the destination port is the port D of the storage server, and the message type is the iSCSI (Internet Small Computer System Interface) protocol.
In the storage client, a virtual switch (vswitch) receives a detection message sent by a detection unit from a virtual port a, and sends the detection message to a physical port a through a virtual port b, wherein the virtual port b and a destination address IP2 of the detection message are in the same network segment. And after receiving the detection message, the physical port A sends the detection message to a port B of the connected IP switch.
The port B of the IP switch is configured with an outer loop attribute, and after receiving the detection message, the port B executes the outer loop and returns the detection message to the port A.
And the port A sends the returned detection message to the vswitch through the corresponding virtual network port b.
An NAT rule is pre-configured on the vswitch, and the matching conditions of the NAT rule are as follows: 1) the message direction is an incoming direction; 2) the source port is a port corresponding to the storage link on the storage client, namely a port A; 3) the message type is the iSCSI protocol. The NAT rule is used to: and for the message meeting the matching condition, converting the destination address of the message into an address IP3 of a logic storage unit which is pre-deployed on the storage client.
Optionally, in order to improve the matching rate, the NAT rule may further add a matching condition: 4) the destination address is the address IP2 of the storage server.
And the vswitch determines that the looped detection message is matched with the NAT rule, so that the destination address of the detection message is modified from IP2 to IP 3. And then, sending the modified detection message to a logic storage unit from a virtual port c, wherein the virtual port c and the destination address IP3 of the modified detection message are in the same network segment.
Therefore, in the IP-SAN, the storage client redirects the received detection flow to the logic storage unit on the storage client for processing through the preset NAT rule.
The logic storage unit processes the received detection message and generates a response message. The source address of the response message is the address IP3 of the logical storage unit, the destination address is the address IP1 of the storage client, the source port is the port D of the storage server, the destination port is the port A of the storage client, and the message type is the iSCSI protocol.
The vswitch receives the response message sent by the logical storage unit from the virtual port c, and sends the response message to the detection unit in the storage client through the virtual port a, and the virtual port a and the destination address IP1 of the response message are in the same network segment.
Optionally, the vswitch may further set an NAT rule for modifying the source address of the response packet to the address IP2 of the storage server. The matching condition of the NAT rule may be set as: 1) the message direction is the outgoing direction; 2) the destination port is a port corresponding to the storage link on the storage client, namely a port A; 3) the message type is the iSCSI protocol.
Therefore, after the vswitch receives the response message through the virtual network port c, the address of the response message can be modified from the address IP3 of the logical storage unit to the address IP2 of the storage server according to the NAT rule, so that the storage client cannot sense the existence of the logical storage unit.
This completes the description of fig. 6.
Referring to fig. 7, the present embodiment also takes a detection segment from detection port a to port B as an example to describe a detection flow processing procedure when the storage client is located in the FC-SAN. In FC-SAN, the detection flow consists of detection frames.
The detection module in the storage client generates a detection frame, the source ID (i.e. source FC address) of the detection frame is port a of the storage client, the destination ID (i.e. destination FC address) is port D of the storage server, and the frame type is FC protocol.
The detection module sends the detection frame to the HBA card of the storage client through internal forwarding, and the HBA card sends the detection frame to a port B of the FC switch through a port A.
The port B of the FC switch is configured with an outer-loop attribute, so after receiving the detection frame, the port B performs an outer-loop to return the detection frame to the port a.
The storage client is internally provided with a conversion module in advance, and the conversion module can be realized through a computer program code. The conversion module is used for converting the destination ID of a frame, which satisfies that the frame direction is an incoming direction, the source ID is a port (i.e., port a) corresponding to the storage link on the storage client, and the frame type is an FC protocol, into a virtual port e of the logical storage unit.
Optionally, to improve the matching rate, the conversion module may further add a matching condition: the destination ID of the frame is the port of the storage server, i.e., port D.
The port A sends the returned detection message to the conversion module, the conversion module processes the looped detection frame, and the target ID of the detection frame is modified into the port e from the port D. The conversion module then sends the modified detection frame from port e to the logical storage unit.
Therefore, in the FC-SAN, the storage client redirects the received detection stream to the logical storage unit on the storage client for processing through the preset conversion module.
The logic storage unit processes the received detection frame and generates a response frame. The source ID of the response frame is a virtual port e of the logical storage unit, the destination ID is a port a of the storage client, and the frame type is an FC protocol.
And after receiving the response frame sent by the logic storage unit, the conversion module sends the response frame to a detection module in the storage client through internal forwarding.
Optionally, the conversion module may be further configured to convert a frame that satisfies that a frame direction is an outgoing direction, a destination ID is a port (i.e., port a) corresponding to the storage link on the storage client, and a frame type is an FC protocol, into a port D of the storage server.
Therefore, the conversion module can process the response frame after receiving the response frame, and modifies the source ID of the response frame from the virtual port e of the logic storage unit to the port D of the storage server, so that the storage client cannot sense the existence of the logic storage unit.
This completes the description of fig. 7.
Whether in an IP-SAN or an FC-SAN, the number of messages or frames included in the detection flow is adjustable, and the storage client in the application can achieve the purpose of self-defining the detection pressure by configuring the number of the messages or frames included in the detection flow.
For example, the storage client may increase the number of packets or frames included in the detection flow, for example, set the number of packets or frames included in the detection flow to 10000 (that is, 10000 times of reading and writing are initiated to the storage server), and test the operation efficiency of the storage link under the high load condition according to the ratio of the number of received response messages to the set number of packets or frames.
The flow shown in fig. 2 is described below by a specific embodiment. It should be noted that this embodiment is only one implementation manner of the present application, and is not limited to the present application.
Referring to fig. 3, taking the storage client located in the IP-SAN as an example, assume that the IP address of the storage server is 1.1.1.1; network management ports are arranged among the storage client, the switch and the storage server, the storage client, the switch and the storage server are in the same management network and can be communicated, and the storage client can operate the switch and the storage server through SSH.
The detection process of the storage link is as follows:
1. the storage client establishes a logical storage unit on the belonging physical host, and an IP address of 192.168.1.1 is assigned to the logical storage unit.
2. The storage client acquires a port sequence related to the storage link and a corresponding loopback attribute, and divides the storage link into a plurality of detection sections.
In fig. 3, the link path for accessing the storage server from the storage client is: port a-port B-port C-port D; the port B needs to be configured with the outer loop attribute, the port C needs to be configured with the inner loop attribute, and the port D needs to be configured with the outer loop attribute.
The detection sections obtained by dividing are as follows:
detecting segment 1, which is the path from port A to port B;
a detection section 2, which is a path from the port A to the port C;
segment 3 is detected as the path from port a to port D.
3. The storage client detects the detection segment 1.
Specifically, on the storage client, an NAT rule is configured, where the NAT rule is: for the message which satisfies the conditions that the message direction is an incoming direction, the source port is a port A, the destination address is 1.1.1.1 and the message type is an iSCSI message, the destination address of the message is converted into 192.168.1.1.
And the storage client logs in the switch through SSH, and configures the outer loop attribute at the port B.
And the storage client accesses 1.1.1.1, and generates an iSCSI message by sending an iSCSI read-write instruction. Under the condition that the detection section 1 is normal, the processing process of the message is as follows:
1) the storage client sends the message to a port B of the switch through a port A;
2) because the port B of the switch is configured with the outer loop, the switch executes the outer loop at the port B to return the message to the port A of the storage client;
3) after the storage client receives the looped message, the destination address of the message is converted from 1.1.1.1 to 192.168.1.1 through the internal NAT conversion;
4) the storage client redirects the modified message to a logic storage unit corresponding to the modified destination address of the message for processing;
if the logic storage unit processes the message, the detection section 1 is normal; if the logical storage unit has not processed the message, it indicates that detection segment 1 failed.
4. If the detection segment 1 is detected to be normal, the storage client side continues to detect the detection segment 2.
Specifically, the storage client logs in the switch through the SSH, cancels the outer loop attribute of the port B, and configures the inner loop attribute for the port C.
And the storage client accesses 1.1.1.1, and generates an iSCSI message by sending an iSCSI read-write instruction. Under the condition that the detection section 2 is normal, the processing process of the message is as follows:
1) the storage client sends the message to a port B of the switch through a port A;
2) the switch internally forwards the message and sends the message to a port C of the switch;
3) because the port C of the switch is configured with the inner loop, the switch executes the inner loop at the port C to return the message to the port B of the switch;
4) the switch returns the message to the port A of the storage client through the port B;
5) after the storage client receives the looped message, the destination address of the message is converted from 1.1.1.1 to 192.168.1.1 through the internal NAT conversion;
6) the storage client redirects the modified message to a logic storage unit corresponding to the modified destination address of the message for processing;
if the logic storage unit processes the message, the detection section 2 is normal; if the logical storage unit has not processed the message, it indicates that detection segment 2 failed.
5. If the detection segment 2 is found to be normal through detection, the storage client side continues to detect the detection segment 3.
Specifically, the storage client logs in the switch through the SSH, and cancels the inner loop attribute of the port C; and logging in the storage server through SSH, and configuring the outer loop attribute at the port D.
And the storage client accesses 1.1.1.1, and generates an iSCSI message by sending an iSCSI read-write instruction. Under the condition that the detection section 3 is normal, the processing process of the message is as follows:
1) the storage client sends the message to a port B of the switch through a port A;
2) the switch internally forwards the message and sends the message to a port C of the switch;
3) the switch sends the message to a port D of the storage server through a port C;
4) because the port D of the storage service end is configured with the outer loop, the storage service end executes the outer loop at the port D to return the message to the port C of the switch;
5) the switch internally forwards the looped message and sends the message to a port B of the switch;
6) the switch returns the message to the port A of the storage client through the port B;
7) after the storage client receives the looped message, the destination address of the message is converted from 1.1.1.1 to 192.168.1.1 through the internal NAT conversion;
8) the storage client redirects the modified message to a logic storage unit corresponding to the modified destination address of the message for processing;
if the logic storage unit processes the message, the detection section 3 is normal; if the logical storage unit has not processed the message, it indicates that detection segment 3 failed.
6. And the storage client integrates the detection results of all the detection sections to determine the fault point of the storage link.
7. After the detection is finished, the storage client logs in the storage server through SSH, the outer loop attribute of the port D is cancelled, and the NAT rule configured in the step 3 is cancelled.
This completes the description of the present embodiment.
To sum up, the technical solution provided by the present application divides the storage link into a plurality of detection segments, and configures a loopback attribute at a port corresponding to an end point of the detection segment, so that the detection stream is sent from a start point of the detection segment and then looped back to a logic storage unit pre-deployed on the storage client through the end point of the detection segment, thereby converting an access to the storage service end into an access to the logic storage unit on the storage client, determining whether the detection segment is normal according to whether the detection stream can be successfully processed by the logic storage unit, and finally synthesizing a detection result of at least one detection segment to determine a fault point on the storage link.
In addition, the technical scheme provided by the application does not need auxiliary equipment, does not need packet grabbing equipment, does not need to change the existing configuration equipment for detection, and does not need to plug and unplug lines, so that the detection is more flexible on the machine during detection, and the SAN can be detected in time when the SAN breaks down. Meanwhile, the detection mode is flexible, and the detection pressure can be defined by user. The technical scheme provided by the application is simultaneously suitable for two types of networks, namely IP-SAN and FC-SAN.
The methods provided herein are described above. The apparatus provided in the present application is described below.
Referring to fig. 8, the functional block diagram of a link detection apparatus provided in this embodiment of the present application is a functional block diagram, where the apparatus may be applied to a storage client, and a storage link of the storage client connected to a storage server is divided into a plurality of detection segments; the starting point of each detection segment is a port of the storage link corresponding to the storage client, and the end point of each detection segment is a port of a switch or a port of a storage server through which the storage link passes. The apparatus may comprise an inspection unit 801 and a fault localization unit 802.
The detection unit 801 is configured to perform a detection operation on at least one detection segment of the plurality of detection segments.
Wherein the detecting operation is:
configuring loopback attribute at the end point of the detection section to be detected; the configured loopback attribute is used for indicating the equipment where the end point of the detection section to be detected is located to loop the stream back to the storage client when the stream with the destination address of the storage server is detected;
sending a detection stream with a destination address as a storage server side through the detection section to be detected;
if the detection flow looped back from the end point of the detection section to be detected is received, the received detection flow is redirected to a logic storage unit on the storage client side for processing; when the detection stream is successfully processed by the logic storage unit, determining that the detection section to be detected is normal;
and if the detection flow looped back from the end point of the detection section to be detected is not received, determining that the detection section to be detected is abnormal.
The fault location unit 802 is configured to determine a fault point according to a detection result of the at least one detection segment.
Optionally, the fault location unit 802 is specifically configured to: if a first detection section exists, the detection result of the first detection section is abnormal, and the first detection section is the shortest detection section in the plurality of detection sections, determining that a fault point is located between the starting point and the end point of the first detection section;
and if a second detection section and a third detection section exist, the detection result of the second detection section is normal, the detection result of the third detection section is abnormal, and other ports do not exist between the end point of the second detection section and the end point of the third detection section, determining that the fault point is located between the end point of the second detection section and the end point of the third detection section.
Optionally, when the storage client is located in an IP-SAN, the detecting unit 801 is specifically configured to: redirecting the received detection flow to a logic storage unit on the storage client for processing through a preset NAT rule;
the NAT rule is as follows: and for the message which meets the requirements that the message direction is an incoming direction, a source port is a port corresponding to the storage link on the storage client, and the message type is an iSCSI protocol, converting the destination address of the message into the address of the logic storage unit.
Optionally, when the storage client is located in an FC-SAN, the detecting unit 801 is specifically configured to: through a preset conversion module, redirecting the received detection stream to a logic storage unit on the storage client for processing;
wherein the conversion module is configured to: and for the frame which meets the conditions that the frame direction is an incoming direction, the source ID is a port corresponding to the storage link on the storage client and the frame type is an FC protocol, converting the destination ID of the frame into the virtual port of the logic storage unit.
Optionally, the number of packets or frames included in the detection stream is configured by the detection unit 801 in the storage client.
It should be noted that the division of the unit in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation. The functional units in the embodiments of the present application 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 integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. Taking a software implementation as an example, as a device in a logical sense, the device is formed by reading corresponding computer program instructions in a memory into an internal memory through a processor of a storage client where the device is located to operate. From a hardware level, as shown in fig. 9, a hardware structure diagram of a storage client where a detection apparatus of a storage link is located is provided in the present application.
The memory may store a link detection logic instruction, and the memory may be, for example, a non-volatile memory (non-volatile memory). The processor may invoke the detection logic instructions of the memory link in the execution memory to perform the function of the storage client in the detection method of the memory link described above.
As shown in fig. 9, an embodiment of the present application further provides a link detection apparatus, where the apparatus includes a processor 901, a memory 902, a communication interface 903, and a bus 904; the processor 901, the memory 902 and the communication interface 903 are communicated with each other through a bus 904.
Among other things, the communication interface 903 is used for sending and receiving detection streams. The processor 901 may be a central processing unit CPU, the memory 902 may be a non-volatile memory (non-volatile memory), and logic instructions are stored in the memory 902, and the processor 901 may execute the link detection logic instructions stored in the memory 902 to implement the function of storing the client in the link detection method, which may be specifically referred to as the flow shown in fig. 2.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and 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 modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A link detection method is characterized in that the method is applied to a storage client, and a storage link of the storage client connected with a storage server is divided into a plurality of detection sections; the starting point of each detection section is a port corresponding to the storage link on the storage client, and the end point of each detection section is a port of a switch or a port of a storage server through which the storage link passes; the method comprises the following steps:
performing a detection operation for at least one detection segment of the plurality of detection segments, respectively;
determining a fault point according to the detection result of the at least one detection section;
wherein the detecting operation is:
configuring loopback attribute at the end point of the detection section to be detected; the configured loopback attribute is used for indicating the equipment where the end point of the detection section to be detected is located to loop the stream back to the storage client when the stream with the destination address of the storage server is detected;
sending a detection stream with a destination address as a storage server side through the detection section to be detected;
if the detection flow looped back from the end point of the detection section to be detected is received, the received detection flow is redirected to a logic storage unit on the storage client side for processing; when the detection stream is successfully processed by the logic storage unit, determining that the detection section to be detected is normal;
and if the detection flow looped back from the end point of the detection section to be detected is not received, determining that the detection section to be detected is abnormal.
2. The method of claim 1, wherein determining a point of failure based on the detection of the at least one detection segment comprises:
if a first detection section exists, the detection result of the first detection section is abnormal, and the first detection section is the shortest detection section in the plurality of detection sections, determining that a fault point is located between the starting point and the end point of the first detection section;
and if a second detection section and a third detection section exist, the detection result of the second detection section is normal, the detection result of the third detection section is abnormal, and other ports do not exist between the end point of the second detection section and the end point of the third detection section, determining that the fault point is located between the end point of the second detection section and the end point of the third detection section.
3. The method of claim 1, wherein redirecting the received detection stream to a logical storage unit on the storage client for processing specifically comprises:
when the storage client is positioned in an IP-SAN (Internet protocol storage area network), redirecting the received detection stream to a logic storage unit on the storage client for processing through a preset NAT (network address translation) rule;
the NAT rule is as follows: and for the message which meets the requirements that the message direction is an incoming direction, a source port is a port corresponding to the storage link on the storage client, and the message type is the iSCSI protocol of the Internet small computer system interface, converting the destination address of the message into the address of the logic storage unit.
4. The method of claim 1, wherein redirecting the received detection stream to a logical storage unit on the storage client for processing specifically comprises:
when the storage client is positioned in a mesh channel storage area network FC-SAN, redirecting the received detection stream to a logic storage unit on the storage client for processing through a preset conversion module;
wherein the conversion module is configured to: and for the frame which meets the conditions that the frame direction is an incoming direction, the source ID is a port corresponding to the storage link on the storage client and the frame type is an FC protocol, converting the destination ID of the frame into the virtual port of the logic storage unit.
5. The method of claim 1, wherein the detection flow comprises a number of packets or frames configured for the storage client.
6. The link detection device is applied to a storage client, and a storage link of the storage client connected with a storage server is divided into a plurality of detection sections; the starting point of each detection section is a port corresponding to the storage link on the storage client, and the end point of each detection section is a port of a switch or a port of a storage server through which the storage link passes; the device comprises:
a detection unit configured to perform a detection operation for at least one detection section of the plurality of detection sections, respectively; wherein the detecting operation is: configuring loopback attribute at the end point of the detection section to be detected; the configured loopback attribute is used for indicating the equipment where the end point of the detection section to be detected is located to loop the stream back to the storage client when the stream with the destination address of the storage server is detected; sending a detection stream with a destination address as a storage server side through the detection section to be detected; if the detection flow looped back from the end point of the detection section to be detected is received, the received detection flow is redirected to a logic storage unit on the storage client side for processing; when the detection stream is successfully processed by the logic storage unit, determining that the detection section to be detected is normal; if the detection flow looped back from the end point of the detection section to be detected is not received, determining that the detection section to be detected is abnormal;
and the fault positioning unit is used for determining a fault point according to the detection result of the at least one detection section.
7. The apparatus of claim 6, wherein the fault location unit is specifically configured to:
if a first detection section exists, the detection result of the first detection section is abnormal, and the first detection section is the shortest detection section in the plurality of detection sections, determining that a fault point is located between the starting point and the end point of the first detection section;
and if a second detection section and a third detection section exist, the detection result of the second detection section is normal, the detection result of the third detection section is abnormal, and other ports do not exist between the end point of the second detection section and the end point of the third detection section, determining that the fault point is located between the end point of the second detection section and the end point of the third detection section.
8. The apparatus as claimed in claim 6, wherein, in redirecting the received detection stream to a logical storage unit on the storage client for processing, the detection unit is specifically configured to:
when the storage client is positioned in an IP-SAN (Internet protocol storage area network), redirecting the received detection stream to a logic storage unit on the storage client for processing through a preset NAT (network address translation) rule;
the NAT rule is as follows: and for the message which meets the requirements that the message direction is an incoming direction, a source port is a port corresponding to the storage link on the storage client, and the message type is the iSCSI protocol of the Internet small computer system interface, converting the destination address of the message into the address of the logic storage unit.
9. The apparatus as claimed in claim 6, wherein, in redirecting the received detection stream to a logical storage unit on the storage client for processing, the detection unit is specifically configured to:
when the storage client is positioned in a mesh channel storage area network FC-SAN, redirecting the received detection stream to a logic storage unit on the storage client for processing through a preset conversion module;
wherein the conversion module is configured to: and for the frame which meets the conditions that the frame direction is an incoming direction, the source ID is a port corresponding to the storage link on the storage client and the frame type is an FC protocol, converting the destination ID of the frame into the virtual port of the logic storage unit.
10. The apparatus of claim 6, wherein the detection flow comprises a number of packets or frames configured for a detection unit in the storage client.
CN201710330153.6A 2017-05-11 2017-05-11 Link detection method and device Active CN107547240B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710330153.6A CN107547240B (en) 2017-05-11 2017-05-11 Link detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710330153.6A CN107547240B (en) 2017-05-11 2017-05-11 Link detection method and device

Publications (2)

Publication Number Publication Date
CN107547240A CN107547240A (en) 2018-01-05
CN107547240B true CN107547240B (en) 2021-02-26

Family

ID=60966851

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710330153.6A Active CN107547240B (en) 2017-05-11 2017-05-11 Link detection method and device

Country Status (1)

Country Link
CN (1) CN107547240B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108400894B (en) * 2018-03-06 2021-02-05 深圳互联先锋科技有限公司 Server cluster network fault positioning method and system
CN109245819A (en) * 2018-07-19 2019-01-18 郑州云海信息技术有限公司 A kind of Fault Locating Method and relevant apparatus
CN110830325B (en) * 2019-11-05 2021-05-14 北京云杉世纪网络科技有限公司 Adaptive network bypass path network flow direction speculation method and system
CN111083009B (en) * 2019-11-29 2021-08-24 北京云测信息技术有限公司 Packet capturing method and device and mobile terminal
CN111010319B (en) * 2019-12-20 2021-11-16 锐捷网络股份有限公司 VSF-based link detection method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101924659A (en) * 2009-06-12 2010-12-22 中兴通讯股份有限公司 Network equipment and method for detecting links of physical ports of same
CN101986604A (en) * 2010-10-29 2011-03-16 中兴通讯股份有限公司 Link fault positioning method and system of packet transport network (PTN)
CN103259685B (en) * 2013-05-24 2016-03-09 杭州华三通信技术有限公司 Detect method and the network equipment of link failure

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103684918A (en) * 2013-12-16 2014-03-26 华为技术有限公司 Method and device for detecting link failure
CN104518911A (en) * 2014-11-20 2015-04-15 毕节供电局 MPLS (multi-protocol label switching)-TP (transport profile)-based PTN (packet transport network) fault detection method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101924659A (en) * 2009-06-12 2010-12-22 中兴通讯股份有限公司 Network equipment and method for detecting links of physical ports of same
CN101986604A (en) * 2010-10-29 2011-03-16 中兴通讯股份有限公司 Link fault positioning method and system of packet transport network (PTN)
CN103259685B (en) * 2013-05-24 2016-03-09 杭州华三通信技术有限公司 Detect method and the network equipment of link failure

Also Published As

Publication number Publication date
CN107547240A (en) 2018-01-05

Similar Documents

Publication Publication Date Title
CN107547240B (en) Link detection method and device
US8996720B2 (en) Method and apparatus for mirroring frames to a remote diagnostic system
US9602197B2 (en) Non-intrusive diagnostic port for inter-switch and node link testing
US8644132B2 (en) Maintaining a communication path from a host to a storage subsystem in a network
US20090245242A1 (en) Virtual Fibre Channel Over Ethernet Switch
US20080025322A1 (en) Monitoring of data packets in a fabric
US10644969B2 (en) Method and system for network elements to internally probe their forwarding elements
US8547845B2 (en) Soft error recovery for converged networks
US20150023154A1 (en) Virtual Destination Identification for Rapidio Network Elements
US9942138B2 (en) Method and device for policy based routing
US11424978B2 (en) Fast forwarding re-convergence of switch fabric multi-destination packets triggered by link failures
US8594080B2 (en) Multiple functionality in a virtual storage area network device
CN111614505B (en) Message processing method and gateway equipment
US20160057043A1 (en) Diagnostic routing system and method for a link access group
CN109639488A (en) A kind of more outer nets shunt accelerated method and system
US20070041313A1 (en) Apparatus and methods for managing nodes on a fault tolerant network
CN109218117B (en) Link detection method and device and network equipment
US11516073B2 (en) Malfunction point estimation method and malfunction point estimation apparatus
US8208370B1 (en) Method and system for fast link failover
EP3544235B1 (en) A method, a network device, and a computer program product for resetting a packet processing component to an operational state
US10461992B1 (en) Detection of failures in network devices
US20050188243A1 (en) Routing communications to a storage area network
US7860113B2 (en) Enforced routing in switch
US20100312866A1 (en) Redundancy pair detecting method, communication device and recording medium for recording redundancy pair detection program
KR101091435B1 (en) Enforced routing in switched network for fru verification

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
GR01 Patent grant
GR01 Patent grant