WO2017032147A1 - Method and apparatus for switching internet small computer system interface session link - Google Patents

Method and apparatus for switching internet small computer system interface session link Download PDF

Info

Publication number
WO2017032147A1
WO2017032147A1 PCT/CN2016/086026 CN2016086026W WO2017032147A1 WO 2017032147 A1 WO2017032147 A1 WO 2017032147A1 CN 2016086026 W CN2016086026 W CN 2016086026W WO 2017032147 A1 WO2017032147 A1 WO 2017032147A1
Authority
WO
WIPO (PCT)
Prior art keywords
session link
iscsi session
iscsi
current
initiator
Prior art date
Application number
PCT/CN2016/086026
Other languages
French (fr)
Chinese (zh)
Inventor
陈开业
余斌
张明志
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017032147A1 publication Critical patent/WO2017032147A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/173Interprocessor communication using an interconnection network, e.g. matrix, shuffle, pyramid, star, snowflake
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/148Migration or transfer of sessions

Definitions

  • the present application relates to, but is not limited to, the field of communications technologies, and in particular, to a method and an apparatus for switching a network small computer system interface session link.
  • Internet Internet Small Computer System Interface is a protocol based on Transmission Control Protocol/Internet Protocol TCP/IP network. It is used to establish and manage IP storage devices, hosts and clients. Connect to each other and create a storage area network (SAN, Storage Area Network).
  • SAN Storage Area Network
  • the storage area network SAN makes it possible to apply the SCSI (Small Computer System Interface) protocol to a high-speed data transmission network, which is performed at a block-level between multiple data storage networks.
  • iSCSI The main function of iSCSI is to encapsulate and reliably transfer large amounts of data between a client (ie, initiator) and a storage device (ie, target) on a TCP/IP network.
  • client ie, initiator
  • storage device ie, target
  • TCP/IP Transmission Control Protocol
  • the initiator and the target there are usually multiple redundant links between the initiator and the target, and one of the redundant links is selected between the initiator and the target to exchange the iSCSI protocol data.
  • the initiator and the target rely on the current link to perform iSCSI traffic.
  • the current link is used to perform the iSCSI service.
  • the iSCSI service traffic is unstable and affects the performance of the iSCSI service. In severe cases, the system is paralyzed and the stability and reliability of the iSCSI service cannot be guaranteed.
  • the main purpose of the embodiments of the present invention is to provide a method and a device for switching an interface session link of a network small computer system, which aims to improve the stability and reliability of iSCSI service execution between the initiator and the target.
  • a method for switching a network small computer system interface session link comprising:
  • the data transmission quality of the current iSCSI session link established between the initiator and the target is detected.
  • detecting data transmission quality of the current iSCSI session link established between the initiator and the target device includes:
  • switching the iSCSI session link between the initiator and the target device includes:
  • switching the iSCSI session link between the initiator and the target device further includes:
  • the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the smallest number of timeout packets in all iSCSI session links is greater than a preset number difference, or the current iSCSI session link is The average time difference of the response packets between the candidate iSCSI session links with the shortest average response time of all the iSCSI session links is greater than the preset time difference, and the current iSCSI session link is frozen, and the initiator and the target are The current iSCSI session link between the switches is switched to the alternate iSCSI session link.
  • the preset test packet is a Nopout packet defined in the iSCSI protocol; and the response packet is a Nopin packet defined in the iSCSI protocol.
  • a switching device for a network small computer system interface session link comprises: a detecting module, a determining module and a switching module.
  • the detecting module is configured to detect a data transmission quality of the current iSCSI session link established between the initiator and the target after establishing a network small computer system interface iSCSI session link between the initiator and the target.
  • the determining module is configured to determine whether the data transmission quality of the current iSCSI session link meets a preset switching condition.
  • a switching module configured to switch an iSCSI session link between the initiator and the target if the data transmission quality of the current iSCSI session link meets a preset switching condition.
  • detecting data transmission quality of the current iSCSI session link established between the initiator and the target includes: :
  • the switching module switches the iSCSI session link between the initiator and the target device, including:
  • the switching module switching the iSCSI session link between the initiator and the target device further includes:
  • the current iSCSI session link is frozen when the average time difference between the response packets of the pre-iSCSI session link and the candidate iSCSI session link with the shortest average response time of all iSCSI session links is greater than a preset time difference.
  • the current iSCSI session link between the initiator and the target is switched to the alternate iSCSI session link.
  • the preset test packet is a Nopout packet defined in the iSCSI protocol; and the response packet is a Nopin packet defined in the iSCSI protocol.
  • a computer readable storage medium storing computer executable instructions that, when executed by a processor, implement a method of switching a network small computer system interface session link.
  • the method and device for switching a network small computer system interface session link detecting the current iSCSI session chain when performing iSCSI services between the initiator and the target using the established current iSCSI session link The data transmission quality of the path; and when the data transmission quality of the current iSCSI session link is determined to meet the preset switching condition, the iSCSI session link between the initiator and the target is switched.
  • the data transmission quality of the current iSCSI session link between the initiator and the target device can be detected when performing the iSCSI service, and when the data transmission quality of the current iSCSI session link is determined to be poor, the The iSCSI service between the initiator and the target is switched from the current iSCSI session link to other links to avoid using the current iSCSI session link when the current iSCSI session link has repeated flapping instability.
  • the iSCSI service is implemented to effectively improve the stability and reliability of iSCSI service execution between the initiator and the target.
  • FIG. 1 is a schematic flowchart of an embodiment of a method for switching an interface session link of a network small computer system according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an interaction process between a Nopout packet and a Nopin packet in an embodiment of a method for switching an interface of a network small computer system according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of functional modules of an embodiment of a device for switching an interface session link of a network small computer system according to an embodiment of the present invention.
  • Embodiments of the present invention provide a method for switching an interface session link of a network small computer system.
  • FIG. 1 is a schematic flowchart of an embodiment of a method for switching an interface session link of a network small computer system according to an embodiment of the present invention.
  • the method for switching the network small computer system interface session link includes steps S10-S302:
  • Step S10 After establishing a network small computer system interface iSCSI session link between the initiator and the target, detecting data transmission quality of the current iSCSI session link established between the initiator and the target.
  • the iSCSI service may be faulty, the network cable is disconnected, the network port is faulty, and the NIC chip is suddenly faulty.
  • the network link may be faulty due to network instability and special application scenarios.
  • redundant links are usually added to the iSCSI connection to improve service reliability. That is, there are usually multiple redundant links between the initiator and the target.
  • the current iSCSI session chain established between the initiator and the target is established. The path is one of multiple redundant links, and the remaining links serve as alternate links for the current iSCSI session link due to a failure.
  • the current iSCSI session link data is detected even if the current iSCSI session link is not disconnected and the iSCSI service can be normally executed.
  • the data transmission quality of the current iSCSI session link may be detected by the execution status of the current iSCSI service, the time difference of the interaction before and after the message on the current iSCSI session link, and the like.
  • the packet that is set to be detected may be a packet defined in the iSCSI protocol, or may be a user-defined test packet, which is not limited herein.
  • Step S20 Determine whether the data transmission quality of the current iSCSI session link meets a preset switching condition.
  • Determining the current iSCSI session link by using the detected execution status of the current iSCSI service, such as the execution speed, the process, or the like, or the time difference between the time before and after the message on the current iSCSI session link. Data transmission quality, and determine whether the data transmission quality of the current iSCSI session link meets a preset switching condition.
  • Step S30 If the data transmission quality of the current iSCSI session link meets a preset switching condition, switch the iSCSI session link between the initiator and the target.
  • the current iSCSI service When the current iSCSI service is detected to be slow and the time difference between the packets on the current iSCSI session link is too long, the data transmission quality of the current iSCSI session link is poor.
  • the current iSCSI session link may be repeated. In the case of unstable oscillation, there is no guarantee that the current iSCSI session link can stably perform the current iSCSI service. Then, it is determined that the data transmission quality of the current iSCSI session link meets the preset switching condition, and the current iSCSI session link needs to be switched.
  • the iSCSI service between the initiator and the target is switched from the current iSCSI session link to other links in the multiple redundant links between the initiator and the target, until the data transmission quality is switched to ensure stable execution. Complete the link of the iSCSI service.
  • the current iSCSI session chain can also be performed.
  • the iSCSI service is automatically switched from the current iSCSI session link to other links in the multiple redundant links between the initiator and the target. , effectively ensure the stability and reliability of iSCSI service execution.
  • the data transmission quality of the current iSCSI session link is detected; and the data transmission quality of the current iSCSI session link is determined to be consistent.
  • the switching condition is preset, the iSCSI session link between the initiator and the target is switched. Since the data transmission quality of the current iSCSI session link between the initiator and the target can be detected when performing the iSCSI service, the initiator and the target can be timely in determining the current data transmission quality of the iSCSI session link.
  • the iSCSI service between the devices is switched from the current iSCSI session link to other links to avoid using the current iSCSI session link to perform iSCSI services when the current iSCSI session link is repeatedly unstable. Improves the stability and reliability of iSCSI service execution between the initiator and the target.
  • step S10 that is, after establishing a network small computer system interface iSCSI session link between the initiator and the target, detecting a current established between the initiator and the target
  • the data transmission quality of the iSCSI session link can include:
  • the detection and reception of the preset test packet may be used for detection. Specifically, if the preset test packet is sent on all the iSCSI session links between the initiator and the target at a preset interval, the preset test on each iSCSI session link in the preset time period is calculated. The number of timeout packets of the packet and/or the average duration of the response packet.
  • the initiator can be used as the transmitting end, and the target is used as the receiving end. The target is used as the transmitting end and the initiator is used as the receiving end, which is not limited herein.
  • the preset test packet may be a packet defined in the iSCSI protocol, or may be a user-defined test packet, which is not limited herein.
  • the preset test packet is a Nopout packet defined in the iSCSI protocol; the corresponding response packet is a Nopin packet defined in the iSCSI protocol, as shown in FIG. 2, and FIG. 2 is The method for the interaction between the Nopout packet and the Nopin packet in the embodiment of the method for switching the interface of the network small computer system interface. If the iSCSI initiator sends an iSCSI session request to the target iSCSI target on the initiator iSCSI initiator, the iSCSI target and the iSCSI target establish an iSCSI session on the current iSCSI session. .
  • the iSCSI target When detecting the data transmission quality of the current iSCSI session link, the iSCSI target sends a Noopout packet, which is the default test packet with the current timestamp, to the iSCSI initiator, and sends 10 Nopout messages every 10 seconds.
  • the packet is counted, and the number of timeout packets of the Nopout packet in the 3 minutes and the duration of the Nopin packet sent by the iSCSI initiator are optionally calculated. Alternatively, the iSCSI initiator feedback can be calculated. The average length of the Nopin message.
  • the same data transmission quality detection operation can be performed on each of a plurality of redundant links between the initiator and the target, that is, on each of all iSCSI session links, to learn the initiator and the target.
  • Data transmission quality of each link between the devices; data transmission quality detection operation is performed on the current iSCSI session link established between the initiator and the target device, which is not limited herein.
  • the foregoing step S30 is to switch between the initiator and the target device if the data transmission quality of the current iSCSI session link meets a preset switching condition.
  • the iSCSI session link includes:
  • the preset test packet is used to detect that the number of timeout packets on the current iSCSI session link exceeds the preset number or the average duration of the response packet exceeds the preset time.
  • the data transmission quality of the current iSCSI session link is poor.
  • the current iSCSI session link may be unstable and unstable.
  • the current iSCSI session link cannot perform the current iSCSI service stably.
  • the current iSCSI session link is frozen, and the current iSCSI session link between the initiator and the target is switched to the default iSCSI session link.
  • the preset iSCSI session link may be a fixed iSCSI session link among multiple redundant links between the preset initiator and the target, or may be a chain adjacent to the current iSCSI session link. Road, here is not limited.
  • the frozen current iSCSI session link can only receive data, and the data is sent out by the switched default iSCSI session link.
  • step S30 may further include:
  • the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the smallest number of timeout packets in all iSCSI session links is greater than a preset number difference, or the current iSCSI session link is The average time difference of the response packets between the candidate iSCSI session links with the shortest average response time of all the iSCSI session links is greater than the preset time difference, and the current iSCSI session link is frozen, and the initiator and the target are The current iSCSI session link between the switches is switched to the alternate iSCSI session link.
  • the relationship between the initiator and the target is obtained.
  • the quality of data transmission per link is obtained.
  • the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the lowest number of timeout packets on all iSCSI session links is greater than the preset number difference, or the current iSCSI session link and all iSCSI session chains
  • the average time difference between the response packets of the alternate iSCSI session link with the shortest average response time in the path is greater than the preset time difference, indicating multiple redundant links between the current iSCSI session link and the initiator and the target. If the link quality between the alternate iSCSI session links with the best data transmission quality is different, the current iSCSI session is frozen.
  • the link switches the current iSCSI session link between the initiator and the target to an alternate iSCSI session link with the best data transmission quality among the multiple redundant links.
  • the iSCSI service is performed by using an alternative iSCSI session link with the best data transmission quality to ensure stable and efficient execution of iSCSI services.
  • the embodiment of the invention further provides a device for switching the interface session link of the network small computer system.
  • FIG. 3 is a schematic diagram of functional modules of an apparatus for switching an interface session link of a network small computer system according to an embodiment of the present invention.
  • the switching device of the network small computer system interface session link comprises: a detecting module, a determining module and a switching module.
  • the detecting module 01 is configured to detect a data transmission quality of a current iSCSI session link established between the initiator and the target after establishing a network small computer system interface iSCSI session link between the initiator and the target.
  • the iSCSI service may be faulty, the network cable is disconnected, the network port is faulty, and the NIC chip is suddenly faulty.
  • the network link may be faulty due to network instability and special application scenarios.
  • the phenomenon of business interruption Therefore, in order to reduce the risk of service interruption caused by the disconnection of the iSCSI connection caused by the network failure, redundant links are usually added to the iSCSI connection to improve service reliability. That is, there are usually multiple redundant links between the initiator and the target.
  • the current iSCSI session link established between the initiator and the target is One of multiple redundant links, the remaining links acting as backup links for the current iSCSI session link due to a failure.
  • the current iSCSI session link data is detected even if the current iSCSI session link is not disconnected and the iSCSI service can be normally executed.
  • the data transmission quality of the current iSCSI session link may be detected by the execution status of the current iSCSI service, the time difference of the interaction before and after the message on the current iSCSI session link, and the like.
  • the packet that is set to be detected may be a packet defined in the iSCSI protocol, or may be a user-defined test packet, which is not limited herein.
  • the determining module 02 is configured to determine whether the data transmission quality of the current iSCSI session link meets a preset switching condition.
  • Determining the data transmission quality of the current iSCSI session link by using the detected execution status of the current iSCSI service, such as the execution speed, the process, or the time difference between the current and the iSCSI session link, and determining the current iSCSI session chain. Whether the data transmission quality of the road meets the preset switching conditions.
  • the switching module 03 is configured to switch the iSCSI session link between the initiator and the target if the data transmission quality of the current iSCSI session link meets the preset switching condition.
  • the current iSCSI session link may be In the case of repeated oscillating instability, there is no guarantee that the current iSCSI session link can stably perform the current iSCSI service. Then, it is determined that the data transmission quality of the current iSCSI session link meets the preset switching condition, and the current iSCSI session link needs to be switched. Performing iSCSI traffic between the initiator and the target from the current iSCSI session link to other links in the multiple redundant links between the initiator and the target, until the quality of the data transmission is guaranteed Stable on the link that performs the iSCSI service.
  • the current iSCSI session chain can also be performed.
  • the iSCSI service is automatically switched from the current iSCSI session link to other links in the multiple redundant links between the initiator and the target. , effectively ensure the stability and reliability of iSCSI service execution.
  • the data transmission quality of the current iSCSI session link is detected; and the data transmission quality of the current iSCSI session link is determined to be in accordance with the preset.
  • switch the iSCSI session link between the initiator and the target Since the data transmission quality of the current iSCSI session link between the initiator and the target can be detected when performing the iSCSI service, the initiator and the target can be timely in determining the current data transmission quality of the iSCSI session link.
  • the iSCSI service between the devices is switched from the current iSCSI session link to other links to avoid using the current iSCSI session link to perform iSCSI services when the current iSCSI session link is repeatedly oscillated. Improves the stability and reliability of iSCSI service execution between the initiator and the target.
  • the detecting module 01 is established between the initiator and the target. After the network small computer system interfaces the iSCSI session link, detecting the data transmission quality of the current iSCSI session link established between the initiator and the target includes:
  • the detection and reception of the preset test packet may be used for detection.
  • the preset test packet may be sent on all the iSCSI session links between the initiator and the target at a preset interval, and the preset test message on each iSCSI session link in the preset time period is calculated. The number of timeout packets and/or the average duration of response packets.
  • the initiator can be used as the transmitting end, and the target is used as the receiving end.
  • the target is used as the transmitting end and the initiator is used as the receiving end, which is not limited herein.
  • the preset test packet may be a packet defined in the iSCSI protocol, or may be a user-defined test packet, which is not limited herein.
  • the preset test packet is a Nopout packet defined in the iSCSI protocol
  • the corresponding response packet is a Nopin packet defined in the iSCSI protocol.
  • the packet is counted, and the number of timeout packets of the Nopout packet in the 3 minutes and the duration of the Nopin packet sent by the iSCSI initiator are optionally calculated. Alternatively, the iSCSI initiator feedback can be calculated. The average length of the Nopin message. It should be noted that the same data transmission quality detection operation can be performed on each of a plurality of redundant links between the initiator and the target, that is, on each of all iSCSI session links, to learn the initiator and the target. Data transmission quality of each link between the devices; data transmission quality detection operation is performed on the current iSCSI session link established between the initiator and the target device, which is not limited herein.
  • the switching module 03 switches between the initiator and the target device.
  • the iSCSI session link includes:
  • the preset test packet is used to detect that the number of timeout packets on the current iSCSI session link exceeds the preset number or the average duration of the response packet exceeds the preset time.
  • the data transmission quality of the current iSCSI session link is poor.
  • the current iSCSI session link may be unstable and unstable.
  • the current iSCSI session link cannot be stably executed.
  • the current iSCSI session link is then frozen, and the current iSCSI session link between the initiator and the target is switched to a preset iSCSI session link.
  • the preset iSCSI session link may be a fixed iSCSI session link among a plurality of redundant links between the preset initiator and the target, or may be a chain adjacent to the current iSCSI session link. Road, here is not limited.
  • the frozen current iSCSI session link can only receive data, and the data is sent out by the switched default iSCSI session link.
  • the switching module 03 switches the iSCSI session link between the initiator and the target.
  • the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the smallest number of timeout packets in all iSCSI session links is greater than a preset number difference, or the current iSCSI session link is The average time difference of the response packets between the candidate iSCSI session links with the shortest average response time of all the iSCSI session links is greater than the preset time difference, and the current iSCSI session link is frozen, and the initiator and the target are The current iSCSI session link between the switches is switched to the alternate iSCSI session link.
  • the relationship between the initiator and the target is obtained.
  • the quality of data transmission per link If the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the lowest number of timeout packets on all iSCSI session links is greater than the preset number difference, or the current iSCSI session link and all iSCSI session chains The average time difference between response packets of the alternate iSCSI session link with the shortest average response time in the path is greater than the preset time difference.
  • the current iSCSI session link is frozen when the link quality between the current iSCSI session link and the alternate iSCSI session link with the best data transmission quality among the multiple redundant links between the initiator and the target is different. Switching the current iSCSI session link between the initiator and the target to an alternate iSCSI session link with the best data transmission quality among the multiple redundant links.
  • the iSCSI service is performed by using an alternative iSCSI session link with the best data transmission quality to ensure stable and efficient execution of iSCSI services.
  • a computer readable storage medium storing computer executable instructions that, when executed by a processor, implement a method of switching a network small computer system interface session link.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • the device/function module/functional unit in the above embodiment When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the method and device for switching a network small computer system interface session link detecting the current iSCSI session chain when performing iSCSI services between the initiator and the target using the established current iSCSI session link The data transmission quality of the path; and when the data transmission quality of the current iSCSI session link is determined to meet the preset switching condition, the iSCSI session link between the initiator and the target is switched.
  • the current iSCSI session Since the data transmission quality of the current iSCSI session link between the initiator and the target can be detected when performing the iSCSI service, the current iSCSI session is judged When the data transmission quality of the link is poor, the iSCSI service between the initiator and the target can be switched from the current iSCSI session link to other links in time to avoid repeated attacks on the current iSCSI session link. In the case of unstable oscillations, the current iSCSI session link is still used to perform iSCSI services, which effectively improves the stability and reliability of iSCSI service execution between the initiator and the target.

Abstract

Disclosed are a method and an apparatus for switching an internet small computer system interface session link. The method comprises: establishing internet small computer system interface (iSCSI) session links between an initiator and a target, and then detecting data transmission quality of a current iSCSI session link established between the initiator and the target; determining whether the data transmission quality of the current iSCSI session link satisfies a pre-set switching condition; and if the data transmission quality of the current iSCSI session link satisfies the pre-set switching condition, switching the iSCSI session links between the initiator and the target.

Description

一种网络小型计算机系统接口会话链路的切换方法及装置Method and device for switching network interface computer system interface session link 技术领域Technical field
本申请涉及但不限于通信技术领域,尤其涉及一种网络小型计算机系统接口会话链路的切换方法及装置。The present application relates to, but is not limited to, the field of communications technologies, and in particular, to a method and an apparatus for switching a network small computer system interface session link.
背景技术Background technique
网络Internet小型计算机系统接口iSCSI(Internet Small Computer System Interface)协议,是一种基于传输控制协议/互联网协议TCP/IP网络的协议,用来建立和管理IP存储设备、主机和客户机等设备之间的相互连接,并创建存储区域网络(SAN,StorageArea Network)。存储区域网络SAN使得SCSI(小型计算机系统接口,Small Computer System Interface)协议应用于高速数据传输网络成为可能,这种传输以数据块级别(block-level)在多个数据存储网络间进行。Internet Internet Small Computer System Interface (iSCSI) is a protocol based on Transmission Control Protocol/Internet Protocol TCP/IP network. It is used to establish and manage IP storage devices, hosts and clients. Connect to each other and create a storage area network (SAN, Storage Area Network). The storage area network SAN makes it possible to apply the SCSI (Small Computer System Interface) protocol to a high-speed data transmission network, which is performed at a block-level between multiple data storage networks.
iSCSI的主要功能是在TCP/IP网络上的客户端(即启动器,initiator)和存储设备(即目标器,target)之间进行大量数据的封装和可靠传输过程。目前,为了降低因网络故障引发的iSCSI连接断开而导致业务中断的风险,通常在iSCSI连接中增加冗余链路来提高业务可靠性。The main function of iSCSI is to encapsulate and reliably transfer large amounts of data between a client (ie, initiator) and a storage device (ie, target) on a TCP/IP network. Currently, in order to reduce the risk of service interruption due to disconnection of the iSCSI connection caused by network failure, redundant links are usually added to the iSCSI connection to improve service reliability.
即相关技术中启动器和目标器之间通常有多条冗余链路,启动器和目标器之间选取冗余链路中的一条来交互iSCSI协议数据。只要启动器和目标器之间的当前链路能交互iSCSI协议数据,启动器和目标器之间就依赖当前链路执行完iSCSI业务。这样,在启动器和目标器之间的当前链路出现反复震荡不稳定的情况时,由于当前链路并非中断,仍能进行iSCSI协议数据的基本交互,因此,启动器和目标器之间仍使用当前链路来执行完iSCSI业务,但这会造成iSCSI业务流量不稳定,影响iSCSI业务执行性能,严重时甚至会造成系统瘫痪,无法保证iSCSI业务执行的稳定性和可靠性。That is, in the related art, there are usually multiple redundant links between the initiator and the target, and one of the redundant links is selected between the initiator and the target to exchange the iSCSI protocol data. As long as the current link between the initiator and the target can exchange iSCSI protocol data, the initiator and the target rely on the current link to perform iSCSI traffic. In this way, when the current link between the initiator and the target is repeatedly unstable, the basic interaction of the iSCSI protocol data can still be performed because the current link is not interrupted. Therefore, the initiator and the target still exist. The current link is used to perform the iSCSI service. However, the iSCSI service traffic is unstable and affects the performance of the iSCSI service. In severe cases, the system is paralyzed and the stability and reliability of the iSCSI service cannot be guaranteed.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。 The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本发明实施例的主要目的在于提供一种网络小型计算机系统接口会话链路的切换方法及装置,旨在提高启动器和目标器之间iSCSI业务执行的稳定性和可靠性。The main purpose of the embodiments of the present invention is to provide a method and a device for switching an interface session link of a network small computer system, which aims to improve the stability and reliability of iSCSI service execution between the initiator and the target.
一种网络小型计算机系统接口会话链路的切换方法,所述方法包括:A method for switching a network small computer system interface session link, the method comprising:
在启动器和目标器之间建立网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量。After the network small computer system interface iSCSI session link is established between the initiator and the target, the data transmission quality of the current iSCSI session link established between the initiator and the target is detected.
判断所述当前iSCSI会话链路的数据传输质量是否符合预设切换条件。Determining whether the data transmission quality of the current iSCSI session link meets a preset switching condition.
如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,则切换所述启动器和目标器之间的iSCSI会话链路。And if the data transmission quality of the current iSCSI session link meets a preset switching condition, switching an iSCSI session link between the initiator and the target.
可选地,所述在启动器和目标器之间建立网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量包括:Optionally, after the network small computer system interface iSCSI session link is established between the initiator and the target, detecting data transmission quality of the current iSCSI session link established between the initiator and the target device includes:
每隔预设间隔时间在所述启动器和目标器之间的所有iSCSI会话链路上发送多个预设测试报文,计算预设时间内每一个iSCSI会话链路上预设测试报文的超时报文个数和/或应答报文平均时长。Sending a plurality of preset test packets on all the iSCSI session links between the initiator and the target at a preset interval, and calculating a preset test packet on each iSCSI session link within a preset time period. The number of timeout packets and/or the average duration of response packets.
可选地,所述如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,则切换所述启动器和目标器之间的iSCSI会话链路包括:Optionally, if the data transmission quality of the current iSCSI session link meets a preset switching condition, switching the iSCSI session link between the initiator and the target device includes:
如果所述当前iSCSI会话链路上的超时报文个数超过预设数量或应答报文平均时长超过预设时间,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为预设iSCSI会话链路。If the number of timeout packets on the current iSCSI session link exceeds a preset number or the average duration of the response message exceeds a preset time, freezing the current iSCSI session link between the initiator and the target device The current iSCSI session link switches to the default iSCSI session link.
可选地,所述如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,则切换所述启动器和目标器之间的iSCSI会话链路还包括:Optionally, if the data transmission quality of the current iSCSI session link meets a preset switching condition, switching the iSCSI session link between the initiator and the target device further includes:
如果所述当前iSCSI会话链路与所有iSCSI会话链路中超时报文个数最少的备选iSCSI会话链路之间的超时报文数量差大于预设数量差,或所述当前iSCSI会话链路与所有iSCSI会话链路中应答报文平均时长最短的备选iSCSI会话链路之间的应答报文平均时间差大于预设时间差,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为所述备选iSCSI会话链路。 If the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the smallest number of timeout packets in all iSCSI session links is greater than a preset number difference, or the current iSCSI session link is The average time difference of the response packets between the candidate iSCSI session links with the shortest average response time of all the iSCSI session links is greater than the preset time difference, and the current iSCSI session link is frozen, and the initiator and the target are The current iSCSI session link between the switches is switched to the alternate iSCSI session link.
可选地,所述预设测试报文为iSCSI协议中定义的Nopout报文;所述应答报文为iSCSI协议中定义的Nopin报文。Optionally, the preset test packet is a Nopout packet defined in the iSCSI protocol; and the response packet is a Nopin packet defined in the iSCSI protocol.
一种网络小型计算机系统接口会话链路的切换装置,所述网络小型计算机系统接口会话链路的切换装置包括:检测模块、判断模块和切换模块。A switching device for a network small computer system interface session link, the switching device of the network small computer system interface session link comprises: a detecting module, a determining module and a switching module.
检测模块,设置为在启动器和目标器之间建立网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量。The detecting module is configured to detect a data transmission quality of the current iSCSI session link established between the initiator and the target after establishing a network small computer system interface iSCSI session link between the initiator and the target.
判断模块,设置为判断所述当前iSCSI会话链路的数据传输质量是否符合预设切换条件。The determining module is configured to determine whether the data transmission quality of the current iSCSI session link meets a preset switching condition.
切换模块,设置为如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,则切换所述启动器和目标器之间的iSCSI会话链路。And a switching module, configured to switch an iSCSI session link between the initiator and the target if the data transmission quality of the current iSCSI session link meets a preset switching condition.
可选地,所述检测模块在启动器和目标器之间建立网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量包括:Optionally, after the detecting module establishes a network small computer system interface iSCSI session link between the initiator and the target, detecting data transmission quality of the current iSCSI session link established between the initiator and the target includes: :
每隔预设间隔时间在所述启动器和目标器之间的所有iSCSI会话链路上发送多个预设测试报文,计算预设时间内每一个iSCSI会话链路上预设测试报文的超时报文个数和/或应答报文平均时长。Sending a plurality of preset test packets on all the iSCSI session links between the initiator and the target at a preset interval, and calculating a preset test packet on each iSCSI session link within a preset time period. The number of timeout packets and/or the average duration of response packets.
可选地,所述如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,所述切换模块则切换所述启动器和目标器之间的iSCSI会话链路包括:Optionally, if the data transmission quality of the current iSCSI session link meets a preset switching condition, the switching module switches the iSCSI session link between the initiator and the target device, including:
如果所述当前iSCSI会话链路上的超时报文个数超过预设数量或应答报文平均时长超过预设时间,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为预设iSCSI会话链路。If the number of timeout packets on the current iSCSI session link exceeds a preset number or the average duration of the response message exceeds a preset time, freezing the current iSCSI session link between the initiator and the target device The current iSCSI session link switches to the default iSCSI session link.
可选地,所述如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,则所述切换模块切换所述启动器和目标器之间的iSCSI会话链路还包括:Optionally, if the data transmission quality of the current iSCSI session link meets a preset switching condition, the switching module switching the iSCSI session link between the initiator and the target device further includes:
如果所述当前iSCSI会话链路与所有iSCSI会话链路中超时报文个数最少的备选iSCSI会话链路之间的超时报文数量差大于预设数量差,或所述当 前iSCSI会话链路与所有iSCSI会话链路中应答报文平均时长最短的备选iSCSI会话链路之间的应答报文平均时间差大于预设时间差,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为所述备选iSCSI会话链路。If the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the smallest number of timeout packets in all iSCSI session links is greater than a preset number difference, or The current iSCSI session link is frozen when the average time difference between the response packets of the pre-iSCSI session link and the candidate iSCSI session link with the shortest average response time of all iSCSI session links is greater than a preset time difference. The current iSCSI session link between the initiator and the target is switched to the alternate iSCSI session link.
可选地,所述预设测试报文为iSCSI协议中定义的Nopout报文;所述应答报文为iSCSI协议中定义的Nopin报文。Optionally, the preset test packet is a Nopout packet defined in the iSCSI protocol; and the response packet is a Nopin packet defined in the iSCSI protocol.
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现所述的网络小型计算机系统接口会话链路的切换方法。A computer readable storage medium storing computer executable instructions that, when executed by a processor, implement a method of switching a network small computer system interface session link.
本发明实施例提出的一种网络小型计算机系统接口会话链路的切换方法及装置,在启动器和目标器之间利用建立的当前iSCSI会话链路执行iSCSI业务时,检测所述当前iSCSI会话链路的数据传输质量;并在判断所述当前iSCSI会话链路的数据传输质量符合预设切换条件时,切换所述启动器和目标器之间的iSCSI会话链路。由于在执行iSCSI业务时能对启动器和目标器之间的当前iSCSI会话链路的数据传输质量进行检测,在判断所述当前iSCSI会话链路的数据传输质量较差时,能及时将所述启动器和目标器之间的iSCSI业务从所述当前iSCSI会话链路切换至其他链路执行,以避免在当前iSCSI会话链路出现反复震荡不稳定的情况时,仍使用当前iSCSI会话链路来执行iSCSI业务,有效地提高了启动器和目标器之间iSCSI业务执行的稳定性和可靠性。The method and device for switching a network small computer system interface session link according to an embodiment of the present invention, detecting the current iSCSI session chain when performing iSCSI services between the initiator and the target using the established current iSCSI session link The data transmission quality of the path; and when the data transmission quality of the current iSCSI session link is determined to meet the preset switching condition, the iSCSI session link between the initiator and the target is switched. The data transmission quality of the current iSCSI session link between the initiator and the target device can be detected when performing the iSCSI service, and when the data transmission quality of the current iSCSI session link is determined to be poor, the The iSCSI service between the initiator and the target is switched from the current iSCSI session link to other links to avoid using the current iSCSI session link when the current iSCSI session link has repeated flapping instability. The iSCSI service is implemented to effectively improve the stability and reliability of iSCSI service execution between the initiator and the target.
附图概述BRIEF abstract
图1为本发明实施例网络小型计算机系统接口会话链路的切换方法一实施例的流程示意图;1 is a schematic flowchart of an embodiment of a method for switching an interface session link of a network small computer system according to an embodiment of the present invention;
图2为本发明实施例网络小型计算机系统接口会话链路的切换方法一实施例中Nopout报文和Nopin报文的交互过程示意图;2 is a schematic diagram of an interaction process between a Nopout packet and a Nopin packet in an embodiment of a method for switching an interface of a network small computer system according to an embodiment of the present invention;
图3为本发明实施例网络小型计算机系统接口会话链路的切换装置一实施例的功能模块示意图。FIG. 3 is a schematic diagram of functional modules of an embodiment of a device for switching an interface session link of a network small computer system according to an embodiment of the present invention.
本发明的实施方式 Embodiments of the invention
下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
本发明实施例提供一种网络小型计算机系统接口会话链路的切换方法。Embodiments of the present invention provide a method for switching an interface session link of a network small computer system.
参照图1,图1为本发明实施例网络小型计算机系统接口会话链路的切换方法一实施例的流程示意图。1 is a schematic flowchart of an embodiment of a method for switching an interface session link of a network small computer system according to an embodiment of the present invention.
在一实施例中,该网络小型计算机系统接口会话链路的切换方法包括步骤S10-S302:In an embodiment, the method for switching the network small computer system interface session link includes steps S10-S302:
步骤S10,在启动器和目标器之间建立网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量。Step S10: After establishing a network small computer system interface iSCSI session link between the initiator and the target, detecting data transmission quality of the current iSCSI session link established between the initiator and the target.
iSCSI业务在实际应用中,可能出现误操作、网线脱落、网口接触不良、网卡芯片突然故障等,由于网络不稳定性以及特殊应用场景等情况可能造成网络链路故障,从而引发iSCSI连接断开,业务发生中断的现象。因此,为了降低因网络故障引发的iSCSI连接断开而导致业务中断的风险,通常在iSCSI连接中增加冗余链路来提高业务可靠性。即启动器和目标器之间通常有多条冗余链路,启动器和目标器之间建立iSCSI会话链路来执行iSCSI业务时,所述启动器和目标器之间建立的当前iSCSI会话链路为多条冗余链路中的一条,其余的链路作为当前iSCSI会话链路因故障断开时的备用的链路。In the actual application, the iSCSI service may be faulty, the network cable is disconnected, the network port is faulty, and the NIC chip is suddenly faulty. The network link may be faulty due to network instability and special application scenarios. The phenomenon of business interruption. Therefore, in order to reduce the risk of service interruption caused by the disconnection of the iSCSI connection caused by the network failure, redundant links are usually added to the iSCSI connection to improve service reliability. That is, there are usually multiple redundant links between the initiator and the target. When an iSCSI session link is established between the initiator and the target to perform iSCSI services, the current iSCSI session chain established between the initiator and the target is established. The path is one of multiple redundant links, and the remaining links serve as alternate links for the current iSCSI session link due to a failure.
本实施例中,在启动器和目标器之间建立iSCSI会话链路执行iSCSI业务时,即使当前iSCSI会话链路没有断开能正常执行iSCSI业务,仍会检测所述当前iSCSI会话链路的数据传输质量。如可通过当前iSCSI业务的执行状态、当前iSCSI会话链路上报文前后交互的时间差等来检测所述当前iSCSI会话链路的数据传输质量。其中,设置为检测的报文可以是iSCSI协议中定义的报文,也可以是用户自定义的测试报文,在此不作限定。In this embodiment, when an iSCSI session link is established between the initiator and the target to perform the iSCSI service, the current iSCSI session link data is detected even if the current iSCSI session link is not disconnected and the iSCSI service can be normally executed. Transmission quality. The data transmission quality of the current iSCSI session link may be detected by the execution status of the current iSCSI service, the time difference of the interaction before and after the message on the current iSCSI session link, and the like. The packet that is set to be detected may be a packet defined in the iSCSI protocol, or may be a user-defined test packet, which is not limited herein.
步骤S20,判断所述当前iSCSI会话链路的数据传输质量是否符合预设切换条件。Step S20: Determine whether the data transmission quality of the current iSCSI session link meets a preset switching condition.
利用检测出的当前iSCSI业务的执行状态如执行速度、进程等或当前iSCSI会话链路上报文前后交互的时间差等参数判断所述当前iSCSI会话链路 的数据传输质量,并判断所述当前iSCSI会话链路的数据传输质量是否符合预设切换条件。Determining the current iSCSI session link by using the detected execution status of the current iSCSI service, such as the execution speed, the process, or the like, or the time difference between the time before and after the message on the current iSCSI session link. Data transmission quality, and determine whether the data transmission quality of the current iSCSI session link meets a preset switching condition.
步骤S30,如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,则切换所述启动器和目标器之间的iSCSI会话链路。Step S30: If the data transmission quality of the current iSCSI session link meets a preset switching condition, switch the iSCSI session link between the initiator and the target.
当检测到当前iSCSI业务的执行速度较慢、当前iSCSI会话链路上报文前后交互的时间差过长时,则判定当前iSCSI会话链路的数据传输质量较差,当前iSCSI会话链路可能出现反复震荡不稳定的情况,无法保证当前iSCSI会话链路能稳定地执行完当前iSCSI业务。则判断当前iSCSI会话链路的数据传输质量符合预设切换条件,需要对当前iSCSI会话链路进行切换。将启动器和目标器之间的iSCSI业务从当前iSCSI会话链路切换至启动器和目标器之间多条冗余链路中的其他链路上执行,直至切换至数据传输质量能保证稳定执行完iSCSI业务的链路上。When the current iSCSI service is detected to be slow and the time difference between the packets on the current iSCSI session link is too long, the data transmission quality of the current iSCSI session link is poor. The current iSCSI session link may be repeated. In the case of unstable oscillation, there is no guarantee that the current iSCSI session link can stably perform the current iSCSI service. Then, it is determined that the data transmission quality of the current iSCSI session link meets the preset switching condition, and the current iSCSI session link needs to be switched. The iSCSI service between the initiator and the target is switched from the current iSCSI session link to other links in the multiple redundant links between the initiator and the target, until the data transmission quality is switched to ensure stable execution. Complete the link of the iSCSI service.
本实施例中不仅仅只在当前iSCSI会话链路因故障断开时切换至启动器和目标器之间多条冗余链路中的其他链路上执行iSCSI业务,还能在当前iSCSI会话链路没有断开但数据传输质量较差、链路不稳定时自动将iSCSI业务从所述当前iSCSI会话链路切换至启动器和目标器之间多条冗余链路中的其他链路上执行,有效地保证了iSCSI业务执行的稳定性和可靠性。In this embodiment, not only when the current iSCSI session link is disconnected due to a fault, but also when switching to the other link among the multiple redundant links between the initiator and the target, the current iSCSI session chain can also be performed. When the path is not disconnected but the data transmission quality is poor, and the link is unstable, the iSCSI service is automatically switched from the current iSCSI session link to other links in the multiple redundant links between the initiator and the target. , effectively ensure the stability and reliability of iSCSI service execution.
本实施例在启动器和目标器之间利用建立的当前iSCSI会话链路执行iSCSI业务时,检测所述当前iSCSI会话链路的数据传输质量;并在判定当前iSCSI会话链路的数据传输质量符合预设切换条件时,切换启动器和目标器之间的iSCSI会话链路。由于在执行iSCSI业务时能对启动器和目标器之间的当前iSCSI会话链路的数据传输质量进行检测,在判定当前iSCSI会话链路的数据传输质量较差时,能及时将启动器和目标器之间的iSCSI业务从所述当前iSCSI会话链路切换至其他链路执行,以避免在当前iSCSI会话链路出现反复震荡不稳定的情况时仍使用当前iSCSI会话链路来执行iSCSI业务,有效地提高了启动器和目标器之间iSCSI业务执行的稳定性和可靠性。In this embodiment, when the iSCSI service is performed by using the established current iSCSI session link between the initiator and the target, the data transmission quality of the current iSCSI session link is detected; and the data transmission quality of the current iSCSI session link is determined to be consistent. When the switching condition is preset, the iSCSI session link between the initiator and the target is switched. Since the data transmission quality of the current iSCSI session link between the initiator and the target can be detected when performing the iSCSI service, the initiator and the target can be timely in determining the current data transmission quality of the iSCSI session link. The iSCSI service between the devices is switched from the current iSCSI session link to other links to avoid using the current iSCSI session link to perform iSCSI services when the current iSCSI session link is repeatedly unstable. Improves the stability and reliability of iSCSI service execution between the initiator and the target.
可选地,在其他实施例中,上述步骤S10,即所述在启动器和目标器之间建立网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量可以包括: Optionally, in other embodiments, step S10, that is, after establishing a network small computer system interface iSCSI session link between the initiator and the target, detecting a current established between the initiator and the target The data transmission quality of the iSCSI session link can include:
每隔预设间隔时间在所述启动器和目标器之间的所有iSCSI会话链路上发送多个预设测试报文,计算预设时间内每一个iSCSI会话链路上预设测试报文的超时报文个数和/或应答报文平均时长。Sending a plurality of preset test packets on all the iSCSI session links between the initiator and the target at a preset interval, and calculating a preset test packet on each iSCSI session link within a preset time period. The number of timeout packets and/or the average duration of response packets.
本实施例中,在检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量时,可采用预设测试报文的收发情况来进行检测。具体地,可每隔预设间隔时间在所述启动器和目标器之间的所有iSCSI会话链路上发送如果干预设测试报文,计算预设时间内每一个iSCSI会话链路上预设测试报文的超时报文个数和/或应答报文平均时长。其中,在收发预设测试报文时,既可由所述启动器作为发送端,目标器作为接收端;也可由所述目标器作为发送端,启动器作为接收端,在此不作限定。该预设测试报文可以是iSCSI协议中定义的报文,也可以是用户自定义的测试报文,在此不作限定。In this embodiment, when detecting the data transmission quality of the current iSCSI session link established between the initiator and the target device, the detection and reception of the preset test packet may be used for detection. Specifically, if the preset test packet is sent on all the iSCSI session links between the initiator and the target at a preset interval, the preset test on each iSCSI session link in the preset time period is calculated. The number of timeout packets of the packet and/or the average duration of the response packet. When the preset test packet is sent and received, the initiator can be used as the transmitting end, and the target is used as the receiving end. The target is used as the transmitting end and the initiator is used as the receiving end, which is not limited herein. The preset test packet may be a packet defined in the iSCSI protocol, or may be a user-defined test packet, which is not limited herein.
本实施例中以所述预设测试报文为iSCSI协议中定义的Nopout报文;对应的应答报文为iSCSI协议中定义的Nopin报文为例进行说明,如图2所示,图2为本发明实施例网络小型计算机系统接口会话链路的切换方法一实施例中Nopout报文和Nopin报文的交互过程示意图。如在启动器iSCSI initiator端向目标器iSCSI target端发起iSCSI会话请求,iSCSI target端向iSCSI initiator端反馈会话应答后,iSCSI initiator端与iSCSI target端即在当前iSCSI会话链路上建立起iSCSI会话连接。在检测当前iSCSI会话链路的数据传输质量时,iSCSI target端每隔10秒向iSCSI initiator端发出1个填充PING DATA为当前时间戳的预设测试报文即Nopout报文,共发送10个Nopout报文,并开始统计计算3分钟内Nopout报文的超时报文个数和iSCSI initiator端反馈的每个应答报文即Nopin报文所花的时长,可选地,还可计算iSCSI initiator端反馈的Nopin报文平均时长。需要说明的是,既可在启动器和目标器之间的多条冗余链路即所有iSCSI会话链路中的每一条链路上进行相同的数据传输质量检测操作,以获知启动器和目标器之间的每一条链路的数据传输质量;也可仅在启动器和目标器之间建立的当前iSCSI会话链路上进行数据传输质量检测操作,在此不作限定。In this embodiment, the preset test packet is a Nopout packet defined in the iSCSI protocol; the corresponding response packet is a Nopin packet defined in the iSCSI protocol, as shown in FIG. 2, and FIG. 2 is The method for the interaction between the Nopout packet and the Nopin packet in the embodiment of the method for switching the interface of the network small computer system interface. If the iSCSI initiator sends an iSCSI session request to the target iSCSI target on the initiator iSCSI initiator, the iSCSI target and the iSCSI target establish an iSCSI session on the current iSCSI session. . When detecting the data transmission quality of the current iSCSI session link, the iSCSI target sends a Noopout packet, which is the default test packet with the current timestamp, to the iSCSI initiator, and sends 10 Nopout messages every 10 seconds. The packet is counted, and the number of timeout packets of the Nopout packet in the 3 minutes and the duration of the Nopin packet sent by the iSCSI initiator are optionally calculated. Alternatively, the iSCSI initiator feedback can be calculated. The average length of the Nopin message. It should be noted that the same data transmission quality detection operation can be performed on each of a plurality of redundant links between the initiator and the target, that is, on each of all iSCSI session links, to learn the initiator and the target. Data transmission quality of each link between the devices; data transmission quality detection operation is performed on the current iSCSI session link established between the initiator and the target device, which is not limited herein.
可选地,在其他实施例中,上述步骤S30,即如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,则切换所述启动器和目标器之间的 iSCSI会话链路包括:Optionally, in other embodiments, the foregoing step S30 is to switch between the initiator and the target device if the data transmission quality of the current iSCSI session link meets a preset switching condition. The iSCSI session link includes:
如果所述当前iSCSI会话链路上的超时报文个数超过预设数量或应答报文平均时长超过预设时间,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为预设iSCSI会话链路。If the number of timeout packets on the current iSCSI session link exceeds a preset number or the average duration of the response message exceeds a preset time, freezing the current iSCSI session link between the initiator and the target device The current iSCSI session link switches to the default iSCSI session link.
本实施例中,在利用预设测试报文检测计算出预设时间内所述当前iSCSI会话链路上的超时报文个数超过预设数量或应答报文平均时长超过预设时间,则说明当前iSCSI会话链路的数据传输质量较差,当前iSCSI会话链路可能出现反复震荡不稳定的情况,无法保证当前iSCSI会话链路能稳定地执行完当前iSCSI业务。则冻结当前iSCSI会话链路,将启动器和目标器之间的当前iSCSI会话链路切换为预设iSCSI会话链路。其中,该预设iSCSI会话链路可以为预先设定的启动器和目标器之间的多条冗余链路中一固定的iSCSI会话链路,也可以是当前iSCSI会话链路相邻的链路,在此不作限定。冻结后的所述当前iSCSI会话链路只能接收数据,由切换后的预设iSCSI会话链路来对外发送数据。In this embodiment, the preset test packet is used to detect that the number of timeout packets on the current iSCSI session link exceeds the preset number or the average duration of the response packet exceeds the preset time. The data transmission quality of the current iSCSI session link is poor. The current iSCSI session link may be unstable and unstable. The current iSCSI session link cannot perform the current iSCSI service stably. The current iSCSI session link is frozen, and the current iSCSI session link between the initiator and the target is switched to the default iSCSI session link. The preset iSCSI session link may be a fixed iSCSI session link among multiple redundant links between the preset initiator and the target, or may be a chain adjacent to the current iSCSI session link. Road, here is not limited. The frozen current iSCSI session link can only receive data, and the data is sent out by the switched default iSCSI session link.
可选地,在其他实施例中,上述步骤S30还可以包括:Optionally, in other embodiments, the foregoing step S30 may further include:
如果所述当前iSCSI会话链路与所有iSCSI会话链路中超时报文个数最少的备选iSCSI会话链路之间的超时报文数量差大于预设数量差,或所述当前iSCSI会话链路与所有iSCSI会话链路中应答报文平均时长最短的备选iSCSI会话链路之间的应答报文平均时间差大于预设时间差,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为所述备选iSCSI会话链路。If the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the smallest number of timeout packets in all iSCSI session links is greater than a preset number difference, or the current iSCSI session link is The average time difference of the response packets between the candidate iSCSI session links with the shortest average response time of all the iSCSI session links is greater than the preset time difference, and the current iSCSI session link is frozen, and the initiator and the target are The current iSCSI session link between the switches is switched to the alternate iSCSI session link.
本实施例中,在计算预设时间内每一iSCSI会话链路上预设测试报文的超时报文个数和/或应答报文平均时长后,即可获知启动器和目标器之间的每一条链路的数据传输质量。如果当前iSCSI会话链路与所有iSCSI会话链路中超时报文个数最少的备选iSCSI会话链路之间的超时报文数量差大于预设数量差,或当前iSCSI会话链路与所有iSCSI会话链路中应答报文平均时长最短的备选iSCSI会话链路之间的应答报文平均时间差大于预设时间差,则说明当前iSCSI会话链路与启动器和目标器之间的多条冗余链路中数据传输质量最佳的备选iSCSI会话链路之间的链路质量相差较大,则冻结当前iSCSI会话 链路,将启动器和目标器之间的当前iSCSI会话链路切换为多条冗余链路中数据传输质量最佳的备选iSCSI会话链路。以利用数据传输质量最佳的备选iSCSI会话链路来执行完iSCSI业务,保证稳定、高效地执行iSCSI业务。In this embodiment, after calculating the number of timeout packets of the preset test packet and/or the average duration of the response packet on each iSCSI session link in the preset time, the relationship between the initiator and the target is obtained. The quality of data transmission per link. If the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the lowest number of timeout packets on all iSCSI session links is greater than the preset number difference, or the current iSCSI session link and all iSCSI session chains The average time difference between the response packets of the alternate iSCSI session link with the shortest average response time in the path is greater than the preset time difference, indicating multiple redundant links between the current iSCSI session link and the initiator and the target. If the link quality between the alternate iSCSI session links with the best data transmission quality is different, the current iSCSI session is frozen. The link switches the current iSCSI session link between the initiator and the target to an alternate iSCSI session link with the best data transmission quality among the multiple redundant links. The iSCSI service is performed by using an alternative iSCSI session link with the best data transmission quality to ensure stable and efficient execution of iSCSI services.
本发明实施例还提供一种网络小型计算机系统接口会话链路的切换装置。The embodiment of the invention further provides a device for switching the interface session link of the network small computer system.
参照图3,图3为本发明实施例网络小型计算机系统接口会话链路的切换装置一实施例的功能模块示意图。Referring to FIG. 3, FIG. 3 is a schematic diagram of functional modules of an apparatus for switching an interface session link of a network small computer system according to an embodiment of the present invention.
在一实施例中,该网络小型计算机系统接口会话链路的切换装置包括:检测模块、判断模块和切换模块。In an embodiment, the switching device of the network small computer system interface session link comprises: a detecting module, a determining module and a switching module.
检测模块01,设置为在启动器和目标器之间建立网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量。The detecting module 01 is configured to detect a data transmission quality of a current iSCSI session link established between the initiator and the target after establishing a network small computer system interface iSCSI session link between the initiator and the target.
iSCSI业务在实际应用中,可能出现误操作、网线脱落、网口接触不良、网卡芯片突然故障等,由于网络不稳定性以及特殊应用场景等情况可能造成网络链路故障,从而引发iSCSI连接断开,业务发生中断的现象。因此,为了降低因网络故障引发的iSCSI连接断开而导致业务中断的风险,通常在iSCSI连接中增加冗余链路来提高业务可靠性。即启动器和目标器之间通常有多条冗余链路,启动器和目标器之间建立iSCSI会话链路来执行iSCSI业务时,启动器和目标器之间建立的当前iSCSI会话链路为多条冗余链路中的一条,其余的链路作为当前iSCSI会话链路因故障断开时的备用的链路。In the actual application, the iSCSI service may be faulty, the network cable is disconnected, the network port is faulty, and the NIC chip is suddenly faulty. The network link may be faulty due to network instability and special application scenarios. The phenomenon of business interruption. Therefore, in order to reduce the risk of service interruption caused by the disconnection of the iSCSI connection caused by the network failure, redundant links are usually added to the iSCSI connection to improve service reliability. That is, there are usually multiple redundant links between the initiator and the target. When an iSCSI session link is established between the initiator and the target to perform iSCSI services, the current iSCSI session link established between the initiator and the target is One of multiple redundant links, the remaining links acting as backup links for the current iSCSI session link due to a failure.
本实施例中,在启动器和目标器之间建立iSCSI会话链路执行iSCSI业务时,即使当前iSCSI会话链路没有断开能正常执行iSCSI业务,仍会检测所述当前iSCSI会话链路的数据传输质量。如可通过当前iSCSI业务的执行状态、当前iSCSI会话链路上报文前后交互的时间差等来检测所述当前iSCSI会话链路的数据传输质量。其中,设置为检测的报文可以是iSCSI协议中定义的报文,也可以是用户自定义的测试报文,在此不作限定。In this embodiment, when an iSCSI session link is established between the initiator and the target to perform the iSCSI service, the current iSCSI session link data is detected even if the current iSCSI session link is not disconnected and the iSCSI service can be normally executed. Transmission quality. The data transmission quality of the current iSCSI session link may be detected by the execution status of the current iSCSI service, the time difference of the interaction before and after the message on the current iSCSI session link, and the like. The packet that is set to be detected may be a packet defined in the iSCSI protocol, or may be a user-defined test packet, which is not limited herein.
判断模块02,设置为判断当前iSCSI会话链路的数据传输质量是否符合预设切换条件。 The determining module 02 is configured to determine whether the data transmission quality of the current iSCSI session link meets a preset switching condition.
利用检测出的当前iSCSI业务的执行状态如执行速度、进程等或当前iSCSI会话链路上报文前后交互的时间差等参数判断所述当前iSCSI会话链路的数据传输质量,并判断当前iSCSI会话链路的数据传输质量是否符合预设切换条件。Determining the data transmission quality of the current iSCSI session link by using the detected execution status of the current iSCSI service, such as the execution speed, the process, or the time difference between the current and the iSCSI session link, and determining the current iSCSI session chain. Whether the data transmission quality of the road meets the preset switching conditions.
切换模块03,设置为如果当前iSCSI会话链路的数据传输质量符合预设切换条件,则切换所述启动器和目标器之间的iSCSI会话链路。The switching module 03 is configured to switch the iSCSI session link between the initiator and the target if the data transmission quality of the current iSCSI session link meets the preset switching condition.
当检测到当前iSCSI业务的执行速度较慢、当前iSCSI会话链路上报文前后交互的时间差过长等时,则判断当前iSCSI会话链路的数据传输质量的较差,当前iSCSI会话链路可能出现反复震荡不稳定的情况,无法保证当前iSCSI会话链路能稳定地执行完当前iSCSI业务。则判定当前iSCSI会话链路的数据传输质量符合预设切换条件,需要对所述当前iSCSI会话链路进行切换。将所述启动器和目标器之间的iSCSI业务从当前iSCSI会话链路切换至启动器和目标器之间多条冗余链路中的其他链路上执行,直至切换至数据传输质量能保证稳定执行完iSCSI业务的链路上。When the current iSCSI service is detected to be slow, and the time difference between the packets before and after the current iSCSI session is too long, the data transmission quality of the current iSCSI session link is poor. The current iSCSI session link may be In the case of repeated oscillating instability, there is no guarantee that the current iSCSI session link can stably perform the current iSCSI service. Then, it is determined that the data transmission quality of the current iSCSI session link meets the preset switching condition, and the current iSCSI session link needs to be switched. Performing iSCSI traffic between the initiator and the target from the current iSCSI session link to other links in the multiple redundant links between the initiator and the target, until the quality of the data transmission is guaranteed Stable on the link that performs the iSCSI service.
本实施例中不仅仅只在当前iSCSI会话链路因故障断开时切换至启动器和目标器之间多条冗余链路中的其他链路上执行iSCSI业务,还能在当前iSCSI会话链路没有断开但数据传输质量较差、链路不稳定时自动将iSCSI业务从所述当前iSCSI会话链路切换至启动器和目标器之间多条冗余链路中的其他链路上执行,有效地保证了iSCSI业务执行的稳定性和可靠性。In this embodiment, not only when the current iSCSI session link is disconnected due to a fault, but also when switching to the other link among the multiple redundant links between the initiator and the target, the current iSCSI session chain can also be performed. When the path is not disconnected but the data transmission quality is poor, and the link is unstable, the iSCSI service is automatically switched from the current iSCSI session link to other links in the multiple redundant links between the initiator and the target. , effectively ensure the stability and reliability of iSCSI service execution.
本实施例在启动器和目标器之间利用建立的当前iSCSI会话链路执行iSCSI业务时,检测当前iSCSI会话链路的数据传输质量;并在判定当前iSCSI会话链路的数据传输质量符合预设切换条件时,切换启动器和目标器之间的iSCSI会话链路。由于在执行iSCSI业务时能对启动器和目标器之间的当前iSCSI会话链路的数据传输质量进行检测,在判定当前iSCSI会话链路的数据传输质量较差时,能及时将启动器和目标器之间的iSCSI业务从当前iSCSI会话链路切换至其他链路执行,以避免在当前iSCSI会话链路出现反复震荡不稳定的情况时,仍使用当前iSCSI会话链路来执行iSCSI业务,有效地提高了启动器和目标器之间iSCSI业务执行的稳定性和可靠性。In this embodiment, when the iSCSI service is performed between the initiator and the target by using the established current iSCSI session link, the data transmission quality of the current iSCSI session link is detected; and the data transmission quality of the current iSCSI session link is determined to be in accordance with the preset. When switching conditions, switch the iSCSI session link between the initiator and the target. Since the data transmission quality of the current iSCSI session link between the initiator and the target can be detected when performing the iSCSI service, the initiator and the target can be timely in determining the current data transmission quality of the iSCSI session link. The iSCSI service between the devices is switched from the current iSCSI session link to other links to avoid using the current iSCSI session link to perform iSCSI services when the current iSCSI session link is repeatedly oscillated. Improves the stability and reliability of iSCSI service execution between the initiator and the target.
可选地,在其他实施例中,上述检测模块01在启动器和目标器之间建立 网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量包括:Optionally, in other embodiments, the detecting module 01 is established between the initiator and the target. After the network small computer system interfaces the iSCSI session link, detecting the data transmission quality of the current iSCSI session link established between the initiator and the target includes:
每隔预设间隔时间在所述启动器和目标器之间的所有iSCSI会话链路上发送多个预设测试报文,计算预设时间内每一个iSCSI会话链路上预设测试报文的超时报文个数和/或应答报文平均时长。Sending a plurality of preset test packets on all the iSCSI session links between the initiator and the target at a preset interval, and calculating a preset test packet on each iSCSI session link within a preset time period. The number of timeout packets and/or the average duration of response packets.
本实施例中,在检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量时,可采用预设测试报文的收发情况来进行检测。可每隔预设间隔时间在所述启动器和目标器之间的所有iSCSI会话链路上发送如果干预设测试报文,计算预设时间内每一iSCSI会话链路上预设测试报文的超时报文个数和/或应答报文平均时长。其中,在收发预设测试报文时,既可由所述启动器作为发送端,目标器作为接收端;也可由所述目标器作为发送端,启动器作为接收端,在此不作限定。该预设测试报文可以是iSCSI协议中定义的报文,也可以是用户自定义的测试报文,在此不作限定。In this embodiment, when detecting the data transmission quality of the current iSCSI session link established between the initiator and the target device, the detection and reception of the preset test packet may be used for detection. The preset test packet may be sent on all the iSCSI session links between the initiator and the target at a preset interval, and the preset test message on each iSCSI session link in the preset time period is calculated. The number of timeout packets and/or the average duration of response packets. When the preset test packet is sent and received, the initiator can be used as the transmitting end, and the target is used as the receiving end. The target is used as the transmitting end and the initiator is used as the receiving end, which is not limited herein. The preset test packet may be a packet defined in the iSCSI protocol, or may be a user-defined test packet, which is not limited herein.
本实施例中以所述预设测试报文为iSCSI协议中定义的Nopout报文;对应的应答报文为iSCSI协议中定义的Nopin报文为例进行说明。如在启动器iSCSI initiator端向目标器iSCSI target端发起iSCSI会话请求,iSCSI target端向iSCSI initiator端反馈会话应答后,iSCSI initiator端与iSCSI target端即在当前iSCSI会话链路上建立起iSCSI会话连接。在检测当前iSCSI会话链路的数据传输质量时,iSCSI target端每隔10秒向iSCSI initiator端发出1个填充PING DATA为当前时间戳的预设测试报文即Nopout报文,共发送10个Nopout报文,并开始统计计算3分钟内Nopout报文的超时报文个数和iSCSI initiator端反馈的每个应答报文即Nopin报文所花的时长,可选地,还可计算iSCSI initiator端反馈的Nopin报文平均时长。需要说明的是,既可在启动器和目标器之间的多条冗余链路即所有iSCSI会话链路中的每一条链路上进行相同的数据传输质量检测操作,以获知启动器和目标器之间的每一条链路的数据传输质量;也可仅在启动器和目标器之间建立的当前iSCSI会话链路上进行数据传输质量检测操作,在此不作限定。In this embodiment, the preset test packet is a Nopout packet defined in the iSCSI protocol, and the corresponding response packet is a Nopin packet defined in the iSCSI protocol. If the iSCSI initiator sends an iSCSI session request to the target iSCSI target on the initiator iSCSI initiator, the iSCSI target and the iSCSI target establish an iSCSI session on the current iSCSI session. . When detecting the data transmission quality of the current iSCSI session link, the iSCSI target sends a Noopout packet, which is the default test packet with the current timestamp, to the iSCSI initiator, and sends 10 Nopout messages every 10 seconds. The packet is counted, and the number of timeout packets of the Nopout packet in the 3 minutes and the duration of the Nopin packet sent by the iSCSI initiator are optionally calculated. Alternatively, the iSCSI initiator feedback can be calculated. The average length of the Nopin message. It should be noted that the same data transmission quality detection operation can be performed on each of a plurality of redundant links between the initiator and the target, that is, on each of all iSCSI session links, to learn the initiator and the target. Data transmission quality of each link between the devices; data transmission quality detection operation is performed on the current iSCSI session link established between the initiator and the target device, which is not limited herein.
可选地,在其他实施例中,所述如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,上述切换模块03切换所述启动器和目标器之间的 iSCSI会话链路包括:Optionally, in other embodiments, if the data transmission quality of the current iSCSI session link meets a preset switching condition, the switching module 03 switches between the initiator and the target device. The iSCSI session link includes:
如果所述当前iSCSI会话链路上的超时报文个数超过预设数量或应答报文平均时长超过预设时间,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为预设iSCSI会话链路。If the number of timeout packets on the current iSCSI session link exceeds a preset number or the average duration of the response message exceeds a preset time, freezing the current iSCSI session link between the initiator and the target device The current iSCSI session link switches to the default iSCSI session link.
本实施例中,在利用预设测试报文检测计算出预设时间内所述当前iSCSI会话链路上的超时报文个数超过预设数量或应答报文平均时长超过预设时间,则说明所述当前iSCSI会话链路的数据传输质量较差,所述当前iSCSI会话链路可能出现反复震荡不稳定的情况,无法保证所述当前iSCSI会话链路能稳定地执行完当前iSCSI业务。则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为预设iSCSI会话链路。其中,该预设iSCSI会话链路可以为预先设定的启动器和目标器之间的多条冗余链路中一个固定的iSCSI会话链路,也可以是当前iSCSI会话链路相邻的链路,在此不作限定。冻结后的所述当前iSCSI会话链路只能接收数据,由切换后的预设iSCSI会话链路来对外发送数据。In this embodiment, the preset test packet is used to detect that the number of timeout packets on the current iSCSI session link exceeds the preset number or the average duration of the response packet exceeds the preset time. The data transmission quality of the current iSCSI session link is poor. The current iSCSI session link may be unstable and unstable. The current iSCSI session link cannot be stably executed. The current iSCSI session link is then frozen, and the current iSCSI session link between the initiator and the target is switched to a preset iSCSI session link. The preset iSCSI session link may be a fixed iSCSI session link among a plurality of redundant links between the preset initiator and the target, or may be a chain adjacent to the current iSCSI session link. Road, here is not limited. The frozen current iSCSI session link can only receive data, and the data is sent out by the switched default iSCSI session link.
可选地,在其他实施例中,所述如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,上述切换模块03切换所述启动器和目标器之间的iSCSI会话链路还包括:Optionally, in other embodiments, if the data transmission quality of the current iSCSI session link meets a preset switching condition, the switching module 03 switches the iSCSI session link between the initiator and the target. include:
如果所述当前iSCSI会话链路与所有iSCSI会话链路中超时报文个数最少的备选iSCSI会话链路之间的超时报文数量差大于预设数量差,或所述当前iSCSI会话链路与所有iSCSI会话链路中应答报文平均时长最短的备选iSCSI会话链路之间的应答报文平均时间差大于预设时间差,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为所述备选iSCSI会话链路。If the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the smallest number of timeout packets in all iSCSI session links is greater than a preset number difference, or the current iSCSI session link is The average time difference of the response packets between the candidate iSCSI session links with the shortest average response time of all the iSCSI session links is greater than the preset time difference, and the current iSCSI session link is frozen, and the initiator and the target are The current iSCSI session link between the switches is switched to the alternate iSCSI session link.
本实施例中,在计算预设时间内每一iSCSI会话链路上预设测试报文的超时报文个数和/或应答报文平均时长后,即可获知启动器和目标器之间的每一条链路的数据传输质量。如果当前iSCSI会话链路与所有iSCSI会话链路中超时报文个数最少的备选iSCSI会话链路之间的超时报文数量差大于预设数量差,或当前iSCSI会话链路与所有iSCSI会话链路中应答报文平均时长最短的备选iSCSI会话链路之间的应答报文平均时间差大于预设时间差,则说明 当前iSCSI会话链路与启动器和目标器之间的多条冗余链路中数据传输质量最佳的备选iSCSI会话链路之间的链路质量相差较大,则冻结当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为多条冗余链路中数据传输质量最佳的备选iSCSI会话链路。以利用数据传输质量最佳的备选iSCSI会话链路来执行完iSCSI业务,保证稳定、高效地执行iSCSI业务。In this embodiment, after calculating the number of timeout packets of the preset test packet and/or the average duration of the response packet on each iSCSI session link in the preset time, the relationship between the initiator and the target is obtained. The quality of data transmission per link. If the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the lowest number of timeout packets on all iSCSI session links is greater than the preset number difference, or the current iSCSI session link and all iSCSI session chains The average time difference between response packets of the alternate iSCSI session link with the shortest average response time in the path is greater than the preset time difference. The current iSCSI session link is frozen when the link quality between the current iSCSI session link and the alternate iSCSI session link with the best data transmission quality among the multiple redundant links between the initiator and the target is different. Switching the current iSCSI session link between the initiator and the target to an alternate iSCSI session link with the best data transmission quality among the multiple redundant links. The iSCSI service is performed by using an alternative iSCSI session link with the best data transmission quality to ensure stable and efficient execution of iSCSI services.
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现所述的网络小型计算机系统接口会话链路的切换方法。A computer readable storage medium storing computer executable instructions that, when executed by a processor, implement a method of switching a network small computer system interface session link.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or a portion of the steps of the above-described embodiments can be implemented using a computer program flow, which can be stored in a computer readable storage medium, such as on a corresponding hardware platform (eg, The system, device, device, device, etc. are executed, and when executed, include one or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。Alternatively, all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
上述实施例中的装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
工业实用性Industrial applicability
本发明实施例提出的一种网络小型计算机系统接口会话链路的切换方法及装置,在启动器和目标器之间利用建立的当前iSCSI会话链路执行iSCSI业务时,检测所述当前iSCSI会话链路的数据传输质量;并在判断所述当前iSCSI会话链路的数据传输质量符合预设切换条件时,切换所述启动器和目标器之间的iSCSI会话链路。由于在执行iSCSI业务时能对启动器和目标器之间的当前iSCSI会话链路的数据传输质量进行检测,在判断所述当前iSCSI会话 链路的数据传输质量较差时,能及时将所述启动器和目标器之间的iSCSI业务从所述当前iSCSI会话链路切换至其他链路执行,以避免在当前iSCSI会话链路出现反复震荡不稳定的情况时,仍使用当前iSCSI会话链路来执行iSCSI业务,有效地提高了启动器和目标器之间iSCSI业务执行的稳定性和可靠性。 The method and device for switching a network small computer system interface session link according to an embodiment of the present invention, detecting the current iSCSI session chain when performing iSCSI services between the initiator and the target using the established current iSCSI session link The data transmission quality of the path; and when the data transmission quality of the current iSCSI session link is determined to meet the preset switching condition, the iSCSI session link between the initiator and the target is switched. Since the data transmission quality of the current iSCSI session link between the initiator and the target can be detected when performing the iSCSI service, the current iSCSI session is judged When the data transmission quality of the link is poor, the iSCSI service between the initiator and the target can be switched from the current iSCSI session link to other links in time to avoid repeated attacks on the current iSCSI session link. In the case of unstable oscillations, the current iSCSI session link is still used to perform iSCSI services, which effectively improves the stability and reliability of iSCSI service execution between the initiator and the target.

Claims (11)

  1. 一种网络小型计算机系统接口会话链路的切换方法,所述方法包括:A method for switching a network small computer system interface session link, the method comprising:
    在启动器和目标器之间建立网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量;After establishing a network small computer system interface iSCSI session link between the initiator and the target, detecting data transmission quality of the current iSCSI session link established between the initiator and the target;
    判断所述当前iSCSI会话链路的数据传输质量是否符合预设切换条件;Determining whether the data transmission quality of the current iSCSI session link meets a preset switching condition;
    如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,则切换所述启动器和目标器之间的iSCSI会话链路。And if the data transmission quality of the current iSCSI session link meets a preset switching condition, switching an iSCSI session link between the initiator and the target.
  2. 如权利要求1所述的网络小型计算机系统接口会话链路的切换方法,其中,所述在启动器和目标器之间建立网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量包括:The method for switching a network small computer system interface session link according to claim 1, wherein said initiator and target are detected after said network small computer system interface iSCSI session link is established between the initiator and the target The data transmission quality of the current iSCSI session link established between the devices includes:
    每隔预设间隔时间在所述启动器和目标器之间的所有iSCSI会话链路上发送多个预设测试报文,计算预设时间内每一个iSCSI会话链路上预设测试报文的超时报文个数和/或应答报文平均时长。Sending a plurality of preset test packets on all the iSCSI session links between the initiator and the target at a preset interval, and calculating a preset test packet on each iSCSI session link within a preset time period. The number of timeout packets and/or the average duration of response packets.
  3. 如权利要求2所述的网络小型计算机系统接口会话链路的切换方法,其中,所述如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,则切换所述启动器和目标器之间的iSCSI会话链路包括:The method for switching a network small computer system interface session link according to claim 2, wherein said switcher and said target are switched if said data transmission quality of said current iSCSI session link meets a preset switching condition The iSCSI session link between:
    如果所述当前iSCSI会话链路上的所述超时报文个数超过预设数量或所述应答报文平均时长超过预设时间,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为预设iSCSI会话链路。If the number of the timeout packets on the current iSCSI session link exceeds a preset number or the average duration of the response message exceeds a preset time, the current iSCSI session link is frozen, and the initiator and the initiator are The current iSCSI session link between the targets switches to the default iSCSI session link.
  4. 如权利要求3所述的网络小型计算机系统接口会话链路的切换方法,其中,所述如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,则切换所述启动器和目标器之间的iSCSI会话链路还包括:The method for switching a network small computer system interface session link according to claim 3, wherein said switcher and said target are switched if said data transmission quality of said current iSCSI session link meets a preset switching condition The iSCSI session link between the two also includes:
    如果所述当前iSCSI会话链路与所有iSCSI会话链路中超时报文个数最少的备选iSCSI会话链路之间的超时报文数量差大于预设数量差,或所述当前iSCSI会话链路与所有iSCSI会话链路中应答报文平均时长最短的备选iSCSI会话链路之间的应答报文平均时间差大于预设时间差,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为所 述备选iSCSI会话链路。If the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the smallest number of timeout packets in all iSCSI session links is greater than a preset number difference, or the current iSCSI session link is The average time difference of the response packets between the candidate iSCSI session links with the shortest average response time of all the iSCSI session links is greater than the preset time difference, and the current iSCSI session link is frozen, and the initiator and the target are Switch between the current iSCSI session link An alternative iSCSI session link.
  5. 如权利要求2至4中任一项所述的网络小型计算机系统接口会话链路的切换方法,其中,所述预设测试报文为iSCSI协议中定义的Nopout报文;所述应答报文为iSCSI协议中定义的Nopin报文。The method for switching a network small computer system interface session link according to any one of claims 2 to 4, wherein the preset test message is a Nopout message defined in the iSCSI protocol; the response message is Nopin packet defined in the iSCSI protocol.
  6. 一种网络小型计算机系统接口会话链路的切换装置,所述网络小型计算机系统接口会话链路的切换装置包括:检测模块、判断模块和切换模块;A switching device for a network small computer system interface session link, the switching device of the network small computer system interface session link comprises: a detecting module, a judging module and a switching module;
    所述检测模块,设置为在启动器和目标器之间建立网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量;The detecting module is configured to detect a data transmission quality of a current iSCSI session link established between the initiator and the target after establishing a network small computer system interface iSCSI session link between the initiator and the target device;
    所述判断模块,设置为判断所述当前iSCSI会话链路的数据传输质量是否符合预设切换条件;The determining module is configured to determine whether the data transmission quality of the current iSCSI session link meets a preset switching condition;
    所述切换模块,设置为如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,则切换所述启动器和目标器之间的iSCSI会话链路。The switching module is configured to switch an iSCSI session link between the initiator and the target if the data transmission quality of the current iSCSI session link meets a preset switching condition.
  7. 如权利要求6所述的网络小型计算机系统接口会话链路的切换装置,其中,所述检测模块在启动器和目标器之间建立网络小型计算机系统接口iSCSI会话链路后,检测所述启动器和目标器之间建立的当前iSCSI会话链路的数据传输质量包括:The apparatus for switching a network small computer system interface session link according to claim 6, wherein said detecting module detects said initiator after establishing a network small computer system interface iSCSI session link between the initiator and the target The data transmission quality of the current iSCSI session link established with the target includes:
    每隔预设间隔时间在所述启动器和目标器之间的所有iSCSI会话链路上发送多个预设测试报文,计算预设时间内每一个iSCSI会话链路上预设测试报文的超时报文个数和/或应答报文平均时长。Sending a plurality of preset test packets on all the iSCSI session links between the initiator and the target at a preset interval, and calculating a preset test packet on each iSCSI session link within a preset time period. The number of timeout packets and/or the average duration of response packets.
  8. 如权利要求7所述的网络小型计算机系统接口会话链路的切换装置,其中,所述如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件,所述切换模块则切换所述启动器和目标器之间的iSCSI会话链路包括:The apparatus for switching a network small computer system interface session link according to claim 7, wherein said switching module switches said startup if said data transmission quality of said current iSCSI session link meets a preset switching condition The iSCSI session link between the device and the target includes:
    如果所述当前iSCSI会话链路上的所述超时报文个数超过预设数量或所述应答报文平均时长超过预设时间,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为预设iSCSI会话链路。If the number of the timeout packets on the current iSCSI session link exceeds a preset number or the average duration of the response message exceeds a preset time, the current iSCSI session link is frozen, and the initiator and the initiator are The current iSCSI session link between the targets switches to the default iSCSI session link.
  9. 如权利要求8所述的网络小型计算机系统接口会话链路的切换装置,其中,所述如果所述当前iSCSI会话链路的数据传输质量符合预设切换条件, 则所述切换模块切换所述启动器和目标器之间的iSCSI会话链路还包括:The apparatus for switching a network small computer system interface session link according to claim 8, wherein if the data transmission quality of the current iSCSI session link meets a preset switching condition, Then, the switching module switches the iSCSI session link between the initiator and the target device, and further includes:
    如果所述当前iSCSI会话链路与所有iSCSI会话链路中超时报文个数最少的备选iSCSI会话链路之间的超时报文数量差大于预设数量差,或所述当前iSCSI会话链路与所有iSCSI会话链路中应答报文平均时长最短的备选iSCSI会话链路之间的应答报文平均时间差大于预设时间差,则冻结所述当前iSCSI会话链路,将所述启动器和目标器之间的当前iSCSI会话链路切换为所述备选iSCSI会话链路。If the difference between the number of timeout packets between the current iSCSI session link and the candidate iSCSI session link with the smallest number of timeout packets in all iSCSI session links is greater than a preset number difference, or the current iSCSI session link is The average time difference of the response packets between the candidate iSCSI session links with the shortest average response time of all the iSCSI session links is greater than the preset time difference, and the current iSCSI session link is frozen, and the initiator and the target are The current iSCSI session link between the switches is switched to the alternate iSCSI session link.
  10. 如权利要求7至9中任一项所述的网络小型计算机系统接口会话链路的切换装置,其中,所述预设测试报文为iSCSI协议中定义的Nopout报文;所述应答报文为iSCSI协议中定义的Nopin报文。The apparatus for switching a network small computer system interface session link according to any one of claims 7 to 9, wherein the preset test message is a Nopout message defined in the iSCSI protocol; the response message is Nopin packet defined in the iSCSI protocol.
  11. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现权利要求1至5任意一项所述的网络小型计算机系统接口会话链路的切换方法。 A computer readable storage medium storing computer executable instructions for performing a method of switching a network small computer system interface session link according to any one of claims 1 to 5 when executed by a processor.
PCT/CN2016/086026 2015-08-25 2016-06-16 Method and apparatus for switching internet small computer system interface session link WO2017032147A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510526738.6 2015-08-25
CN201510526738.6A CN106487826A (en) 2015-08-25 2015-08-25 The changing method of network small computer system interface session link and device

Publications (1)

Publication Number Publication Date
WO2017032147A1 true WO2017032147A1 (en) 2017-03-02

Family

ID=58099449

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/086026 WO2017032147A1 (en) 2015-08-25 2016-06-16 Method and apparatus for switching internet small computer system interface session link

Country Status (2)

Country Link
CN (1) CN106487826A (en)
WO (1) WO2017032147A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3618292B1 (en) 2018-08-31 2023-12-06 KNORR-BREMSE Systeme für Nutzfahrzeuge GmbH System and method for establishing an intervehicle communication
CN112039727B (en) * 2020-08-26 2022-04-01 北京字节跳动网络技术有限公司 Data transmission method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030079018A1 (en) * 2001-09-28 2003-04-24 Lolayekar Santosh C. Load balancing in a storage network
US20050138466A1 (en) * 2003-12-19 2005-06-23 Spry Andrew J. Method and apparatus for supporting legacy mode fail-over driver with ISCSI network entity including multiple redundant controllers
CN101237314A (en) * 2008-01-16 2008-08-06 杭州华三通信技术有限公司 A method and access device for guaranteeing duplication service transmission
CN101651559A (en) * 2009-07-13 2010-02-17 浪潮电子信息产业股份有限公司 Failover method of storage service in double controller storage system
CN104009873A (en) * 2014-06-11 2014-08-27 华为技术有限公司 Processing method and device for iSCSI

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030079018A1 (en) * 2001-09-28 2003-04-24 Lolayekar Santosh C. Load balancing in a storage network
US20050138466A1 (en) * 2003-12-19 2005-06-23 Spry Andrew J. Method and apparatus for supporting legacy mode fail-over driver with ISCSI network entity including multiple redundant controllers
CN101237314A (en) * 2008-01-16 2008-08-06 杭州华三通信技术有限公司 A method and access device for guaranteeing duplication service transmission
CN101651559A (en) * 2009-07-13 2010-02-17 浪潮电子信息产业股份有限公司 Failover method of storage service in double controller storage system
CN104009873A (en) * 2014-06-11 2014-08-27 华为技术有限公司 Processing method and device for iSCSI

Also Published As

Publication number Publication date
CN106487826A (en) 2017-03-08

Similar Documents

Publication Publication Date Title
US10263829B2 (en) Network element reachability
US8306039B2 (en) Methods and systems for automatic transport path selection for multi-homed entities in stream control transmission protocol
CA2770791C (en) System, method, computer program for multidirectional pathway selection
US8868998B2 (en) Packet communication apparatus and packet communication method
US8189488B2 (en) Failback to a primary communications adapter
US9350665B2 (en) Congestion mitigation and avoidance
CA2311197A1 (en) Enhanced dual counter rotating ring network control system
US9838245B2 (en) Systems and methods for improved fault tolerance in solicited information handling systems
WO2005094004A1 (en) Methods and devices for high network availability
US10516599B1 (en) Link priority for loop-protect
CN102624584A (en) Link detection method and link detection device
US9503343B2 (en) Method and system for detecting network topology change
WO2015096149A1 (en) Tcp link configuration method, apparatus and device
US10541904B2 (en) Establishing a network fault detection session
US10581669B2 (en) Restoring control-plane connectivity with a network management entity
WO2019174454A1 (en) Link recovery method and device, system, storage medium, and electronic device
JP2007180891A (en) Communication device, packet transmission control method used therefor, and program
Qin et al. Analysis for TCP in data center networks: Outcast and Incast
WO2017032147A1 (en) Method and apparatus for switching internet small computer system interface session link
CN112866338B (en) Server state detection method and device
CN114363147B (en) Improved error handling for medium access control security
WO2017206785A1 (en) Network element, protection switching method and system, and storage medium
US10887207B2 (en) System and method for determining branch gateway device availability in computer networks
Konidis et al. Evaluating traffic redirection mechanisms for high availability servers
CN106301835B (en) BFD link establishing method and device and router

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16838407

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16838407

Country of ref document: EP

Kind code of ref document: A1