A fiber channel (FC) protocol emulation network system
By constructing a simulated switching device with a pure software layered architecture on general network equipment, simulating the switching functions of the Fibre Channel FC protocol, the problems of high cost and protocol rigidity of dedicated hardware switches are solved, and low-cost and efficient testing and debugging are achieved.
Patent Information
- Application Number
- CN202611464424.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-20
- Publication Date
- 2026-11-27
AI Technical Summary
The learning, development and debugging of the existing Fibre Channel (FC) protocol rely on expensive dedicated hardware switches, resulting in high costs for large-scale network testing and rigid protocol behavior, making it difficult to simulate abnormal scenarios for testing.
The simulated network system adopts a pure software layered architecture, including FC transmitting endpoints, FC receiving endpoints, and simulated switching equipment. It simulates switch functions through a UDP encapsulation adaptation layer, a virtual hardware abstraction layer, and an FC protocol stack processing layer to realize the routing and forwarding of Fibre Channel frames.
It reduces the cost of FC SAN networking, enables flexible customization of protocol behavior and simulation of abnormal scenarios, and supports elastic expansion of large-scale test scenarios.
Smart Images

Figure CN123185091A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a Fibre Channel FC protocol simulation network system. Background Technology
[0002] Currently, in the field of learning, research and development and debugging of the Fibre Channel (FC) protocol, it is necessary to build a complete Fibre Channel Storage Area Network (FC SAN) network that includes the initiator, the fabric, and the target.
[0003] However, all three of these aspects require dedicated hardware. Fabric, as the core of the FC SAN, heavily relies on dedicated FC switches. Dedicated FC switches are expensive, and their high hardware costs make it difficult to support large-scale network testing. Furthermore, the protocol behavior of dedicated FC switches is fixed in firmware, making it impossible to customize or modify them as needed. This hinders the simulation of different abnormal scenarios for testing, severely limiting the learning, development, and debugging of the FC protocol.
[0004] Therefore, there is an urgent need for a low-cost, unrestricted FC protocol simulation network system. Summary of the Invention
[0005] In view of this, embodiments of this application provide a Fibre Channel FC protocol simulation network system.
[0006] 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 simulation switching device 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, and an FC protocol stack processing layer. The UDP encapsulation adaptation layer, based on the UDP port number carried in the UDP header of the UDP packet originating from the FC sending endpoint, identifies the UDP packet as a simulation packet for Fibre Channel FC protocol simulation. It then extracts the complete FC frame from the UDP packet and transmits it to the virtual hardware abstraction layer. The FC sending endpoint generates a complete Fibre Channel frame conforming to the Fibre Channel frame format standard FC-FS for simulation. This complete Fibre Channel frame is encapsulated into the UDP packet as the sole data payload of the User Datagram Protocol (UDP) packet. No simulation protocol header is added to the UDP packet. 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, based on the destination Fibre Channel identifier FC_ID in the frame header of the FC frame, queries the preset simulation routing table to determine the IP address and UDP port number of the next-hop simulation node corresponding to the destination FC_ID, and then transmits the FC frame and the IP address and UDP port number of the next-hop simulation node to the UDP encapsulation adaptation layer through the virtual hardware abstraction layer. The UDP encapsulation adaptation layer uses the IP address and UDP port number of the next-hop simulation node as the destination address, re-encapsulates the FC frame as the sole data payload of the UDP packet, and uses the Internet Protocol network to simulate the data transmission of the Fibre Channel physical link to the next-hop simulation node.
[0007] As can be seen from the above technical solution, the FC protocol simulation network system provided in this embodiment has a simulated virtual structure configured in the simulated switching device. This simulated virtual structure includes, from bottom to top, a UDP encapsulation adaptation layer, a virtual hardware abstraction layer, and an FC protocol stack processing layer. The UDP encapsulation adaptation layer identifies the simulated packet based on the port number carried in the UDP header 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 queries the simulated routing table based on the destination FC_ID in the FC frame header to determine the next-hop information. The UDP encapsulation adaptation layer re-encapsulates the UDP packet with the next-hop information and forwards it to the next-hop node. The layers work together to fully realize the frame routing function of the simulated switching device, that is, the pure software simulation of the FC switch function is realized through the simulated virtual structure.
[0008] This simulation method, based on a pure software layered architecture and UDP packets carrying FC, compared to the background technology that relies on dedicated hardware to implement FC networking, not only eliminates the dependence on expensive dedicated hardware and significantly reduces the construction and debugging costs of FC SAN networking, but also replaces the fixed hardware firmware with a software-based simulation virtual structure, allowing protocol behavior to be customized or modified as needed, thereby flexibly simulating various abnormal scenarios to verify the fault tolerance capability of the switch.
[0009] Furthermore, the pure software implementation is no longer constrained by physical hardware resources. Multiple simulated switching devices can be quickly instantiated on the same device, or multiple simulated switching devices can form a large-scale Fabric topology, realizing the elastic expansion of the test scenario and effectively solving the problem that large-scale network testing is difficult to carry out due to the high cost of dedicated FC switches. Attached Figure Description
[0010] Figure 1 System architecture diagram provided for embodiments of this application; Figure 2This is a schematic diagram of the virtual simulation structure in the simulation switching device provided in the embodiments of this application; Figure 3 A flowchart of packet forwarding in a simulated switching device provided in this application embodiment; Figure 4A The login process interaction diagram for the simulation switching device to assign FC_ID to the simulation node provided in the embodiments of this application; Figure 4B Another login process interaction diagram for the simulation switching device to assign FC_ID to the simulation node provided in the embodiments of this application; Figure 5 A flowchart illustrating the forwarding of response frames by a simulated switching device provided in this application embodiment; Figure 6 The interactive flowchart of the simulation network provided in the embodiments of this application is shown. Detailed Implementation
[0011] To make the methods provided in this application easier to understand, the system provided in this application will be described in detail below with reference to the accompanying drawings and embodiments.
[0012] 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.
[0013] Simulated switching devices simulate the switching behavior of a real FC SAN's fabric (i.e., FC switches) by setting up a simulated virtual structure on general-purpose network devices (such as general-purpose servers). The simulated virtual structure includes, from bottom to top, the following layers: UDP encapsulation and adaptation layer, virtual hardware abstraction layer, and FC protocol stack processing layer. The specific workflow of each layer in the simulated switching device will be explained in detail later and will not be elaborated here.
[0014] Optionally, the FC transmitting endpoint and the FC receiving endpoint can also implement the function of FC protocol emulation nodes by deploying simulated virtual structures on general network devices. The FC transmitting endpoint is used to simulate the behavior of the initiator (i.e., the server HBA) in a real FC SAN, and the FC receiving endpoint is used to simulate the behavior of the target (i.e., the storage device) in a real FC SAN.
[0015] 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.
[0016] In this embodiment, the general-purpose device is a general-purpose computing device with network communication capabilities (running an operating system). The FC transmitting endpoint, the emulation switching device, and the FC receiving endpoint are all deployed on the general-purpose device. The network interface provided by the operating system is used to complete the sending and receiving of UDP packets, thereby realizing the emulation interaction of the FC protocol on the IP network.
[0017] The following is combined Figure 2 This paper provides a detailed explanation of the virtual simulation structure and its operation process in the simulation switching equipment. See Figure 2 , Figure 2 This is a schematic diagram of the virtual simulation structure in the simulation switching device provided in the embodiments of this application. Figure 2 As shown, the emulation switching device is implemented by configuring an emulation virtual structure on a general network device. The emulation virtual structure includes, in order from bottom to top: UDP encapsulation adaptation layer, virtual hardware abstraction layer, and FC protocol stack processing layer.
[0018] exist Figure 2 Based on the simulated virtual structure shown, the following section elaborates on the specific processes of each layer in the simulated switching device when forwarding packets.
[0019] See Figure 3 , Figure 3 A flowchart of message forwarding in a simulated switching device provided in this application embodiment.
[0020] 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 for Fibre Channel FC protocol simulation based on the UDP port number carried in the UDP header of the UDP packet from the FC sending endpoint. Then, it extracts the complete FC frame from the UDP packet and transmits it to the virtual hardware abstraction layer.
[0021] In this embodiment, during the operation of the simulated network system (e.g., testing), the FC transmitting endpoint generates a complete Fibre Channel frame conforming to the Fibre Channel Framing and Signaling (FC-FS) standard for simulation. This complete Fibre Channel frame is encapsulated as the sole data payload of a User Datagram Protocol (UDP) packet. The UDP packet does not include any simulated protocol header; the UDP header includes the destination port number. The destination port number is the designated UDP port number of the simulated switching device (i.e., the designated UDP port number of this simulated switching device) traversed from the Fibre Channel transmitting endpoint to the Fibre Channel receiving endpoint as the next hop. The UDP packet is then sent using Internet Protocol (IP) to simulate data transmission over the Fibre Channel physical link.
[0022] After the simulated switching device starts up, it binds to its configured UDP port number through the network interface (Socket API) provided by the operating system and listens for UDP packets from the IP network. When the operating system receives a UDP packet with the destination address being the device's IP address and the destination port being the UDP port number bound to the 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 to pass the UDP packet to the UDP encapsulation adapter layer.
[0023] After the UDP encapsulation adapter layer's receive function interface is invoked, it obtains the UDP packet transmitted by the operating system and checks the destination port number in the UDP packet header. If the destination port number matches the specified UDP port number bound to the emulated switching device, the UDP packet is determined to be an emulated packet carrying Fibre Channel emulation data. Subsequently, the UDP encapsulation adapter layer strips the UDP header, extracts the complete FC frame from the UDP payload, and transmits the FC frame to the Virtual Hardware Abstraction Layer by invoking the Virtual Hardware Abstraction Layer's receive function interface.
[0024] Optionally, as an embodiment, the simulated virtual structure further includes an upper application layer located above the FC protocol stack processing layer. This upper application 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 pre-configured IP addresses and specified UDP port numbers for each simulation node. The UDP encapsulation and adaptation layer obtains the specified UDP port number corresponding to this simulation switching device 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.
[0025] 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.
[0026] After the virtual hardware abstraction layer's receive function interface is called by the UDP encapsulation and adaptation layer, it simulates a hardware interrupt when an FC physical port receives a frame, and passes the FC frame to the FC protocol stack processing layer. This allows the FC protocol stack processing layer to perceive the arrival of an FC frame as if it were received from a real FC physical port. Specifically, the virtual hardware abstraction layer passes the FC frame as a parameter to the FC protocol stack processing layer by calling its receive function interface.
[0027] It should be noted that the virtual hardware abstraction layer simulates an FC physical port between the FC protocol stack processing layer and the UDP encapsulation adaptation layer, enabling the FC protocol stack processing layer to perceive the sending and receiving behavior of the IP network interface as the sending and receiving behavior of the FC physical port.
[0028] In step S303, the FC protocol stack processing layer queries the preset simulation routing table based on the destination Fibre Channel identifier FC_ID in the frame header of the FC frame to determine the IP address and UDP port number of the next-hop simulation node corresponding to the destination FC_ID, and then passes the FC frame and the IP address and UDP port number of the next-hop simulation node to the UDP encapsulation adapter layer through the virtual hardware abstraction layer.
[0029] After the FC protocol stack processing layer's receive function interface is called by the virtual hardware abstraction layer, it parses the FC frame header to obtain the destination FC_ID. Then, using this FC_ID as an index, it queries a pre-built emulation routing table to determine the IP address and UDP port number of the next-hop emulation node corresponding to that FC_ID. It should be noted that this emulation routing table is pre-built by the FC protocol stack processing layer to record the correspondence between the destination FC_ID and the IP address and UDP port number of the next-hop emulation node. The specific construction method of the emulation routing table will be described in detail later and will not be elaborated here.
[0030] The FC protocol stack processing layer transmits the FC frame and the IP address and UDP port number of the next-hop emulator node to the Virtual Hardware Abstraction Layer (VHDL) by calling the VHDL's send function interface. The FC protocol stack processing layer does not decapsulate the FC frame's data payload to ensure forwarding efficiency. When the VHDL's send function interface is called, it transmits the FC frame and the IP address and UDP port number of the next-hop emulator node to the UDP encapsulation adapter layer and then calls the UDP encapsulation adapter layer's send function interface.
[0031] It should be noted that the FC protocol stack processing layer does not decapsulate the data payload of the FC frame, that is, it does not parse the data payload content in the FC frame in order to ensure forwarding efficiency.
[0032] In step S304, the UDP encapsulation adapter layer uses the IP address and UDP port number of the next-hop simulation node as the destination address, re-encapsulates the UDP packet with the FC frame as the only data payload of the UDP packet, and uses the Internet Protocol network to simulate the data transmission of the Fibre Channel physical link to the next-hop simulation node.
[0033] After the UDP encapsulation adapter layer's send function interface is called, based on the IP address and UDP port number of the next-hop emulator node returned by the FC protocol stack processing layer, the FC frame is re-encapsulated as the sole data payload of the UDP packet, using the IP address and UDP port number of the next-hop emulator node as the destination address. This re-encapsulates the UDP packet and sends it to the next-hop emulator node via the network interface (Socket API) provided by the operating system. The content of the FC frame in the original UDP packet remains unchanged.
[0034] This concludes the process. Figure 3 The process is illustrated. The FC protocol simulation network system provided in this embodiment features a simulated virtual structure configured in the simulated switching device. This virtual structure, from bottom to top, includes a UDP encapsulation and adaptation layer, a virtual hardware abstraction layer, and an FC protocol stack processing layer. The UDP encapsulation and adaptation layer identifies the simulated packet based on the port number carried in the UDP header and extracts the complete FC frame. The virtual hardware abstraction layer simulates a hardware interrupt when the FC physical port receives the frame and delivers the FC frame to the FC protocol stack processing layer. The FC protocol stack processing layer queries the simulated routing table based on the destination FC_ID in the FC frame header to determine the next-hop information. The UDP encapsulation and adaptation layer re-encapsulates the UDP packet with this next-hop information and forwards it to the next-hop node. These layers work together to fully implement the frame routing function of the simulated switching device, thus achieving pure software simulation of the FC switch function through the simulated virtual structure.
[0035] This simulation method, based on a pure software layered architecture and UDP packets carrying FC, compared to the background technology that relies on dedicated hardware to implement FC networking, not only eliminates the dependence on expensive dedicated hardware and significantly reduces the construction and debugging costs of FC SAN networking, but also replaces the fixed hardware firmware with a software-based simulation virtual structure, allowing protocol behavior to be customized or modified as needed, thereby flexibly simulating various abnormal scenarios to verify the fault tolerance capability of the switch.
[0036] Furthermore, the pure software implementation is no longer constrained by physical hardware resources. Multiple simulated switching devices can be quickly instantiated on the same device, or multiple simulated switching devices can form a large-scale Fabric topology, realizing the elastic expansion of the test scenario and effectively solving the problem that large-scale network testing is difficult to carry out due to the high cost of dedicated FC switches.
[0037] In description Figure 3The flowchart mentioned the simulation routing table, and the construction process of the simulation routing table will be described in detail below.
[0038] During the network simulation initialization phase, the IP addresses and designated UDP port numbers of each simulation node are pre-configured using a configuration file. After the upper-layer application layer of the simulation switch starts, it reads the locally pre-stored configuration file. This configuration file contains the pre-configured IP addresses and designated UDP port numbers of each simulation node, as well as the role identifier of this device as a simulation switch. After the upper-layer application layer reads the role identifier from the configuration file and confirms that this device is a simulation switch, it sends the IP addresses and UDP port numbers of each simulation node from the configuration file to the FC protocol stack processing layer.
[0039] After each emulation node (FC sending endpoint and FC receiving endpoint) starts up, it initiates an FLOGI login process to the emulation switching device. The FC protocol stack processing layer of the emulation switching device receives the login frame, assigns an FC_ID to each emulation node, and records the mapping between each emulation node's FC_ID and its IP address and UDP port number. Based on the mapping between the FC_ID assigned to each emulation node through the login process and the IP address and UDP port number in the configuration file, the FC protocol stack processing layer constructs an emulation routing table. This routing table records the mapping between the destination FC_ID and the IP address and UDP port number of the next-hop emulation node, used to determine the IP address and UDP port number of the next-hop emulation node in subsequent UDP packet forwarding.
[0040] This concludes the description of the simulation routing table construction process.
[0041] The following section details the login process for the simulation switching device to assign FC_ID to the simulation node.
[0042] In this embodiment, after the FC transmitting endpoint and the FC receiving endpoint are started, they both need to obtain the FC_ID through the login process before subsequent FC message communication can proceed. Regardless of whether the login frame originates from the FC transmitting endpoint or the FC receiving endpoint, the simulated switching device processes the login frame in the same way.
[0043] See Figure 4A , Figure 4A This document presents a login process diagram illustrating the allocation of FC_IDs to emulator nodes by the emulator switching device provided in this embodiment. The diagram demonstrates the complete login process between the FC sending endpoint, the FC receiving endpoint, and the emulator switching device via UDP packet interaction.
[0044] like Figure 4AAs shown, after the FC sending endpoint is started, it first generates a complete FC frame conforming to the FC-FS standard for simulation. The frame type of this FC frame is a login frame (which can be called an FC login frame or an FLOGI frame). This FC login frame is used as the only data payload of the UDP packet. It is encapsulated into a UDP packet with the IP address of the simulated switching device and the specified UDP port number as the destination address and sent to the simulated switching device through the IP network.
[0045] The FC login frame is used as the sole data payload of the UDP packet. The IP address of the simulated switching device and the specified UDP port number are used as the destination address. The packet is encapsulated into a UDP packet and sent to the simulated switching device via the IP network.
[0046] After receiving the UDP packet, the UDP encapsulation and adaptation layer of the emulation switching device identifies the UDP packet as an emulation packet based on the UDP port number carried in the UDP header. It then strips the UDP header to extract the FC login frame from the UDP payload and calls the receive function interface of the virtual hardware abstraction layer to pass the FC login frame to the virtual hardware abstraction layer.
[0047] 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. By calling the FC protocol stack processing layer's receive function interface, the FC frame is delivered to the FC protocol stack processing layer.
[0048] After the FC protocol stack processing layer determines that the frame type of the FC login frame is a login frame, it assigns an FC_ID 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 FC response frame conforming to the FC-FS standard, carrying the FC_ID (the frame type of the FC response frame is a login response frame, which can be called an FC login response frame or an FLOGI_ACC frame).
[0049] The FC protocol stack processing layer passes the FC login response frame to the Virtual Hardware Abstraction Layer (VHDL) by calling the VHDL's send function interface. The VHDL then passes the FC login response frame to the UDP encapsulation adapter layer by calling the UDP encapsulation adapter layer's send function interface. The UDP encapsulation adapter layer uses this FC 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.
[0050] After receiving the login response frame, the FC transmitting endpoint extracts and saves the FC_ID, which can then be used to send Fibre Channel messages.
[0051] like Figure 4BAs shown, the login process for the FC receiving endpoint is completely identical to that for the FC sending endpoint. After the FC receiving endpoint starts, it also generates an FC login frame, encapsulates it into a UDP packet, and sends it to the emulated switching device. The emulated switching device, following the same processing flow, assigns an FC_ID to the FC receiving endpoint, records the corresponding relationship, and returns a login response frame. Upon receiving the login response frame, the FC receiving endpoint obtains and saves the FC_ID, which can then be used for sending and receiving Fibre Channel packets.
[0052] This concludes the process. Figure 4A and Figure 4B Description of the process shown.
[0053] As can be seen from the login process described above, both the FC sending and receiving endpoints obtain the FC_ID by initiating a login process with the emulated switching device. The emulated switching device processes the login frame uniformly, allocating the FC_ID through the FC protocol stack and returning a login response frame, enabling the emulated node to obtain the FC_ID and conduct subsequent communication. Simultaneously, the switching device establishes a mapping between the FC_ID and the IP address and UDP port number of each emulated node during the login process, providing a foundation for the subsequent construction of the emulated routing table.
[0054] The following section provides a detailed explanation of the process by which the simulated switching device forwards response frames.
[0055] Upon receiving a UDP packet, the FC receiver endpoint, based on the destination port number carried in the UDP header, identifies the UDP packet as a simulation packet carrying Fibre Channel simulation data. It then strips the UDP header and extracts the complete Fibre Channel frame from the UDP packet. The FC protocol stack of the FC receiver endpoint parses the frame header of this FC frame, determines the type of the FC frame based on the frame type field in the header, and performs corresponding processing operations according to the type of the FC frame.
[0056] Specifically, if the frame type of the FC frame is a SCSI command frame (FCP_CMND), the FC receiving endpoint extracts the SCSI command description block (CDB) from the payload of the FC frame, performs the corresponding data read / write operation, obtains the SCSI processing result, and generates an FCP_RSP response frame accordingly, carrying the SCSI execution status (such as GOOD or CHECK CONDITION) and return data.
[0057] If the frame type of the FC frame is a SCSI command frame (FCP_CMND), the FC receiving endpoint extracts the SCSI command description block (CDB) from the payload of the FC frame, performs the corresponding data read / write operation, obtains the SCSI processing result, and generates an FCP_RSP response frame accordingly (FC response frame is a type of FC response frame), carrying the SCSI execution status (such as GOOD or CHECKCONDITION) and return data.
[0058] If the frame type of the FC frame is a login frame (FLOGI / PLOGI), the FC receiving endpoint executes the corresponding login procedure or port login procedure and generates the corresponding login response frame (PLOGI_ACC). The login response frame (PLOGI_ACC) is a type of FC response frame and carries negotiation parameters.
[0059] It should be noted that the login frame received by the FC receiving endpoint in this embodiment is not... Figure 4A or Figure 4B The process shown uses an FLOGI login frame initiated to the emulated switching device, but it is not the same as the PLOGI port login frame initiated by the FC sending endpoint. The two have different functions: the FLOGI login frame is used by the emulated node to obtain the FC address from the emulated switching device (e.g., ...). Figure 4A or Figure 4B The interaction between the FC transmitting endpoint and the FC receiving endpoint is between the emulator node and the emulator switching device. The PLOGI port login frame is used to establish a port-level session between the FC transmitting endpoint and the FC receiving endpoint. All login frames described in this section are PLOGI port login frames.
[0060] If the FC frame is a PLOGI port login frame, the FC receiving endpoint executes the port login procedure and generates a PLOGI_ACC port login response frame (the PLOGI_ACC response frame is a type of FC response frame), carrying negotiation parameters. If the FC frame is a data frame (FCP_DATA) or other types of control frames, the FC receiving endpoint performs the corresponding data transmission or control processing according to the FC protocol standard, and usually does not need to generate a response frame.
[0061] The FC receiving endpoint uses the generated FC response frame as the sole data payload of the UDP packet, encapsulates it into a UDP packet with the emulated switch's IP address and a specified UDP port number as the destination address, and sends it to the emulated switch over the IP network. This UDP packet does not include any emulated protocol header.
[0062] The following section provides a detailed explanation of the process by which the simulated switching device forwards response frames.
[0063] See Figure 5 , Figure 5This is a flowchart illustrating the forwarding of response frames by a simulated switching device, as provided in an embodiment of this application.
[0064] like Figure 5 As shown, the process may include the following steps: In step S501, the UDP encapsulation and adaptation layer identifies the UDP packet as a simulation packet for Fibre Channel FC protocol simulation based on the UDP port number carried in the UDP header of the UDP packet from the FC receiving endpoint. Then, it extracts the complete FC response frame from the UDP packet and transmits it to the virtual hardware abstraction layer.
[0065] In this embodiment, the FC receiving endpoint encapsulates the generated FC response frame into a UDP packet and sends it to the emulated switching device. After receiving the UDP packet from the FC receiving endpoint, the UDP encapsulation adaptation layer of the emulated switching device identifies the UDP packet as an FC emulation packet by the port number carried in the UDP header, strips the UDP header, extracts the complete FC response frame from the UDP payload, and passes the FC response frame to the virtual hardware abstraction layer by calling the receive function interface of the virtual hardware abstraction layer.
[0066] In step S502, the virtual hardware abstraction layer simulates the hardware interrupt of the FC physical port receiving the frame and passes the FC response frame to the FC protocol stack processing layer.
[0067] 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. By calling the FC protocol stack processing layer's receive function interface, it delivers the FC response frame to the FC protocol stack processing layer.
[0068] In step S503, the FC protocol stack processing layer queries the preset simulation routing table based on the destination FC_ID in the frame header of the FC response frame to determine the IP address and UDP port number of the next-hop simulation node corresponding to the destination FC_ID, and then passes the FC response frame and the IP address and UDP port number of the next-hop simulation node to the UDP encapsulation adapter layer through the virtual hardware abstraction layer.
[0069] After the receive function interface of the FC protocol stack processing layer is called, it parses the FC response frame header to obtain the destination FC_ID. This destination FC_ID corresponds to the original FC transmitting endpoint. The FC protocol stack processing layer uses this FC_ID as an index to query the emulation routing table to determine the IP address and UDP port number of the next-hop emulation node (i.e., the FC transmitting endpoint) corresponding to this FC_ID.
[0070] Subsequently, the FC protocol stack processing layer transmits the FC response frame and the IP address and UDP port number of the next-hop emulator node to the virtual hardware abstraction layer by calling the virtual hardware abstraction layer's send function interface. The virtual hardware abstraction layer then transmits the FC response frame and next-hop information to the UDP encapsulation adapter layer by calling the UDP encapsulation adapter layer's send function interface.
[0071] In step S504, the UDP encapsulation adapter layer uses the IP address and UDP port number of the next-hop simulation node as the destination address, re-encapsulates the UDP packet with the FC response frame as the only data payload of the UDP packet, and uses the Internet Protocol network to simulate the data transmission of the Fibre Channel physical link to the next-hop simulation node.
[0072] After the UDP encapsulation adapter layer's send function interface is called, based on the next-hop information returned by the FC protocol stack processing layer, the IP address and UDP port number of the next-hop emulation node (i.e., the FC sending endpoint) are used as the destination address. The FC response frame is then used as the sole data payload of the UDP packet to re-encapsulate the UDP packet and send it to the FC sending endpoint through the network interface provided by the operating system.
[0073] This concludes the process. Figure 5 The process is shown below.
[0074] pass Figure 5 As shown in the flowchart, the process of forwarding response frames by the simulated switching device is the same as that of forwarding data frames. The only difference is that the frame source is the FC receiving endpoint, and the forwarded frame type is an FC response frame. Through the coordinated efforts of each layer, the complete forwarding of the response frame from the FC receiving endpoint through the simulated switching device to the FC sending endpoint is achieved.
[0075] Combination Figures 2 to 5 The FC protocol simulation network system provided in this application simulates the switching behavior of 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 is responsible for identifying simulated packets and extracting FC frames. The virtual hardware abstraction layer simulates the interrupt behavior of FC physical ports. The FC protocol stack processing layer queries the simulated routing table based on the FC_ID to determine the next-hop information. These layers work together to fully implement the frame routing function of the simulated switching device. Simultaneously, the simulated switching device can identify login frames and execute the login process, assign FC addresses to simulated nodes, and return login response frames, enabling simulated nodes to obtain FC addresses and conduct subsequent communication.
[0076] This concludes the description of the system embodiments of this application.
[0077] To illustrate the method provided in this application in more detail, the solution provided in this application will be described in more detail below with reference to specific embodiments.
[0078] 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.
[0079] 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.
[0080] The IP addresses and agreed UDP port numbers of the three devices are pre-configured through a configuration file.
[0081] 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.
[0082] 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.
[0083] 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.
[0084] 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.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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).
[0091] 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.
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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).
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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).
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] 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.
[0108] 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.
[0109] 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.
[0110] 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.
[0111] 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.
[0112] 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 result returned by the upper-layer application module.
[0113] 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.
[0114] 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.
[0115] 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.
[0116] 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).
[0117] 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.
[0118] 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.
[0119] 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.
[0120] The complete interactive process provided in the embodiments of this application has been described above.
[0121] 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 emulation switching device 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, and an FC protocol stack processing layer; The UDP encapsulation and adaptation layer, based on the UDP port number carried in the UDP header of the UDP packet originating from the FC sending endpoint, identifies the UDP packet as a simulation packet carrying Fibre Channel simulation data. It then extracts the complete FC frame from the UDP packet and transmits it to the virtual hardware abstraction layer. The FC sending endpoint generates a complete FC frame conforming to the Fibre Channel frame format standard FC-FS for simulation. The FC frame is encapsulated into the UDP packet as the sole data payload of the User Datagram Protocol (UDP) packet. No simulation protocol header is added to the UDP packet. 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, based on the destination Fibre Channel identifier FC_ID in the frame header of the FC frame, queries the preset simulation routing table to determine the IP address and UDP port number of the next-hop simulation node corresponding to the destination FC_ID, and then transmits the FC frame and the IP address and UDP port number of the next-hop simulation node to the UDP encapsulation adaptation layer through the virtual hardware abstraction layer. The UDP encapsulation adaptation layer uses the IP address and UDP port number of the next-hop simulation node as the destination address, re-encapsulates the FC frame as the sole data payload of the UDP packet, and uses the Internet Protocol network to simulate the data transmission of the Fibre Channel physical link to the next-hop simulation node.
2. The system according to claim 1, characterized in that, The FC frame includes a start delimiter, a Fibre Channel header, a data payload, a cyclic redundancy check (CRC) code, and an end delimiter.
3. The system according to claim 1, characterized in that, The simulated virtual structure also includes an upper application layer located above the FC protocol stack processing layer; The upper application layer is used to read the configuration file; the configuration file contains the pre-configured IP address and specified UDP port number of each simulation node, as well as a pre-set role identifier indicating that this device is an FC transmitting endpoint; After the upper application layer reads the role identifier in the configuration file and determines that the device is a simulated switching device, it 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 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; the simulation routing table records the correspondence between the destination FC_ID and the IP address and UDP port number of the next-hop simulation node.
4. The system according to claim 3, characterized in that, When the UDP encapsulation adaptation layer receives a UDP packet from the FC sending endpoint, it obtains the specified UDP port number corresponding to this simulated switching device from the configuration file of the upper application layer. 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 packet is determined to be a simulation packet carrying Fibre Channel simulation data.
5. The system according to claim 3, characterized in that, During the initialization phase of the simulation network, The UDP encapsulation and adaptation layer, based on the UDP port number carried in the UDP header of the UDP packet originating from the FC sending endpoint, identifies the UDP packet as a simulation packet carrying Fibre Channel simulation data. It then extracts the complete FC frame from the UDP packet and transmits it to the virtual hardware abstraction layer. The FC frame is a login frame, sent when the FC sending endpoint starts. The FC frame is encapsulated into the UDP packet as the sole data payload. No simulation protocol header is added to the UDP packet. 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. When the FC protocol stack processing layer determines that the FC frame is an FC frame sent by the FC sending endpoint and the frame type is a login frame, it assigns a corresponding FC_ID to the FC sending endpoint and generates a complete FC response frame conforming to FC-FS carrying the FC_ID; the frame type of the FC response frame is a login response frame. The FC response frame is encapsulated into the UDP packet as the sole data payload of the UDP packet. The UDP message does not include any emulation protocol header; the destination port number in the UDP header is the specified UDP port number of the FC sending endpoint; The UDP packet is sent to the FC sending endpoint by simulating the data transmission of the Fibre Channel physical link using the Internet Protocol network.
6. The system according to claim 1, characterized in that, The UDP encapsulation adaptation layer, based on the UDP port number carried in the UDP header of the UDP packet originating from the FC receiving endpoint, identifies the UDP packet as a simulation packet carrying Fibre Channel simulation data. It then extracts a complete FC response frame from the UDP packet and transmits it to the virtual hardware abstraction layer. The UDP packet is a response packet originating from the FC receiving endpoint and forwarded via the simulation switching device. When the FC receiving endpoint receives a UDP packet forwarded from the simulation switching device, it extracts a complete FC frame from the UDP packet, performs corresponding processing according to the frame type of the FC frame, generates a complete FC response frame conforming to the Fibre Channel frame format standard FC-FS for simulation based on the processing structure, encapsulates the FC response frame as the sole data payload of the UDP packet into the UDP packet, sends it to the simulation switching device, and forwards it via the simulation switching device. The virtual hardware abstraction layer simulates a hardware interrupt when the FC physical port receives a frame, and passes the FC response frame to the FC protocol stack processing layer. The FC protocol stack processing layer queries the preset simulation routing table based on the destination FC_ID in the frame header of the FC response frame to determine the IP address and UDP port number of the next-hop simulation node corresponding to the destination FC_ID, and then transmits the FC response frame and the IP address and UDP port number of the next-hop simulation node to the UDP encapsulation adaptation layer through the virtual hardware abstraction layer. The UDP encapsulation adaptation layer uses the IP address and UDP port number of the next-hop emulation node as the destination address, re-encapsulates the UDP packet with the FC response frame as the sole data payload of the UDP packet, and uses the Internet Protocol network to simulate the data transmission of the Fibre Channel physical link to the next-hop emulation node.
7. The system according to claim 6, characterized in that, When the UDP encapsulation adaptation layer receives a UDP packet from the FC receiving endpoint, it obtains the specified UDP port number corresponding to this simulated switching device from the configuration file of the upper application layer. 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 packet is determined to be a simulation packet carrying Fibre Channel simulation data.
8. The system according to claim 6, characterized in that, During the network simulation initialization phase, the UDP encapsulation and adaptation layer, based on the UDP port number carried in the UDP header of the UDP packet originating from the FC receiving endpoint, identifies the UDP packet as a simulation packet for Fibre Channel FC protocol simulation. It then extracts a complete FC frame from the UDP packet and transmits it to the virtual hardware abstraction layer. The FC frame is a login frame, sent when the FC receiving endpoint starts up. The FC frame is encapsulated into the UDP packet as the sole data payload. No simulation protocol header is added to the UDP packet. 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. When the FC protocol stack processing layer determines that the FC frame is an FC frame sent by the FC receiving endpoint and the frame type is a login frame, it assigns a corresponding FC_ID to the FC receiving endpoint and generates a complete FC response frame conforming to FC-FS carrying the FC_ID; the frame type of the FC response frame is a login response frame. The FC response frame is encapsulated into the UDP packet as the sole data payload of the UDP packet. The UDP message does not include any emulation protocol header; the destination port number in the UDP header is the specified UDP port number of the FC receiving endpoint; The UDP message is sent to the FC receiving endpoint by simulating the data transmission of the Fibre Channel physical link using the Internet Protocol network.
