CN111385257A - Network packet processing method and device - Google Patents

Network packet processing method and device Download PDF

Info

Publication number
CN111385257A
CN111385257A CN201811626057.7A CN201811626057A CN111385257A CN 111385257 A CN111385257 A CN 111385257A CN 201811626057 A CN201811626057 A CN 201811626057A CN 111385257 A CN111385257 A CN 111385257A
Authority
CN
China
Prior art keywords
network packet
bytes
belonging
receiving
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811626057.7A
Other languages
Chinese (zh)
Other versions
CN111385257B (en
Inventor
张志交
余嘉伟
刘哲鸿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
To Mao Electronics Suzhou Co ltd
Chroma ATE Suzhou Co Ltd
Original Assignee
To Mao Electronics Suzhou Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by To Mao Electronics Suzhou Co ltd filed Critical To Mao Electronics Suzhou Co ltd
Priority to CN201811626057.7A priority Critical patent/CN111385257B/en
Publication of CN111385257A publication Critical patent/CN111385257A/en
Application granted granted Critical
Publication of CN111385257B publication Critical patent/CN111385257B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2463/00Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00
    • H04L2463/102Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00 applying security measure for e-commerce

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A network packet processing method and device thereof, wherein the network packet comprises a plurality of bytes, the byte type comprises a header type, an application type and a check type, the network packet processing method comprises: receiving all bytes belonging to the header class; and receiving and parsing a part of the bytes belonging to the application category according to the setting information until receiving a designated byte belonging to the application category. Therefore, the effect of analyzing the network packet in advance to reduce the analysis time is achieved.

Description

Network packet processing method and device
Technical Field
The present disclosure relates to a network packet processing method and device, and more particularly, to a network packet processing method and device for real-time processing of network packets.
Background
A layered structure is generally adopted in the network communication protocol, so that the data in the network packet can be obtained only by disassembling the network packet layer by layer. In general, after the entire network packet is received and the received network packet is determined to be a valid network packet, the data in the network packet is parsed to further use the parsed data.
To illustrate the foregoing concepts more clearly, the structure of the network packet is described. Please refer to fig. 1, which is a diagram illustrating a network packet NP. The network packet NP includes a plurality of bytes 0-9, the categories of bytes 0-9 include a header category HT, an application category AT, and a check category TT, wherein the categories of bytes 0 and 1 belong to the header category HT, the categories of bytes 2-7 belong to the application category AT, and the categories of bytes 8-9 belong to the check category TT. It should be noted that the network packet NP structure shown in fig. 1 is only an example and is not intended to be limiting.
When the data of bytes 2-7 belonging to the application type AT in the network packet NP is to be analyzed, the process can be started after the whole network packet NP is received, that is, after sequentially receiving bytes 0 and 1 belonging to the header type HT, bytes 2-7 belonging to the application type AT, and bytes 8 and 9 belonging to the check type TT, and determining that the integrity of the network packet NP is complete through a Checksum (Checksum) mechanism.
However, it takes a lot of processing time to disassemble the network packet, and in a specific case (for example, in a case where the data needs to be analyzed in a very short time), the subsequent processing of the network packet data is delayed, which causes a problem of processing time delay.
Disclosure of Invention
A first aspect of the present invention provides a network packet processing method, in which a network packet includes a plurality of bytes, the byte types include a header type, an application type, and a check type, and the network packet processing method includes: receiving all bytes belonging to the header class; and receiving and parsing a part of the bytes belonging to the application category according to the setting information until receiving a designated byte belonging to the application category.
According to an embodiment of the present invention, the method is for a financial transaction, and the network packet is provided by a context server, wherein after the steps of receiving and parsing a part of bytes belonging to the application class according to the setting information until the designated bytes belonging to the application class are received, the method further comprises: a request is generated based on parsing at least a portion of the data received in the portion of bytes and the specified bytes that belong to the application class.
According to an embodiment of the present invention, after the step of receiving a part of bytes belonging to the application category until the designated bytes belonging to the application category are received according to the setting information, the method further comprises: receiving a remainder byte belonging to the application class and all bytes belonging to the check class; and transmitting the order to a transaction server for ordering after judging the integrity of the network package to be complete by utilizing a Checksum (Checksum) mechanism.
According to an embodiment of the present invention, the setting information is when a position of the specified byte matches a predetermined count value.
A second aspect of the present invention is to provide a network packet processing apparatus, electrically connected to a server, wherein a network packet includes a plurality of bytes, the byte types include a header type, an application type, and a check type, and the network packet processing apparatus includes: a receiving unit and an analyzing unit. The receiving unit is used for receiving the network packet; and the analysis unit is electrically connected with the receiving unit and used for receiving all bytes belonging to the header category through the receiving unit and receiving and analyzing partial bytes belonging to the application category according to the setting information until receiving the specified bytes belonging to the application category.
According to an embodiment of the present disclosure, the receiving unit is electrically connected to a profile server providing the network packet, wherein the parsing unit generates a request ticket according to at least a part of the received part of the bytes belonging to the application class and the designated bytes.
According to an embodiment of the present disclosure, a transmitting unit, electrically connected to the parsing unit, is configured to receive the remaining bytes belonging to the application category and all bytes belonging to the check category after the parsing unit receives the partial bytes belonging to the application category according to the setting information until the designated bytes belonging to the application category are received, and transmit the order to a transaction server for ordering after a Checksum (Checksum) mechanism is used to determine that the integrity of the network packet is complete.
According to an embodiment of the present invention, the setting information is when a position of the specified byte matches a predetermined count value.
The disclosed network packet processing method and device thereof mainly utilize the hardware structure of the embedded system, which can disassemble the packet while receiving the packet to obtain the data in the packet, thereby achieving the effect of analyzing the packet in advance to reduce the analyzing time.
Drawings
The foregoing and other objects, features, advantages and embodiments of the disclosure will be apparent from the following more particular description of the disclosure, as illustrated in the accompanying drawings in which:
FIG. 1 is a schematic diagram of a network packet;
FIG. 2 is a diagram of a network packet processing device according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a network packet processing method according to an embodiment of the disclosure;
FIG. 4 is a schematic diagram of a financial transaction system according to an embodiment of the present disclosure;
FIG. 5 is a diagram illustrating a network packet processing device applied to financial transactions according to an embodiment of the present disclosure; and
FIG. 6 is a flowchart illustrating a network packet processing method applied to financial transactions according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present invention will be described below with reference to the accompanying drawings. In the drawings, the same reference numbers indicate the same or similar elements or process flows.
Please refer to fig. 1 to 3. Fig. 2 is a schematic diagram of a network packet processing apparatus according to an embodiment of the disclosure, and fig. 3 is a flowchart of a network packet processing method according to an embodiment of the disclosure. In this embodiment, the network packet processing apparatus 100 shown in fig. 2 can be used to disassemble the network packet NP shown in fig. 1 in real time according to the steps described in the network packet processing method shown in fig. 3.
First, the configuration of the network packet processing apparatus 100 will be described. As shown in fig. 2, the network packet processing apparatus 100 includes a receiving unit 110 and a parsing unit 130. The receiving unit 110 is electrically connected to the parsing unit 130, the receiving unit 110 is used for receiving the network packet NP, and the parsing unit 130 is used for receiving and parsing bytes 0-9 in the network packet NP through the receiving unit 110. In various embodiments of the present invention, the network packet processing apparatus 100 may be implemented by a Field Programmable Gate Array (FPGA), or may be implemented by other types of embedded system boards.
Next, an example of the network packet processing method shown in fig. 3 applied to the network packet processing apparatus 100 to disassemble the network packet NP shown in fig. 1 will be described.
As shown in fig. 3, the network packet processing method includes steps S110 and S130.
In step S110, all bytes belonging to the header category are received.
In one embodiment, the parsing unit 130 is configured to receive all bytes belonging to the header type HT, i.e. byte 0 and byte 1, via the receiving unit 110.
In step S130, partial bytes belonging to the application category are received and parsed according to the setting information until a specified byte belonging to the application category is received.
In one embodiment, it is assumed that the designated byte DB has been selected as the byte 5 belonging to the application class AT according to the setting information. Wherein, the setting information is when the position of the designated byte DB meets the preset count value, for example, the position of the byte 5 belonging to the application category AT is known to be five count values, therefore, in order to select the byte 5 as the designated byte DB, the preset count value can be set to be five, thereby achieving the purpose; in addition, the selection of the designated byte DB is determined according to the requirement, for example, the data concerned by the user is located in the byte 5. After the designated byte DB is selected as the byte 5 belonging to the application class AT, the parsing unit 130 receives and parses the byte 2, the byte 3, the byte 4 and the byte 5 belonging to the application class HT through the receiving unit 110 according to the setting information.
It should be noted that the above-mentioned "receiving and parsing" means that the parsing unit 130 will parse the received bytes at the same time when receiving the bytes through the receiving unit 110. For example, when the parsing unit 130 receives byte 2 through the receiving unit 110, it will parse byte 2 at the same time; when receiving byte 3 through the receiving unit 110, the parsing unit 130 will parse byte 3 at the same time; the rest is analogized in the same way. Therefore, the data of the bytes belonging to the application type AT can be analyzed in advance without receiving the whole network packet.
Next, an example of applying the network packet processing apparatus 200 and the network packet processing method similar to the network packet processing apparatus 100 to a financial transaction will be further described.
Please refer to fig. 1, 4-6. Fig. 4 is a schematic diagram of a financial transaction system according to an embodiment of the present disclosure, fig. 5 is a schematic diagram of a network packet processing device applied to a financial transaction according to an embodiment of the present disclosure, and fig. 6 is a flowchart of a network packet processing method applied to a financial transaction according to an embodiment of the present disclosure.
First, the structure of the financial transaction system 1 and the network packet processing device 200 will be described. As shown in fig. 4, the financial transaction system 1 includes a network packet processing device 200, and a market server 310 and a transaction server 320 disposed in an exchange 300, and the network packet processing device 200 is electrically connected to the market server 310 and the transaction server 320.
As shown in fig. 5, the network packet processing apparatus 200 includes a receiving unit 210, a parsing unit 230, and a transmitting unit 250. The receiving unit 210, the parsing unit 230 and the transmitting unit 250 are electrically connected in sequence, the receiving unit 210 is used for receiving the network packet NP, the parsing unit 230 is used for receiving and parsing bytes 0-9 in the network packet NP through the receiving unit 210, and the transmitting unit 250 is used for transmitting the order OD according to the packet determination signal DS. In various embodiments of the present invention, the network packet processing apparatus 200 may be implemented by a Field Programmable Gate Array (FPGA), or may be implemented by other types of embedded system boards.
Next, an example of the network packet processing method shown in fig. 6 applied to the financial transaction system 1 for performing financial transactions will be described.
As shown in fig. 6, the network packet processing method includes steps S210, S230, S250, S260 and S270, wherein steps S210 and S230 are similar to steps S110 and S130 of fig. 3, respectively, and therefore are not repeated herein.
After step S230, the process proceeds to step S250 and step S260, i.e., step S250 and step S260 can be performed synchronously.
In step S250, a request form is generated by analyzing at least a part of the data of the received partial byte and the designated byte belonging to the application category.
In one embodiment, it is assumed that the data of interest to the user (e.g., the best five gears or the bargain) are located in byte 2, byte 3 and byte 5 (which specifies byte DB), respectively, where the location of the data of interest to the user is known in advance. After the location of the data of interest to the user is known, the parsing unit 230 will generate a purchase order based on the data of byte 2, byte 3 and byte 5, wherein the content of the purchase order can be one that is purchased at a higher price than the transaction price. It should be noted that the contents of the aforementioned user-interested data and the order are only exemplary and not intended to be limiting.
Meanwhile, in step S260, the remaining bytes belonging to the application class and all bytes belonging to the check class are received.
In one embodiment, parsing unit 230 receives bytes 6 and 7 belonging to the application class AT and bytes 8 and 9 belonging to the check class via receiving unit 210. In other words, in step, the network packet NP is completely received.
After step S260, the process proceeds to step S270. In step S270, a Checksum (Checksum) mechanism is used to determine the integrity of the network packet, and then a packet determination signal is generated.
In an embodiment, after determining that the integrity of the network packet NP is complete through the checksum mechanism, the parsing unit 230 transmits the order OD obtained in step S250 to the transaction server 320 for ordering, wherein the checksum mechanism is common knowledge of those skilled in the art and is not described herein.
In the case of applying the network packet processing apparatus 200 and the network packet processing method to the financial transaction, it can be understood that since the steps S250 and S260 can be performed synchronously, the time of the financial transaction can be shortened, which is very important for the financial transaction with seconds.
In summary, the network packet processing method and the device thereof disclosed in the present disclosure mainly utilize the hardware architecture of the embedded system, which can disassemble the packet while receiving the network packet to obtain the data in the network packet, and after determining that the content of the received network packet is correct, the network packet is transmitted to the transaction server, so as to achieve the effect of analyzing the network packet in advance to reduce the analysis time.
Certain terms are used throughout the description and following claims to refer to particular components. However, those of ordinary skill in the art will appreciate that the various elements may be referred to by different names. The specification and claims do not intend to distinguish between components that differ in name but not function. In the description and claims, the terms "include" and "comprise" are used in an open-ended fashion, and thus should be interpreted to mean "include, but not limited to.
In addition, any reference to singular is intended to include the plural unless the specification specifically states otherwise.
The above are only preferred embodiments of the present invention, and all equivalent changes and modifications made in the claims of the present invention should be covered by the present invention.

Claims (8)

1. A method for processing a network packet, wherein a network packet comprises a plurality of bytes, and the types of the bytes comprise a header type, an application type, and a check type, the method comprising:
receiving all bytes belonging to the header class; and
a portion of the bytes belonging to the application category are received and parsed according to a configuration message until a designated byte belonging to the application category is received.
2. The method of claim 1, wherein the network packet is for a financial transaction and the network packet is provided by a context server, and further comprising, after the step of receiving and parsing a portion of bytes belonging to the application class according to the configuration information until the designated bytes belonging to the application class are received:
a request is generated based on parsing at least a portion of the data received in the portion of bytes and the specified bytes that belong to the application class.
3. The method of claim 2, further comprising, after the step of receiving a portion of bytes belonging to the application class until the designated bytes belonging to the application class are received according to the configuration information:
receiving a remainder byte belonging to the application class and all bytes belonging to the check class; and
after the integrity of the network packet is judged to be complete by using a Checksum (Checksum) mechanism, the order is transmitted to a transaction server for ordering.
4. The method of claim 1, wherein the configuration information is when a location of the specified byte matches a predetermined count value.
5. A network packet processing apparatus, wherein a network packet comprises a plurality of bytes, and wherein the bytes comprise a header type, an application type, and a check type, the network packet processing apparatus comprising:
a receiving unit for receiving the network packet; and
an analysis unit electrically connected to the receiving unit for receiving all bytes belonging to the header category through the receiving unit and receiving and analyzing part of bytes belonging to the application category according to a setting message until receiving a designated byte belonging to the application category.
6. The device of claim 5, wherein the receiving unit is used for a financial transaction and is electrically connected to a context server providing the network packet, and wherein the parsing unit generates a request based on at least a portion of the received bytes belonging to the application class and the specified bytes.
7. The network packet processing device of claim 6, further comprising:
a transmitting unit electrically connected to the analyzing unit for receiving the remaining bytes belonging to the application category and all bytes belonging to the check category after the analyzing unit receives the partial bytes belonging to the application category until the designated bytes belonging to the application category according to the setting information, and transmitting the order to a transaction server for ordering after judging the integrity of the network packet as complete by using a Checksum (Checksum) mechanism.
8. The apparatus of claim 5, wherein the configuration information is when a position of the specified byte matches a predetermined count value.
CN201811626057.7A 2018-12-28 2018-12-28 Network packet processing method and device Active CN111385257B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811626057.7A CN111385257B (en) 2018-12-28 2018-12-28 Network packet processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811626057.7A CN111385257B (en) 2018-12-28 2018-12-28 Network packet processing method and device

Publications (2)

Publication Number Publication Date
CN111385257A true CN111385257A (en) 2020-07-07
CN111385257B CN111385257B (en) 2022-03-15

Family

ID=71216391

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811626057.7A Active CN111385257B (en) 2018-12-28 2018-12-28 Network packet processing method and device

Country Status (1)

Country Link
CN (1) CN111385257B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW465211B (en) * 1998-10-27 2001-11-21 Port Corp C Digital communications processor
TW200605572A (en) * 2004-07-23 2006-02-01 Kwok-Yan Leung Byte-based data processing device and method
TW200830780A (en) * 2007-01-10 2008-07-16 Genie Networks Ltd System and method for controlling the network traffic
CN101262604A (en) * 2008-04-23 2008-09-10 哈尔滨工程大学 A telescopic video coding method for optimized transmission of interested area
CN101904168A (en) * 2007-08-08 2010-12-01 迈凌有限公司 TS packet grooming
CN103166855A (en) * 2011-12-12 2013-06-19 深圳市共进电子股份有限公司 Method and system for recognizing and transforming address information in network message
WO2015010512A1 (en) * 2013-07-23 2015-01-29 中兴通讯股份有限公司 Gre packet encapsulation method, decapsulation method, and corresponding apparatuses
CN104702600A (en) * 2015-03-02 2015-06-10 国家计算机网络与信息安全管理中心 Method and device for parsing network data message
US20150195387A1 (en) * 2014-01-08 2015-07-09 Cavium, Inc. Methods and systems for flexible packet classification
US20150334033A1 (en) * 2013-01-30 2015-11-19 Huawei Technologies Co., Ltd. Data transmission method and related apparatus
US20160261663A1 (en) * 2015-03-02 2016-09-08 Qualcomm Incorporated Indication for Partial Segment
CN106921618A (en) * 2015-12-25 2017-07-04 瑞昱半导体股份有限公司 Reception device and its method for processing packet

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW465211B (en) * 1998-10-27 2001-11-21 Port Corp C Digital communications processor
TW200605572A (en) * 2004-07-23 2006-02-01 Kwok-Yan Leung Byte-based data processing device and method
TW200830780A (en) * 2007-01-10 2008-07-16 Genie Networks Ltd System and method for controlling the network traffic
CN101904168A (en) * 2007-08-08 2010-12-01 迈凌有限公司 TS packet grooming
CN101262604A (en) * 2008-04-23 2008-09-10 哈尔滨工程大学 A telescopic video coding method for optimized transmission of interested area
CN103166855A (en) * 2011-12-12 2013-06-19 深圳市共进电子股份有限公司 Method and system for recognizing and transforming address information in network message
US20150334033A1 (en) * 2013-01-30 2015-11-19 Huawei Technologies Co., Ltd. Data transmission method and related apparatus
WO2015010512A1 (en) * 2013-07-23 2015-01-29 中兴通讯股份有限公司 Gre packet encapsulation method, decapsulation method, and corresponding apparatuses
US20150195387A1 (en) * 2014-01-08 2015-07-09 Cavium, Inc. Methods and systems for flexible packet classification
CN104702600A (en) * 2015-03-02 2015-06-10 国家计算机网络与信息安全管理中心 Method and device for parsing network data message
US20160261663A1 (en) * 2015-03-02 2016-09-08 Qualcomm Incorporated Indication for Partial Segment
CN106921618A (en) * 2015-12-25 2017-07-04 瑞昱半导体股份有限公司 Reception device and its method for processing packet

Also Published As

Publication number Publication date
CN111385257B (en) 2022-03-15

Similar Documents

Publication Publication Date Title
CN105608145B (en) The method and device of download based on downloading channel statistics application software
CN112804121B (en) TTE network transmission delay test system and method
WO2017054552A1 (en) Terminal, cache server, and method for acquiring video slices and device thereof
US20010010059A1 (en) Method and apparatus for determining travel time for data sent between devices connected to a computer network
CN107040549A (en) A kind of TCP packet splicings processing method, server and system
EP3613183B1 (en) Content based byte-range caching using a dynamically adjusted chunk size
US9329961B2 (en) Testing development using real-time traffic
CN109446075A (en) Interface testing method and device
CN109982068B (en) Method, apparatus, device and medium for evaluating quality of synthesized video
CN110138608A (en) The method and server of network service Service Quality Management
CN111294798A (en) Data interaction method, device, terminal equipment and medium
US20180068342A1 (en) Advertisement accessing server and advertisement accessing service method
CN110930608A (en) POS terminal ISO8583 message testing method and simulation background baffle system
CN113177848A (en) Securities and financial derivatives transaction risk control system and risk control method
CN111385257B (en) Network packet processing method and device
WO2021134418A1 (en) Data checking method and apparatus
US20140379553A1 (en) Method and a system for sending an electronic message
CN111813622A (en) Equipment monitoring method and device
JP2014505951A (en) Market access system and method
JP2007523508A (en) Method and apparatus for network throughput measurement
CN107517237B (en) Video identification method and device
CN109120479B (en) Network throughput testing method based on network message format
CN104469427B (en) Data transmission method and terminal and server
CN116455974A (en) Transaction caching and ordering method, device, electronic equipment and storage medium
TW202027468A (en) Network packet processing method and device thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant