CN112822084B - Gateway control chip and network packet processing method thereof - Google Patents

Gateway control chip and network packet processing method thereof Download PDF

Info

Publication number
CN112822084B
CN112822084B CN201911129038.8A CN201911129038A CN112822084B CN 112822084 B CN112822084 B CN 112822084B CN 201911129038 A CN201911129038 A CN 201911129038A CN 112822084 B CN112822084 B CN 112822084B
Authority
CN
China
Prior art keywords
packet
network packet
type
network
operations
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.)
Active
Application number
CN201911129038.8A
Other languages
Chinese (zh)
Other versions
CN112822084A (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.)
Realtek Semiconductor Corp
Original Assignee
Realtek Semiconductor Corp
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 Realtek Semiconductor Corp filed Critical Realtek Semiconductor Corp
Priority to CN201911129038.8A priority Critical patent/CN112822084B/en
Publication of CN112822084A publication Critical patent/CN112822084A/en
Application granted granted Critical
Publication of CN112822084B publication Critical patent/CN112822084B/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
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • 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
    • H04L2212/00Encapsulation of packets

Landscapes

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

Abstract

A gateway control chip and a network packet processing method thereof are provided. The gateway control chip is used for: acquiring a network packet; judging that the network packet is an uplink IP tunnel network packet; judging the packet type of the uplink IP tunnel network packet; acquiring a packet operation list corresponding to the packet type, wherein the packet operation list records a plurality of packet operations; and performing a packet operation to process the network packet.

Description

Gateway control chip and network packet processing method thereof
Technical Field
The present invention relates to a network device control chip and a network packet processing method thereof, and more particularly, to a gateway control chip and a network packet processing method thereof.
Background
In the conventional network technology, an IP Tunneling (IP Tunneling) enables the client and the server to communicate via a specific channel, and during data transmission of the channel, the original network packet needs to be encapsulated by a specific extra encapsulation. However, the existing IP tunneling technology is implemented by software to perform additional encapsulation of the original network packet, so the processing speed of the network packet is limited by the software.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a network packet processing method for a gateway control chip, comprising: acquiring a network packet; judging that the network packet is an uplink IP tunnel network packet; judging the packet type of the uplink IP tunnel network packet; acquiring a packet operation list corresponding to the packet type, wherein the packet operation list records a plurality of packet operations; and performing a packet operation to process the network packet.
The invention further provides a gateway control chip, which comprises a processing unit and a storage unit. The storage unit stores a program. The program, upon execution, causes the processing unit to: acquiring a network packet; judging the network packet is an uplink IP tunnel network packet; judging the packet type of the uplink IP tunnel network packet; acquiring a packet operation list corresponding to the packet type, wherein the packet operation list records a plurality of packet operations; and performing a packet operation to process the network packet.
Drawings
Aspects of the invention are best understood from the following detailed description when read with the accompanying drawing figures. It should be noted that the various features may not be drawn to scale. In fact, the dimensions of the various features may be arbitrarily increased or reduced for clarity of discussion.
Fig. 1 is a block diagram of a gateway control chip according to some embodiments of the invention.
Fig. 2 is a schematic diagram of a gateway control chip according to some embodiments of the present invention.
Fig. 3A-3G are schematic diagrams illustrating operations of network packets according to some embodiments of the invention.
Fig. 4A-4H are schematic diagrams illustrating operations of network packets according to some embodiments of the present invention.
Fig. 5A-5C are schematic diagrams illustrating operations of network packets according to some embodiments of the invention.
Fig. 6 is a block diagram of a gateway control chip according to some embodiments of the invention.
Fig. 7 is a flowchart of a network packet processing method according to some embodiments of the invention.
Fig. 8A-8B are flowcharts illustrating a network packet processing method according to some embodiments of the invention.
Detailed Description
The following disclosure provides many different embodiments, or examples, for implementing different features of the provided subject matter. Specific examples of components and configurations are described below to simplify the present disclosure. Of course, such components and configurations are merely examples and are not intended to be limiting. In the present disclosure, reference in the following description to an embodiment in which a first feature is formed over or on a second feature may include an embodiment in which the first feature is formed in direct contact with the second feature, and may also include an embodiment in which additional features may be formed between the first and second features, such that the first and second features may not be in direct contact. Additionally, the present disclosure may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed.
Embodiments of the invention are discussed in more detail below. It should be appreciated, however, that the present invention provides many applicable concepts that can be embodied in a wide variety of specific contexts. The particular embodiments discussed are illustrative only and do not limit the scope of the invention.
Moreover, for ease of description, spatially relative terms, such as "below … …," "below … …," "above … …," "upper," "lower," "left side," "right side," and similar terms, may be used herein to describe one element or feature's relationship to another element(s) or feature as illustrated in the figures. Spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientation depicted in the figures. The device may be otherwise oriented (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein interpreted accordingly. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present.
The numerical ranges and parameters setting forth the broad scope of the invention are approximations, and the numerical values set forth in the specific examples may be reported as precisely as possible. Some numerical values, however, may contain certain errors necessarily resulting from the standard deviation found in the respective testing measurement. Further, as used herein, the term "about" generally means within ± 10%, ± 5%, ± 1% or ± 0.5% of a given value or range. Alternatively, the term "about" is understood by those of ordinary skill in the art to mean within an acceptable standard error of the mean. Except in the operating/working examples, or unless otherwise expressly specified, all of the numerical ranges, amounts, values, and percentages (such as those of amounts of materials, durations, temperatures, operating conditions, ratios of amounts, and the like disclosed herein) are to be understood as modified in all instances by the term "about". Accordingly, unless indicated to the contrary, the numerical parameters set forth in the specification and attached claims are approximations that may vary. At the very least, each numerical parameter should be construed in light of the number of reported significant digits and by applying ordinary rounding techniques. Ranges may be expressed herein as from one end point to the other end point or between the two end points. Unless otherwise specified, all ranges disclosed herein are inclusive of the endpoints. The term "substantially coplanar" may refer to two surfaces that are within a few micrometers (μm) along the same plane (such as within 10 μm, within 5 μm, within 1 μm, or within 0.5 μm along the same plane). When values or properties are said to be "substantially" the same, the term can refer to the values being within ± 10%, 5%, 1%, or 0.5% of the mean of the values.
The present invention provides a gateway control chip 10 for the additional encapsulation required for network encapsulation of IP tunnels. Thus, the packaging process is accelerated through additional hardware setup. Please refer to fig. 1, which is a block diagram of a gateway control chip 10 according to some embodiments of the present invention. The gateway control chip 10 includes a processing unit 101 and a storage unit 103. The processing unit 101 and the storage unit 103 are electrically connected through a bus 109. Through the bus 109, the processing unit 101 can execute a program PG stored in the storage unit 103. The program PG, when executed, causes the processing unit 101 to perform network packet processing functions. Related network packet processing functions are described further below.
Please refer to fig. 2, which is a schematic diagram illustrating an operation of the gateway control chip 10 according to the present invention. As shown, the gateway control chip 10 is disposed on a gateway 1 for processing network packets forwarded to the gateway 1. Specifically, the gateway 1 is connected to a client 9 and a server 8 through a LAN and a WAN respectively, and when the program PG of the gateway chip 10 is executed, the processing unit 101 is triggered to obtain a network packet 90 from the LAN or the WAN.
In some embodiments, when the processing unit 101 determines that the network packet 90 is an uplink IP tunneling network packet that the ue 9 intends to transmit to the server 8, the gateway control chip 10 needs to process the network packet 90 again before transmitting the network packet 90. Because different types of uplink IP tunneling network packets have different packet contents, the different types of uplink IP tunneling network packets need to correspond to different packet processing operation steps. Accordingly, after determining that the network packet 90 is an uplink IP tunnel network packet, the processing unit 101 of the gateway control chip 10 needs to further determine a packet type 90T of the uplink IP tunnel network packet.
Then, after determining the packet type 90T of the uplink IP tunnel network packet, the processing unit 101 may obtain a packet operation list LS corresponding to the packet type 90T from the storage unit 103 for the packet type 90T. The packet operation list LS records a plurality of packet operations for processing network packets of the packet type 90T. Accordingly, the processing unit 101 executes the packet operation recorded in the packet operation list LS to further process the network packet 90, and transmits the network packet 90 to the server 8 through the transmission interface of the gateway 1.
In some embodiments, the packet type 90T includes a Point-to-Point Tunneling Protocol (PPTP) type, a Layer 2Tunneling Protocol (L2 TP) type, or a Dual-Stack simplified (DS-Lite) type. For different types, the plurality of packet operations include: an insert outer header operation, a change packet ethertype operation, a packet length update operation, a Generic Routing Encapsulation (GRE) data or IP identification (IPID) update operation, a Layer three (Layer3, L3) checksum update operation, a Layer four (Layer 4, L4) checksum update operation, or a combination thereof. The packet operations corresponding to the PPTP type, the L2TP type, and the DS-Lite type will be further described below.
In some embodiments, when the packet type 90T is determined to be PPTP, the network packet 90 requires the following operations for further processing: an insert outer header operation, a change packet ethertype operation, a packet length update operation, a GRE data or IPID update operation, and an L3 checksum update operation. The aforementioned operations are recorded in the packet operation list LS in various possible combinations.
More specifically, when the packet type 90T of the network packet 90 is the PPTP type, the processing unit 101 obtains the packet operation list LS, and sequentially performs the following packet operations recorded in the packet operation list LS: (1) inserting an outer header operation; (2) changing the packet ether type operation; (3) updating the packet length; (4) GRE data or IPID update operations; (5) l3 check code update operation; (6) updating the packet length; and (7) GRE data or IPID update operations. In other words, after acquiring the packet operation list LS, the processing unit 101 sequentially performs the recorded packet operations (1) to (7) to perform further processing on the network packet 90.
In some embodiments, the packet operation list LS records a plurality of operation parameters corresponding to the packet operation at the same time, and the processing unit 101 sequentially performs the packet operations (1) to (7) according to the plurality of operation parameters to further process the network packet 90. The following describes in detail the implementation of the aforementioned packet operations (1) to (7) with the operation parameters through fig. 3A to 3G and examples.
For example, based on the PPTP Protocol, some PPTP-type network packets further include an IPv4 header with a length of 20 bytes, a GRE header with a length of 16 bytes, and a Point-to-Point Protocol (PPP) header with a length of 4 bytes in addition to the original network packet 90, so that an outer header with a length of 40 bytes (including an IPv4 header, a GRE header, and a PPP header) needs to be additionally inserted for the network packet 90.
Accordingly, referring to fig. 3A and 3B, when the processing unit 101 performs (1) the operation of inserting the outer layer header, the corresponding start address operation parameter is the address after the ethertype field (ethertype) of the original network packet 90, and the length operation parameter is 40 (in bytes). In other words, based on the two operation parameters, when (1) the insert outer header operation is performed, the processing unit 101 inserts the outer header with a length of 40 bytes after the ethertype field originally recorded in the network packet 90. Then, the processing unit 101 performs (2) a change packet ethertype operation to change the ethertype field originally recorded in the network packet 90 to 0x0800 (i.e., IPv4 ethertype).
Next, referring to fig. 3C, when the processing unit 101 performs (3) a packet length update operation, the corresponding start address operation parameter is an address after the outer header offset value 2 (in bytes), and the length operation parameter is 2 (in bytes). In addition, the operation further has an additional operation parameter 0 (representing the addition operand) and an additional value parameter 40. In other words, based on the four operation parameters, when (3) a packet length update operation is performed, the processing unit 101 performs an update on data with a length of 2 bytes (i.e. the diagonal portion of the network packet 90 in fig. 3C) after the outer header is shifted by 2 bytes, and the update operation mainly adds 40 to the original data value. It should be noted that in fig. 3C, the diagonal portion of the network packet 90 is the total length field.
Referring to fig. 3D, when processing unit 101 performs (4) an IPID update operation, the corresponding start address operation parameter is the address after the outer header offset value of 4 (in bytes). In other words, based on the aforementioned operation parameters, when (4) an IPID update operation is performed, the processing unit 101 updates the content recorded in the IPID field with the packet index value of the corresponding nic after the outer header is shifted by 4 bytes. It should be noted that in fig. 3D, the diagonal portion of the network packet 90 is an IPID field and has a length of 2 bytes.
Referring to FIG. 3E, when processing unit 101 performs (5) the L3 checksum update operation, the corresponding start address operation parameter is the address after the outer header offset value of 10 (in bytes). In other words, based on the aforementioned operation parameters, when (5) the L3 checksum updating operation is performed, the processing unit 101 performs the L3 checksum operation on the content of the existing network packet 90 again, and updates the L3 checksum field after the outer header offset is 10 bytes with the result of the operation. It should be noted that, in fig. 3E, the diagonal portion of the network packet 90 is L3 checksum field, and the length is 2 bytes.
Next, referring to fig. 3F, when the processing unit 101 performs (6) a packet length update operation, the corresponding start address operation parameter is the address after the outer header offset value 24 (in bytes), and the length operation parameter is 2 (in bytes). In addition, the operation further has an additional operation parameter of 0 (representing the addition operand) and an additional value parameter of 4. In other words, based on the above four operation parameters, when (6) a packet length update operation is performed, the processing unit 101 performs an update on data with a length of 2 bytes (i.e. the hatched portion of the network packet 90 in fig. 3F) after the outer header is shifted by 24 bytes, and the update operation is performed by adding 4 to the original data value. It should be noted that, in fig. 3F, the diagonal portion of the network packet 90 is a GRE payload length field.
Referring to fig. 3G, when the processing unit 101 performs (7) the GRE data update operation, the corresponding start address operation parameter is the outer header offset value 28 (in bytes). In other words, based on the aforementioned operation parameters, when (7) the GRE data update operation is performed, the processing unit 101 updates the content of the GRE sequence number/Acknowledgement (ACK) number field record with the packet index value of the corresponding network transmission interface after the outer layer header is offset by the address of 28 bytes. It should be noted that in fig. 3G, the diagonal portion of the network packet 90 is a GRE sequence number/acknowledgement number field.
In some embodiments, when the packet type 90T is determined to be L2TP type, the network packet 90 requires the following operations for further processing: an insert outer header operation, a change packet ethertype operation, a packet length update operation, a GRE data or IPID update operation, an L3 checksum update operation, and an L3 checksum update operation. The aforementioned operations are recorded in the packet operation list LS in various possible combinations.
More specifically, when the packet type 90T of the network packet 90 is L2TP type, the processing unit 101 obtains the packet operation list LS, and sequentially performs the following packet operations recorded in the packet operation list LS: (1) inserting an outer header operation; (2) changing the packet ether type operation; (3) updating the packet length; (4) GRE data or IPID update operations; (5) l3 check code update operation; (6) updating the packet length; (7) updating the packet length; and (8) L4 checksum update operations. In other words, after obtaining the packet operation list LS, the processing unit 101 sequentially performs the recorded packet operations (1) to (8) to perform further processing on the network packet 90.
In some embodiments, the packet operation list LS records a plurality of operation parameters corresponding to the packet operation at the same time, and the processing unit 101 sequentially performs the packet operations (1) to (8) according to the plurality of operation parameters to further process the network packet 90. The following describes in detail the implementation of the above-mentioned packet operations (1) to (8) with the operation parameters through fig. 4A to 4H and examples.
For example, based on the L2TP protocol, some L2TP type network packets further include an IPv4 header with a length of 20 bytes, a UDP header with a length of 8 bytes, an L2TP header with a length of 8 bytes, and a PPP header with a length of 4 bytes in addition to the content of the original network packet 90, so that an outer layer header (including an IPv4 header, a UDP header, an L2TP header, and a PPP header) with a length of 40 bytes needs to be additionally inserted for the network packet 90.
Accordingly, referring to fig. 4A and 4B, when the processing unit 101 performs (1) the operation of inserting the outer layer header, the corresponding start address operation parameter is the address after the ethertype field of the original network packet 90, and the length operation parameter is 40 (in bytes). In other words, based on the two operation parameters, when (1) the insert outer header operation is performed, the processing unit 101 inserts the outer header with a length of 40 bytes after the ethertype field originally recorded in the network packet 90. Then, the processing unit 101 performs (2) a change packet ethertype operation to change the ethertype field originally recorded in the network packet 90 to 0x0800 (i.e., IPv4 ethertype).
Next, referring to fig. 4C, when the processing unit 101 performs (3) a packet length update operation, the corresponding start address operation parameter is an address after the outer header offset value 2 (in bytes), and the length operation parameter is 2 (in bytes). In addition, the operation further has an additional operation parameter 0 (representing the addition operand) and an additional value parameter of 40. In other words, based on the four operation parameters, when (3) a packet length update operation is performed, the processing unit 101 performs an update on data with a length of 2 bytes (i.e. the hatched portion of the network packet 90 in fig. 4C) after the outer header is shifted by 2 bytes, and the update operation mainly adds 40 to the original data value. It should be noted that in fig. 4C, the slashed portion of the network packet 90 is a total length field.
Next, referring to fig. 4D, when the processing unit 101 performs (4) an IPID update operation, the corresponding start address operation parameter is the address after the outer header offset value of 4 (in bytes). In other words, based on the aforementioned operation parameters, when (4) the IPID update operation is performed, the processing unit 101 performs an update on the content recorded in the IPID field by using the packet index value of the corresponding nic after the outer header is shifted by 4 bytes. It should be noted that in fig. 4D, the diagonal line portion of the network packet 90 is an IPID field and has a length of 2 bytes.
Next, referring to fig. 4E, when processing unit 101 performs (5) the L3 checksum updating operation, the corresponding start address operation parameter is the address after the outer header offset value 10 (in bytes). In other words, based on the aforementioned operation parameters, when the (5) L3 checksum updating operation is performed, the processing unit 101 performs the L3 checksum operation on the content of the existing network packet 90 again, and updates the L3 checksum field after the outer header offset of 10 bytes with the result of the operation. It should be noted that, in fig. 4E, the diagonal portion of the network packet 90 is L3 checksum field, and the length is 2 bytes.
Next, referring to fig. 4F, when the processing unit 101 performs (6) a packet length update operation, the corresponding start address operation parameter is the address after the outer header offset value 24 (in bytes), and the length operation parameter is 2 (in bytes). In addition, the operation further has an additional operation parameter of 0 (representing the addition operand) and an additional value parameter of 20. In other words, based on the four operation parameters, when (6) the packet length update operation is performed, the processing unit 101 performs an update on the data with the length of 2 bytes (i.e. the hatched portion of the network packet 90 in fig. 4F) after the outer header is shifted by 24 bytes, and the update operation mainly adds 20 to the value of the original data. It should be noted that in fig. 4F, the diagonal portion of the network packet 90 is UDP header length field.
Next, referring to fig. 4G, when the processing unit 101 performs (7) a packet length update operation, the corresponding start address operation parameter is the address after the outer header offset value 30 (in bytes), and the length operation parameter is 2 (in bytes). In addition, the operation further has an additional operation parameter of 0 (representing the addition operand) and an additional value parameter of 12. In other words, based on the four operation parameters, when (7) a packet length update operation is performed, the processing unit 101 performs an update on data with a length of 2 bytes (i.e. the hatched portion of the network packet 90 in fig. 4G) after the outer header is shifted by 30 bytes, and the update operation is performed by adding 12 to the original data value. It should be noted that in fig. 4G, the slashed portion of the network packet 90 is a header length field of L2 TP.
Referring to FIG. 4H, when processing unit 101 performs (8) the L4 checksum update operation, the corresponding start address operation parameter is the address after outer header offset value 26 (in bytes). In other words, based on the aforementioned operation parameters, when the (8) L4 checksum updating operation is performed, the processing unit 101 re-performs the L4 checksum operation on the content of the existing network packet 90, and updates the L4 checksum field after the outer header offset of 26 bytes with the result of the operation. It should be noted that, in fig. 4H, the diagonal portion of the network packet 90 is L4 checksum field, and the length is 2 bytes.
In some embodiments, when the packet type 90T is determined to be DS-Lite, the network packet 90 may need to be further processed as follows: an insert outer header operation, a change packet ethertype operation, and a packet length update operation. The aforementioned operations are recorded in the packet operation list LS in various possible combinations.
More specifically, when the packet type 90T of the network packet 90 is a DS-Lite type, the processing unit 101 obtains the packet operation list LS, and sequentially performs the following packet operations recorded in the packet operation list LS: (1) inserting an outer header operation; (2) changing the packet ether type operation; and (3) packet length update operation. In other words, after acquiring the packet operation list LS, the processing unit 101 sequentially performs the recorded packet operations (1) to (3) to perform further processing on the network packet 90.
In some embodiments, the packet operation list LS records a plurality of operation parameters corresponding to the packet operation at the same time, and the processing unit 101 sequentially performs the packet operations (1) to (3) according to the plurality of operation parameters to further process the network packet 90. The following describes the execution of the above-mentioned packet operations (1) to (3) with the operation parameters in detail by referring to fig. 5A to 5C and examples.
For example, based on the DS-Lite protocol, some DS-Lite type network packets further include an IPv6 header of length 40 bytes in addition to the content of the original network packet 90, so that an outer header (including an IPv6 header) of length 40 bytes needs to be additionally inserted for the network packet 90.
Accordingly, referring to fig. 5A and 5B, when the processing unit 101 performs (1) the operation of inserting the outer layer header, the corresponding start address operation parameter is the address after the ethertype field of the original network packet 90, and the length operation parameter is 40 (in bytes). In other words, based on the two operation parameters, when (1) the insert outer header operation is performed, the processing unit 101 inserts the outer header with a length of 40 bytes after the ethertype field originally recorded in the network packet 90. Then, the processing unit 101 performs (2) a change packet ethertype operation to change the ethertype field originally recorded in the network packet 90 to 0x86dd (i.e. IPv6 ethertype).
Next, referring to fig. 5C, when the processing unit 101 performs (3) a packet length update operation, the corresponding start address operation parameter is an address after the outer header offset value 4 (in bytes), and the length operation parameter is 2 (in bytes). In addition, the operation further has an additional operation parameter 0 (representing the addition operand) and the additional parameter is the value 40. In other words, based on the four operation parameters, when (3) a packet length update operation is performed, the processing unit 101 performs an update on data with a length of 2 bytes (i.e. the hatched portion of the network packet 90 in fig. 5C) after the outer header is shifted by 4 bytes, and the update operation mainly adds 40 to the original data value. It should be noted that in fig. 5C, the diagonal portion of the network packet 90 is the total length field.
The above-mentioned processing before the packet transmission of the uplink IP tunnel network is completed by the gateway control chip 10. In some embodiments, during the transmission of the partial IP tunneling network packet, the corresponding sequence number (sequence number) and acknowledgement (acknowledgement) number are changed, so that the gateway control chip 10 can store the latest sequence number and acknowledgement number of the packet through an additional buffer, so as to facilitate the software and hardware to determine the latest status of the packet transmission and maintain the normal packet transmission.
Please refer to fig. 6, which is a block diagram of a gateway control chip 10 according to some embodiments of the present invention. The gateway control chip 10 further includes a register 105. The processing unit 101, the storage unit 103, and the register 105 are electrically connected via a bus 109. Through the bus 109, the processing unit 101 can execute the program PG stored in the storage unit 103. The program PG, when executed, causes the processing unit 101 to perform the network packet status update function. The related network packet status update function will be further described below.
In some embodiments, the register 105 stores the GRE sequence number, the GRE confirmation number, and the IPID for recording the latest status of the network packet delivery. Specifically, when the processing unit 101 determines that the packet type 90T of the network packet 90 is the PPTP type in the foregoing embodiment, the GRE sequence number, the GRE acknowledgement number, and the IPID of the network packet 90 are updated in the corresponding packet operation by using the GRE sequence number, the GRE acknowledgement number, and the IPID stored in the buffer 105.
Then, when the processing unit 101 transmits the network packet 90 to the server 8 through the transmission interface of the gateway 1, the processing unit 101 updates the GRE sequence number of the buffer 105 (e.g., adding the GRE sequence number to the value 1) and updates the IPID of the buffer 105 (e.g., adding the IPID to the value 1). On the other hand, when the gateway 1 receives a downlink PPTP network packet transmitted from the server 8 to the client 9, the processor 101 of the gateway control chip 10 acquires the downlink PPTP network packet, and updates the GRE confirmation number of the buffer 105 with the GRE sequence number of the downlink PPTP network packet.
In some embodiments, the register 105 stores an IPID for recording the latest status of network packet delivery. Specifically, when the processing unit 101 determines that the packet type 90T of the network packet 90 is L2TP type in the above embodiment, the IPID of the network packet 90 is updated in the corresponding packet operation by using the IPID stored in the register 105. Then, after the processing unit 101 transmits the network packet 90 to the server 8 through the transmission interface of the gateway 1, the processing unit 101 updates the IPID of the buffer 105 (for example, the IPID is added to the value 1).
Some embodiments of the present invention include a method for network packet processing, a flowchart of which is shown in fig. 7. The network packet processing method of the embodiments is implemented by a gateway control chip (such as the gateway control chip 10 of the previous embodiments). The detailed operation of the method is as follows.
First, step S701 is executed to obtain a network packet. Step S702 is executed to determine whether the network packet is an uplink IP tunnel network packet. If not, step S701 is executed to obtain another network packet. If yes, go to step S703 to determine a packet type of the uplink IP tunneling network packet. Then, step S704 is executed to obtain a packet operation list corresponding to the packet type. Wherein, the packet operation list records a plurality of packet operations. Step S705 is executed to perform a packet operation to process the network packet.
Some embodiments of the invention include a network packet processing method, and the flow charts thereof are shown in fig. 8A to 8B. The network packet processing method of the embodiments is implemented by a gateway control chip (such as the gateway control chip 10 of the previous embodiments). The detailed operation of the method is as follows.
First, step S801 is executed to obtain a network packet. Step S802 is executed to determine whether the network packet is an uplink IP tunneling network packet or a downlink IP tunneling network packet. In this embodiment, the packet type of the IP tunneling network packet is PPTP type, L2TP type or DS-Lite type. If the packet is a downlink IP tunnel network packet, step S803 is executed to determine whether the downlink IP tunnel network packet is of a PPTP type, if so, step S804 is executed to update the GRE confirmation number of the buffer, and then step S801 is executed to acquire another network packet. If not, step S801 is directly executed to obtain another network packet.
On the other hand, when the network packet is determined to be the uplink IP tunneling network packet in step S802, step S805 is executed to determine a packet type of the uplink IP tunneling network packet. If the packet type of the uplink IP tunneling network packet is PPTP, step S806 is executed to obtain a packet operation list corresponding to the PPTP type. Then, S807 is executed to perform a plurality of packet operations of the packet operation list according to the plurality of operation parameters of the packet operation list to process the network packet.
If the packet type of the uplink IP tunneling packet is L2TP, step S808 is executed to obtain a packet operation list corresponding to the type L2 TP. Then, S809 is executed to execute a plurality of packet operations of the packet operation list according to the plurality of operation parameters of the packet operation list, so as to process the network packet. If the packet type of the uplink IP tunnel network packet is DS-Lite, step S810 is executed to obtain a packet operation list corresponding to the DS-Lite type. Then, S811 is executed to execute a plurality of packet operations of the packet operation list according to a plurality of operation parameters of the packet operation list to process the network packet.
It should be specifically noted that the detailed operations in step S807 include the encapsulation operations (1) to (7) performed by the gateway control chip 10 according to the foregoing embodiment for the PPTP type, the detailed operations in step S809 include the encapsulation operations (1) to (8) performed by the gateway control chip 10 according to the foregoing embodiment for the L2TP type, and the detailed operations in step S811 include the encapsulation operations (1) to (3) performed by the gateway control chip 10 according to the foregoing embodiment for the DS-Lite type, which are not described herein again.
In addition, after the above steps are completed, it represents that the network packet is processed, so that an additional step of transmitting the network packet can be performed, and based on the technology of the gateway control chip 10 in the foregoing embodiment, an additional step can be performed to update the content of the buffer, so that software and hardware can determine the latest state of network packet transmission to maintain normal packet transmission.
The above-mentioned embodiments are only used to illustrate the implementation of the present invention and to explain the technical features of the present invention, and are not used to limit the protection scope of the present invention. Any modifications or equivalent arrangements which may be readily apparent to those skilled in the art are intended to be included within the scope of this invention as defined in the appended claims.
[ notation ] to show
1 gateway
10 gateway control chip
101 processing unit
103 storage unit
105 buffer
109 bus
8 servo end
9 customer terminal
90 network encapsulation
LS packet operation list
PG program
S701 to S705 steps
Steps S801 to S811

Claims (10)

1. A network packet processing method for a gateway control chip includes:
acquiring a network packet;
determining that the network packet is an uplink IP tunnel network packet;
judging a packet type of the uplink IP tunnel network packet;
acquiring a packet operation list corresponding to the packet type, wherein the packet operation list records a plurality of packet operations; and
executing the packet operations to process the network packet;
the network packet processing method further comprises the following steps:
and updating the IP identification code of the uplink IP tunnel network packet by using the IP identification code of a buffer.
2. The method of claim 1, wherein the packet type comprises a point-to-point tunneling protocol type, a layer two tunneling protocol type, or a dual stack reduction type.
3. The method of claim 2, wherein the packet operations comprise an insert outer header operation, a change packet ethertype operation, a packet length update operation, a generic routing encapsulation data or IP identity update operation, a layer three checksum update operation, a layer four checksum update operation, or a combination thereof.
4. The method of claim 3, wherein the packet type is the PPP type, the packet operations include the insert outer header operation, the change packet Ether type operation, the packet length update operation, the UPDAP or IP ID update operation, and the L-checksum update operation.
5. The method of claim 3, wherein the packet type is the dual stack simplified type, and the packet operations include the insert outer header operation, the change packet ethertype operation, and the packet length update operation.
6. The method of claim 1, wherein the packet operation list records a plurality of operation parameters corresponding to the packet operations, and the step of performing the packet operations to process the network packet further comprises:
the packet operations are executed according to the operation parameters to process the network packet.
7. The method of claim 2, wherein the packet type is the peer-to-peer tunneling protocol type, the method further comprising:
updating the generic routing encapsulation sequence number of the uplink IP tunnel network packet by the generic routing encapsulation sequence number of a buffer;
updating the universal route package confirming number of the uplink IP tunnel network package by the universal route package confirming number of the buffer;
and updating the IP identification code of the uplink IP tunnel network packet by using the IP identification code of the buffer.
8. The method of claim 7, further comprising:
transmitting the network packet;
updating the general routing encapsulation sequence number of the buffer;
and updating the IP identification code of the buffer.
9. The method of claim 2, wherein the packet type is the layer two tunneling protocol type.
10. A gateway control chip, comprising:
a processing unit;
a storage unit for storing a program, wherein the program, when executed, causes the processing unit to:
acquiring a network packet;
determining that the network packet is an uplink IP tunnel network packet;
judging a packet type of the uplink IP tunnel network packet;
acquiring a packet operation list corresponding to the packet type, wherein the packet operation list records a plurality of packet operations; and
executing the packet operations to process the network packet;
processing the network packet further comprises:
and updating the IP identification code of the uplink IP tunnel network packet by using the IP identification code of a buffer.
CN201911129038.8A 2019-11-18 2019-11-18 Gateway control chip and network packet processing method thereof Active CN112822084B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911129038.8A CN112822084B (en) 2019-11-18 2019-11-18 Gateway control chip and network packet processing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911129038.8A CN112822084B (en) 2019-11-18 2019-11-18 Gateway control chip and network packet processing method thereof

Publications (2)

Publication Number Publication Date
CN112822084A CN112822084A (en) 2021-05-18
CN112822084B true CN112822084B (en) 2022-08-30

Family

ID=75852474

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911129038.8A Active CN112822084B (en) 2019-11-18 2019-11-18 Gateway control chip and network packet processing method thereof

Country Status (1)

Country Link
CN (1) CN112822084B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103260191A (en) * 2008-08-01 2013-08-21 联发科技股份有限公司 Methods for handling packet-switched data transmissions by mobile station with subscriber identiy cards and systems utilizing the same
CN109150733A (en) * 2017-06-16 2019-01-04 群晖科技股份有限公司 Router and and box-like method for processing packet

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728714B (en) * 2004-07-27 2011-07-27 邓里文 Method for mutual communication between IPv4 network and IPv6 network
CN101247308B (en) * 2007-02-13 2011-04-27 上海亿人通信终端有限公司 Tunnel packet processing method for implementing IPv6 traversing IPv4 based on network processor
CN101552772B (en) * 2008-04-02 2013-08-28 华为技术有限公司 Method, devices and system for optical network data processing
CN102480424A (en) * 2010-11-30 2012-05-30 瑞昱半导体股份有限公司 Device and method for processing network packet
US20140204917A1 (en) * 2013-01-24 2014-07-24 Ralink Technology Corp. Method of Managing Packet Transmission for Wireless System
CN105094695B (en) * 2015-06-29 2018-09-04 浪潮(北京)电子信息产业有限公司 A kind of storage method and system
US10278198B2 (en) * 2016-08-23 2019-04-30 Realtek Singapore Private Limited Packet forwarding device, and packet-forwarding priority setting circuit and method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103260191A (en) * 2008-08-01 2013-08-21 联发科技股份有限公司 Methods for handling packet-switched data transmissions by mobile station with subscriber identiy cards and systems utilizing the same
CN109150733A (en) * 2017-06-16 2019-01-04 群晖科技股份有限公司 Router and and box-like method for processing packet

Also Published As

Publication number Publication date
CN112822084A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
CN107248941B (en) Method and device for detecting path
US9356863B2 (en) Communications over multiple protocol interfaces in a computing environment
CN112751769B (en) Method, device and system for sending message
EP4057576A1 (en) Packet encapsulating method and apparatus, and packet decapsulating method and apparatus
EP4195541A1 (en) Message transmission method, apparatus, and system
WO2017193732A1 (en) Method for encapsulating and decapsulating pseudo-wire data message, and relevant apparatus
CN110971537A (en) Data transmission method, device, equipment and readable storage medium
TWI500298B (en) Techniques for forwarding or receiving data segments associated with a large data packet
EP4274123A1 (en) Packet encapsulation and de-encapsulation method and device, storage medium, and electronic device
CN112822084B (en) Gateway control chip and network packet processing method thereof
WO2014116409A1 (en) Method and system for using extension headers to support protocol stack migration
JP3017217B1 (en) IPv4-IPv6 conversion device
Al-Ani et al. Ipv4/ipv6 transition
TWI727493B (en) Gateway controlling chip and network packet processing method
US20170064046A1 (en) Communication device, communication method, and computer program product
CN103986652B (en) A kind of method for tracing route and device
US11115506B2 (en) Inner VXLAN tunnel packet detection
TWI459763B (en) Method for packet segmentation offload and the apparatus using the same
WO2024055858A1 (en) In-situ flow information telemetry method, encapsulation node, telemetry node, and computer-readable medium
WO2022267875A1 (en) Packet transmission method and related device
US11496382B2 (en) System and method for recording a routing path within a network packet
WO2023193471A1 (en) Address setting method and device, storage medium, and electronic device
US10630610B1 (en) Mechanisms for preventing IPID overflow in computer networks
CN105991307B (en) Method and device for remotely controlling router
CN115733769A (en) Link testing method, electronic device and storage medium

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