1. Field of Invention
The present invention relates to a processing method for a network packet, and more particular to a processing method for a network packet in an Internet small computer system interface storage device.
2. Related Art
The Internet Small Computer Systems Interface (iSCSI) is a communication protocol standard proposed by the IETF. The iSCSI connects multiple computer hosts in a network through the TCP/TP communication protocol, so as to serially connect multiple storage devices distributed in the Internet into a virtual network storage device. Users can access the network storage device as if they are accessing a local hard disk apparatus. In comparison with conventional SCSI and RAID techniques, the iSCSI technique has the high speed transmission capability of the SCSI, and can extend the capacity of the virtual storage device without being limited to the extension/backup capability of the storage devices. The virtual storage device is called a storage area network (SAN), which is composed mainly by an initiator and a target. The initiator sends an access request for establishing a session with the target. The target may be regarded as an administrator/distributor of the available storage apparatus resources of the network, and can assign corresponding logic unit numbers (LUNs) to a plurality of storage apparatuses. The LUNs are similar to virtual logical volumes, and each LUN is corresponding to a physical storage device on one or more networks.
After the system receives the access request from the initiator, the target stores the packet payload in the access request in a memory of the target. In the prior art, the packet payload is converted to transformer control protocol (TCP) packets in different layers, and the packets are mapped to a firmware layer of a network card. Finally, the packets are sent to the storage device by the firmware layer of the network card through an egress packet generator.
In view of the above problems, the present invention is directed to a communication method for accelerating Internet small computer system interface data, which is used for sending a plurality of data packets to a plurality of storage devices by a target of the Internet small computer system interface.
To achieve the above objective, the communication method for accelerating Internet small computer system interface data of the present invention includes the following steps. An access request for accessing storage devices is received by a target. A plurality of small computer interface commands is generated according to the access request. The small computer interface commands are read by an egress packet generator in the target. An address resolving procedure is performed by the egress packet generator for converting the small computer interface commands to a plurality of network packets. A first check code is generated according to a storage content in each network packet. The first check codes are added to the network packets.
In another aspect of the present invention, the present invention is directed to a processing system for network packets of an Internet small computer system interface, which is used for transporting and processing a plurality of network packets among Internet small computer system interface storage systems.
To achieve the above objective, the processing system for network packets of an Internet small computer system interface of the present invention includes an initiator, storage devices, and a target. The initiator is adapted to send an access request. The storage devices are adapted to store target information. The target receives the access request from the initiator, and accesses the target information in the storage devices according to the access request and transports the target information to the initiator.
In the network packet transporting method of the present invention, the check codes for the network packets are generated by utilizing a network card in the target. Thus, the time and memory space for the target to map the access request to the network card are reduced.
The present invention will become more fully understood from the detailed description given herein below for illustration only, and thus are not limitative of the present invention, and wherein:
The packet information of the Internet small computer system interface is re-segmented after entering the TCP layer. Therefore, the packet information of one Internet small computer system interface may be stored in multiple TCP network packets, or the packet information of multiple Internet small computer system interfaces may be stored in one TCP network packet. Thus, a first check code is generated by the egress packet generator according to a storage content in each network packet (step S350).
In addition to the situation in which a single initiator 210 sends the request, the present invention may also utilize the access requests of a plurality of initiators 210.
A plurality of small computer interface commands is generated according to the access requests (step S430). The small computer interface commands are read by an egress packet generator in the target (step S440). A memory address in the target is read (step S451). Network packets are encapsulated in batches according to the small computer interface commands stored in the memory address (step S452).
An address resolving procedure is performed by the egress packet generator for converting the small computer interface commands to a plurality of network packets (step S460). An offset is calculated for each network packet (step S470). A check code is added to the network packet according to the offset of the network packet (step S471). A first check code is generated according to a storage content of each network packet (step S472). The first check codes are added to the network packets (step S480), and the network packets are sent to a corresponding apparatus.
In order to illustrate the operational process when multiple initiators 210 initiate the access requests clearly, the following implementation aspect is described in detail below. It should be noted the number of the initiators 210 is limited in the present invention. A first initiator initiates a first access request; a second initiator initiates a second access request; a third initiator initiates a third access request. The target 230 generates corresponding small computer interface commands (a first small computer interface, a second small computer interface, and a third small computer interface, respectively) according to the different access requests after the target 230 receives the access requests.
The network packet transporting method of the present invention generates check codes for the network packets by using a network card in the target 230. Thereby, the time and memory space for the target 230 to map the access request to the network card are reduced.