Fibre channel fc protocol simulation network system and fc receiving end point simulation method

By configuring a simulated virtual structure on general network equipment, pure software simulation of the Fibre Channel (FC) protocol was achieved, solving the problems of dependence on expensive equipment and uncontrollable response behavior in R&D, and realizing low-cost and efficient FC SAN testing.

CN123145191APending Publication Date: 2026-11-20BEIJING TENGLING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611464439.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-20
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In existing technologies, it is difficult for researchers to comprehensively test the anomaly handling capabilities of Fibre Channel Storage Area Network (FC SAN) devices under low-cost and controllable conditions because they rely on expensive dedicated storage devices and have fixed firmware behavior, making it impossible to simulate response behavior under specific conditions.

Method used

A Fibre Channel FC protocol emulation network system is provided. By configuring a emulation virtual structure on a general network device, including a UDP encapsulation adaptation layer, a virtual hardware abstraction layer, an FC protocol stack processing layer, and an upper application layer, it achieves pure software emulation of the FC target side's functions. It can simulate specific LUN offline, inject response delay, and return specific SCSI error codes.

Benefits of technology

It reduces the hardware cost of FC protocol learning and R&D testing, enables precise control over the target party's response behavior, shortens the R&D cycle, improves test coverage and reliability, and supports parallel software and hardware development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123145191A_ABST
    Figure CN123145191A_ABST
Patent Text Reader

Abstract

The application provides an FC protocol simulation network system and an FC receiving endpoint simulation method. The system comprises an FC sending endpoint, an FC receiving endpoint and a simulation switching device. The FC receiving endpoint is configured with a simulation virtual structure, comprising a UDP encapsulation adaptation layer, a virtual hardware abstraction layer, an FC protocol stack processing layer and an upper application layer. The UDP encapsulation adaptation layer receives a UDP message, identifies a simulation message and extracts an FC frame based on a UDP port number; the virtual hardware abstraction layer simulates an FC physical port interrupt and delivers the FC frame to the FC protocol stack processing layer; the FC protocol stack processing layer extracts an IO request in SCSI format and delivers the IO request to the upper application layer; and the upper application layer performs a storage operation on a back-end virtual storage system based on the IO request in SCSI format. The system realizes pure software simulation of an FC target function, gets rid of dependence on a special storage device and reduces FC research and development test cost; and a response behavior can be customized, a LUN can be simulated to be offline, a delay can be injected and a SCSI error code can be returned to test an exception processing capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a simulation method for a Fibre Channel FC protocol simulation network system and an FC receiver endpoint. Background Technology

[0002] In the learning, equipment development, and debugging of the FC protocol, the Target is one of the core endpoints in building the Fibre Channel Storage Area Network (FC SAN) test environment. Developers need to receive and process input / output (IO) requests from the initiator through the Target to verify the correctness and stability of the storage protocol stack, as well as the protocol interaction process of the entire network.

[0003] Obtaining target functionality in R&D and debugging scenarios typically relies on dedicated storage devices or servers with FC ports. These devices are expensive, have long procurement cycles, and are complex to configure, often making them difficult to obtain in the early stages of R&D. Furthermore, the firmware behavior of storage devices is fixed, making it impossible for developers to precisely control their response behavior under different conditions. For example, it's impossible to simulate specific LUN offline events, inject latency, or return specific SCSI error codes, making it difficult to comprehensively test the receiver and switch's processing capabilities under various abnormal conditions. Summary of the Invention

[0004] In view of this, this application provides a simulation network system for the Fibre Channel FC protocol and a simulation method for the FC receiving endpoint, so as to realize low-cost FC protocol learning, research and development and debugging.

[0005] This application provides a Fibre Channel FC protocol simulation network system, the system including: an FC transmitting endpoint, an FC receiving endpoint, and at least one simulation switching device between the FC transmitting endpoint and the FC receiving endpoint; the FC receiving endpoint is configured with a simulation virtual structure; the simulation virtual structure includes, in order from bottom to top: a UDP encapsulation adaptation layer, a virtual hardware abstraction layer, an FC protocol stack processing layer, and an upper application layer; The UDP encapsulation and adaptation layer, based on the UDP port number carried in the UDP header of the UDP packet forwarded by the FC sending endpoint via the emulation switching device, identifies the UDP packet as an emulation packet carrying Fibre Channel emulation data, then strips the header of the UDP packet, extracts the complete FC frame from the UDP packet, and transmits it to the virtual hardware abstraction layer. The virtual hardware abstraction layer simulates a hardware interrupt when the FC physical port receives a frame, and passes the FC frame to the FC protocol stack processing layer. The FC protocol stack processing layer extracts SCSI format I / O requests from the FC frame and passes the SCSI format I / O requests to the upper application layer, so that the upper application layer performs corresponding storage operations on the backend virtual storage system based on the SCSI format I / O requests.

[0006] This application embodiment also provides a simulation method for a Fibre Channel FC receiver endpoint, which configures a simulation virtual structure on a network device; the simulation virtual structure includes, in order from bottom to top: a UDP encapsulation adaptation layer, a virtual hardware abstraction layer, an FC protocol stack processing layer, and an upper application layer; The UDP encapsulation and adaptation layer is used to receive UDP packets forwarded from the FC sending endpoint via the emulation switching device. Based on the UDP port number carried in the UDP header of the UDP packet, it identifies that the UDP packet is an emulation packet carrying Fibre Channel emulation data. Then, it strips the header of the UDP packet, extracts the complete FC frame from the UDP packet, and transmits it to the virtual hardware abstraction layer. The virtual hardware abstraction layer is used to simulate a hardware interrupt when the FC physical port receives a frame and to pass the FC frame to the FC protocol stack processing layer. The FC protocol stack processing layer is used to extract SCSI format I / O requests from the FC frame and pass the SCSI format I / O requests to the upper application layer. The upper application layer is used to perform corresponding storage operations on the backend virtual storage system based on the SCSI format IO requests.

[0007] As can be seen from the above technical solution, the FC receiving endpoint simulation system provided in this embodiment is configured with a simulation virtual structure. This simulation virtual structure includes, from bottom to top, a UDP encapsulation adaptation layer, a virtual hardware abstraction layer, an FC protocol stack processing layer, and an upper application layer. The UDP encapsulation adaptation layer receives UDP packets forwarded from the FC sending endpoint via the simulation switching device, identifies the simulation packets, and extracts the complete FC frame. The virtual hardware abstraction layer simulates the interrupt behavior of the FC physical port and delivers the FC frame to the FC protocol stack processing layer. The FC protocol stack processing layer extracts SCSI format IO requests from the FC frame and passes them to the upper application layer. The upper application layer performs corresponding storage operations on the backend virtual storage system according to the SCSI format IO requests. The various layers work together to completely realize the behavior simulation of the FC target endpoint, that is, the pure software simulation of the FC target function is realized through the simulation virtual structure.

[0008] This simulation method, based on a pure software layered architecture, compared to the method in the background technology that relies on dedicated storage devices to realize the functions of the FC target, not only eliminates the dependence on expensive dedicated storage hardware and physical servers, significantly reducing the hardware costs of FC protocol learning, research and development and testing, but also allows developers to precisely control the response behavior of the target under different conditions through a software-based simulation virtual structure to replace the fixed hardware firmware, such as simulating specific LUN offline, injecting response delay, and returning specific SCSI error codes, thereby enabling comprehensive testing of the fault tolerance and processing logic of the initiator and the switch under various abnormal conditions.

[0009] Furthermore, the pure software implementation allows for rapid deployment and flexible expansion of the simulated receiving endpoint on general-purpose computing devices. Researchers can conduct switch integration testing without waiting for dedicated storage devices to become available, enabling parallel software and hardware development and shortening the development cycle. Simultaneously, the target's protocol behavior is fully controllable, and abnormal scenarios can be accurately reproduced, improving test coverage and reliability. Attached Figure Description

[0010] The accompanying drawings, which are incorporated in and form part of this application, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0011] Figure 1 System architecture diagram provided for embodiments of this application; Figure 2 This is a schematic diagram of the virtual simulation structure in the FC receiving endpoint provided in the embodiments of this application; Figure 3 A flowchart illustrating the transmission of FC frames by an FC receiving endpoint as provided in this application embodiment; Figure 4 A flowchart illustrating the FC receiving endpoint receiving an FC response frame provided in this application embodiment; Figure 5 This is an interactive diagram of the FC receiving endpoint login process provided in an embodiment of this application; Figure 6 The interactive flowchart of the simulation network provided in the embodiments of this application is shown. Detailed Implementation

[0012] To make the methods provided in the embodiments of this application easier to understand, the methods provided in this application will be described in detail below with reference to the accompanying drawings and embodiments.

[0013] Before introducing the solutions provided in the embodiments of this application, the relevant technical terms will be explained: FC is a high-speed serial transmission protocol standard designed to overcome the limitations of traditional parallel buses (such as SCSI) in terms of transmission rate, distance, and number of connected devices. SCSI is an abbreviation for Small Computer System Interface.

[0014] The FC protocol not only defines data transmission rules but also specifies the characteristics of physical interfaces and transmission media (such as optical fibers and copper cables). It supports bandwidths from 1Gbps to 128Gbps and even higher, and features high bandwidth, low latency, and low bit error rate (e.g., less than...). It has strong resistance to electromagnetic interference. Gbps is an abbreviation for Gigabit per second.

[0015] Similar to the Open System Interconnection (OSI) network model, the FC protocol can adopt the following five-layer structure: 1. FC-0 (Physical Layer): Defines the physical characteristics of components such as cables, connectors, and optical modules; 2. FC-1 (Transmission Protocol Layer): Defines the encoding / decoding methods for data (such as 8B / 10B or 64B / 66B encoding), etc. 3. FC-2 (Signaling Protocol Layer): This is the core of the FC protocol, defining frame format, flow control mechanisms (such as cache-cache credit mechanism), quality of service, and data fragmentation and reassembly rules, etc. 4. FC-3 (Public Service Layer): Provides advanced services such as data encryption, compression, and multi-port striping; 5. FC-4 (Protocol Mapping Layer): Allows upper-layer protocols (such as SCSI, IP, etc.) to be mapped to FC protocol transmission; common mappings include FCP (SCSI over FC), which enables the transmission of SCSI commands and data over FC networks.

[0016] The following describes the architecture of a Fibre Channel Storage Area Network (FC SAN): An FC SAN is a dedicated high-speed block-level storage network built on the FC protocol, used to enable interconnection and communication between servers, FC switches, and storage devices. For example, a typical FC SAN may include four parts: an initiator, a switching fabric, a target, and the FC protocol. | Initiator |<----- FC protocol----->| Fabric |<----- FC protocol----->| Target|.

[0017] Specifically, the Initiator (server) acts as the data consumer, i.e., the data requester, running applications and operating systems, and needs to read and write data on the storage device.

[0018] The initiator includes a key component: the Host Bus Adapter (HBA). This dedicated card, installed in the server's PCIe slot, provides an FC port to translate the server's internal bus protocols (such as PCIe) into FC protocols for data transmission within the SAN. The HBA possesses a 64-bit Globally Unique Name (WWN) to uniquely identify the server's FC port within the SAN. PCIE stands for Peripheral Component Interconnect Express. For Fabric (a switching architecture consisting of one or more FC switches), it serves as the core connectivity device of the SAN, responsible for intelligently routing and exchanging FC frames between the Initiator and the Target.

[0019] Based on the above description, in the FC field, native FC SAN technology is currently commonly used to learn, develop, and debug the FC protocol. Specifically, native FC SAN technology is the most original and standard implementation of the FC protocol. It relies entirely on dedicated FC physical layers (fiber optic / copper cables), FC host bus adapters (HBAs), and FC switches to build an independent, closed, high-speed storage network. In this network, the server (Initiator) and the target (storage device) communicate directly with the switch (Fabric) via the FC protocol. Based on this, the FC SAN built using the aforementioned dedicated FC hardware is used to learn, develop, and debug the FC protocol.

[0020] In R&D and debugging scenarios, the Initiator, Target, and Fabric in an FC SAN all rely on dedicated equipment. The Target typically depends on a dedicated storage device or server with an FC port. These devices are expensive, have long procurement cycles, and are complex to configure, often making them difficult to obtain in the early stages of R&D. Furthermore, the firmware behavior of storage devices is fixed, making it impossible for developers to precisely control their response behavior under different conditions. For example, it's impossible to simulate specific LUN offline events, inject latency, or return specific SCSI error codes, making it difficult to comprehensively test the receiver and switch's processing capabilities under various abnormal conditions.

[0021] To address the aforementioned issues, embodiments of this application provide a Fibre Channel FC protocol simulation network system and a simulation method for FC receiving endpoints.

[0022] To facilitate understanding of this solution, let's first combine... Figure 1 The system architecture diagram provided in the embodiments of this application is described as follows: See Figure 1 , Figure 1 This is a system architecture diagram provided for an embodiment of this application. Figure 1 As shown, the FC protocol emulation network system includes: an FC transmitting endpoint, at least one emulation switching device, and an FC receiving endpoint. The FC transmitting endpoint, the emulation switching device, and the FC receiving endpoint are connected via an Internet Protocol network.

[0023] The FC receiver endpoint simulates the behavior of the target (i.e., the storage device) in a real FC SAN by setting up a virtual structure on a general-purpose network device (such as a general-purpose server). This virtual structure, in a bottom-up order, includes: a UDP encapsulation and adaptation layer, a virtual hardware abstraction layer, an FC protocol stack processing layer, and an upper application layer. The specific workflow of each layer in the FC receiver endpoint will be explained in detail later and will not be elaborated here.

[0024] Optionally, the emulated switching device and the FC transmitting endpoint can also be implemented by deploying emulated virtual structures on general network devices to realize the function of FC protocol emulation nodes. The emulated switching device is used to simulate the behavior of the switching fabric (i.e., FC switch) in a real FC SAN, and the FC transmitting endpoint is used to simulate the behavior of the initiator (i.e., server HBA) in a real FC SAN.

[0025] It should be noted that the FC transmitting endpoint, the emulation switching device, and the FC receiving endpoint can all be referred to as emulation nodes. The emulation nodes communicate with each other via UDP packets carrying FC frames, using the Internet Protocol network to simulate data transmission over a physical Fibre Channel link.

[0026] In this embodiment, the general-purpose network device is distinguished from the dedicated FC device. The general-purpose network device is a general-purpose computing device with network communication capabilities (running an operating system, IP protocol stack, etc.). The FC transmitting endpoint, the emulation switching device, and the FC receiving endpoint are all deployed on the general-purpose network device. The network interface provided by the operating system, rather than the physical FC port, is used to complete the sending and receiving of UDP packets, thereby realizing the emulation interaction of the FC protocol on the IP network.

[0027] The following is combined Figure 2 and Figure 3 The virtual simulation structure and its operation process in the FC receiver endpoint are described in detail: See Figure 2 , Figure 2 This is a schematic diagram of the virtual simulation structure in the FC receiving endpoint provided in an embodiment of this application. Figure 2 As shown, the FC receiving endpoint is implemented by configuring a simulated virtual structure on a general network device. This simulated virtual structure includes, in order from bottom to top: UDP encapsulation and adaptation layer, virtual hardware abstraction layer, FC protocol stack processing layer, and upper application layer.

[0028] exist Figure 2 Based on the simulated virtual structure shown, the following section elaborates on the specific processes of each layer in the FC receiver endpoint when receiving and processing FC frames.

[0029] See Figure 3 , Figure 3 This is a flowchart illustrating how an FC receiving endpoint receives and processes FC frames, as provided in an embodiment of this application.

[0030] like Figure 3 As shown, the process may include the following steps: In step S301, the UDP encapsulation and adaptation layer identifies the UDP packet as a simulation packet carrying Fibre Channel simulation data based on the UDP port number carried in the UDP header of the UDP packet forwarded by the FC sending endpoint via the simulation switching device. Then, it strips the header of the UDP packet, extracts the complete FC frame from the UDP packet, and transmits it to the virtual hardware abstraction layer.

[0031] In this embodiment, the FC sending endpoint encapsulates the FC frame as the sole data payload of the UDP packet and forwards it to the FC receiving endpoint via the emulated switching device.

[0032] The FC receiver endpoint binds to its configured UDP port number through the network interface (Socket API) provided by the operating system, listening for UDP packets from the IP network. When the operating system receives a UDP packet with the destination address being the local device's IP address and the destination port being the UDP port number bound to the local device, it strips the Ethernet header and IP header from the UDP packet and calls the receive function interface of the UDP encapsulation adapter layer through the network interface provided by the operating system, passing the UDP packet to the UDP encapsulation adapter layer.

[0033] After receiving a UDP packet, the UDP encapsulation adapter layer of the FC receiver endpoint retrieves the specified UDP port number corresponding to this FC receiver endpoint from the configuration file and checks the destination port number in the UDP packet header. When the destination port number carried in the UDP packet header matches the specified UDP port number bound to this FC receiver endpoint, the UDP packet is determined to be a simulation packet carrying Fibre Channel simulation data. Subsequently, the UDP encapsulation adapter layer strips the UDP header, extracts the complete FC frame from the UDP payload, and calls the receive function interface of the Virtual Hardware Abstraction Layer to pass the FC frame to the Virtual Hardware Abstraction Layer.

[0034] Optionally, as an embodiment, the upper application layer, located above the FC protocol stack processing layer, obtains a configuration file during the simulation network initialization phase (the simulation network initialization phase will be described later and will not be repeated here). The configuration file contains the pre-configured IP addresses and specified UDP port numbers of each simulation node. The UDP encapsulation and adaptation layer obtains the specified UDP port number corresponding to its FC receiving endpoint from the locally pre-configured configuration file. When the destination port number carried in the UDP packet header matches the specified UDP port number obtained from the configuration file, the UDP packet is determined to be a simulation packet carrying Fibre Channel simulation data.

[0035] In step S302, the virtual hardware abstraction layer simulates the hardware interrupt of the FC physical port receiving the frame and passes the FC frame to the FC protocol stack processing layer.

[0036] After the virtual hardware abstraction layer's receive function interface is called, it simulates a hardware interrupt when the FC physical port receives a frame. The FC frame is then passed to the FC protocol stack processing layer by calling the FC protocol stack processing layer's receive function interface.

[0037] In step S303, the FC protocol stack processing layer extracts the SCSI format IO request from the FC frame and passes the SCSI format IO request to the upper application layer so that the upper application layer can perform corresponding storage operations on the backend virtual storage system based on the SCSI format IO request.

[0038] In this embodiment, after the receive function interface of the FC protocol stack processing layer is called, the FC frame is parsed, the SCSI format IO request is extracted from the payload of the FC frame, and the SCSI format IO request is passed to the upper application layer.

[0039] Optionally, as an example, the upper application layer also provides a configuration interface for creating and configuring virtual storage spaces in the backend virtual storage system. The virtual storage space includes at least a LUN of specified capacity and type, and specified response characteristics of the created LUN. After receiving a SCSI-formatted IO request, the upper application layer determines the corresponding backend virtual storage space based on the LUN information carried in the SCSI-formatted IO request and the already configured virtual storage spaces of the storage system.

[0040] In this embodiment, after the receive function interface of the FC protocol stack processing layer is called, the FC frame is parsed to obtain the frame type and payload content (the payload content is an IO request or SCSI data in SCSI format). The FC protocol stack processing layer performs the corresponding processing operation according to the frame type.

[0041] If the FC frame is an FCP_CMND command frame, the FC protocol stack processing layer extracts the SCSI format I / O request from the FC frame payload and passes it to the upper application layer. The upper application layer determines the corresponding backend virtual storage space based on the LUN information carried in the SCSI format I / O request. If the SCSI format I / O request is a read command, data is read from the backend virtual storage space to obtain the read operation result, and an FC response frame is subsequently generated. If the SCSI format I / O request is a write command, data is written to the backend virtual storage space to obtain the write operation result, such as receiving a subsequent FCP_DATA data frame, performing the corresponding write operation, and generating an FC response frame indicating whether the write was successful or failed upon completion.

[0042] If the FC frame is of type FCP_DATA, the FC protocol stack processing layer extracts SCSI data from the FC frame payload and passes the SCSI data to the upper application layer. The upper application layer determines the corresponding backend virtual storage space based on the LUN information carried in the FCP_CMND command frame associated with the FCP_DATA frame and writes the SCSI data to the backend virtual storage space.

[0043] If the FC frame is of a different frame type, it will be processed according to the FC protocol standard.

[0044] This concludes the process. Figure 3 The process is shown below.

[0045] pass Figure 3As shown in the flowchart, the FC receiving endpoint provided in this embodiment is configured with a simulated virtual structure. This simulated virtual structure includes, from bottom to top, a UDP encapsulation adaptation layer, a virtual hardware abstraction layer, an FC protocol stack processing layer, and an upper application layer. The UDP encapsulation adaptation layer receives UDP packets forwarded from the FC sending endpoint via the simulated switching device, identifies the simulated packet based on the UDP port number, and extracts the complete FC frame. The virtual hardware abstraction layer simulates the hardware interrupt of the FC physical port receiving the frame and delivers the FC frame to the FC protocol stack processing layer. The FC protocol stack processing layer extracts SCSI format IO requests from the FC frame and passes them to the upper application layer. The upper application layer performs corresponding storage operations on the backend virtual storage system based on the SCSI format IO requests. The layers work together to completely realize the behavior simulation of the FC target endpoint, that is, the pure software simulation of the FC target function is realized through the simulated virtual structure.

[0046] This simulation method, based on a pure software layered architecture, compared to the method in the background technology that relies on dedicated storage devices to realize the functions of the FC target, not only eliminates the dependence on expensive dedicated storage hardware and physical servers, significantly reducing the hardware costs of FC protocol learning, research and development and testing, but also allows developers to precisely control the response behavior of the target under different conditions through a software-based simulation virtual structure to replace the fixed hardware firmware, such as simulating specific LUN offline, injecting response delay, and returning specific SCSI error codes, thereby enabling comprehensive testing of the fault tolerance and processing logic of the initiator and the switch under various abnormal conditions.

[0047] Furthermore, the pure software implementation allows for rapid deployment and flexible expansion of the simulated receiving endpoint on general-purpose computing devices. Researchers can conduct switch integration testing without waiting for dedicated storage devices to become available, enabling parallel software and hardware development and shortening the development cycle. Simultaneously, the target's protocol behavior is fully controllable, and abnormal scenarios can be accurately reproduced, improving test coverage and reliability.

[0048] The following section provides a detailed explanation of the process by which the FC receiving endpoint returns a response frame.

[0049] After the FC receiving endpoint performs the storage operation, it generates a response frame based on the execution result and returns the response frame to the FC sending endpoint.

[0050] See Figure 4 , Figure 4 A flowchart illustrating the FC receiving endpoint returning a response frame as provided in an embodiment of this application.

[0051] like Figure 4 As shown, the process may include the following steps: In step S401, after the upper application layer performs the storage operation, it returns the execution result to the FC protocol stack processing layer.

[0052] In this embodiment, after the upper application layer performs the corresponding storage operation according to the SCSI format IO request, it returns the execution result (including the read operation result or the write operation result) to the FC protocol stack processing layer.

[0053] Specifically, the upper application layer performs the corresponding storage operation based on the type of SCSI format IO request (read command or write command), obtains the execution result, and returns the execution result to the FC protocol stack processing layer.

[0054] Specifically, if the SCSI format I / O request is a read command, the upper application layer determines the corresponding backend virtual storage space based on the LUN information carried in the SCSI format I / O request, reads data from the backend virtual storage space, and obtains the read operation result (including the read data and read status). The upper application layer returns the read operation result to the FC protocol stack processing layer.

[0055] If the SCSI format I / O request is a write command, the upper application layer determines the corresponding backend virtual storage space based on the LUN information carried in the SCSI format I / O request, writes the SCSI data carried in the subsequently received associated FCP_DATA data frame into the backend virtual storage space, and obtains the write operation result (including the write status, such as success or failure). The upper application layer returns the write operation result to the FC protocol stack processing layer.

[0056] If the SCSI format IO request is another type of SCSI command (such as a query command, control command, etc.), the upper application layer will perform the corresponding control or query operation according to the command type, obtain the corresponding operation result, and return the operation result to the FC protocol stack processing layer.

[0057] In step S402, the FC protocol stack processing layer constructs a complete FC response frame based on the execution result, determines the IP address and specified UDP port number of the emulated switching device as the next hop, and passes the FC response frame, IP address and specified UDP port number to the UDP encapsulation adapter layer through the virtual hardware abstraction layer.

[0058] In this embodiment, if the execution result is a read operation result, the FC protocol stack processing layer constructs an FCP_DATA response frame based on the read data and uses the read data as the payload of the FCP_DATA response frame; if the execution result is a write operation result or a SCSI command execution status, the FC protocol stack processing layer constructs an FCP_RSP response frame based on the write status or execution status and carries the SCSI execution status code (such as GOOD or CHECK CONDITION).

[0059] The FC protocol stack processing layer constructs a complete FC response frame based on the execution result returned by the upper application layer. This FC response frame includes a start delimiter, a Fibre Channel frame header, a data payload, a cyclic redundancy check (CRC) code, and an end delimiter.

[0060] Simultaneously, the FC protocol stack processing layer determines the IP address and designated UDP port number of the emulated switch device to serve as the next hop. Specifically, there are two methods for determining the next hop: one is to obtain the IP address and designated UDP port number of the emulated switch device directly connected to the FC receiving endpoint from a pre-configured configuration file, using this as the next hop address; the other is to look up the destination FC_ID in the FC response frame header in a pre-defined mapping table to determine the IP address and UDP port number of the emulated switch device corresponding to the destination FC_ID, using this as the next hop address. The mapping table records the correspondence between the destination FC_ID and the IP address and designated UDP port number of the emulated switch device.

[0061] The FC protocol stack processing layer transmits the FC response frame, the IP address of the next-hop emulated switch, and the specified UDP port number to the UDP encapsulation adapter layer by calling the send function interface of the virtual hardware abstraction layer.

[0062] In step S403, the UDP encapsulation adapter layer uses the IP address as the destination address of the IP header corresponding to the UDP packet, uses the specified UDP port number as the destination port number of the UDP header, encapsulates the FC response frame as the unique data payload of the UDP packet into the UDP packet, and uses the Internet Protocol network to simulate the data transmission of the Fibre Channel physical link to send the UDP packet to the simulated switching device.

[0063] After receiving the FC response frame and the IP address and specified UDP port number of the next-hop emulated switch, the UDP encapsulation and adaptation layer uses the complete FC response frame as the data payload of the UDP packet (without adding any custom headers). It constructs the UDP header: the source port is the local port, and the destination port number is the specified UDP port number of the next-hop emulated switch. Subsequently, the UDP encapsulation and adaptation layer calls the standard Socket API, and the operating system network stack constructs the IP header: the source IP is the local IP address, the destination IP is the IP address of the next-hop emulated switch, and the protocol number indicates that the upper layer is using the UDP protocol. Finally, a complete UDP / IP / Ethernet packet is formed and sent to the emulated switch through the physical network card. This UDP packet does not add any emulation protocol headers; the specified UDP port number indicates that this UDP packet is an emulation packet carrying Fibre Channel emulation data.

[0064] This concludes the process. Figure 4 The process is shown below.

[0065] pass Figure 4As shown in the process, the FC receiving endpoint performs storage operations through the upper application layer and returns the execution result. The FC protocol stack processing layer constructs an FC response frame based on the execution result and determines the next hop information. The UDP encapsulation and adaptation layer encapsulates the FC response frame into a UDP packet and sends it to the emulation switching device. The cooperation of each layer fully realizes the behavior of the FC target endpoint returning a response frame.

[0066] The process of constructing the mapping table is described in detail below.

[0067] In this embodiment, the configuration file contains a role identifier indicating that this device is an FC receiving endpoint. During the network simulation initialization phase, after the FC receiving endpoint is started, the upper application layer reads the role identifier in the configuration file, determines that this device is an FC receiving endpoint, and sends the IP address and UDP port number of each simulation node in the configuration file to the FC protocol stack processing layer.

[0068] The FC receiving endpoint initiates an FLOGI login request to the emulation switch to obtain its local FC_ID, and queries the name service to obtain the FC_ID assigned to each emulation node. The FC protocol stack processing layer constructs a mapping table based on the IP address and UDP port number of each emulation node in the configuration file, and the FC_ID assigned to each emulation node obtained through the name service query. This mapping table records the correspondence between the destination FC_ID and the IP address and specified UDP port number of the emulation switch, and is used by the FC protocol stack processing layer to determine the address information of the next-hop emulation switch when sending an FC response frame.

[0069] This concludes the description of the mapping relationship table construction process.

[0070] The following section details the process of obtaining the FC_ID by initiating the login procedure from the FC receiving endpoint.

[0071] In this embodiment, after the FC receiving endpoint is started, it needs to obtain the FC_ID through the login process before it can carry out subsequent FC message communication.

[0072] See Figure 5 , Figure 5 This diagram illustrates the login process of the FC receiving endpoint provided in this embodiment of the application. It shows the complete login process between the FC receiving endpoint and the emulated switching device via UDP message interaction.

[0073] like Figure 5As shown, after the FC receiving endpoint starts, the upper application layer reads the role identifier in the configuration file, determines that this device is the FC receiving endpoint, and calls the FC protocol stack processing layer to initiate the login process. The FC protocol stack processing layer generates a login FC frame conforming to the FC-FS standard for simulation. The destination FC_ID in the frame header of this login FC frame is a fixed FC_ID (0xFFFFFE), which indicates that the login FC frame is used to initiate a login request to obtain the FC_ID of the FC receiving endpoint. The FC protocol stack processing layer obtains the IP address and specified UDP port number of the simulated switching device from the configuration file, and passes the login FC frame, IP address, and specified UDP port number to the UDP encapsulation adapter layer through the virtual hardware abstraction layer.

[0074] The UDP encapsulation adapter layer uses this IP address as the destination address of the IP header corresponding to the UDP packet, and the specified UDP port number as the destination port number of the UDP header. It encapsulates the login FC frame as the sole data payload into the UDP packet and sends it to the simulation switching device via the IP network. This UDP packet does not include any simulation protocol header; the specified UDP port number indicates that this UDP packet is a simulation packet carrying Fibre Channel simulation data.

[0075] After receiving the login FC frame, the simulated switching device assigns the corresponding FC_ID to the FC receiving endpoint and returns a login FC response frame.

[0076] The UDP encapsulation adaptation layer of the FC receiver endpoint identifies the UDP packet as a simulation packet carrying Fibre Channel simulation data based on the UDP port number carried in the UDP header of the UDP packet originating from the emulated switching device. It then strips the UDP header, extracts the complete FC login response frame from the UDP packet, and transmits it to the virtual hardware abstraction layer. This UDP packet is the FC login response frame returned by the emulated switching device, carrying the FC_ID assigned to the FC receiver endpoint.

[0077] The virtual hardware abstraction layer simulates a hardware interrupt when the FC physical port receives a frame, and passes the FC login response frame to the FC protocol stack processing layer. The FC protocol stack processing layer parses the FC login response frame, extracts and saves the FC_ID assigned to the FC receiving endpoint, so that the FC receiving endpoint can use the FC_ID as the destination FC address to receive subsequent Fibre Channel frames.

[0078] This concludes the process. Figure 5 The process is shown below.

[0079] pass Figure 5As shown in the process diagram, the FC receiving endpoint obtains the FC_ID by initiating a login process with the emulated switching device. The emulated switching device assigns the FC_ID and returns a login response frame. After obtaining the FC_ID, the FC receiving endpoint can then receive subsequent FC messages.

[0080] Combination Figures 2 to 5 The FC protocol simulation network system provided in this application embodiment simulates the behavior of a target in a real FC SAN by configuring a simulated virtual structure on a general network device. This simulated virtual structure, in a bottom-up order, includes a UDP encapsulation adaptation layer, a virtual hardware abstraction layer, an FC protocol stack processing layer, and an upper-layer application layer. The UDP encapsulation adaptation layer receives UDP packets forwarded from the FC sending endpoint via the simulated switching device and extracts FC frames. The virtual hardware abstraction layer simulates the interrupt behavior of the FC physical port. The FC protocol stack processing layer extracts SCSI-formatted I / O requests from the FC frames and passes them to the upper-layer application layer. The upper-layer application layer performs corresponding storage operations on the backend virtual storage system based on the SCSI-formatted I / O requests. These layers work together to fully simulate the behavior of the FC target endpoint. Simultaneously, the FC receiving endpoint can initiate a login process to obtain the FC_ID and construct a response frame based on the execution result to return to the FC sending endpoint, thus realizing the complete functionality of the FC target endpoint.

[0081] Furthermore, in this embodiment, when the UDP encapsulation adapter layer receives a UDP packet forwarded from the FC sending endpoint via the emulation switching device, it obtains the specified UDP port number corresponding to the FC receiving endpoint from the configuration file; when the destination port number carried in the UDP packet header is consistent with the specified UDP port number obtained from the configuration file, it determines that the UDP packet is an emulation packet carrying Fibre Channel emulation data, thereby accurately distinguishing emulation packets from ordinary UDP traffic.

[0082] This concludes the description of the system embodiments of this application.

[0083] To illustrate the method provided in this application in more detail, the following will be combined with... Figure 6 The solution provided in this application will be described in more detail by way of specific embodiments.

[0084] To more clearly illustrate the specific implementation process of the FC protocol simulation network system provided in this application, a complete FC message interaction process is described in detail below. This embodiment covers the complete data flow and response return process between the FC transmitting endpoint, the simulation switching device, and the FC receiving endpoint.

[0085] In this embodiment, it is assumed that three general-purpose servers are deployed in the simulated network, serving as the FC transmitting endpoint, the simulated switching device, and the FC receiving endpoint, respectively. The FC transmitting endpoint, the simulated switching device, and the FC receiving endpoint are all configured with a simulated virtual structure on the general-purpose servers. This simulated virtual structure, in a bottom-up order, includes: a UDP encapsulation and adaptation layer, a virtual hardware abstraction layer, an FC protocol stack processing layer, and an upper-layer application layer.

[0086] The IP addresses and agreed UDP port numbers of the three devices are pre-configured through a configuration file.

[0087] The IP address of the FC sending endpoint is 192.168.1.10, and the UDP port number is 5000. The simulated switch device has an IP address of 192.168.1.100 and a UDP port number of 5001. The IP address of the FC receiver endpoint is 192.168.1.20, and the UDP port number is 5002.

[0088] Reference Figure 6 The process includes the following steps: I. Simulation Network Initialization and Login Process During the simulation network initialization phase, each simulation node first needs to obtain the FC_ID through a login process.

[0089] 1. After the FC transmitting endpoint starts, the upper application layer reads the locally pre-stored configuration file, obtains the IP address and specified UDP port number of each emulation node, and determines the role identifier of this device as the transmitting endpoint. Subsequently, the FC transmitting endpoint initiates the FLOGI login process to the emulation switching device.

[0090] Specifically, the upper application layer calls the send function interface of the FC protocol stack processing layer to send the FLOGI login frame. When the send function interface of the FC protocol stack processing layer is called, it generates a complete FLOGI frame conforming to the FC-FS standard for simulation based on the FLOGI login request. This complete Fibre Channel frame includes a start delimiter, a Fibre Channel frame header, a data payload, a cyclic redundancy check (CRC) code, and an end delimiter. The destination FC_ID in the frame header is 0xFFFFFE, which is preset by the simulation switching device. Subsequently, the FC protocol stack processing layer calls the send function interface of the virtual hardware abstraction layer to pass the FLOGI frame to the virtual hardware abstraction layer.

[0091] When the virtual hardware abstraction layer's send function interface is called, it transmits the FLOGI frame and the IP address and UDP port number of the simulated switching device to the UDP encapsulation adapter layer based on the IP address and UDP port number of the simulated switching device obtained from the configuration file, and then calls the send function interface of the UDP encapsulation adapter layer.

[0092] When the UDP encapsulation adapter layer's send function interface is called, it uses the IP address and UDP port number of the simulated switch as the destination address, encapsulates the FLOGI frame as the sole data payload into the UDP packet, and calls the operating system's network interface to send the UDP packet to the simulated switch. This UDP packet does not include any simulated protocol headers other than the UDP header.

[0093] 2. After the simulation switching device starts up, the upper application layer reads the locally pre-stored configuration file, obtains the IP address and specified UDP port number of each simulation node, and determines the role identifier of this device as a simulation switching device.

[0094] After receiving a UDP packet from the FC sending endpoint, the UDP encapsulation and adaptation layer of the emulated switching device identifies the UDP packet as an emulated packet based on the UDP port number carried in the UDP header. It then strips the UDP header, extracts the complete FLOGI frame from the UDP payload, and passes it to the FC protocol stack processing layer through the virtual hardware abstraction layer. The virtual hardware abstraction layer simulates a hardware interrupt when the FC physical port receives the frame, and delivers the FLOGI frame to the FC protocol stack processing layer.

[0095] After the FC protocol stack processing layer determines that the FLOGI frame is a login frame, it assigns an FC_ID (let's assume it's 0x010203) to the FC sending endpoint and records the mapping between the FC_ID and the IP address and UDP port number of the FC sending endpoint locally. Subsequently, the FC protocol stack generates a complete FLOGI_ACC login response frame conforming to the FC-FS standard, carrying the FC_ID.

[0096] The FC protocol stack processing layer passes the FLOGI_ACC login response frame to the UDP encapsulation adapter layer through the Virtual Hardware Abstraction Layer. The UDP encapsulation adapter layer uses this FLOGI_ACC login response frame as the sole data payload of a UDP packet, re-encapsulates the UDP packet with the specified UDP port number of the FC sending endpoint as the destination port number of the UDP header, and sends it to the FC sending endpoint over the IP network. Upon receiving the login response frame, the FC sending endpoint extracts and saves the FC_ID (0x010203).

[0097] The login process for the FC receiving endpoint is exactly the same as that for the FC sending endpoint. After the FC receiving endpoint starts, it also initiates an FLOGI login process to the emulated switching device. The emulated switching device assigns it an FC_ID (let's assume it's 0x040506) and records the corresponding relationship. After receiving the login response frame, the FC receiving endpoint obtains the FC_ID (0x040506) and saves it.

[0098] The FC protocol stack processing layer of the simulated switching device constructs a simulation routing table based on the mapping between the FC_ID assigned to each simulated node through the login process and the IP address and UDP port number in the configuration file. This simulation routing table records the mapping between the destination FC_ID and the IP address and UDP port number of the next-hop simulated node, which is used to determine the next-hop information in subsequent UDP packet forwarding.

[0099] At this point, each simulation node has completed the login process and obtained its FC_ID. The simulation switching device has completed the construction of its simulation routing table, and the simulation network has entered a ready state, ready for subsequent FC message communication. The FC protocol stack processing layer of the simulation switching device constructs the simulation routing table based on the correspondence between the FC_ID assigned to each simulation node through the login process and the IP address and UDP port number in the configuration file.

[0100] Destination FC_ID Next-hop IP address Next-hop UDP port number 0x010203 192.168.1.10 5001 0x040506 192.168.1.20 5002 II. FC transmitting endpoint sends FC frames 1. The upper-layer application module generates an I / O request: Reference Figure 6 As shown, the upper-layer application module of the FC sending endpoint (such as a simulated SCSI initiator) initiates a write operation, calls the interface of the FC protocol stack processing engine, and passes the IO request (including information such as operation type, data address, and data length) to the FC protocol stack processing engine.

[0101] 2. The FC protocol stack processing engine constructs FC frames: The FC protocol stack processing engine constructs a standard FC frame based on the FC protocol (FC-2 layer). This FC frame contains the following: SOF (Start Delimiter); FC frame header: source FC_ID is 0x010203 (FC address of the FC transmitting endpoint), destination FC_ID is 0x040506 (FC address of the FC receiving endpoint), sequence number, exchange ID, etc.; Data payload (e.g., SCSI command description block CDB); CRC check; EOF (End delimiter).

[0102] At this point, the FC frame is treated as a complete data block. The FC protocol stack processing engine calls the virtual hardware abstraction layer's sending interface to hand the FC frame over to the virtual hardware abstraction layer.

[0103] 3. The virtual hardware abstraction layer simulates the hardware behavior of the FC HBA and passes the FC frame to the UDP encapsulation adapter layer: The virtual HBA submodule in the virtual hardware abstraction layer simulates the behavior of FC HBA hardware, maintaining the mapping from FC ports to UDP receive ports and passing FC frames to the UDP encapsulation adapter layer. Simulating the behavior of FC HBA hardware means returning states such as "link activated" and "credit available" to the upper layer, making the FC protocol stack processing engine aware that the FC physical link is ready, but not actually operating the fiber optic cable; data will be transmitted through the IP network.

[0104] 4. The UDP encapsulation adapter layer performs UDP encapsulation: After receiving an FC frame, the UDP encapsulation adapter layer uses the complete FC frame as the data payload of the UDP packet (without adding any custom headers) and constructs the UDP header: Source port number: 5000; Destination port number: port 5001 of the emulated switch (because it needs to be sent to the emulated switch, which will then look up the destination FC_ID and forward it to the FC receiving endpoint, instead of sending it directly to the FC receiving endpoint). UDP length and checksum.

[0105] 5. Use the Socket API to construct the IP header and Ethernet header, and send them through the physical network card: The UDP encapsulation and adaptation layer calls the standard Socket API, and the operating system's network stack constructs the IP header. Source IP: IP address of the FC sending endpoint, 192.168.1.10; Destination IP: The IP address of the emulated switch device, 192.168.1.100; Protocol number: 17 (indicating that the upper layer is the UDP protocol).

[0106] The operating system further constructs the Ethernet header: Source MAC address: The MAC address of the physical network interface card (NIC) of the FC sending endpoint; Destination MAC address: The MAC address of the next-hop device (i.e., the directly connected device in the network segment where the default gateway or emulated switch is located), obtained through the ARP protocol.

[0107] Ultimately, a complete UDP / IP / Ethernet packet is formed, which is converted into an electrical or optical signal by the physical network interface card (NIC) and sent to the IP network. This packet is then forwarded hop-by-hop by routing devices within the IP network, eventually reaching the simulated switching device. The entire process utilizes the Internet Protocol (IP) network to simulate data transmission over a physical Fibre Channel link.

[0108] III. Simulated switching equipment forwarding FC frames After receiving a UDP packet from the FC sending endpoint, the emulated switching device (IP address 192.168.1.100, UDP port number 5000) processes it according to the following steps: 1. The operating system's network stack receives UDP packets: When the network interface card (NIC) of the simulated switching device receives an Ethernet frame, it removes the Ethernet header and passes it to the IP layer. The IP layer checks that the destination IP is the switch's IP (192.168.1.100), removes the IP header, and passes it to the UDP layer according to protocol number 17. The UDP layer checks that the destination port is 5001 (the conventional port), confirms that this is a UDP packet carrying an FC frame, and delivers the UDP payload (the original FC frame) to the UDP encapsulation adapter layer.

[0109] 2. UDP encapsulation adapter layer decapsulation: The UDP encapsulation and adaptation layer obtains the UDP data payload (raw FC frame) from the operating system's network stack, makes no modifications, and directly calls the virtual hardware abstraction layer's receive function interface to pass the FC frame to the virtual hardware abstraction layer.

[0110] 3. The Virtual Hardware Abstraction Layer receives FC frames: The virtual hardware abstraction layer simulates the hardware event of "receiving an FC frame" and passes the FC frame to the FC protocol stack processing layer by calling the receive function interface of the FC protocol stack processing layer.

[0111] 4. FC protocol stack processing engine table lookup forwarding: The FC protocol stack processing engine parses the FC frame header, extracts the destination FC_ID as 0x040506, queries the internally maintained simulation routing table, and finds the next-hop information corresponding to this FC_ID: the IP address of the FC receiving endpoint, 192.168.1.20, and the UDP port number, 5002. The FC protocol stack processing layer does not decapsulate the data payload of the FC frame.

[0112] 5. Re-encapsulate UDP packets and forward them: The FC protocol stack processing engine calls the virtual hardware abstraction layer's (HHB) send function interface to pass the FC frame and next-hop information to the HHB. The HHB then calls the UDP encapsulation adapter layer's (UDP) send function interface to pass the FC frame and next-hop information to the UDP encapsulation adapter layer.

[0113] The UDP encapsulation adapter layer uses the IP address (192.168.1.20) and UDP port number (5002) of the FC receiving endpoint as the destination address, re-encapsulates the UDP packet with the FC frame as the sole data payload, and sends it to the FC receiving endpoint through the operating system's network interface. The content of the FC frame in the original UDP packet remains unchanged.

[0114] IV. The FC receiving endpoint receives and processes FC frames. After receiving a UDP packet, the FC receiving endpoint (IP address 192.168.1.20, UDP port number 5002) processes it according to the following steps: 1. The operating system's network stack receives UDP packets: When the network card of the FC receiving endpoint receives an Ethernet frame, it strips off the Ethernet header and IP header layer by layer. The UDP layer checks that the destination port is 5002 (the agreed port bound to the FC receiving endpoint), confirms that this is an FC emulation message, and delivers the UDP data payload (the original FC frame) to the UDP encapsulation adapter layer.

[0115] 2. UDP encapsulation adapter layer decapsulation: The UDP encapsulation and adaptation layer extracts the FC frame from the UDP payload and calls the virtual hardware abstraction layer's receive function interface to pass the FC frame to the virtual hardware abstraction layer.

[0116] 3. The Virtual Hardware Abstraction Layer receives FC frames: The virtual hardware abstraction layer simulates a hardware interrupt of "receiving an FC frame" and passes the FC frame to the FC protocol stack processing layer by calling the receive function interface of the FC protocol stack processing layer.

[0117] 4. The FC protocol stack processing engine processes FC frames: The FC protocol stack processing engine parses the FC frame header and finds that the destination FC_ID is 0x040506, which matches the local FC address. Based on the frame type, it determines that it is a SCSI command frame (FCP_CMND). It extracts the SCSI Command Description Block (CDB) from the FC frame payload and calls the upper-layer application module (the simulated storage backend) to perform data read / write operations. After processing the I / O request, the upper-layer application module returns the execution result (success / failure, data) to the FC protocol stack processing engine.

[0118] V. FC Receiver Endpoint Returns Response Frame 1. The FC protocol stack processing engine constructs response frames: The FC protocol stack processing engine constructs an FCP_RSP response frame (containing SCSI execution status, such as GOOD or CHECK CONDITION, and return data) based on the execution results returned by the upper-layer application module.

[0119] 2. The Virtual Hardware Abstraction Layer transmits response frames: The FC protocol stack processing engine calls the virtual hardware abstraction layer's (HHB) send function interface to pass the FC response frame to the HHB. The HHB then calls the UDP encapsulation adapter layer's (UDP) send function interface to pass the FC response frame to the UDP encapsulation adapter layer.

[0120] 3. The UDP encapsulation and adaptation layer encapsulates and sends the response frame: The UDP encapsulation adapter layer uses the FC response frame as the sole data payload of the UDP packet, encapsulates it into a UDP packet with the IP address of the emulated switch (192.168.1.100) and the specified UDP port number (5001) as the destination address, and sends it to the emulated switch over the IP network. No emulated protocol header is added to this UDP packet.

[0121] VI. Simulated switching equipment forwarding response frames After the simulated switching device receives a UDP packet from the FC receiver endpoint: 1. Identify and extract UDP encapsulation adapter layer: The UDP encapsulation and adaptation layer identifies the UDP packet as an FC emulation packet (destination port number 5000), strips the UDP header to extract the complete FC response frame from the UDP payload, and passes it to the FC protocol stack processing engine through the virtual hardware abstraction layer.

[0122] 2. FC protocol stack processing engine table lookup forwarding: The FC protocol stack processing engine parses the FC response frame header, obtains the destination FC_ID as 0x010203, and queries the simulation routing table to determine that the corresponding next-hop simulation node is the FC sending endpoint (IP address 192.168.1.10, UDP port number 5001).

[0123] 3. The UDP encapsulation and adaptation layer re-encapsulates and sends the data: The FC protocol stack processing engine passes the FC response frame and next-hop information to the UDP encapsulation adapter layer through the virtual hardware abstraction layer. The UDP encapsulation adapter layer uses the IP address (192.168.1.10) and UDP port number (5001) of the FC sending endpoint as the destination address, re-encapsulates the FC response frame as the sole data payload of the UDP packet, and sends it to the FC sending endpoint through the network interface provided by the operating system.

[0124] 7. FC transmitting endpoint receives response frame After receiving the UDP packet corresponding to the response frame, the FC sending endpoint (IP address 192.168.1.10, UDP port number 5001) strips the UDP header to extract the complete FC response frame, and parses the FC response frame to obtain the SCSI processing result.

[0125] This completes a full FC protocol request-response interaction loop. Throughout the process, the emulator, emulator switch, and emulator target all adopt the same layered software architecture (upper-layer application module, FC protocol stack processing engine, virtual hardware abstraction layer, UDP encapsulation and adaptation layer). FC frames are transparently transmitted over the IP network, while fully preserving the native interaction details of the FC protocol. Furthermore, all entities are pure software, requiring no dedicated FC hardware.

[0126] The system provided in the embodiments of this application has been described above.

[0127] As a simulation method for a Fibre Channel FC receiver endpoint, the execution subject of this method is a network device, which acts as the FC receiver endpoint. The method includes: Configure a simulated virtual structure on the network device; the simulated virtual structure includes the following components in order from bottom to top: UDP encapsulation and adaptation layer, virtual hardware abstraction layer, FC protocol stack processing layer, and upper application layer. The UDP encapsulation and adaptation layer receives UDP packets forwarded from the FC sending endpoint via the emulation switching device. Based on the UDP port number carried in the UDP header of the UDP packet, it identifies the UDP packet as an emulation packet carrying Fibre Channel emulation data. Then, it strips the UDP header, extracts the complete FC frame from the UDP packet, and transmits it to the virtual hardware abstraction layer. The virtual hardware abstraction layer simulates the hardware interrupt of the FC physical port receiving a frame and passes the FC frame to the FC protocol stack processing layer. The FC protocol stack processing layer extracts the SCSI format I / O request from the FC frame and passes the SCSI format I / O request to the upper application layer. The upper application layer executes corresponding storage operations on the backend virtual storage system based on SCSI format IO requests.

[0128] Optionally, as an example, the upper application layer performs corresponding storage operations on the backend virtual storage system based on SCSI format IO requests, including: determining the corresponding backend virtual storage space according to the LUN information carried in the SCSI format IO request; if the SCSI format IO request is a read command, then reading data from the backend virtual storage space to obtain the read operation result; if the SCSI format IO request is a write command, then writing data to the backend virtual storage space to obtain the write operation result.

[0129] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A Fibre Channel (FC) protocol emulation network system, characterized in that, The system includes: an FC transmitting endpoint, an FC receiving endpoint, and at least one emulation switching device between the FC transmitting endpoint and the FC receiving endpoint; the FC receiving endpoint is configured with an emulation virtual structure; the emulation virtual structure includes, in order from bottom to top: a UDP encapsulation adaptation layer, a virtual hardware abstraction layer, an FC protocol stack processing layer, and an upper application layer; The UDP encapsulation and adaptation layer, based on the UDP port number carried in the UDP header of the UDP packet forwarded by the FC sending endpoint via the emulation switching device, identifies the UDP packet as an emulation packet carrying Fibre Channel emulation data, then strips the header of the UDP packet, extracts the complete FC frame from the UDP packet, and transmits it to the virtual hardware abstraction layer. The virtual hardware abstraction layer simulates a hardware interrupt when the FC physical port receives a frame, and passes the FC frame to the FC protocol stack processing layer. The FC protocol stack processing layer extracts SCSI format I / O requests from the FC frame and passes the SCSI format I / O requests to the upper application layer, so that the upper application layer performs corresponding storage operations on the backend virtual storage system based on the SCSI format I / O requests.

2. The system according to claim 1, characterized in that, The upper application layer performs corresponding storage operations on the backend virtual storage system based on SCSI format IO requests, including: The corresponding backend virtual storage space is determined based on the LUN information carried in the SCSI format IO request. If the SCSI format IO request is a read command, then data is read from the backend virtual storage space to obtain the read operation result; If the SCSI format IO request is a write command, then data is written to the backend virtual storage space to obtain the write operation result.

3. The system according to claim 1, characterized in that, The upper application layer is also used to provide a configuration interface; the configuration interface is used to create and configure virtual storage space in the backend virtual storage system; The virtual storage space includes at least: a LUN of specified capacity and type, and specified response characteristics of the created LUN.

4. The system according to claim 1, characterized in that, The upper application layer is also used to receive configuration files and store them locally; the configuration files contain the pre-configured IP addresses of each simulation node and the specified UDP port numbers; The UDP port number carried in the UDP header of the UDP packet forwarded by the FC sending endpoint via the emulated switching device includes: The UDP encapsulation adaptation layer obtains the specified UDP port number corresponding to the receiving endpoint of this FC from the configuration file; When the destination port number carried in the UDP header of the UDP packet matches the specified UDP port number obtained from the configuration file, the UDP encapsulation adapter layer determines that the UDP packet is a simulation packet carrying Fibre Channel simulation data.

5. The system according to claim 1, characterized in that, After the upper application layer performs the storage operation, it returns the execution result to the FC protocol stack processing layer; the execution result includes at least one of the read operation result and the write operation result. The FC protocol stack processing layer constructs a complete FC response frame based on the execution result, determines the IP address and specified UDP port number of the emulated switching device that serves as the next hop from the FC receiving endpoint to the FC sending endpoint, and transmits the FC response frame and the IP address and specified UDP port number to the UDP encapsulation adaptation layer through the virtual hardware abstraction layer. The UDP encapsulation adaptation layer uses the IP address as the destination address of the IP header corresponding to the UDP packet, uses the specified UDP port number as the destination port number of the UDP header, and encapsulates the FC response frame as the unique data payload of the User Datagram Protocol (UDP) packet into the UDP packet. The UDP packet does not include any simulation protocol header; the specified UDP port number is used to indicate that the UDP packet is a simulation packet carrying Fibre Channel simulation data. The UDP packets are then transmitted to the simulated switching device using the Internet Protocol network to simulate the physical link of the Fibre Channel.

6. The system according to claim 5, characterized in that, The determination of the IP address and specified UDP port number of the emulated switching device that serves as the next hop from the FC receiving endpoint to the FC transmitting endpoint includes: The IP address and specified UDP port number of the emulated switching device directly connected to the FC receiving endpoint are obtained from the pre-configured configuration file and used as the IP address and specified UDP port number of the emulated switching device for the next hop; the configuration file contains the pre-configured IP address and specified UDP port number of each emulated node; the configuration file is received by the upper application layer and stored locally; or, Based on the destination FC_ID in the frame header of the FC response frame, a preset mapping table is queried to determine the IP address and UDP port number of the emulated switch device corresponding to the destination FC_ID. The IP address and UDP port number of the emulated switch device corresponding to the destination FC_ID are then determined as the IP address and specified UDP port number of the next-hop emulated switch device. The mapping table records the correspondence between the destination FC_ID and the IP address and specified UDP port number of the emulated switch device.

7. The system according to claim 6, characterized in that, The configuration file also includes a role identifier indicating that this device is an FC receiving endpoint; The mapping table is determined through the following steps: During the initialization phase of the simulated network, after the FC receiving endpoint is started, the upper application layer reads the role identifier in the configuration file to determine that this device is the FC receiving endpoint, and sends the IP address and UDP port number of each simulated node in the configuration file to the FC protocol stack processing layer. The FC protocol stack processing layer constructs the mapping table based on the IP address and UDP port number of each simulation node in the configuration file and the FC_ID assigned to each simulation node obtained through name service query.

8. The system according to claim 1, characterized in that, During the initialization phase of the simulation network, After the FC receiving endpoint is started, when the upper application layer reads the role identifier in the configuration file to determine that this device is an FC receiving endpoint, it calls the FC protocol stack processing layer to initiate the login process. The FC protocol stack processing layer generates an FC-FS compliant login FC frame for simulation, obtains the IP address and specified UDP port of the emulated switching device that serves as the next hop from the FC receiving endpoint to the FC sending endpoint from the configuration file, and passes the login FC frame and the IP address and specified UDP port number to the UDP encapsulation adaptation layer through the virtual hardware abstraction layer; the destination FC_ID in the frame header of the login FC frame is a fixed FC_ID; the fixed FC_ID is used to indicate that the login FC frame is used to initiate a login request to obtain the FC_ID of the FC receiving endpoint; The UDP encapsulation adaptation layer uses the IP address as the destination address of the IP header corresponding to the UDP packet, uses the specified UDP port number as the destination port number of the UDP header, and encapsulates the login FC frame as the unique data payload of the User Datagram Protocol (UDP) packet into the UDP packet. The UDP packet does not include any simulation protocol header; the specified UDP port number is used to indicate that the UDP packet is a simulation packet carrying Fibre Channel simulation data. The UDP packets are transmitted to the simulated switching device using the Internet Protocol network to simulate a Fibre Channel physical link, so that the simulated switching device can assign an FC_ID to the FC receiving endpoint.

9. The system according to claim 8, characterized in that, The UDP encapsulation and adaptation layer, based on the UDP port number carried in the UDP header of the UDP packet originating from the emulated switching device, identifies the UDP packet as an emulated packet carrying Fibre Channel emulation data. It then strips the UDP packet header, extracts the complete login FC response frame from the UDP packet, and transmits it to the virtual hardware abstraction layer. This UDP packet is the login FC response frame returned by the emulated switching device, carrying the FC_ID assigned to the FC receiving endpoint. The virtual hardware abstraction layer simulates a hardware interrupt when the FC physical port receives a frame, and passes the FC login response frame to the FC protocol stack processing layer. The FC protocol stack processing layer parses the login FC response frame, extracts and saves the FC_ID assigned to the FC receiving endpoint, so that the FC receiving endpoint can use the FC_ID as the destination FC address to receive subsequent Fibre Channel frames.

10. A simulation method for a fiber channel FC receiver endpoint, characterized in that, Configure a simulated virtual structure on the network device; the simulated virtual structure includes, in order from bottom to top: UDP encapsulation and adaptation layer, virtual hardware abstraction layer, FC protocol stack processing layer, and upper application layer. The UDP encapsulation and adaptation layer is used to receive UDP packets forwarded from the FC sending endpoint via the emulation switching device. Based on the UDP port number carried in the UDP header of the UDP packet, it identifies that the UDP packet is an emulation packet carrying Fibre Channel emulation data. Then, it strips the header of the UDP packet, extracts the complete FC frame from the UDP packet, and transmits it to the virtual hardware abstraction layer. The virtual hardware abstraction layer is used to simulate a hardware interrupt when the FC physical port receives a frame and to pass the FC frame to the FC protocol stack processing layer. The FC protocol stack processing layer is used to extract SCSI format I / O requests from the FC frame and pass the SCSI format I / O requests to the upper application layer. The upper application layer is used to perform corresponding storage operations on the backend virtual storage system based on the SCSI format IO requests.