Packet identification system and packet identification method
By using the host to dynamically set the packet header format in the packet identification system, and using the first packet header analyzer and the second packet header analyzer, the problem of difficulty in real-time expansion of the packet identification system in the existing technology is solved, and the newly added Identification of packet types and reduction of circuit area and cost.
Patent Information
- Application Number
- CN202310279455.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2024-09-24
AI Technical Summary
Due to fixed hardware limitations, existing packet identification systems are difficult to expand identification capabilities immediately and require hardware changes to support new packet types, resulting in an increase in circuit area and cost.
Adopt the new packet header format that needs to be dynamically set by the host, identify multiple packet types through the first packet header analyzer and the second packet header analyzer, and use the host to configure and store the dynamically set packet header format to achieve Added identification of packet types.
Real-time expansion of packet identification capabilities is achieved, circuit area and cost are reduced, and new packet types can be supported without additional hardware changes.
Smart Images

Figure CN118694829A
Abstract
Description
Technical Field
[0001] The present invention relates to a packet identification system and a packet identification method, and more particularly to a packet identification system and a packet identification method in which a host can dynamically set a format of a packet header to be added to identify a new packet type. Background Art
[0002] Receivers for various communication technologies have built-in packet identification systems to identify packet types by analyzing packet header formats. However, as communication specifications continue to evolve, packet types continue to increase, so packet identification systems often need to expand packet identification capabilities for newly added packet types. However, existing packet identification systems are mostly implemented with fixed hardware, and the packet header format of the packet type to be identified must be set in advance. Therefore, when new packet types are added, the existing packet identification system will encounter the problem of being unable to expand packet identification capabilities immediately, and hardware changes must be made for the new packet types, which increases the circuit area and cost of the packet identification system. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a packet identification system and a packet identification method that can dynamically set the format of the packet header to be added by the host to identify the newly added packet type.
[0004] In order to solve the above-mentioned technical problems, one of the technical solutions adopted by the present invention is to provide a packet identification system, which receives a target packet and includes a first packet header analyzer, a host and a second packet header analyzer. The first packet header analyzer is configured to preset multiple first packet header formats, and identify whether the target packet is one of multiple first packet types based on the first packet header formats. The first packet header formats correspond to the multiple first packet types respectively. The host is communicatively connected to the first packet header analyzer and is configured to dynamically set at least one second packet header format. The second packet header analyzer is communicatively connected to the host, configured to store at least one second packet header format, and identify whether the target packet is at least one second packet type based on at least one second packet header format. At least one second packet header format corresponds to at least one second packet type.
[0005] In order to solve the above technical problems, another technical solution adopted by the present invention is to provide a packet identification method, which is applicable to a packet identification system. The packet identification system includes a first packet header analyzer, a host and a second packet header analyzer, the first packet header analyzer and the second packet header analyzer are communicatively connected to the host, and the packet identification method includes: configuring the first packet header analyzer to preset multiple first packet header formats, and the multiple first packet header formats correspond to multiple first packet types respectively; configuring the host to dynamically set at least one second packet header format; configuring the second packet header analyzer to store at least one second packet header format, and at least one second packet header format corresponds to at least one second packet type; receiving a target packet; using the first packet header analyzer to identify whether the target packet is one of the multiple first packet types according to the multiple first packet header formats; and using the second packet header analyzer to identify whether the target packet is at least one second packet type according to at least one second packet header format.
[0006] To further understand the features and technical contents of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings provided are only for reference and description and are not intended to limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 is a schematic diagram of a packet identification system according to an embodiment of the present invention.
[0008] Figure 2 It is a schematic diagram of an embodiment of the present invention that divides the first packet header analyzer and the second packet header analyzer into a multi-segment architecture.
[0009] Figure 3 is a flow chart of the steps of the packet identification method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0010] The following is an explanation of the implementation of the present invention through specific embodiments. Those skilled in the art can understand the advantages and effects of the present invention from the content provided in this specification. The present invention can be implemented or applied through other different specific embodiments, and the details in this specification can also be modified and changed in various ways based on different viewpoints and applications without departing from the concept of the present invention. In addition, the drawings of the present invention are only simple schematic illustrations and are not depicted according to actual dimensions. It is stated in advance. The following implementations will further explain the relevant technical content of the present invention in detail, but the content provided is not intended to limit the scope of protection of the present invention.
[0011] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram of a packet identification system according to an embodiment of the present invention. Figure 1As shown, the packet identification system 1 receives a target packet TP, and includes a first packet header analyzer 11, a host 13, and a second packet header analyzer 15. The first packet header analyzer 11 is configured to preset a plurality of first packet header formats, and identify whether the target packet is one of a plurality of first packet types according to the plurality of first packet header formats. The plurality of first packet header formats correspond to the plurality of first packet types respectively.
[0012] For example, the first packet header analyzer 11 may be configured to preset two first packet header formats HF1_1 and HF1_2 corresponding to the two first packet types PT1_1 and PT1_2 respectively, but Figure 1 The first packet types PT1_1 and PT1_2 are not shown, and the first packet header analyzer 11 identifies whether the target packet TP is one of the first packet types PT1_1 and PT1_2 according to the first packet header formats HF1_1 and HF1_2. In this embodiment, the first packet header analyzer 11 can also generate a first identification result IR1 and output it to the host 13.
[0013] Specifically, the first packet types PT1_1 and PT1_2 may be packet types known to an existing packet identification system (referred to as known packet types), and the first packet header formats HF1_1 and HF1_2 are packet header formats of the above-mentioned known packet types (referred to as known packet header formats). Therefore, the first packet header analyzer 11 may be implemented using fixed hardware, and a known packet header format is pre-set to identify the known packet type, but the present invention does not limit the specific implementation of the first packet header analyzer 11.
[0014] On the other hand, the host 13 is communicatively connected to the first packet header analyzer 11, and is configured to dynamically set at least one second packet header format. In this embodiment, the host 13 can be a remote or local processor, but the present invention does not limit the specific implementation of the host 13. In addition, the second packet header analyzer 15 is communicatively connected to the host 13, and is configured to store at least one second packet header format, and identify whether the target packet TP is at least one second packet type according to the at least one second packet header format. The at least one second packet header format corresponds to the at least one second packet type.
[0015] Furthermore, the second packet header analyzer 15 may include a plurality of registers 151_1-151_N and a plurality of comparators 153_1-153_N, that is, N is an integer greater than 1. The registers 151_1-151_N are communicatively connected to the host 13, and are used to store at least one second packet header format dynamically set by the host 13. In addition, the comparators 153_1-153_N are respectively connected to the registers 151_1-151_N, and are used to compare the target packet header format of the target packet TP with the at least one second packet header format, so as to identify whether the target packet TP is of at least one second packet type.
[0016] It should be noted that, in response to the aforementioned at least one second packet header format including a plurality of second packet header formats, the plurality of second packet header formats respectively correspond to a plurality of second packet types, and the plurality of second packet header formats are respectively stored in registers 151_1 to 151_N. In addition, each comparator of the second packet header analyzer 15 is activated in response to the connected register storing one of the second packet header formats to compare the target packet header format of the target packet TP with the second packet header format, and generate a corresponding second identification result output to the host 13.
[0017] For the convenience of the following description, the present embodiment takes the second packet header analyzer 15 storing two second packet header formats HF2_1 and HF2_2 corresponding to two second packet types PT2_1 and PT2_2 as an example. Figure 1 The second packet types PT2_1 and PT2_2 are not shown, and the second packet header formats HF2_1 and HF2_2 are stored in the registers 151_1 and 151_2 respectively. Therefore, the comparator 153_1 can be activated to compare the target packet header format of the target packet TP with the second packet header format HF2_1, and generate a corresponding second identification result IR2_1 to output to the host 13.
[0018] Similarly, the comparator 153_2 can be activated to compare the target packet header format of the target packet TP with the second packet header format HF2_2, and generate a corresponding second identification result IR2_2 to output to the host 13. Therefore, the second packet header analyzer 15 of this embodiment can be used to identify whether the target packet TP is one of the second packet types PT2_1 and PT2_2 according to the second packet header formats HF2_1 and HF2_2, and generate the second identification results IR2_1 and IR2_2 to output to the host 13.
[0019] Specifically, the second packet types PT2_1 and PT2_2 may be newly added packet types, and the second packet header formats HF2_1 and HF2_2 are packet header formats of the aforementioned newly added packet types (referred to as newly added packet header formats for short). Therefore, in response to a newly added packet type identification requirement of the packet identification system 1, the host 13 may be configured to set a newly added packet header format as one of the second packet header formats to be stored in one of the registers, and activate a comparator connected to the aforementioned register to compare the target packet header format with the newly added packet header format.
[0020] On the other hand, each second packet header format may be a bit sequence, and in response to the length of the bit sequence being less than the storage space of the stored register, the host 13 may also be configured to set a corresponding mask according to the length of the bit sequence (i.e., the second packet header format) and the storage space. In this embodiment, the host 13 may obtain the length of the corresponding mask by subtracting the length of the second packet header format from the storage space, and store the second packet header format and the corresponding mask in a register. Therefore, if Figure 1 As shown, the host 13 can set the mask M1 according to the length and storage space of the second packet header format HF2_1, and store the second packet header format HF2_1 and the mask M1 in the register 151_1. Similarly, the host 13 can set the mask M2 according to the length and storage space of the second packet header format HF2_2, and store the second packet header format HF2_2 and the mask M2 in the register 151_2.
[0021] In addition, if the second packet header format HF2_1 is a sequence of twelve bits and the length of the mask M1 is three bits, the comparator 153_1 will compare the first twelve bits of the target packet header format with the second packet header format HF2_1. Similarly, if the second packet header format HF2_2 is a sequence of ten bits and the length of the mask M2 is five bits, the comparator 153_2 will compare the first ten bits of the target packet header format with the second packet header format HF2_2. In other words, the mask of this embodiment is used to cover the sequence range that does not need to be compared, so as to avoid identification errors caused by comparing bit sequences of different lengths.
[0022] As can be seen from the above, the host 13 receives the packet identification result (i.e., including the first identification result IR1 generated by the first packet header analyzer 11 and at least one second identification result generated by the second packet header analyzer 15), and uses it to set the second packet header analyzer 15 as required. In this embodiment, the host 13 can also directly receive the target packet TP, and after the first packet header analyzer 11 identifies that the target packet TP is not one of the first packet types PT1_1 and PT1_2 and the second packet header analyzer 15 identifies that the target packet TP is not one of the second packet types PT2_1 and PT2_2, the host 13 can also directly perform packet identification on the target packet TP.
[0023] Then, after the host 13 completes the packet identification of the target packet TP, the host 13 may set the target packet header format of the target packet TP as another second packet header format to be stored in another register (for example, the second packet header format HF2_3 is stored in the register 151_3), and activate the comparator 153_3 connected to the register 151_3. Therefore, when the packet identification system 1 receives a new target packet TP, the second packet header analyzer 15 may compare the target packet header format of the new target packet TP with the second packet header format HF2_3 through the register 151_3 and the comparator 153_3 to identify whether the new target packet TP is the second packet type PT2_3 corresponding to the second packet header format HF2_3, but Figure 1 The second packet type PT2_3 is also not shown.
[0024] In addition, since the host 13 only needs to directly perform packet identification on the target packet TP when the first packet header analyzer 11 and the second packet header analyzer 15 cannot identify the target packet TP, the packet identification system 1 can have lower requirements on the computing power and computing speed of the host 13. In other words, the present invention can select a host 13 with a smaller area and power consumption. Furthermore, as mentioned above, each packet header format can be a one-bit sequence, so the present invention can also divide the first packet header analyzer 11 and the second packet header analyzer 15 into a multi-segment architecture, and each segment is used to identify a small segment of the packet header of the target packet TP.
[0025] See also Figure 2 , Figure 2 FIG. 1 is a schematic diagram of an embodiment of the present invention in which the first packet header analyzer and the second packet header analyzer are divided into multiple sections. Figure 2As shown, the first packet header analyzer 11 can be divided into a plurality of first sub-packet header analyzers 11_1~11_K, and the second packet header analyzer 15 can be divided into a plurality of second sub-packet header analyzers 15_1~15_K. K is an integer greater than 1. In the present embodiment, each sub-packet header analyzer is used to identify a small segment of the header of the target packet TP. For example, when the format of the first segment of the packet header of the target packet TP conforms to the format of the first segment of the second packet header of at least one second packet type, the packet identification system 1 can continue to identify whether the format of the second segment of the packet header of the target packet TP conforms to the format of the second segment of the second packet header of at least one second packet type through the second sub-packet header analyzer 15_2 corresponding to the next segment of the header, thereby making the circuit utilization rate higher and more flexible. Since the operation details of each sub-packet header analyzer have been described in the aforementioned embodiment, they will not be repeated here.
[0026] On the other hand, see Figure 3 , Figure 3 is a flow chart of the steps of the packet identification method according to an embodiment of the present invention. Figure 3 The packet identification method can be applied to Figure 1 Packet Identification System 1, so please also refer to Figure 1 To facilitate understanding. Figure 3 As shown, the packet identification method includes the following steps.
[0027] Step S301: Configure the first packet header analyzer 11 to preset a plurality of first packet header formats, and the plurality of first packet header formats respectively correspond to a plurality of first packet types. For example, the first packet header analyzer 11 may be configured to preset two first packet header formats HF1_1 and HF1_2 respectively corresponding to two first packet types PT1_1 and PT1_2.
[0028] Step S302: Configure the host 13 to dynamically set at least one second packet header format.
[0029] Step S303: Configure the second packet header analyzer 15 to store at least one second packet header format, and the at least one second packet header format corresponds to at least one second packet type. For example, the second packet header analyzer 15 can be configured to store two second packet header formats HF2_1 and HF2_2 corresponding to two second packet types PT2_1 and PT2_2, respectively.
[0030] Step S304: Receive the target packet TP. In this embodiment, the first packet header analyzer 11, the host 13 and the second packet header analyzer 15 of the packet recognition system 1 can all receive the target packet TP.
[0031] Step S305 : Using the first packet header analyzer 11 to identify whether the target packet TP is one of the first packet types according to the first packet header formats. In this embodiment, the first packet header analyzer 11 can also generate a first identification result IR1 and output it to the host 13 .
[0032] Step S306: Using the second packet header analyzer 15 to identify whether the target packet TP is of at least one second packet type according to at least one second packet header format. In this embodiment, the second packet header analyzer 15 can also generate at least one second identification result and output it to the host 13. For example, in response to the aforementioned at least one second packet header format including the second packet header formats HF2_1 and HF2_2, the second packet header analyzer 15 can also generate second identification results IR2_1 and IR2_2 and output them to the host 13. Since the relevant details are the same as the previous content, they will not be repeated here.
[0033] In summary, one of the beneficial effects of the present invention is that the packet identification system and packet identification method provided by the present invention can dynamically set the packet header format that needs to be added to identify the newly added packet type by the host, so that the packet identification capability can be expanded immediately. In addition, the host dynamically sets the newly added packet header format to store it in the register of the second packet header analyzer, and activates the comparator connected to the register to compare the target packet header format of the target packet with the newly added packet header format, thereby greatly reducing the circuit area and cost at the same time.
[0034] The contents provided above are only preferred feasible embodiments of the present invention, and are not intended to limit the scope of the present invention. Therefore, all equivalent technical changes made using the contents of the present invention's specification and drawings are included in the scope of the present invention.
[0035]
Explanation of symbols
[0036] 1: Packet Identification System
[0037] TP: Target Packet
[0038] 11: First packet header analyzer
[0039] HF1_1, HF1_2: First packet header format
[0040] IR1: First identification result
[0041] 13: Host
[0042] 15: Second packet header analyzer
[0043] 151_1~151_N: register
[0044] 153_1~153_N: Comparator
[0045] HF2_1, HF2_2, HF2_3: Second packet header format
[0046] IR2_1, IR2_2: Second recognition result
[0047] M1,M2: Mask
[0048] 11_1~11_K: First sub-packet header analyzer
[0049] 15_1~15_K: Second sub-packet header analyzer
[0050] S301~S306: process steps.
Claims
1. A packet identification system receives a target packet and comprises: a first packet header analyzer configured to preset a plurality of first packet header formats and identify whether the target packet is one of a plurality of first packet types according to the plurality of first packet header formats, wherein the plurality of first packet header formats respectively correspond to the plurality of first packet types; a host, communicatively connected to the first packet header analyzer and configured to dynamically set at least one second packet header format; as well as A second packet header analyzer is communicatively connected to the host and is configured to store the at least one second packet header format and identify whether the target packet is of at least one second packet type according to the at least one second packet header format, wherein the at least one second packet header format corresponds to the at least one second packet type.
2. The packet identification system as claimed in claim 1, wherein the second packet header analyzer comprises: A plurality of registers, communicatively connected to the host, for storing the at least one second packet header format dynamically set by the host; as well as A plurality of comparators are respectively connected to the plurality of registers and are used for comparing a target packet header format of the target packet with the at least one second packet header format to identify whether the target packet is of the at least one second packet type.
3. The packet identification system as described in claim 2, wherein in response to the at least one second packet header format including multiple second packet header formats, the multiple second packet header formats respectively correspond to multiple second packet types, and the multiple second packet header formats are respectively stored in the multiple registers.
4. A packet identification system as described in claim 3, wherein the first packet header analyzer also generates a first identification result output to the host, and each of the multiple comparators of the second packet header analyzer is activated in response to the connected register storing one of the second packet header formats to compare the target packet header format with the second packet header format and generate a corresponding second identification result output to the host.
5. A packet identification system as described in claim 4, wherein in response to the packet identification system having a new packet type identification requirement, the host is configured to set a new packet header format as one of the second packet header formats to be stored in one of the registers, and activate the comparator connected to the register to compare the target packet header format with the second packet header format.
6. The packet identification system of claim 3 , wherein each of the plurality of second packet header formats is a bit sequence, and in response to a length of the bit sequence being smaller than a storage space of the stored register, the host is further configured to set a corresponding mask according to the length of the bit sequence and the storage space.
7. A packet identification method, applicable to a packet identification system, wherein the packet identification system comprises a host, a first packet header analyzer and a second packet header analyzer, the first packet header analyzer and the second packet header analyzer are communicatively connected to the host, and the packet identification method comprises: The first packet header analyzer is configured to preset a plurality of first packet header formats, and the plurality of first packet header formats respectively correspond to a plurality of first packet types; Configuring the host to dynamically set at least one second packet header format; configuring the second packet header analyzer to store the at least one second packet header format, and the at least one second packet header format corresponds to at least one second packet type; receiving a target packet; Using the first packet header analyzer to identify whether the target packet is one of the first packet types according to the first packet header formats; as well as The second packet header analyzer is used to identify whether the target packet is of the at least one second packet type according to the at least one second packet header format.
8. The packet identification method as claimed in claim 7, wherein the second packet header analyzer comprises: A plurality of registers, communicatively connected to the host, for storing the at least one second packet header format dynamically set by the host; as well as A plurality of comparators are respectively connected to the plurality of registers and are used for comparing a target packet header format of the target packet with the at least one second packet header format to identify whether the target packet is of the at least one second packet type.
9. The packet identification method as claimed in claim 8, wherein in response to the at least one second packet header format including multiple second packet header formats, the multiple second packet header formats respectively correspond to multiple second packet types, and the multiple second packet header formats are respectively stored in the multiple registers.
10. The packet identification method of claim 9, wherein the first packet header analyzer further generates a first identification result and outputs it to the host, and each of the plurality of comparators of the second packet header analyzer yes In response to the connected register storing one of the second packet header formats, the device is activated to compare the target packet header format with the second packet header format, and generates a corresponding second identification result to be output to the host.
