Abstract:
A switch equipment and data processing method for supporting link layer security transmission are provided. The switch equipment for supporting link layer security transmission comprises a switch module and multiple port modules, each port module is electrically connected with the switch module respectively; the port module supports a link layer key management capability, and is used for establishing a share key for encrypting and decrypting data frames between the switch equipment and other network nodes.

Description:
This application is a US National Stage of International Application No. PCT/CN2011/075856, filed Jun. 17, 2011, designating the United States, and claiming the benefit of Chinese Patent Application No. 201010596665.5, filed with the Chinese Patent Office on Dec. 20, 2010 and entitled “Switch device supporting link layer secured transmission and data processing method thereof,” both of which are hereby incorporated by reference in their entireties. 
     FIELD 
     The present invention relates to the field of network security and particularly to a switch device supporting link layer secured transmission and a data processing method thereof. 
     BACKGROUND 
     A wired local area network is typically a broadcast network in which data transmitted from a node can be received by any other node. The respective nodes on the network share a channel, which poses great potential insecurity to the network. An attacker can capture all data packets on the network simply by accessing the network to listen. 
     No data security method has been proposed for a Local Area Network (LAN) defined in the existing national standard GB/T 15629.3 (corresponding to the IEEE 802.3 or ISO/IEC 8802-3), and this makes it easy for an attacker to steal key information. In the domain of international researches, a data encryption protocol to secure the Ethernet has been proposed in the IEEE 802.1 AE standard established by the IEEE, and a security measure with encryption per hop has been adopted for secured delivery of data between network nodes. 
     A switch device supporting the GB/T 15629.3 forwards all data packets directly and is incapable of link layer secured transmission, and information of the transmitted data packets is susceptible to interception; and a switch device supporting the IEEE 802.1 AE supports only encryption per hop and has to operate to decrypt and then encrypt all the forwarded encrypted data packets, thus resulting in a heavy burden on the switch device and a significant delay in transmission of the data on a network. 
     SUMMARY 
     In order to address the foregoing technical problems in the prior art, embodiments of the invention provides a switch device supporting link layer secured transmission with an alleviated computing burden of the switch device and at a low network upgrade cost and a data processing method thereof. 
     An embodiment of the invention provides a switch device supporting link layer secured transmission, which includes a switch module and a plurality of port modules, and the port modules are electrically connected with the switch module respectively; and the port modules support a link layer key management capability and are configured to create shared keys between the switch device and another network node for encrypting and decrypting a data frame. 
     An embodiment of the invention further provides a data processing method of a switch device supporting link layer secured transmission, wherein the method includes: 
     1) an interface module of a port, Port X, of the switch device receiving a data frame, Frame A 1 , and submitting the data frame to a security process module of the port, Port X, wherein the data frame, Frame A 1 , includes a first header and a first payload; 
     2) the security process module of the port, Port X, of the switch device in combination with a key management module and an algorithm module of the port, Port X, processing Frame A 1  according to information of the first header of Frame A 1  to construct a data frame, Frame A 2 , and submitting Frame A 2  to a switch module of the switch device, wherein Frame A 2 , includes a second header and a second payload; 
     3) the switch module of the switch device extracting information of the second header of Frame A 2 , and if a DA field in the second header is consistent with an MAC address of the switch device, then the switch device delivering the second payload of Frame A 2  to an upper layer (e.g., a network layer, an application layer, etc.) of the link layer for processing; otherwise, the switch device switching Frame A 2  correctly to a security process module of a port, Port Y, of the switch device according to local MAC address learning information; and 
     4) the security process module of the port, Port Y, in combination with a key management module and an algorithm module of the port, Port Y, processing Frame A 2  according to the information of the second header to construct a data frame, Frame A 3 , and outputting Frame A 3  through an interface module of the port, Port Y, wherein Frame A 3  includes a third header and a third payload, and 
     Wherein: 
     Port X represents a first port module of the switch device, which is an input port of a data frame, Frame A; 
     Port Y represents a second port module of the switch device, which is an output port of the data frame, Frame A; 
     Frame A 1  represents a data frame received by the interface module by the port, Port X; 
     Frame A 2  represents a data frame submitted by the security process module of the port, Port X, to the switch module; and 
     Frame A 3  represents a data frame finally output by the interface module of the port, Port Y, and 
     if Frame A 1  received by the switch device is an encrypted data frame, then the switch device needs to decrypt and then encrypt and then forward the data frame, wherein a key used to decrypt the data frame, Frame A 1 , to construct Frame A 2  is denoted by KEY 1 , and a key used to encrypt the data frame, Frame A 2 , to construct Frame A 3  is denoted by KEY 2 , and then Port X of the switch device decrypts Frame A 1  by KEY 1  to construct Frame A 2 ; and Port Y encrypts Frame A 2  by KEY 2  to construct Frame A 3 . 
     The switch device supporting link layer secured transmission according to the embodiment of the invention can support both a data frame in the standard ISO/IEC 8802-3 and data frames in a variety of link layer encryption protocols including a data frame in the IEEE 802.1AE protocol. The variety of link layer encryption protocols can be supported together with the possibility of forward compatibility to thereby perform secured transmission of a data frame at the link layer and improve the security of a network. As compared with an IEEE 802.1AE switch device, the switch device supporting link layer secured transmission according to the embodiment of the invention has the capability to process a data frame including an MAClist field in a link layer encryption protocol in addition to the support of link layer secured transmission so that it is not necessary to operate to decrypt and then encrypt and then forward all the data packets to be forwarded and thus it is possible to lower a computing burden on the switch device. Furthermore the switch device according to the embodiment of the invention supports a variety of data frames and thus is capable of hybrid networking together with other switch devices to thereby lower a network upgrade cost. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a schematic diagram of a switch device supporting link layer secured transmission according to an embodiment of the invention; and 
         FIG. 2  is a flow chart of a data processing method of a switch device supporting link layer secured transmission according to an embodiment of the invention. 
     
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
     Referring to  FIG. 1 , a switch device supporting link layer secured transmission according to an embodiment of the invention includes a switch module and a plurality of port modules, where all the port modules are electrically connected respectively with the switch module; and each port module includes an algorithm module, an interface module, an security process module and a key management module, and the security process module is electrically connected respectively with the interface module, the algorithm module and the key management module. 
     Each port module supports a link layer key management capability and can create shared keys between the switch device and another network node for encrypting and decrypting a data frame; and the created shared keys can be pre-shared or can be negotiated about upon successful node identity authentication and are managed and stored by the key management module of the port module. 
     The algorithm module relates to encryption and decryption algorithms and/or an integrity check algorithm and can be embodied in hardware or in software. 
     The switch device supporting link layer secured transmission according to the embodiment of the invention supports both a data frame in the standard ISO/IEC 8802-3, and a data frame in a link layer encryption protocol which includes a header and a payload as depicted in Table 1 below: 
     
       
         
               
               
               
             
           
               
                   
                 TABLE 1 
               
               
                   
                   
               
             
             
               
                   
                 Header 
                 Payload 
               
               
                   
                   
               
             
          
         
       
     
     Particularly the header is as depicted in Table 2 below: 
     
       
         
               
               
               
               
               
               
               
             
           
               
                   
                 TABLE 2 
               
               
                   
                   
               
             
             
               
                   
                 DA 
                 SA 
                 Ethertype 
                 isE 
                 keyIndex 
                 MAClist 
               
               
                   
                   
               
             
          
         
       
     
     Where: 
     The DA field represents the identifier of a destination node, the value of which is an MAC address of the destination node; 
     The SA field represents the identifier of a source node, the value of which is an MAC address of the source node; 
     The Ethertype field represents an Ethernet-type field with the value thereof being an Ethernet-type field in the link layer encryption protocol to identify the corresponding link layer encryption protocol and frame structure; 
     The is E field represents an encryption flag bit to identify whether the payload of the data frame is plaintext information or ciphertext information of user data, and this field is used by a recipient of the data packet as a criterion to judge whether decryption is required; 
     The keyIndex field represents the identifier of a key to secure the payload; 
     The MAClist field represents a list of specific MAC addresses, and this field is an optional field; and 
     The payload field represents information of user data, which can be either plaintext information of the user data or ciphertext information of the user data. 
     With the presence of the MAClist field, the switch device in the list of specific MAC addresses given in the MAClist field will receive and decrypt the received data frame if it is the destination node or will decrypt and then encrypt and then forward the received data frame if it is not the destination node; and the switch device which is not in the list of specific MAC addresses given in the MAClist field will receive and decrypt the received data frame if it is the destination node or will only forward the received ciphertext data packet directly if it is not the destination node; or 
     With the absence of the MAClist field, the switch device receiving the data frame will receive and decrypt the received data frame if it is the destination node or will decrypt and then encrypt and then forward the received data frame if it is not the destination node. 
     With the presence of the MAClist field, retrieval information of the key used by the switch device in the list of specific MAC addresses given in the field to decrypt the ciphertext data packet includes MAClist, SA and keyIndex; and retrieval information of the key used for encryption thereof includes MAClist and DA. 
     With the absence of the MAClist field, the switch device will decrypt and then encrypt and then forward all the ciphertext data packets to be forwarded, and the retrieval information of the key used to decrypt the ciphertext data packet includes SA and keyIndex; and the retrieval information of the key used for encryption thereof includes DA. 
     A particular method of determining key retrieval information will not be limited to the embodiments of the invention but can depend upon the link layer encryption protocol, identified by Ethertype and supported by the switch device. A unique key can be retrieved by key retrieval information for decryption; and a plurality of keys may be retrieved for encryption by key retrieval information, and the switch device selects one of the keys under a local strategy and fills keyIndex of the selected key into the header of the data frame. 
     Referring to  FIG. 2 , a port module of the switch device supporting link layer secured transmission may be an inlet of the switch device or may be an outlet of the switch device. 
     Taking a data frame, Frame A, as example for a description, Frame A is input via a port, Port X, of the switch device and output via a port, Port Y; and in order to distinguish different Frames A transmitted between different modules, they are identified respectively by Frames A 1  to A 3 , where: 
     Frame A 1  represents a data frame received by the interface module of the port, Port X; 
     Frame A 2  represents a data frame submitted by the security process module of the port, Port X, to the switch module; and 
     Frame A 3  represents a data frame finally output by the interface module of the port, Port Y. 
     If Frame A 1  received by the switch device is an encrypted data frame, then the switch device will decrypt and then encrypt and then forward the data frame, where a key used to decrypt the data frame, Frame A 1 , to construct Frame A 2  is denoted by KEY 1 , and a key used to encrypt the data frame, Frame A 2 , to construct Frame A 3  is denoted by KEY 2 , and then Port X of the switch device decrypts Frame A 1  by KEY 1  to construct Frame A 2 ; and Port Y encrypts Frame A 2  by KEY 2  to construct Frame A 3 . 
     An implementation of a data process flow of the switch device supporting link layer secured transmission according to the embodiment of the invention is as follows: 
     1) The interface module of the port, Port X, of the switch device receives the data frame, Frame A 1 , and submits Frame A 1  to the security process module of the port, Port X; 
     2) The security process module of the port, Port X, of the switch device in combination with the key management module and the algorithm module of the port, Port X, processes Frame A 1  according to information of the header  1  of Frame A 1  to construct Frame A 2  and submits Frame A 2  to the switch module of the switch device; 
     3) The switch module of the switch device extracts information of the header  2  of Frame A 2 , and if the DA field in the header  2  is consistent with the MAC address of the switch device, then the switch device delivers the payload  2  of Frame A 2  to an upper layer (e.g., the network layer, the application layer, etc.) of the link layer for processing; otherwise, the switch device switches Frame A 2  correctly to the security process module of the port, Port Y, according to local MAC address learning information; and 
     4) The security process module of the port, Port Y, of the switch device in combination with the key management module and the algorithm module of the port, Port Y, processes Frame A 2  according to the information of the header  2  to construct Frame A 3  and outputs Frame A 3  through the interface module of the port, Port Y. 
     Particularly a particular flow of the forgoing step 2) is as follows: 
     2.1) The security process module of the port, Port X, determines from the Ethertype field in the data frame, Frame A 1 , the link layer encryption protocol used for data encapsulation and determines from the is E field whether the payload  1  is encrypted, and if it is encrypted, then the step 2.2) is performed; otherwise, Frame A 1  is taken directly as Frame A 2 , that is, the header  2  is the same as the header  1  and the payload  2  is the same as the payload  2 , and the step 2.6) is performed; 
     2.2) If the MAClist field is present in the data frame, Frame A 1 , then it is determined whether the MAC address of the switch device is in the list of specific MAC addresses given in the MAClist field, and if it is not in the list, then Frame A 1  is taken directly as Frame A 2 , that is, the header  2  is the same as the header  1  and the payload  2  is the same as the payload  2 , and the step 2.6) is performed, or if the MAC address of the switch device is in the list, then the step 2.3) is performed; or if there is no MAClist field in the data frame, Frame A 1 , then the step 2.3) is performed directly; 
     2.3) The security process module of the port, Port X, determines from the keyIndex field and the SA field of the data frame, Frame A 1 , or from the keyIndex field, the SA field and the MAClist field of the data frame, Frame A 1 , the retrieval information of the key, KEY 1 , to secure Frame A 1  and sends the retrieval information of the key, KEY 1 , to the key management module of the port, Port X; 
     2.4) The key management module of the port, Port X searches for the corresponding key, KEY 1 , by the retrieval information of the key, KEY 1 , and feeds the key, KEY 1 , back to the security process module of the port, Port X; 
     2.5) The security process module of the port, Port X, invokes the algorithm module, inputs the key, KEY 1 , and the payload  1  of Frame A 1 , obtains the plaintext information of the payload  1  of Frame A 1  through decryption and constructs Frame A 2  by taking the plaintext information of the payload  1  of Frame A 1  as the payload  2  of Frame A 2  and taking the information of the header  1  of Frame A 1  directly as the information of the header  2  of Frame A 2 , that is, the header  2  is the same as the header  1 , and the payload  2  is the plaintext information of the payload  1 ; and 
     2.6) The security process module of the port, Port X, submits Frame A 2  to the switch module. 
     Particularly a particular flow of the forgoing step 4) is as follows: 
     4.1) The security process module of the port, Port Y, determines from the Ethertype field in Frame A 2  the link layer encryption protocol used for data encapsulation and determines from the is E field whether to encrypt the payload  2  for transmission in a ciphertext form on a network, and if so, then the step 4.2) is performed; otherwise, Frame A 2  is taken directly as Frame A 3 , that is, a header  3  is the same as the header  2 , and a payload  3  is the same as the payload  2 , and the step 4.6) is performed; 
     4.2) If the MAClist field is present in the data frame, Frame A 2 , then it is determined whether the MAC address of the switch device is in the list of specific MAC addresses given in the MAClist field, and if it is not in the list, then Frame A 2  is taken directly as Frame A 3 , that is, the header  3  is the same as the header  2  and the payload  3  is the same as the payload  2 , and the step 4.6) is performed directly, or if the MAC address of the switch device is in the list, then the step 4.3) is performed; or if there is no MAClist field in the data frame, Frame A 2 , then the step 4.3) is performed directly; 
     4.3) The security process module of the port, Port Y, determines from the DA field of the data frame, Frame A 2 , or from the DA field and the MAClist field of the data frame, Frame A 2 , the retrieval information of the key, KEY 2 , to secure Frame A 2 , sends the retrieval information of the key, KEY 2 , to the key management module of the port, Port Y, and performs the step 4.4); 
     4.4) The key management module of the port, Port Y searches for available keys by the retrieval information of the key, KEY 2 , selects a key, KEY 2 , according to a local strategy and feeds the key, KEY 2 , and the identifier keyIndex of the key, KEY 2 , back to the security process module of the port, Port Y; 
     4.5) The security process module of the port, Port Y, invokes the algorithm module, inputs the key, KEY 2 , and the payload  2  of Frame A 2 , obtains ciphertext information of the payload  2  of Frame A 2  through encryption and constructs Frame A 3  by taking the ciphertext information of the payload  2  of Frame A 2  as the payload  3  of Frame A 3  and updating with keyIndex of the used key, KEY 2 , the keyIndex field in the header  2  of Frame A 2  as information of the header  3  of Frame A 3 , that is, the header  3  is the header  2  with the keyIndex field updated with keyIndex of KEY 2 , and the payload  3  is the ciphertext information of the payload  2 ; and 
     4.6) The security process module of the port, Port Y, outputs Frame A 3  through the interface module. 
     In another embodiment, the data frame, in the link layer encryption protocol, supported by the switch device supporting link layer secured transmission according to the embodiment of the invention can further include an MIC field (e.g., MIC 1 , MIC 2 , and MIC 3  in  FIG. 2 ) representing an integrity check code which is an integrity check value as a result of calculation on the data frame, Frame (e.g., Frame A 1 , Frame A 2  and Frame A 3  in  FIG. 2 ); and the integrity check MIC calculation covers a range of fields determined by the link layer encryption protocol corresponding to Ethertype supported by the switch device, and in an implementation in which the MIC field is supported, the key to secure the data frame includes two parts, one of which is an integrity check key, and the other of which is a session encryption key, where the integrity check key is used to calculate the integrity check code MIC on the data frame, and the session encryption key is used to encrypt the payload of the data frame. 
     A process of the switch device supporting link layer secured transmission to secure the data frame can firstly calculate the integrity check code on the data frame to construct the MIC field and then encrypt the user data of the data frame to construct the payload field; or can firstly encrypt the user data of the data frame to construct the payload field and then calculate the integrity check code to construct the MIC field. 
     Since the encryption process involves two strategies with encryption and without encryption, whether decryption is required will firstly be determined upon reception and then the MIC field can be verified for correctness in the alternative in which the integrity check code is firstly calculated to construct the MIC field; and 
     In the alternative in which the integrity check code is then calculated to construct the MIC field, firstly the MIC field can be verified for correctness upon reception and then whether decryption is required will be determined, where: 
     I. when the integrity check code is firstly calculated on the data frame to construct the MIC field and then user data of the data frame is encrypted to construct the payload field, a particular flow of the forgoing step 2) is as follows: 
     2.1) The security process module of the port, Port X, determines from the Ethertype field in the data frame, Frame A 1 , the link layer encryption protocol used for data encapsulation; 
     2.2) If the MAClist field is present in the data frame, Frame A 1 , then it is determined whether the MAC address of the switch device is in the list of specific MAC addresses given in the MAClist field, and if it is not in the list, then Frame A 1  is taken directly as Frame A 2 , that is, the header  2  is the same as the header  1 , the payload  2  is the same as the payload  1 , and MIC 2  is the same as MIC 1 , and the step 2.9) is performed, or if the MAC address of the switch device is in the list, then the step 2.3) is performed; or if there is no MAClist field in the data frame, Frame A 1 , then the step 2.3) is performed directly; 
     2.3) The security process module of the port, Port X, determines from the keyIndex field and the SA field of the data frame, Frame A 1 , or from the keyIndex field, the SA field and the MAClist field of the data frame, Frame A 1 , the retrieval information of the key, KEY 1 , to secure Frame A 1  and sends the retrieval information of the key, KEY 1 , to the key management module of the port, Port X; 
     2.4) The key management module of the port, Port X searches for the corresponding key, KEY 1 , by the retrieval information of the key, KEY 1 , and feeds the key, KEY 1 , back to the security process module of the port, Port X; 
     2.5) The security process module of the port, Port X, determines from the is E field whether the payload  1  is encrypted, and if it is encrypted, then the step 2.6) is performed; otherwise, the payload  1  of Frame A 1  is plaintext information of the payload  1 , and the step 2.7) is performed directly; 
     2.6) The security process module of the port, Port X, invokes the algorithm module, inputs the session encryption key of the key, KEY 1 , and the payload  1  of Frame A 1 , and obtains the plaintext information of the payload  1  of Frame A 1  through decryption; 
     2.7) The security process module of the port, Port X, invokes the algorithm module, inputs the integrity check key of the key, KEY 1 , and the plaintext information of the payload  1  of Frame A 1  and verifies the MIC 1  field for correctness; and if it is correct, then 2.8) is performed; otherwise, the packet is discarded; 
     2.8) The security process module of the port, Port X, constructs Frame A 2  by taking the plaintext information of the payload  1  of Frame A 1  as the payload  2  of Frame A 2  and taking the information of the header  1  of Frame A 1  directly as the information of the header  2  of Frame A 2 , that is, the header  2  is the same as the header  1 , and the payload  2  is a plaintext of the payload  1 ; and 
     2.9) The security process module of the port, Port X, submits Frame A 2  to the switch module. 
     A particular flow of the forgoing step 4) is as follows: 
     4.1) The security process module of the port, Port Y, determines from the Ethertype field in Frame A 2  the link layer encryption protocol used for data encapsulation; 
     4.2) If the MAClist field is present in the data frame, Frame A 2 , then it is determined whether the MAC address of the switch device is in the list of specific MAC addresses given in the MAClist field, and if it is not in the list, then Frame A 2  is taken directly as Frame A 3 , that is, a header  3  is the same as the header  2 , a payload  3  is the same as the payload  2 , and MIC 3  is the same as MIC 2 , and the step 4.9) is performed directly, or if the MAC address of the switch device is in the list, then the step 4.3) is performed; or if there is no MAClist field in the data frame, Frame A 2 , then the step 4.3) is performed directly; 
     4.3) The security process module of the port, Port Y, determines from the DA field of the data frame, Frame A 2 , or from the DA field and the MAClist field of the data frame, Frame A 2 , the retrieval information of the key, KEY 2 , to secure Frame A 2 , sends the retrieval information of the key, KEY 2 , to the key management module of the port, Port Y, and performs the step 4.4); 
     4.4) The key management module of the port, Port Y searches for available keys by the retrieval information of the key, KEY 2 , selects a key, KEY 2 , according to a local strategy and feeds the key, KEY 2 , and the identifier keyIndex of the key, KEY 2 , back to the security process module of the port, Port Y; 
     4.5) The security process module of the port, Port Y, invokes the algorithm module, inputs the integrity check key of the key, KEY 2 , and the payload  2  of Frame A 2  and calculates the integrity check code MIC 3  field; 
     4.6) The security process module of the port, Port Y, determines from the is E field of the data frame, Frame A 2 , whether to encrypt the payload  2  for transmission in a ciphertext form on a network, and if so, then the step 4.7) is performed; otherwise, the step 4.8) is performed; 
     4.7) The security process module of the port, Port Y, invokes the algorithm module, inputs the session encryption key of the key, KEY 2 , and the payload  2  of Frame A 2 , obtains ciphertext information of the payload  2  of Frame A 2  through encryption, constructs Frame A 3  by taking the ciphertext information of the payload  2  of Frame A 2  as the payload  3  of Frame A 3 , updating with keyIndex of the used key, KEY 2 , the keyIndex field in the header  2  of Frame A 2  as information of the header  3  of Frame A 3  and taking MIC 3  calculated in the step 4.5) as the MIC 3  field of Frame A 3 , that is, the header  3  is the header  2  with the keyIndex field updated with keyIndex of KEY 2 , the payload  3  is the ciphertext information of the payload  2 , and MIC 3  is MIC 3  calculated in the step 4.5), and performs the step 4.9); and 
     4.8) The security process module of the port, Port Y, constructs Frame A 3  by taking the payload  2  of Frame A 2  directly as the payload  3  of Frame A 3 , updating with keyIndex of the used key, KEY 2 , the keyIndex field in the header  2  of Frame A 2  as information of the header  3  of Frame A 3  and taking MIC 3  calculated in the step 4.5) as the MIC 3  field of Frame A 3 , that is, the header  3  is the header  2  with the keyIndex field updated with keyIndex of KEY 2 , the payload  3  is same as the payload  2 , and MIC 3  is MIC 3  calculated in the step 4.5), and performs the step 4.9); and 
     4.9) The security process module of the port, Port Y, outputs Frame A 3  through the interface module. 
     II. when user data of the data frame is firstly encrypted to construct the payload field and then the integrity check code is calculated to construct the MIC field, a particular flow of the forgoing step 2) is as follows: 
     2.1) The security process module of the port, Port X, determines from the Ethertype field in the data frame, Frame A 1 , the link layer encryption protocol used for data encapsulation; 
     2.2) If the MAClist field is present in the data frame, Frame A 1 , then it is determined whether the MAC address of the switch device is in the list of specific MAC addresses given in the MAClist field, and if it is not in the list, then Frame A 1  is taken directly as Frame A 2 , that is, the header  2  is the same as the header  1 , the payload  2  is the same as the payload  1 , and MIC 2  is the same as MIC 1 , and the step 2.9) is performed, or if the MAC address of the switch device is in the list, then the step 2.3) is performed; or if there is no MAClist field in the data frame, Frame A 1 , then the step 2.3) is performed directly; 
     2.3) The security process module of the port, Port X, determines from the keyIndex field and the SA field of the data frame, Frame A 1 , or from the keyIndex field, the SA field and the MAClist field of the data frame, Frame A 1 , the retrieval information of the key, KEY 1 , to secure Frame A 1  and sends the retrieval information of the key, KEY 1 , to the key management module of the port, Port X; 
     2.4) The key management module of the port, Port X searches for the corresponding key, KEY 1 , by the retrieval information of the key, KEY 1 , and feeds the key, KEY 1 , back to the security process module of the port, Port X; 
     2.5) The security process module of the port, Port X, invokes the algorithm module, inputs the integrity check key of the key, KEY 1 , and the payload  1  of Frame A 1  and verifies the MIC 1  field for correctness, and if it is correct, then the step 2.6) is performed; otherwise, the packet is discarded; 
     2.6) The security process module of the port, Port X, determines from the is E field whether the payload  1  is encrypted, and if it is encrypted, then the step 2.7) is performed; otherwise, the payload  1  of Frame A 1  is plaintext information of the payload  1 , and the step 2.8) is performed directly; 
     2.7) The security process module of the port, Port X, invokes the algorithm module, inputs the session encryption key of the key, KEY 1 , and the payload  1  of Frame A 1  and obtains the plaintext information of the payload  1  of Frame A 1  through decryption; 
     2.8) The security process module of the port, Port X, constructs Frame A 2  by taking the plaintext information of the payload  1  of Frame A 1  as the payload  2  of Frame A 2  and taking the information of the header  1  of Frame A 1  directly as the information of the header  2  of Frame A 2 , that is, the header  2  is the same as the header  1 , and the payload  2  is the plaintext information of the payload  1 ; and 
     2.9) The security process module of the port, Port X, submits Frame A 2  to the switch module. 
     A particular flow of the forgoing step 4) is as follows: 
     4.1) The security process module of the port, Port Y, determines from the Ethertype field in Frame A 2  the link layer encryption protocol used for data encapsulation; 
     4.2) If the MAClist field is present in the data frame, Frame A 2 , then it is determined whether the MAC address of the switch device is in the list of specific MAC addresses given in the MAClist field, and if it is not in the list, then Frame A 2  is taken directly as Frame A 3 , that is, a header  3  is the same as the header  2 , a payload  3  is the same as the payload  2 , and MIC 3  is the same as MIC 2 , and the step 4.9) is performed directly, or if the MAC address of the switch device is in the list, then the step 4.3) is performed; or if there is no MAClist field in the data frame, Frame A 2 , then the step 4.3) is performed directly; 
     4.3) The security process module of the port, Port Y, determines from the DA field of the data frame, Frame A 2 , or from the DA field and the MAClist field of the data frame, Frame A 2 , the retrieval information of the key, KEY 2 , to secure Frame A 2 , sends the retrieval information of the key, KEY 2 , to the key management module of the port, Port Y, and performs the step 4.4); 
     4.4) The key management module of the port, Port Y searches for available keys by the retrieval information of the key, KEY 2 , selects a key, KEY 2 , according to a local strategy and feeds the key, KEY 2 , and the identifier keyIndex of the key, KEY 2 , back to the security process module of the port, Port Y; 
     4.5) The security process module of the port, Port Y, determines from the is E field of the data frame, Frame A 2 , whether to encrypt the payload  2  for transmission in a ciphertext form on a network, and if so, then the step 4.6) is performed; otherwise, the step 4.8) is performed; 
     4.6) The security process module of the port, Port Y, invokes the algorithm module, inputs the session encryption key of the key, KEY 2 , and the payload  2  of Frame A 2  and obtains ciphertext information of the payload  2  of Frame A 2  through encryption; 
     4.7) The security process module of the port, Port Y, invokes the algorithm module, inputs the integrity check key of the key, KEY 2 , and ciphertext information of the payload  2  of Frame A 2 , calculates the integrity check code MIC 3  field, constructs Frame A 3  by taking the ciphertext information of the payload  2  of Frame A 2  as the payload  3  of Frame A 3 , updating with keyIndex of the used key, KEY 2 , the keyIndex field in the header  2  of Frame A 2  as information of the header  3  of Frame A 3  and taking calculated MIC 3  as the MIC 3  field of Frame A 3 , that is, the header  3  is the header  2  with the keyIndex field updated with keyIndex of KEY 2 , the payload  3  is the ciphertext information of the payload  2 , and MIC 3  is MIC 3  calculated in the step 4.7), and performs the step 4.9); 
     4.8) The security process module of the port, Port Y, invokes the algorithm module, inputs the integrity check key of the key, KEY 2 , and the payload  2  of Frame A 2 , calculates the integrity check code MIC 3  field, constructs Frame A 3  by taking the payload  2  of Frame A 2  directly as the payload  3  of Frame A 3 , updating with keyIndex of the used key, KEY 2 , the keyIndex field in the header  2  of Frame A 2  as information of the header  3  of Frame A 3  and taking calculated MIC 3  as MIC 3  of Frame A 3 , that is, the header  3  is the header  2  with the keyIndex field updated with keyIndex of KEY 2 , the payload  3  is same as the payload  2 , and MIC 3  is MIC 3  calculated in the step 4.8), and performs the step 4.9); and 
     4.9) The security process module of the port, Port Y, outputs Frame A 3  through the interface module.