Abstract:
The present disclosure relates to a hardware protocol stack, and more particularly, to a hardware protocol stack to which a user-defined protocol is applicable. The present disclosure compares header information stored in a register unit with header information of a received frame, and determines a processing of the received frame on the basis of a comparison result. Also, according to a determined frame process method, data of the received frame is processed based on a logic according to the header information, it is stored at a designated position, or a response frame is transmitted.

Description:
CROSS REFERENCE TO RELATED APPLICATION 
       [0001]    This application claims the benefit of Korean Patent Application No. 10-2016-0051141, fled on Apr. 26, 2016, entitled “HARDWARE PROTOCOL STACK TO APPLY USER-DEFINED PROTOCOL AND METHOD FOR. APPLY USER-DEFINED to PROTOCOL OF HARDWARE PROTOCOL STACK”, which is hereby incorporated by reference in its entirety into this application. 
       BACKGROUND 
     1. Technical Field 
       [0002]    The present disclosure relates to a hardware protocol stack and a method for applying a user-defined protocol, and more particularly, to a hardware protocol stack to which a protocol defined by a user is applicable and a method for applying a user-defined protocol to the hardware protocol stack. 
       2. Description of the Related Art 
       [0003]    A software protocol stack product and a hardware protocol stack product are provided with a function for automatically interpreting a protocol, and each of them processes only information related to a specific protocol. A software protocol stack ports and uses a software stack to a currently used hardware without having a separate hardware and thus there is no necessary for an additional hardware resource. However, a protocol is interpreted through software so that there is a disadvantage in which a process time is increased. Also, a hardware protocol stack is necessary for an additional hardware resource, but it has an advantage in which a process time is remarkably faster than that of the software protocol stack. 
         [0004]      FIG. 1  is a conceptual diagram illustrating a process of extracting frame data from a software protocol stack according to the related art. 
         [0005]    Referring to  FIG. 1 , in a software protocol stack  40  according to the related art, a device stores a frame  20  in a frame storage  30  when the frame  20  is input to media  10 . Also, the software protocol stack  40  verifies header information of the frame  20  and determines to extract error data or the frame  20  that should be transmitted to which storage. With such a structure, when using the software protocol stack according to the related art, a developer may reduce a time necessary for development because data is automatically extracted even when the developer does not know a process in which the software protocol stack interprets a frame. 
         [0006]      FIG. 2  is a conceptual diagram illustrating a process of extracting frame data from a hardware protocol stack according to the related art. 
         [0007]    Referring to  FIG. 2 , unlike the software protocol stack, a hardware protocol stack  50  according to the related art immediately processes the frame  20  therein instead of storing the frame  20  at a frame storage when the frame  20  is input to the media  10 . Therefore, a user may rapidly extract desired data. 
         [0008]    As described above, the hardware protocol stack automatically interprets a protocol so that a development time may be reduced even when a developer does not exactly know the protocol. On the other hand, when a user-defined protocol rather than the protocol or a protocol not provided by the hardware protocol stack is processed, the developer should implement a process of interpreting a protocol in software. However, in this case, a development time or an effort is additionally necessary and performance is degraded in comparison with a protocol stack implemented in hardware. 
       SUMMARY 
       [0009]    An object of the present disclosure is to provide a hardware protocol stack to which a user-defined protocol is applied and a method for applying a user-defined protocol to a hardware protocol stack, which are capable of maintaining a rapid speed of the hardware protocol stack even when a user newly defines a protocol. 
         [0010]    The object of the present disclosure is not limited to the above described object, and other objects and advantages not mentioned above will be understood in the art from the following description and also will be apparently understood by an embodiment of the present disclosure. Also, it will be easily understood that the object and advantages of the present disclosure described herein may be implemented by means and a combination thereof defined by the appended claims. 
         [0011]    To attain the described above object, it is provided a hardware protocol stack to which a user-defined protocol is applied, which includes a register unit in which header information is stored, a comparison unit configured to compare header information of a received frame with header information stored in the register unit whether the two header information are matched to each other, an interface logic unit configured to determine a process of the received frame on the basis of a comparison result of the comparison unit, and 
         [0012]    a logic process unit configured to process data of the received frame based on a logic according to the header information when the frame process method, which is determined in the interface logic according to the header information stored in the register unit and being matched to the header information of the received frame, is a processing of a frame. 
         [0013]    The logic according to the header information includes a unit designation of the data according to header information. The unit designation of the data may be performed such that the logic process unit sets a basic offset and a size unit of the data when receiving a request for writing payload data in a specific region of the data and then stores payload in the basic offset by expanding the payload to be corresponded to the set size unit of the data. 
         [0014]    Here, a frame receiving unit is included, which is configured to store the received frame in a predesignated position when the frame process method, which is determined in the interface logic unit according to header information stored in the register unit and matched to the header information of the received frame, is a storing of a frame. 
         [0015]    Also, a frame production unit is included, which is configured to produce and transmit a response frame with respect to the received frame when the frame process method, which is determined in the interface logic unit according to header information stored in the register unit and matched to the header information of the received frame, is a transmitting of a response frame. 
         [0016]    Further, the present disclosure provides a method for applying a user-defined protocol to a hardware protocol stack, which includes receiving an input of a register in which at least one or more frame header information is included from a user in a register unit, comparing frame header information of a received frame with at least one or more register header information in a comparison unit, and determining a frame process method on the basis of register header information matched to the at least one or more frame header information among the at least one or more register header information in an interface logic unit. 
         [0017]    The method includes processing the received frame in a logic process unit when the frame process method, which is determined in the interface logic unit, is a processing of a frame, producing and transmitting a response frame with respect to the received frame in a frame production unit when the frame process method, which is determined in the interface logic unit, is a transmitting of a response frame, and storing the received frame at a preset destination in a frame receiving unit when the frame process method, which is determined in the interface logic unit, is a storing of a frame. 
         [0018]    In accordance with the present disclosure, flexibility and expendability may be increased by expanding a frame interpretation function applied to only a protocol provided from a supplier of a hardware protocol stack, and by providing a function for a frame interpretation not provided by the supplied, a function for interpreting a protocol made by a user, and a calculation function. 
         [0019]    Also, in accordance with the present disclosure, a development time may be reduced by improving an automatic interpretation function fixed to kinds of protocols in a hardware protocol stack to automatically process a protocol defined by a user in hardware, and a rapid speed may be maintained because a frame is interpreted in hardware even when the user defines a protocol. 
     
    
     
       BRIEF DESCRIPTION OF DRAWINGS 
         [0020]      FIG. 1  is a conceptual diagram illustrating a process of extracting frame data from a software protocol stack according to the related art. 
           [0021]      FIG. 2  is a conceptual diagram illustrating a process of extracting frame data from a hardware protocol stack according to the related art. 
           [0022]      FIGS. 3 and 4  are block diagrams of a hardware protocol stack to which a user-defined protocol is applied according to the present disclosure, respectively. 
           [0023]      FIG. 5  is a flow chart of a method for applying a user-defined protocol of a hardware protocol stack according to the present disclosure. 
       
    
    
     DETAILED DESCRIPTION 
       [0024]    The above and other objects, features and advantages of the present disclosure will be described later in detail with reference to the accompanying drawings, and thus the technical spirit of the present disclosure can be easily implemented by those skilled in the art. In the following description of the present disclosure, if a detailed description of known configurations and functions is determined to obscure the interpretation of embodiments of the present disclosure, the detailed description thereof will be omitted. Hereinafter, preferred embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. In the drawings, the same reference numerals refer to the same or similar elements throughout. 
         [0025]      FIGS. 3 and 4  are block diagrams of a hardware protocol stack to which a user-defined protocol is applied according to the present disclosure, respectively. 
         [0026]    As shown in  FIGS. 3 and 4 , a hardware protocol stack to which a user-defined protocol is applied according to the present disclosure includes a comparison unit  110  for comparing a header of a received frame with a header stored in a register, a register unit  120  for storing a header, an interface logic unit  130  determining a process of a received frame, a logic process unit  140  for processing data of a received frame according to a logic, a frame receiving unit  150  for receiving and storing a frame, and a frame production unit  160  for generating a frame. 
         [0027]    The comparison unit  110  compares header information of a frame received from media, that is, frame header information with header information stored in the register unit  120 , that is, register header information. Generally, the frame is configured with header information, that is, frame header information, data, and a frame check sequence (FCS). The comparison unit  110  compares the frame header information among the frame header information, the data, and the FCS with the register header information whether they are the same as each other. 
         [0028]    The register unit  120  stores header information of a protocol that is an analysis target. A user may store header information of a protocol, which is not used in a commercial stack product or is defined by the user so as to develop a product, in a register. Such a register unit  120  may include a plurality of registers. The present disclosure exemplifies that the register unit  120  includes a first register  121 , a second register  122 , and an N th  register  123 . Here, the first register  121  includes in number of register header information (m is a natural number), and this exemplifies HDR_00, HDR_01, . . . , HDR_0m. The second register  122  also includes m number of register header information (m is a natural number), this exemplifies HDR_10, HDR_11, . . . , HDR_1m. Also, the N th  register  123  (N is a natural number) includes in number of register header information (m is a natural number), this exemplifies HDR_N0, HDR_N1, . . . , HDR_Nm. 
         [0029]    When the m number of register header information (m is a natural number) included in a frame are exemplified as HDR_R0, HDR_R1, HDR_Rm, the comparison unit  110  compares HDR_00, HDR_01, . . . , HDR_0m, which are the register header information included in the first register  121 , with HDR_R0, HDR_R1, . . . , , HDR_Rm, which are the frame header information included in the frame. Here, when the two header information (that is, the frame header information and the register header information) are not matched to each other, the comparison unit  110  compares HDR_10, HDR_11, . . . , HDR_1m, which are the register header information included in the second register  122 , with HDR_R0, HDR_R1, . . . , HDR_Rm, which are the frame header information included in the frame. When the frame header information and the register header information included in the second register  122  are matched to each other, the header information comparison is terminated. On the other hand, when the frame header information and the register header information included in the second register  122  are not matched to each other, register header information included in a third register that is a next register is compared with the frame header information. Also, the comparison unit  110  performs the comparison operation unit the frame header information and the register header information are matched to each other, and such a comparison operation may be performed up to the N th  register  123 . However, the present disclosure is not limited thereto, and the frame header information and all the register header information may be simultaneously compared with each other as necessary. 
         [0030]    The interface logic unit  130  determines whether the frame header information of the received frame is compared with the register header information stored in the register unit  120 , a comparison range of the frame header information and the register header information, and whether the received frame is stored. That is, the interface logic unit  130  differently performs a frame process method on a frame according to a kind of a header included therein. Here, the frame process method includes a processing or storing of the frame and a producing and transmitting of a response frame. 
         [0031]    When the frame header information of the frame and the register header information are matched to each other and the frame process method of the interface logic unit  130  with respect to corresponding frame header information is a processing of a frame, the logic process unit  140  processes data of the received frame according to a logic. Here, the logic is a rule according to the frame header information, and, for example, it may include a unit designation of frame data according to the frame header information, and the like. In the unit designation of the frame data, a unit is not designated in the data included in the received frame. Therefore, the logic process unit  140  designates a unit in data according to header information of a corresponding frame. 
         [0032]    For example, referring to Table 1, when a request for writing payload data in a size of 0×20 at a 0×10 region is received, a user may use the logic process unit  140  to have expandability capable of setting a basic offset to 0×1000 and a size unit to 4 bytes and storing payload at 0×1010 as much as 0×80. 
         [0000]    
       
         
               
               
               
             
           
               
                   
                 TABLE 1 
               
               
                   
                   
               
             
             
               
                   
                 Before applying logic 
                 Source: payload, Destination: 0 × 10, Size:  
               
               
                   
                 process unit 
                 0 × 20 
               
               
                   
                 After applying logic 
                 Source: payload, Destination: 0 × 10 + 0 ×  
               
               
                   
                 process unit 
                 1000. Size: (0 × 20)*4 
               
               
                   
                   
               
             
          
         
       
     
         [0033]    When the frame header information and the register header information are matched to each other and a frame process method of the interface logic unit  130  with respect to a corresponding frame header information is a frame storing, the frame receiving unit  150  stores a corresponding frame at a preset position, that is, processes along a path {circle around ( 2 )} in  FIG. 3 . 
         [0034]    When the frame header information and the register header information are matched to each other and a frame process method of the interface logic unit  130  with respect to the corresponding frame header information is a response frame transmitting, the frame production unit  160  produces and transmits a response frame, that is, processes along a path {circle around ( 1 )} in  FIG. 3 . Here, the frame production unit  160  may produce not only the response frame but also various frames designated according to the frame header information. 
         [0035]    Next, a method for applying a user-defined protocol of a hardware protocol stack according to the present disclosure will be described with reference to the drawings. In the following description, contents, which are overlapped with the above described hardware protocol stack to which the user-defined protocol according to the present disclosure is applied, will be omitted or described in brief. 
         [0036]      FIG. 5  is a flow chart of a method for applying a user-defined protocol of a hardware protocol stack according to the present disclosure. 
         [0037]    As shown in  FIG. 5 , the method for applying a user-defined protocol of a hardware protocol stack includes receiving an input of a register in Operation S 1 , comparing header information in Operation S 2 , determining a frame process in Operation S 3 , processing a frame in Operation S 4 , responding with the frame in Operation S 5 , and storing the frame  56 . 
         [0038]    The register unit receives an input of a register from a user in Operation S  1 . The register unit stores the received register input by the user so as to compare the received register with frame header information of a frame that will be received later, Also, the received register input by the user includes header information, that is, register header information. 
         [0039]    When a frame is received in Operation S 2 , the comparison unit compares the register header information of the received register input in Operation S 1  with frame header information of the received frame. Here, the register unit includes a first register to an N th  register. Also, the comparison unit compares the frame header information with register header information of each of the first register to the N th  register until the two hear information are matched to each other. 
         [0040]    Meanwhile, when the frame header information and the register header information are matched to each other in Operation S 2 , the present disclosure may further include receiving additionally an input of a register from the user in Operation S 2 - 1 . 
         [0041]    When the register header information matched to the frame header information exists in Operation S 2 , the interface logic unit processes the frame with a frame process method according to the corresponding register header information in Operation S 3 . Here, the frame process method includes a processing or storing of the frame and a producing and transmitting of a response frame as described above. 
         [0042]    When the frame process method according to the header information is a processing of a frame in Operation S 3 , the logic process unit processes the received frame in Operation S 4 . 
         [0043]    On the other hand, when the frame process method according to the header information is a responding with a frame, that is, a transmitting a response frame in Operation S 3 , the frame production unit produces and transmits a response frame in Operation S 5 . 
         [0044]    Further, when the frame process method according to the header information is a storing of a frame in Operation S 3 , the frame receiving unit stored the received frame at a destination in Operation S 6 . 
         [0045]    Although the present disclosure has been described with reference to the embodiments, it should be understood that numerous other substitutions, modifications and alterations can be devised by those skilled in the art without departing the technical spirit of this disclosure, and thus it should be construed that the present disclosure is not limited by the embodiments described above and the accompanying drawings.