Method and apparatus for processing GPRS tunneling protocol GTP packets

By merging the GTP packet header and content to generate a second GTP packet, the problem of low bandwidth utilization in GTP packet transmission is solved, achieving more efficient network resource utilization and data transmission.

CN113518386BActive Publication Date: 2026-01-06HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010275193.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-09
Publication Date
2026-01-06
Estimated Expiration
2040-04-09

AI Technical Summary

Technical Problem

Existing data packet transmission methods have failed to effectively improve bandwidth utilization in the GPRS Tunneling Protocol (GTP), resulting in a waste of network resources.

Method used

By merging the headers and contents of n GTP packets, a second GTP packet is generated and transmitted as the payload of a UDP message, reducing the number of IP and UDP headers. The constant fields in the GTP header are used for compression and merging.

Benefits of technology

While maintaining compatibility with the traditional GTP protocol, it reduces data transmission volume and improves network bandwidth utilization and message processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113518386B_ABST
    Figure CN113518386B_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for processing GPRS Tunneling Protocol (GTP) packets. The method includes: determining n first GTP packets to be sent, wherein the n first GTP packets have the same destination network protocol IP address, and n is a positive integer; merging the GTP packet headers and contents of the n first GTP packets to obtain a second GTP packet; using the destination IP address as the destination IP address of the second GTP packet, and sending the second GTP packet to a second device. The GPRS Tunneling Protocol (GTP) packet processing method and apparatus provided in this application can reduce the amount of data transmitted, thereby greatly improving the network bandwidth utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method and apparatus for processing GPRS tunneling protocol GTP packets. Background Technology

[0002] To cope with the explosive growth of mobile data traffic, the massive number of mobile communication device connections, and the continuous emergence of various new services and application scenarios, how to improve bandwidth utilization has become a hot topic of discussion in the industry.

[0003] Currently, in order to improve bandwidth utilization, packet header compression is commonly used for packet transmission. Specifically, n Real-time Transport Protocol (RTP) messages of the same length are sequentially placed in the payload of a User Datagram Protocol (UDP) message as a compressed message, thus saving n-1 Internet Protocol (IP) and UDP headers corresponding to the messages. After receiving the message, the receiving device reads the content from the UDP payload in a fixed length as an RTP message. And since it is a fixed-length message merging, the length of each segment does not need to be processed during message compression and parsing. The above compression method utilizes two properties of most types of RTP streams: (1) Most fields in the IP, UDP, and RTP headers do not change during the lifetime of the RTP session, and these constant value fields can be represented by fewer bits with session context during transmission; (2) For consecutive packets in the stream, RTP header fields such as sequence numbers and timestamps are increased to constant values.

[0004] However, since the General Packet Radio Service (GPRS) Tunneling Protocol (GTP) does not add a constant value to the header field of the data packets, the compression method described above is not applicable to GTP packets. Therefore, how to improve bandwidth utilization when transmitting GTP packets is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] This application provides a method and apparatus for processing GPRS tunneling protocol GTP packets, which can reduce the amount of data transmitted, thereby greatly improving the network bandwidth utilization.

[0006] In a first aspect, embodiments of this application provide a method for processing GPRS tunneling protocol GTP packets, applied to a first device. The method includes: determining n first GTP packets to be sent, wherein the n first GTP packets have the same destination network protocol IP address, and n is a positive integer; merging the GTP packet headers and contents of the n first GTP packets to obtain a second GTP packet; using the destination IP address as the destination IP address of the second GTP packet, and sending the second GTP packet to the second device.

[0007] After determining the n first GTP packets to be sent, the first device can merge the GTP packet headers and contents of the n first GTP packets. This allows for compression and merging of the first GTP packets while maintaining compatibility with the traditional GTP protocol. It can reduce the amount of data transmitted while preserving the original GTP packet header information during transmission, thereby greatly improving the network bandwidth utilization.

[0008] In one possible implementation, the GTP headers and contents of the n first GTP packets are merged to obtain the second GTP packet. This includes: merging the GTP headers and contents of the other first GTP packets (excluding the first first GTP packet) into the content portion of the first first GTP packet in sequence to obtain the second GTP packet.

[0009] In this scheme, the GTP headers and contents of the other first GTP packets (excluding the first first GTP packet) are sequentially merged into the content portion of the first first GTP packet to obtain the merged second GTP packet. Since the n first GTP packets can reuse IP headers and UDP headers, the merged second GTP packet can save the space of n-1 IP headers and UDP headers.

[0010] In one possible implementation, the IP header of the second GTP packet includes a first field that indicates the total length of the second GTP packet.

[0011] In one possible implementation, for each first GTP packet, the GTP header of the first GTP packet includes a second field that indicates the length of the GTP header and content of the first GTP packet.

[0012] In this scheme, since the IP header of the second GTP packet includes a first field, which is used to indicate the total length of the second GTP packet, and the GTP header of each first GTP packet includes a second field, which is used to indicate the GTP header and content of the first GTP packet, the second device can determine whether the second GTP packet has been received completely based on the first and second fields, thereby ensuring the accuracy of data reception.

[0013] In one possible implementation, the second GTP packet is obtained by merging the GTP headers and contents of the n first GTP packets, including: merging the GTP headers of each of the n first GTP packets to obtain a merged GTP header; merging the contents of each of the n first GTP packets to obtain merged contents; and appending the merged contents to the merged GTP header to obtain the second GTP packet.

[0014] The merging method in this scheme results in a fixed-length header for the merged second GTP packet, which improves the parsing efficiency of the second device. In addition, by centralizing the GTP headers and contents of each first GTP packet, parallel processing of messages can be achieved, which improves the efficiency of message processing.

[0015] In one possible implementation, the GTP headers of each of the n first GTP packets are merged to obtain a merged GTP header. This includes merging the second, third, and fourth fields in the GTP headers of each of the n first GTP packets to obtain a merged GTP header. The third field is used to indicate a flag, the second field is used to indicate the length of the GTP header and content of the first GTP packet, and the fourth field is used to indicate the message type of the first GTP packet. Correspondingly, the content portions of each of the n first GTP packets are merged to obtain a merged content. This includes merging the remaining fields in the GTP headers of each of the n first GTP packets, as well as the content portion, to obtain the merged content. The remaining fields include all fields in the GTP header except for the second, third, and fourth fields.

[0016] The merging method in this scheme results in a fixed-length header for the merged second GTP packet, which improves the parsing efficiency of the second device. In addition, by centralizing the GTP headers and contents of each first GTP packet, parallel processing of messages can be achieved, which improves the efficiency of message processing.

[0017] In one possible implementation, the GTP headers and contents of the n first GTP packets are merged to obtain a second GTP packet. This includes: merging the second, third, and fifth fields from the GTP headers of the n first GTP packets into the extended header of the first first GTP packet, and then merging the remaining fields and contents from the GTP headers of the n first GTP packets into the extended header of the first first GTP packet, to obtain the second GTP packet. The remaining fields include all fields in the GTP header except for the second, third, and fifth fields.

[0018] The merging method in this scheme has several advantages. First, it ensures that the header of the merged second GTP packet is of a fixed length, which improves the parsing efficiency of the second device. Second, by centralizing the GTP headers and contents of each first GTP packet, parallel processing of messages can be achieved, which improves message processing efficiency. Third, this encapsulation method requires minimal modification to the existing GTP packet encapsulation, further enhancing message processing efficiency.

[0019] In one possible implementation, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.

[0020] In this scheme, the total length field occupies 1 byte, which reduces the space occupied by the first GTP packet.

[0021] In one possible implementation, the GTP headers and contents of the n first GTP packets are merged to obtain a second GTP packet, including: compressing the Target Tunnel Endpoint Identifier (TEID) field included in each of the n first GTP packets to obtain n compressed first GTP packets; and merging the GTP headers and contents of the n compressed first GTP packets to obtain the second GTP packet.

[0022] In this scheme, the overhead of the packet header can be saved by compressing the target TEID field included in each first GTP packet.

[0023] In one possible implementation, the target tunnel endpoint identifier (TEID) field included in each of the n first GTP packets is compressed, including: based on the target TEID included in each of the n first GTP packets, querying a hash table to see if there is a mapping value corresponding to each target TEID, the hash table including the correspondence between multiple TEIDs and mapping values; if there is a mapping value corresponding to each target TEID in the hash table, then replacing the target TEID included in each of the n first GTP packets with the corresponding mapping value, wherein the space occupied by the mapping value is smaller than the space occupied by the target TEID.

[0024] In this scheme, since the space occupied by the mapped value is smaller than the space occupied by the target TEID, replacing the target TEID included in the first GTP packet with the mapped value can reduce the overhead of the GTP header of the first GTP packet, thereby reducing the space occupied by the second GTP packet and improving bandwidth utilization.

[0025] In one possible implementation, the method further includes: if there is no mapping value corresponding to the first target TEID in the hash table, then determining the target mapping value corresponding to the first target TEID, and storing the correspondence between the first target TEID and the target mapping value in the hash table, wherein the first target TEID is any one of a plurality of target TEIDs; correspondingly, sending the second GTP packet to the second device includes: sending the correspondence between the first target TEID and the target mapping value, and the second GTP packet to the second device.

[0026] In this scheme, the correspondence between the first target TEID and the target mapping value is stored in a hash table. In this way, the target mapping value corresponding to the first target TEID will not be recalculated in the next query. Instead, the target mapping value can be directly replaced with the first target TEID, thereby improving the efficiency of target TEID field compression in GTP packets.

[0027] In one possible implementation, the method further includes: determining whether there are target first GTP packets with the same message type field among the n first GTP packets; if there are target first GTP packets with the same message type field, then retaining the message type field in the first target first GTP packet and deleting the message type fields in the other target first GTP packets.

[0028] In this scheme, if there are multiple target first GTP packets with the same message type field, the message type field in the first target first GTP packet is retained, and the message type field in the other target first GTP packets is deleted. This can save the space occupied by the GTP packet header of the first GTP packet and help improve bandwidth utilization.

[0029] In one possible implementation, sending the second GTP packet to the second device includes: placing the second GTP packet into a buffer queue; and sending the second GTP packet in the buffer queue to the second device when the length of the buffer queue reaches a preset length or the waiting time exceeds a preset value.

[0030] In this scheme, the second GTP packet in the buffer queue can be sent to the second device when the length of the buffer queue reaches a preset length, thus improving bandwidth utilization. Alternatively, the second GTP packet in the buffer queue can be sent to the second device when the waiting time exceeds a preset value, thereby reducing waiting latency and improving GTP packet transmission efficiency.

[0031] In one possible implementation, the method further includes: if all m consecutive second GTP packets are sent when the waiting time exceeds a preset value, then the length of the buffer queue is reduced, where m is a positive integer; or, if the second GTP packets are sent t consecutively when the length of the buffer queue reaches a preset length, then the length of the buffer queue is increased, where t is a positive integer.

[0032] In this scheme, by dynamically adjusting the length and waiting time of the buffer queue, an efficiency trade-off between waiting latency and merging efficiency can be achieved in real time based on the continuous link packet transmission and reception, increasing the dynamism and flexibility of GTP packet transmission. Furthermore, when the GTP packet transmission rate is low, the maximum queue length of the buffer queue can be dynamically reduced, decreasing the merging degree of the first GTP packet, thereby efficiently utilizing system bandwidth. Conversely, when the GTP packet transmission rate is high, increasing the length of the buffer queue and reducing the waiting time can increase the merging degree of the first GTP packet, further maximizing link bandwidth utilization.

[0033] Secondly, embodiments of this application provide a method for processing GPRS tunneling protocol GTP packets, applied to a second device. The method includes: receiving a second GTP packet sent by a first device, wherein the second GTP packet is obtained by merging the GTP packet headers and contents of n first GTP packets; and parsing the second GTP packet to obtain n first GTP packets, wherein the n first GTP packets have the same destination IP address.

[0034] After determining the n first GTP packets to be sent, the first device can merge the GTP packet headers and contents of the n first GTP packets. This allows for compression and merging of the first GTP packets while maintaining compatibility with the traditional GTP protocol. It can reduce the amount of data transmitted while preserving the original GTP packet header information during transmission, thereby greatly improving the network bandwidth utilization.

[0035] In one possible implementation, the second GTP packet is parsed to obtain n first GTP packets, including: parsing n GTP packet headers from the second GTP packet, and the content portion corresponding to each of the n GTP packet headers; merging each GTP packet header and the content portion corresponding to that GTP packet header to obtain the n first GTP packets.

[0036] In this scheme, since n GTP packet headers and the corresponding content of each GTP packet header can be directly parsed from the second GTP packet, the efficiency of parsing the second GTP packet can be improved.

[0037] In one possible implementation, the IP header of the second GTP packet includes a first field that indicates the total length of the second GTP packet.

[0038] In one possible implementation, for each first GTP packet, the GTP header of the first GTP packet includes a second field that indicates the length of the GTP header and content of the first GTP packet.

[0039] In this scheme, since the IP header of the second GTP packet includes a first field, which is used to indicate the total length of the second GTP packet, and the GTP header of each first GTP packet includes a second field, which is used to indicate the GTP header and content of the first GTP packet, the second device can determine whether the second GTP packet has been received completely based on the first and second fields, thereby ensuring the accuracy of data reception.

[0040] In one possible implementation, the second GTP packet is parsed to obtain n first GTP packets, including: parsing n second fields, n third fields, and p fourth fields from the header of the second GTP packet; where p is a positive integer less than or equal to n; parsing the remaining fields of the GTP packet header and n content parts from the content of the second GTP packet, where the remaining fields include all fields in the GTP packet header except for the second, third, and fourth fields; and merging the second, third, fourth, remaining fields, and content parts to obtain n first GTP packets.

[0041] In this scheme, the second device can improve the efficiency of data parsing by parsing n second fields, n third fields, and p fourth fields, then parsing the remaining fields of n GTP packet headers and n content parts, and then merging the second fields, third fields, fourth fields, remaining fields, and content parts to obtain n first GTP packets.

[0042] In one possible implementation, the second GTP packet is parsed to obtain n first GTP packets, including: parsing the remaining fields of the GTP packet header and n content parts sequentially from the extended header of the second GTP packet, wherein the remaining fields include all fields in the GTP packet header except for the second field, the third field, and the fifth field; parsing the n second fields, the n third fields, and the n fifth fields sequentially from the extended header of the second GTP packet; and merging the second fields, the third fields, the fifth fields, the remaining fields, and the content parts to obtain n first GTP packets.

[0043] In this scheme, since the header of the second GTP packet is of a fixed length, it is beneficial to improve the parsing efficiency of the second device when parsing the second GTP packet.

[0044] In one possible implementation, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.

[0045] In this scheme, the total length field occupies 1 byte, which reduces the space occupied by the first GTP packet.

[0046] In one possible implementation, the method further includes: for each of the n first GTP packets, querying a hash table to see if there exists a target tunnel endpoint identifier (TEID) corresponding to the mapping value in the first GTP packet, the hash table including multiple correspondences between TEIDs and mapping values; if there is a target TEID corresponding to the mapping value in the hash table, then replacing the mapping value included in the first GTP packet with the corresponding target TEID to obtain the processed first GTP packet; wherein the size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID.

[0047] In this scheme, since the space occupied by the mapping value is smaller than that occupied by the target TEID, the space occupied by the GTP packet header can be reduced. Furthermore, the second device replaces the mapping value included in the first GTP packet with the queried target TEID by querying a hash table, thereby ensuring the accuracy of the reconstructed first GTP packet.

[0048] In one possible implementation, the method further includes receiving the correspondence between the target TEID and the mapping value from the first device.

[0049] Thirdly, embodiments of this application provide a processing apparatus for GPRS tunneling protocol GTP packets, comprising: a processing unit, configured to determine n first GTP packets to be sent, the n first GTP packets having the same destination network protocol IP address, where n is a positive integer; the processing unit is further configured to merge the GTP packet headers and contents of the n first GTP packets to obtain a second GTP packet; and a sending unit, configured to use the destination IP address as the destination IP address of the second GTP packet and send the second GTP packet to a second device.

[0050] In one possible implementation, the processing unit is specifically used to: sequentially merge the GTP packet headers and contents of the n first GTP packets (excluding the first first GTP packet) into the content portion of the first first GTP packet to obtain the second GTP packet.

[0051] In one possible implementation, the IP header of the second GTP packet includes a first field that indicates the total length of the second GTP packet.

[0052] In one possible implementation, for each first GTP packet, the GTP header of the first GTP packet includes a second field that indicates the length of the GTP header and content of the first GTP packet.

[0053] In one possible implementation, the processing unit is specifically configured to: merge the GTP headers of each of the n first GTP packets to obtain a merged GTP header; merge the content portions of each of the n first GTP packets to obtain a merged content; and append the merged content to the merged GTP header to obtain the second GTP packet.

[0054] In one possible implementation, the processing unit is specifically configured to: merge the second, third, and fourth fields in the GTP header of each of the n first GTP packets to obtain a merged GTP header, wherein the third field is used to indicate a flag bit, the second field is used to indicate the length of the GTP header and content of the first GTP packet, and the fourth field is used to indicate the message type of the first GTP packet; and merge the remaining fields in the GTP header of each of the n first GTP packets, as well as the content portion, to obtain the merged content; wherein the remaining fields include all fields in the GTP header other than the second, third, and fourth fields.

[0055] In one possible implementation, the processing unit is specifically configured to: sequentially merge the second, third, and fifth fields in the GTP headers of the n first GTP packets into the extended header of the first first GTP packet, and then sequentially merge the remaining fields and content portions in the GTP headers of the n first GTP packets into the extended header of the first first GTP packet to obtain the second GTP packet, wherein the remaining fields include all fields in the GTP header except for the second, third, and fifth fields.

[0056] In one possible implementation, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.

[0057] In one possible implementation, the processing unit is specifically used to: compress the Target Tunnel Endpoint Identifier (TEID) field included in each of the n first GTP packets to obtain n compressed first GTP packets; and merge the GTP packet headers and contents of the n compressed first GTP packets to obtain the second GTP packet.

[0058] In one possible implementation, the processing unit is specifically configured to: query a hash table for a mapping value corresponding to each target TEID, based on the target TEID included in each of the n first GTP packets, wherein the hash table includes multiple correspondences between TEIDs and mapping values; if a mapping value corresponding to each target TEID exists in the hash table, then the target TEID included in each of the n first GTP packets is replaced with the corresponding mapping value, wherein the size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID.

[0059] In one possible implementation, the processing unit is specifically configured to: if there is no mapping value corresponding to the first target TEID in the hash table, determine the target mapping value corresponding to the first target TEID, and store the correspondence between the first target TEID and the target mapping value in the hash table, wherein the first target TEID is any one of a plurality of target TEIDs; correspondingly, the sending unit is specifically configured to: send the correspondence between the first target TEID and the target mapping value, as well as the second GTP packet, to the second device.

[0060] In one possible implementation, the processing unit is specifically used to: determine whether there are target first GTP packets with the same message type field among the n first GTP packets; if there are target first GTP packets with the same message type field, then retain the message type field in the first target first GTP packet and delete the message type field in the other target first GTP packets.

[0061] In one possible implementation, the sending unit is specifically configured to: place the second GTP packet into a buffer queue; and when the length of the buffer queue reaches a preset length or the waiting time exceeds a preset value, send the second GTP packet in the buffer queue to the second device.

[0062] In one possible implementation, the processing unit is specifically configured to: reduce the length of the buffer queue if all m consecutive second GTP packets are sent when the waiting time exceeds a preset value, where m is a positive integer; or increase the length of the buffer queue if the second GTP packets are sent t consecutively when the length of the buffer queue reaches a preset length, where t is a positive integer.

[0063] Fourthly, embodiments of this application provide a processing apparatus for GPRS tunneling protocol GTP packets, comprising: a receiving unit for receiving a second GTP packet sent by a first device, the second GTP packet being obtained by merging the GTP packet headers and contents of n first GTP packets; and a processing unit for parsing the second GTP packet to obtain n first GTP packets, the n first GTP packets having the same destination IP address.

[0064] In one possible implementation, the processing unit is specifically used to: parse n GTP headers and the content portion corresponding to each of the n GTP headers from the second GTP packet; and merge each GTP header and the content portion corresponding to that GTP header to obtain the n first GTP packets.

[0065] In one possible implementation, the IP header of the second GTP packet includes a first field that indicates the total length of the second GTP packet.

[0066] In one possible implementation, for each first GTP packet, the GTP header of the first GTP packet includes a second field that indicates the length of the GTP header and content of the first GTP packet.

[0067] In one possible implementation, the processing unit is specifically configured to: parse n second fields, n third fields, and p fourth fields from the header of the second GTP packet; where p is a positive integer less than or equal to n; parse n remaining fields of the GTP packet header and n content portions from the content of the second GTP packet, wherein the remaining fields include other fields in the GTP packet header besides the second, third, and fourth fields; and merge the second, third, fourth, remaining fields, and content portions to obtain n first GTP packets.

[0068] In one possible implementation, the processing unit is specifically configured to: sequentially parse n remaining fields of the GTP packet header and n content portions from the extended header of the second GTP packet, wherein the remaining fields include other fields in the GTP packet header besides the second field, the third field, and the fifth field; sequentially parse n second fields, n third fields, and n fifth fields from the extended header of the second GTP packet; and merge the second field, the third field, the fifth field, the remaining fields, and the content portions to obtain n first GTP packets.

[0069] In one possible implementation, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.

[0070] In one possible implementation, the processing unit is specifically configured to: for each of the n first GTP packets, query a hash table to see if there exists a target tunnel endpoint identifier (TEID) corresponding to the mapping value in the hash table, the hash table including multiple correspondences between TEIDs and mapping values; if there is a target TEID corresponding to the mapping value in the hash table, replace the mapping value included in the first GTP packet with the corresponding target TEID to obtain the processed first GTP packet; wherein the size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID.

[0071] In one possible implementation, the apparatus further includes a receiving unit for receiving the correspondence between the target TEID and the mapping value from the first device.

[0072] Fifthly, embodiments of this application provide a processing apparatus for GPRS tunneling protocol GTP packets. The apparatus includes a processor and a memory, in which a computer program is stored. The processor executes the computer program stored in the memory to cause the apparatus to perform the method described in the first or second aspect.

[0073] In a sixth aspect, embodiments of this application provide a processing apparatus for GPRS tunneling protocol GTP packets, comprising: a processor and an interface circuit; the interface circuit is configured to receive code instructions and transmit them to the processor; the processor is configured to execute the code instructions to perform the method as described in the first or second aspect.

[0074] The apparatus mentioned in the third aspect of this application can be a network device or a chip within a network device. The network device or chip has the function of implementing the GPRS tunneling protocol GTP packet processing method in the above aspects or any possible design thereof. The function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.

[0075] The network device includes a processing unit and a transceiver unit. The processing unit may be a processor, and the transceiver unit may be a transceiver, which includes radio frequency circuitry. Optionally, the network device also includes a storage unit, such as a memory. When the network device includes a storage unit, the storage unit is used to store computer-executed instructions. The processing unit is connected to the storage unit and executes the computer-executed instructions stored in the storage unit to enable the network device to perform the GPRS tunneling protocol GTP packet processing method in the above aspects or any possible design thereof.

[0076] The chip includes a processing unit and a transceiver unit. The processing unit may be a processor, and the transceiver unit may be an input / output interface, pins, or circuits on the chip. The processing unit can execute computer-executable instructions stored in the storage unit to cause the chip to perform the processing methods of the GPRS tunneling protocol GTP packets in the above aspects or any possible design. Optionally, the storage unit may be an on-chip storage unit (e.g., registers, caches, etc.), or it may be an external storage unit located within the terminal device (e.g., read-only memory (ROM)) or other types of static storage devices capable of storing static information and instructions (e.g., random access memory (RAM)).

[0077] The processor mentioned above can be a central processing unit (CPU), a microprocessor, or an application-specific integrated circuit (ASIC). It can also be one or more integrated circuits that execute programs to control the processing methods of GPRS tunneling protocol GTP packets for the above aspects or any possible design thereof.

[0078] The apparatus mentioned in the fourth aspect of this application can be a serving gateway (SGW) or a chip within the SGW. The SGW or chip has the function of processing GPRS tunneling protocol GTP packets in the above aspects or any possible design thereof. The function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.

[0079] The SGW includes a processing unit and a transceiver unit. The processing unit may be a processor, and the transceiver unit may be a transceiver including radio frequency circuitry. Optionally, the SGW also includes a storage unit, such as a memory. When the SGW includes a storage unit, the storage unit is used to store computer-executable instructions. The processing unit is connected to the storage unit and executes the computer-executable instructions stored in the storage unit to enable the SGW to perform the processing method of GPRS tunneling protocol GTP packets in the above aspects or any possible design thereof.

[0080] The chip includes a processing unit and a transceiver unit. The processing unit may be a processor, and the transceiver unit may be an input / output interface, pins, or circuits on the chip. The processing unit can execute computer-executable instructions stored in the storage unit to cause the chip to perform the processing methods of the GPRS tunneling protocol GTP packets in the above aspects or any possible design thereof. Optionally, the storage unit may be an on-chip storage unit (e.g., registers, caches, etc.), or it may be an external storage unit within the SGW (e.g., read-only memory (ROM)) or other types of static storage devices capable of storing static information and instructions (e.g., random access memory (RAM)).

[0081] The processor mentioned above can be a central processing unit (CPU), a microprocessor, or an application-specific integrated circuit (ASIC). It can also be one or more integrated circuits that execute programs to control the processing methods of GPRS tunneling protocol GTP packets for the above aspects or any possible design thereof.

[0082] In a seventh aspect, embodiments of this application provide a system for processing GPRS tunneling protocol GTP packets, including the network device as described in the third aspect and the SGW as described in the fourth aspect.

[0083] Eighthly, embodiments of this application provide a readable storage medium for storing instructions that, when executed, cause the method as described in the first or second aspect to be implemented.

[0084] Ninthly, embodiments of this application provide a computer program product containing instructions that, when run on a computer or processor, cause the computer or processor to execute the GPRS tunneling protocol GTP packet processing method provided by any one of the first to second aspects of the embodiments of this application.

[0085] The GPRS tunneling protocol GTP packet processing method and apparatus provided in this application determine n first GTP packets to be sent, where the n first GTP packets have the same destination IP address (n is a positive integer). The GTP packet headers and contents of the n first GTP packets are merged to obtain a second GTP packet. The destination IP address is then used as the destination IP address of the second GTP packet, and the second GTP packet is sent to a second device. The second device parses the second GTP packet to obtain the n first GTP packets. Since the first device can merge the GTP packet headers and contents of the n first GTP packets after determining them, it can compress and merge the first GTP packets while maintaining compatibility with the traditional GTP protocol. This ensures that the original GTP packet header information is preserved during transmission, reducing the amount of data transmitted and thus greatly improving network bandwidth utilization. Attached Figure Description

[0086] Figure 1 This application provides a schematic diagram of the architecture of a communication system.

[0087] Figure 2 This is a schematic diagram of the architecture of another communication system provided in an embodiment of this application;

[0088] Figure 3 This is a signaling interaction diagram illustrating the GTP packet processing method of this application;

[0089] Figure 4 This is a schematic diagram of the structure of the first GTP packet;

[0090] Figure 5 This is a structural diagram of the merged second GTP packet;

[0091] Figure 6 This is another structural diagram of the merged second GTP packet;

[0092] Figure 7 This is another structural diagram of the merged second GTP packet;

[0093] Figure 8This is a schematic diagram of the first GTP packet after TEID compression;

[0094] Figure 9 This is a schematic diagram of the first GTP packet after the message type field has been compressed;

[0095] Figure 10 A schematic diagram of a GPRS tunneling protocol GTP packet processing device provided in this application embodiment;

[0096] Figure 11 A schematic diagram of a GPRS tunneling protocol GTP packet processing device provided in this application embodiment;

[0097] Figure 12 This application provides a schematic diagram of the structure of a network device according to an embodiment of the present application.

[0098] Figure 13 This is a schematic diagram of the structure of the SGW provided in an embodiment of this application. Detailed Implementation

[0099] The following explanations of some terms used in this application are provided to facilitate understanding by those skilled in the art.

[0100] 1) The unit in this application refers to a functional unit or logical unit. It can be in software form, where its function is implemented by a processor executing program code; or it can be in hardware form.

[0101] 2) "Multiple" refers to two or more, and other quantifiers are similar. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship. "Above" or "below" describe ranges including boundary points.

[0102] In this application, the first device can be a network device, and the second device can be a serving gateway (SGW). Alternatively, the first device can be a device with transmitting capabilities, and the second device can be a device with receiving capabilities. In this application, the embodiments are described using the example of the first device being a network device and the second device being an SGW. The cases where the first and second devices are other devices are similar to the cases where the first device is a network device and the second device is an SGW, and will not be described further in this application.

[0103] To ensure clarity and conciseness in the description of the following embodiments, a brief introduction to the related technologies is given first:

[0104] The GTP packet processing methods provided in the following embodiments of this application can be applied to communication systems. Figure 1 This is a schematic diagram of the architecture of a communication system provided in an embodiment of this application. Figure 1 As shown, the communication system may include at least one network device 10 and at least one terminal device located within the coverage area of ​​the network device 10. The terminal device may be fixed in location or mobile. Figure 1 This is just an illustration; the communication system may also include other devices, such as core network equipment. Network devices connect to the core network equipment wirelessly or via wired connections. The core network equipment and network devices can be independent physical devices, or the functions of the core network equipment and the logical functions of the network devices can be integrated onto the same physical device. Alternatively, a single physical device can integrate some of the functions of the core network equipment and some of the functions of the network devices. Furthermore, the communication system may also include other network devices, such as wireless relay equipment and wireless backhaul equipment. Figure 1 The components are not shown in the diagram. The embodiments of this application do not limit the number of core network devices, network devices, and terminal devices included in the communication system.

[0105] exist Figure 1 In the communication system of the illustrated embodiment, the communication between network device 10 and terminal devices is described. Specifically, network device 10, as the sender, can send downlink information to one or more of the terminal devices 11 to 16. Correspondingly, terminal devices 11 to 15, which can communicate directly with network device 10, can also send uplink information to network device 10 individually or simultaneously.

[0106] In this context, network equipment refers to an entity on the network side used to transmit or receive signals, such as a next-generation Node B (gNodeB). Network equipment can be used to communicate with mobile devices. It can be an access point (AP) in a wireless local area network (WLAN), a base transceiver station (BTS) in a global system for mobile communications (GSM) or code division multiple access (CDMA), a base station (NodeB, NB) in wideband code division multiple access (WCDMA), an evolved Node B (eNB or eNodeB) in long-term evolution (LTE), a relay station or access point, or in-vehicle equipment, wearable devices, and network equipment in future 5G networks or future public land mobile networks (PLMNs), or a gNodeB in an NR system, etc. Furthermore, in this embodiment, the network device provides services to a cell, and the terminal device communicates with the network device through the transmission resources (e.g., frequency domain resources, or spectrum resources) used by the cell. This cell can be a cell corresponding to the network device (e.g., a base station). The cell can belong to a macro base station or a base station corresponding to a small cell. Small cells can include: metro cells, microcells, pico cells, femto cells, etc. These small cells have the characteristics of small coverage area and low transmission power, making them suitable for providing high-speed data transmission services. In addition, in other possible cases, the network device can be other devices that provide wireless communication functions for the terminal device. The embodiments of this application do not limit the specific technology or device form used by the network device. For ease of description, in this embodiment, the device that provides wireless communication functions for the terminal device is referred to as a network device.

[0107] The terminal device can be a wireless terminal device capable of receiving network device scheduling and instruction information. It can be a device providing voice and / or data connectivity to the user, a handheld device with wireless connectivity, or other processing devices connected to a wireless modem. The wireless terminal device can communicate with one or more core networks or the Internet via a radio access network (RAN). It can be a mobile terminal device, such as a mobile phone (or "cellular" phone), computer, or data card. For example, it can be a portable, pocket-sized, handheld, computer-embedded, or vehicle-mounted mobile device that exchanges voice and / or data with the radio access network. Examples include personal communications service (PCS) phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), tablets, and computers with wireless transceiver capabilities. Wireless terminal equipment can also be referred to as a system, subscriber unit, subscriber station, mobile station, mobile station (MS), remote station, access point (AP), remote terminal, access terminal, user terminal, user agent, subscriber station (SS), customer premises equipment (CPE), terminal, user equipment (UE), mobile terminal (MT), etc. Wireless terminal equipment can also be wearable devices and next-generation communication systems, such as terminal equipment in 5G networks, terminal equipment in future PLMN networks, and terminal equipment in new radio (NR) communication systems.

[0108] like Figure 1As shown, terminal devices 14 to 16 can also form a device-to-device communication system. In the device-to-device communication system, terminal device 15, as the sender, can send information to one or more of terminal devices 14 and 16. Correspondingly, terminal devices 14 and 16 can send data to terminal device 15 separately or simultaneously.

[0109] Network devices and terminal devices can be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; they can also be deployed on water; and they can also be deployed in the air on aircraft, balloons, and satellites. The embodiments of this application do not limit the application scenarios of the network devices and terminal devices.

[0110] Figure 2 This is a schematic diagram of the architecture of another communication system provided in an embodiment of this application. For example... Figure 2 As shown, an LTE network may include: UE, Evolved UMTS Terrestrial Radio Access Network (E-UTRAN), Mobility Management Entity (MME), SGW, Packet Data Network Gateway (PGW), Policy and Charging Rule Function (PCRF), Home Subscriber Server (HSS), and operator IP services, etc.

[0111] The core network of an LTE network mainly consists of three logical functional units: MME, SGW, and PGW. MME is the signaling management network element, responsible for Non-Access Stratum (NAS) signaling encryption, assigning temporary identity identifiers to UEs, selecting core network elements such as SGW and PGW, and providing roaming, tracking, and security functions. SGW is the mobility anchor point for handover between local eNBs and provides functions related to lawful interception. PGW is responsible for user address allocation, scheme control, and the execution of charging rules, as well as functions related to lawful interception. HSS stores user subscription information. PCRF provides scheme and charging control rules.

[0112] When the method of this application is applied to an LTE system, the Access and Mobility Management Function (AMF) entity and the Session Management Function (SMF) entity can be replaced by the MME, the User Plane Function (UPF) entity can be replaced by the PGW and SGW in the LTE system, and the Authentication Server Function (AUSF) entity and the ARPF entity can be replaced by the HSS. The HSS is used to store subscription information, which can be subscription information from a Subscriber Identity Module (SIM) card or a Universal Subscriber Identity Module (USIM) card. The MME is a signaling management network element responsible for NAS signaling encryption, assigning temporary identities to UEs, selecting core network elements such as the SGW and PGW, and providing roaming, tracking, and security functions. The SGW is the mobility anchor point for handover between eNBs and provides functions related to lawful eavesdropping. The PGW is responsible for IP address allocation, scheme control, execution of charging rules, and functions related to lawful eavesdropping.

[0113] The communication system described above can be an LTE system, an LTE Advanced (LTE-A) system, or a 5G NR system. This application's embodiments can also be applied to other communication systems, as long as an entity in the system can determine the n first GTP packets to be sent, that these n first GTP packets have the same destination IP address, and merge the GTP packet headers and contents of the n first GTP packets to obtain a second GTP packet. Then, the destination IP address is used as the destination IP address of the second GTP packet, and the second GTP packet is sent to another entity. After the aforementioned entity sends the second GTP packet, the other entity can parse the second GTP packet to obtain the n first GTP packets.

[0114] The system architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0115] Currently, in order to improve bandwidth utilization, the method of compressing packet headers is usually used for packet transmission. Specifically, n RTP packets of the same length can be placed sequentially in the payload of a UDP packet as a compressed packet, thereby saving the IP and UDP headers corresponding to n-1 packets. After receiving the packet, the receiving device reads the content from the UDP payload in a fixed length as an RTP packet. In the above method, since the RTP header and payload are not processed and fixed-length packets are merged, the length of each segment does not need to be processed during packet compression and parsing. The above compression method utilizes two properties of most types of RTP streams: (1) Most fields in the IP, UDP and RTP headers do not change during the lifetime of the RTP session, and these constant value fields can be represented by fewer bits with session context during transmission; (2) For consecutive packets in the stream, RTP header fields such as sequence number and timestamp are increased to constant values.

[0116] However, since GTP packets do not add a constant value to the header field of the data packets, the compression method described above is not applicable to GTP packets. Therefore, how to improve bandwidth utilization when transmitting GTP packets is a technical problem that urgently needs to be solved.

[0117] This application proposes a GTP packet processing method to address the aforementioned issues. The method involves determining n first GTP packets to be sent, where each packet has the same destination IP address (n is a positive integer). The GTP headers and contents of these n first GTP packets are then merged to obtain a second GTP packet. The destination IP address of the second GTP packet is then used as the destination IP address of the second GTP packet, and the second GTP packet is sent to a second device. Since the first device can merge the GTP headers and contents of the n first GTP packets after determining them, the amount of data transmitted can be reduced, thereby improving bandwidth utilization.

[0118] The technical solution of this application will now be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0119] Figure 3 This is a signaling interaction diagram illustrating the GTP packet processing method of this application. In the above... Figures 1-2 Based on the application scenarios shown, such as Figure 3 As shown, in this embodiment, the method for processing the GTP packet may include the following steps:

[0120] Step 301: Determine the n first GTP packets to be sent.

[0121] Among them, n first GTP packets have the same destination IP address, where n is a positive integer.

[0122] In this step, the first device will continuously send GTP packets to the second device. The n first GTP packets can be GTP packets continuously sent by the first device to the second device, and the destination IP address included in the n first GTP packets is the same.

[0123] Step 302: Merge the GTP packet headers and contents of the n first GTP packets to obtain the second GTP packet.

[0124] In this step, in order to reduce the amount of data transmitted, after the first device determines n first GTP packets, it can merge the GTP packet headers and contents of the n first GTP packets. The contents of the first GTP packets can also be understood as the payload of the first GTP packets, which may include user messages or user data, etc.

[0125] The following section details several methods for merging the headers and contents of n first GTP packets:

[0126] In one possible implementation, merging the GTP headers and contents of n first GTP packets can be achieved by sequentially merging the GTP headers and contents of the other first GTP packets (excluding the first first GTP packet) into the content portion of the first first GTP packet to obtain the second GTP packet.

[0127] Specifically, since the n first GTP packets have the same destination IP address, the n first GTP packets can reuse the IP header and UDP header. That is, when merging the GTP packet headers and contents of the n first GTP packets, the GTP packet headers and contents of the first GTP packet can be treated as a whole, and the GTP packet headers and contents of the second to nth GTP packets can be merged into the content part of the first GTP packet in sequence.

[0128] The following explanation uses the merging of the GTP headers and contents of two first GTP packets as an example. The method for merging the GTP headers and contents of three or more first GTP packets is similar to that for merging the GTP headers and contents of two first GTP packets, and will not be repeated here.

[0129] Figure 4 This is a schematic diagram of the structure of the first GTP packet, as shown below. Figure 4As shown, each first GTP packet includes an IP header, a UDP header, a GTP header, and GTP content. The GTP header includes a version number field, a protocol type field, an extension header flag field, a sequence number flag field, an N-PDU number flag field, a TEID flag field, a total length field, a message type field, a TEID, and a TEID hash value field. The TEID field is only present when the value of the TEID flag field is 1.

[0130] Figure 5 A structural diagram of the merged second GTP packet, as shown below. Figure 4 and Figure 5 As shown, the first and second GTP packets can reuse the same IP header and UDP header. The GTP header and GTP content of the second GTP packet are merged into the GTP content of the first GTP packet. That is, the version number field, protocol type field, extension header flag field, sequence number flag field, N-PDU number flag field, TEID flag field, total length field, message type field, TEID field, and TEID hash value field of the second GTP packet, as well as the GTP content, are merged into the GTP content of the first GTP packet.

[0131] In this embodiment, the GTP headers and contents of the n first GTP packets (excluding the first first GTP packet) are sequentially merged into the content portion of the first first GTP packet to obtain the merged second GTP packet. Since the n first GTP packets can reuse IP and UDP headers, the merged second GTP packet can save the space of n-1 IP and UDP headers. Alternatively, the headers and contents of the n first GTP packets are merged to obtain the second GTP packet, which has only one IP and UDP header, thus saving the space of n-1 IP and UDP headers. The two methods achieve the same effect, and the first method will be used for explanation below.

[0132] Furthermore, the IP header of the merged second GTP packet includes a first field, which indicates the total length of the second GTP packet.

[0133] For each first GTP packet, the GTP header of the first GTP packet includes a second field, which indicates the length of the GTP header and content of the first GTP packet. For example, the second field may be... Figure 4 The total length field shown.

[0134] It should be noted that when the second device receives and parses the second GTP packet, it can determine whether there will be a subsequent first GTP packet based on the first field in the IP header and the second field in the parsed GTP header. For example, if there is no subsequent first GTP packet, the length information indicated by the first field matches the length information indicated by the second field in the parsed GTP header. This matching can be understood as the length information indicated by the first field being equal to the length information indicated by the second field in the parsed GTP header, or as a corresponding relationship existing between the length information indicated by the first field and the length information indicated by the second field in the parsed GTP header.

[0135] In this embodiment, since the IP header of the second GTP packet includes a first field, which is used to indicate the total length of the second GTP packet, and the GTP header of each first GTP packet includes a second field, which is used to indicate the GTP header and content of the first GTP packet, the second device can determine whether the second GTP packet has been received completely based on the first field and the second field, thereby ensuring the accuracy of data reception.

[0136] In another possible implementation, the GTP headers and contents of the n first GTP packets are merged. This can be done by merging the GTP headers of each of the n first GTP packets to obtain a merged GTP header, and then merging the contents of each of the n first GTP packets to obtain a merged content. Finally, the merged content is added to the merged GTP header to obtain the second GTP packet.

[0137] Specifically, when merging the GTP headers and contents of n first GTP packets, the GTP headers and contents of the n first GTP packets can be merged separately. This merging method results in a fixed-length header for the merged second GTP packet, which improves the parsing efficiency of the second device. Furthermore, by centralizing the GTP headers and contents of each first GTP packet, parallel message processing can be achieved, further improving message processing efficiency.

[0138] In another possible implementation, when merging the GTP headers of n first GTP packets, the second, third, and fourth fields of the GTP header of each of the n first GTP packets can be merged to obtain a merged GTP header. The third field indicates a flag, the second field indicates the length of the GTP header and content of the first GTP packet, and the fourth field indicates the message type of the first GTP packet. Correspondingly, merging the content of each of the n first GTP packets can be achieved by merging the remaining fields in the GTP header of each of the n first GTP packets, as well as the content portion, to obtain a merged content. The remaining fields include all fields in the GTP header except for the second, third, and fourth fields.

[0139] The following explanation will be based on the example of the second field being the total length field, the third field including the extension header flag field, the sequence number flag field, the N-PDU number flag field, and the TEID flag field, and the fourth field being the message type field.

[0140] like Figure 4 As shown, the GTP header of the first GTP packet includes a version number field, a protocol type field, an extension header flag field, a sequence number flag field, an N-PDU number flag field, a TEID flag field, a total length field, a message type field, a TEID field, and a TEID hash value field. Figure 6Another structural diagram of the merged second GTP packet is shown below. Figure 6 As shown, when merging the GTP headers of n first GTP packets, the extension header flag, sequence number flag, N-PDU number flag, TEID flag, total length, and message type fields can be extracted from the GTP header of each first GTP packet. These extracted fields are then merged to obtain the merged GTP header, which is placed in the header position of the second GTP packet. Next, the remaining fields from the GTP header of each first GTP packet and the GTP content portion are merged and placed in the content portion of the second GTP packet. Alternatively, the remaining fields and content portions from the GTP headers of the n first GTP packets can be sequentially placed after the merged header to form the content portion of the second GTP packet. The remaining fields include the version number, protocol type, TEID, and TEID hash value.

[0141] The merging method in this embodiment results in a fixed-length header for the merged second GTP packet, which improves the parsing efficiency of the second device. In addition, by centralizing the GTP headers and GTP content of each first GTP packet, parallel processing of messages can be achieved, which improves the efficiency of message processing.

[0142] In another possible implementation, the GTP headers and contents of the n first GTP packets are merged. This can be done by merging the second, third, and fifth fields from the GTP headers of the n first GTP packets into the extended header of the first first GTP packet, and then merging the remaining fields and contents from the GTP headers of the n first GTP packets into the extended header of the first first GTP packet, to obtain the second GTP packet. The remaining fields include all fields in the GTP header except for the second, third, and fifth fields.

[0143] Specifically, the second field can be the total length field, the third field can be the extension header flag field, the sequence number flag field, the N-PDU number flag field, and the TEID flag field, and the fifth field can be the TEID field. The remaining fields include the version number field, the protocol type field, the message type field, and the TEID hash value field.

[0144] In this merging method, the header of the merged GTP packet is primarily carried by the extended header of the first GTP packet. The following explanation uses the merging of three first GTP packets as an example. The merging method for other numbers of first GTP packets is similar to that for three first GTP packets, and will not be elaborated further here. Figure 7 This is another structural diagram of the merged second GTP packet, as shown below. Figure 4 and Figure 7 As shown, the GTP header of the first GTP packet GTP-U1 can be used as the GTP header of the second GTP packet. The total length field, extension header flag field, sequence number flag field, N-PDU number flag field, TEID flag field, and TEID field of the second and third GTP packets GTP-U2 and GTP-U3 can be sequentially merged into the extension header of GTP-U1. In other words, the aforementioned fields from GTP-U2 and GTP-U3 can be placed sequentially after the extension header field or sequence number field of GTP-U1. Additionally, as... Figure 7 As shown, after the GTP-U1 extension header, the GTP-U1 content portion, the GTP-U2 extension header portion, the GTP-U2 content portion, the GTP-U3 extension header portion, and the GTP-U3 content portion will be placed in sequence. The GTP-U2 extension header portion and the GTP-U3 extension header portion both include the remaining fields, namely the version number field, the protocol type field, the message type field, and the TEID hash value field.

[0145] The merging method in this embodiment has several advantages. First, it divides the header of the merged second GTP packet into a fixed length, which helps improve the parsing efficiency of the second device. Second, by centralizing the GTP headers and contents of each first GTP packet, parallel processing of messages can be achieved, which helps improve the efficiency of message processing. Third, this encapsulation method requires minimal modification to the existing GTP packet encapsulation, thus improving the efficiency of message processing.

[0146] The above-mentioned merging methods, which reuse UDP and IP headers based on the tunnel endpoint IP, can greatly reduce the bandwidth waste caused by redundant outer IP / UDP headers and improve bandwidth utilization.

[0147] Furthermore, the total length field included in the GTP header of each of the aforementioned n first GTP packets occupies 1 byte.

[0148] Understandably, in the first GTP packet, the third and fourth bytes indicate the message length, where 16 bits can represent a range of 0 to 2. 16 -1 byte. For GTP packets, the typical length is 20, 40-250 bytes, so only 8 bits, or one byte, are needed to represent the length. Therefore, the total length field can be compressed, meaning the total length field in the GTP packet header occupies 1 byte, thus reducing the space occupied by the first GTP packet.

[0149] In another possible implementation, the GTP headers and contents of the n first GTP packets are merged. This can be done by compressing the target TEID field included in each of the n first GTP packets to obtain n compressed first GTP packets, and then merging the GTP headers and contents of the n compressed first GTP packets to obtain a second GTP packet.

[0150] Specifically, the target TEID field included in the first GTP packet occupies four bytes, typically accounting for 50% of the entire GTP packet header size. Therefore, to save header overhead, compression of the target TEID field can be considered. In practical applications, one TEID is usually assigned to each session. From the perspective of saving TEID header space and considering the need to quickly recover the original TEID information at the receiving end, a hash table is usually chosen. The average time complexity of hash mapping is O(1), which can meet the requirement of the receiving end to quickly recover the original TEID. In addition, the length of the mapped field, based on practical scenarios, can usually be allocated to 16 bits, or 2 bytes, thus achieving a balance between reducing the need for resetting the hash table after it is full and reducing field occupancy.

[0151] Furthermore, on the one hand, by using a hash strategy to compress TEID, the TEID field can be stably compressed to 2 bytes while ensuring a one-to-one correspondence, saving 50% of the TEID field space compared to the original GTP packet. On the other hand, since the hash algorithm has an O(1) read efficiency, it can maximize bandwidth utilization with almost no increase in latency.

[0152] For example, when compressing the target TEID field included in each of the n first GTP packets, the process can be as follows: Based on the target TEID included in each of the n first GTP packets, query a hash table to see if there is a mapping value corresponding to each target TEID. The hash table includes multiple correspondences between TEIDs and mapping values. If a mapping value corresponding to each target TEID exists in the hash table, then the target TEID included in each of the n first GTP packets is replaced with the corresponding mapping value. The size of the mapping value is smaller than the size of the target TEID.

[0153] Specifically, the first device includes a hash table containing at least one TEID and a mapping value corresponding to each TEID, wherein the size of the mapping value is smaller than the size of its corresponding TEID. For example, the size of the mapping value is typically 2 bytes, while the size of the TEID is typically 4 bytes.

[0154] For each target TEID included in the first GTP packet, the first device will query the hash table to determine whether there is a mapping value corresponding to the target TEID in the hash table. If there is a mapping value corresponding to the target TEID in the hash table, the target TEID included in the first GTP packet will be replaced with the queried mapping value, and the TEID flag in the first GTP packet will be set to 1.

[0155] In this embodiment, since the space occupied by the mapping value is smaller than the space occupied by the target TEID, replacing the target TEID included in the first GTP packet with the mapping value can reduce the overhead of the GTP packet header of the first GTP packet, thereby reducing the space occupied by the second GTP packet and improving the bandwidth utilization.

[0156] Furthermore, if there is no mapping value corresponding to the first target TEID in the hash table, then the target mapping value corresponding to the first target TEID is determined, and the correspondence between the first target TEID and the target mapping value is stored in the hash table. The first target TEID can be any one of the multiple target TEIDs.

[0157] Specifically, if the first device queries the hash table and determines that there is no mapping value corresponding to the first target TEID included in the GTP header of a certain first GTP packet in the hash table, the target mapping value corresponding to the first target TEID can be determined by a preset algorithm. For example, the target mapping value can be determined by a hash algorithm. Of course, other algorithms can also be used to determine the target mapping value, as long as the size of the space occupied by the calculated target mapping value is smaller than the size of the space occupied by the first target TEID. This application embodiment does not limit the preset algorithm.

[0158] After determining the target mapping value corresponding to the first target TEID, the first device can replace the first target TEID in the first GTP packet with the determined target mapping value and set the TEID flag field in the first GTP packet to 1. Alternatively, the correspondence between the first target TEID and the target mapping value can be stored in a hash table. This way, in subsequent queries, the target mapping value corresponding to the first target TEID will not be recalculated; instead, the target mapping value will be directly used to replace the first target TEID, thereby improving the efficiency of target TEID field compression in GTP packets.

[0159] In addition, in order for the second device to correctly restore the first GTP packet, the first device also needs to send the correspondence between the first target TEID and the target mapping value to the second device.

[0160] It is understood that the first device can simultaneously send the second GTP packet and the determined correspondence to the second device, or it can send the second GTP packet first and then send the correspondence, or it can send the correspondence first and then send the second GTP packet. This application embodiment does not limit the method of sending the correspondence between the first target TEID and the target mapping value.

[0161] Furthermore, to save storage space in both the first and second devices, if the content stored in the hash table exceeds a preset number of fields and the content in the hash table is updated frequently, the content in the hash table can be cleared to perform a new mapping, that is, to store the new correspondence between TEID and mapping value. Alternatively, the correspondence between TEID and mapping value can be deleted according to the storage time, in chronological order of storage time, deleting the oldest correspondence, etc.

[0162] Figure 8 This is a schematic diagram of the first GTP packet after TEID compression, as shown below. Figure 8 As shown, the first GTP packet includes a version field, a protocol type field, an extension header flag field, a sequence number flag field, an N-PDU number flag field, a TEID flag field, a total length field, a message type field, a TEID field, a TEID hash value field, a sequence number field, an N-PDU number field, an extension context length field, a next extension header type field, and extension context. The total length field is 1 byte, and the TEID field in the GTP packet header is replaced by a TEID hash value, which is the mapping value mentioned above.

[0163] It should be noted that the above Figures 5-7 In the merging method shown, the TEID in the GTP packet header can also be replaced by the TEID hash value or the mapping value.

[0164] In addition, to further reduce the space occupied by the GTP header of the first GTP packet, the second device can also compress the message type field included in the GTP header of the first GTP packet. For example, it can be determined whether there is a target first GTP packet with the same message type field among n first GTP packets. If there is a target first GTP packet with the same message type field, the message type field in the first target first GTP packet is retained, and the message type fields in the other target first GTP packets are deleted.

[0165] Specifically, the first device maintains a buffer pool containing multiple buffer queues. First GTP packets in each buffer queue can be merged and sent. The buffer pool is maintained based on the destination IP address, and buffer queues are further maintained within the buffer pool based on message type. In practical applications, it can be determined whether any of the n first GTP packets to be sent contain target first GTP packets with the same message type. If such target first GTP packets exist, they are placed in the same buffer queue. Furthermore, only the message type field from the first target first GTP packet needs to be retained; the message type fields from the other target first GTP packets can be deleted, thus saving 1 byte of storage space.

[0166] Figure 9 This is a schematic diagram of the first GTP packet after compressing the message type field, as shown below. Figure 9 As shown, compared to Figure 8 The first GTP packet in the process can have its message type field removed, which can save 1 byte of storage space.

[0167] In this embodiment, if there are multiple target first GTP packets with the same message type field, the message type field in the first target first GTP packet is retained, and the message type field in the other target first GTP packets is deleted. This can save the space occupied by the GTP packet header of the first GTP packet and help improve the bandwidth utilization.

[0168] It should be noted that the above merging methods can be combined with each other. Therefore, merging n first GTP packets can save n-1 UDP and IP header space, n-1 message type field space, and also reduce the TEID field by 3n bytes.

[0169] Step 303: Use the destination IP address as the destination IP address of the second GTP packet and send the second GTP packet to the second device.

[0170] In this step, the n first GTP packets merged by the first device have the same destination IP address. After the first device obtains the second GTP packet, it can use this destination IP address as the destination IP address of the second GTP packet and send the second GTP packet to the second device.

[0171] In one possible implementation, when the first device sends a second GTP packet to the second device, the second GTP packet can be placed in a buffer queue. When the length of the buffer queue reaches a preset length or the waiting time exceeds a preset value, the second GTP packet in the buffer queue is sent to the second device.

[0172] Specifically, the first device maintains a buffer pool containing multiple buffer queues. Multiple first GTP packets in each buffer queue can be merged to obtain a second GTP packet, which is then sent. The length of each buffer queue can be set to a preset length. When the length of the second GTP packets in the buffer queue reaches the preset length, the second GTP packets in the buffer queue can be sent to the second device. Alternatively, to reduce latency, the second GTP packets in the buffer queue can be sent to the second device when the waiting time exceeds a preset value.

[0173] The preset length and preset value can be set according to actual conditions or experience. For example, the preset length can be set to 3 and the preset value can be 5ms. The specific values ​​of the preset length and preset value are not limited in this embodiment.

[0174] In this embodiment, the second GTP packet in the buffer queue can be sent to the second device when the length of the buffer queue reaches a preset length, which can improve bandwidth utilization. Alternatively, the second GTP packet in the buffer queue can be sent to the second device when the waiting time exceeds a preset value, thereby reducing waiting latency and improving the transmission efficiency of GTP packets.

[0175] Furthermore, to improve the flexibility of data transmission and the adaptive adjustment of parameters to link conditions, this embodiment can also dynamically adjust the parameters of the transmission buffer queue by recording the packet transmission status over a period of time. The parameters of the buffer queue include the maximum number of packets allowed in the buffer queue and / or the maximum allowed waiting time for each packet. Specifically, if m consecutive second GTP packets are sent when the waiting time exceeds a preset value, the length of the buffer queue is reduced, where m is a positive integer. Alternatively, if the second GTP packets are sent t consecutively when the length of the buffer queue reaches a preset length, the length of the buffer queue is increased, where t is a positive integer.

[0176] If, when sending a second GTP packet included in a certain buffer queue, m consecutive second GTP packets in the buffer queue are sent only after the waiting time exceeds a preset value, it indicates that the length of the buffer queue may be too large. In this case, the length of the buffer queue can be reduced. The value of m can be set according to actual conditions or experience, for example, it can be 3. The specific value of m is not limited in this embodiment.

[0177] If, when sending a second GTP packet included in a certain buffer queue, the second GTP packet in the buffer queue is sent t times consecutively when the length of the buffer queue reaches a preset length, it indicates that the length of the buffer queue may be too small. In this case, the length of the buffer queue can be increased. The value of t can be set according to actual conditions or experience, for example, it can be 3. The specific value of t is not limited in this embodiment.

[0178] For example, a sending state (`state`) can be defined to indicate whether the transmission occurs when the waiting time exceeds a preset value or when the length of the buffer queue reaches a preset length. Typically, two counters, `cnt-queuefull` and `cnt-timeout`, are set for each buffer queue. `cnt-queuefull` represents the number of consecutive GTP packets sent by the buffer queue due to queue fullness, and `cnt-timeout` represents the number of consecutive GTP packets sent by the buffer queue due to timeout. Additionally, each buffer queue maintains a sending waiting time [MIN-LENGTH, MAX-LENGTH] and a queue length range [MIN-WAIT-TIME, MAX-WAIT-TIME]. For increasing and decreasing the buffer queue length, change factors `a` and `b` can be defined to identify the changes in the buffer queue length and waiting time, respectively. In the specific implementation, the increase and decrease values ​​of the buffer queue length can be determined as follows:

[0179] If m consecutive second GTP packets in the buffer queue are not sent after the waiting time has elapsed, the length of the buffer queue can be considered too large. In this case, the length of the buffer queue, Queue-length, can be reduced within a certain threshold range according to formula (1), while the waiting time of the second GTP packet can be increased according to formula (2).

[0180] Queue-length=Queue-length–a (Queue-length>MIN-LENGTH) (1)

[0181] Wait-time=Wait-time+b (Wait-time <MAX-WAIT-TIME) (2)

[0182] Where m can be 3.

[0183] If the packets are sent t times consecutively when the length of the buffer queue reaches the preset length, it can be assumed that the current size of the buffer queue cannot meet the merging requirements. In this case, the length of the buffer queue, Queue-length, can be dynamically increased according to formula (3), while the waiting time of the second GTP packet can be reduced according to formula (4).

[0184] Queue-length=Queue-length+a (Queue-length <MAX-LENGTH) (3)

[0185] Wait-time=Wait-time-b (Wait-time>MIN-WAIT-TIME) (4)

[0186] In this embodiment, by dynamically adjusting the length and waiting time of the buffer queue, an efficiency trade-off can be struck between waiting latency and merging efficiency based on the continuous link packet transmission and reception status in real time, increasing the dynamism and flexibility of GTP packet transmission. Furthermore, when the GTP packet transmission rate is low, the maximum queue length of the buffer queue can be dynamically reduced, decreasing the merging degree of the first GTP packet, thereby efficiently utilizing system bandwidth. Conversely, when the GTP packet transmission rate is high, increasing the length of the buffer queue and reducing the waiting time can increase the merging degree of the first GTP packet, further maximizing link bandwidth utilization.

[0187] Step 304: Parse the second GTP packet to obtain n first GTP packets, which have the same destination IP address.

[0188] In this step, after receiving the second GTP packet, the second device will parse the second GTP packet to restore the n first GTP packets before merging.

[0189] In one possible implementation, when the second device parses the second GTP packet, it may parse n GTP packet headers and the content portion corresponding to each of the n GTP packet headers from the second GTP packet, and then merge each GTP packet header and the content portion corresponding to the GTP packet header to obtain n first GTP packets.

[0190] Specifically, if the first device merges n first GTP packets by sequentially merging the GTP packet headers and contents of the other first GTP packets (excluding the first first GTP packet) into the content portion of the first first GTP packet to obtain the second GTP packet, then the second device will obtain the packet headers and corresponding content portions of the other first GTP packets from the content portion of the first first GTP packet.

[0191] Let's take two first GTPs as examples to illustrate, such as... Figure 5 As shown, since the GTP header and GTP content of the second first GTP packet are merged into the GTP content of the first first GTP packet, after receiving the second GTP packet, the second device uses the GTP header of the second GTP packet as the first GTP header, and parses the second GTP header and the corresponding content from the content. Then, it uses the remaining content as the content corresponding to the first GTP header, and then merges the first GTP header and its corresponding content to obtain the first first GTP packet. Finally, it merges the second GTP header and its corresponding content to obtain the second first GTP packet.

[0192] In this embodiment, since n GTP packet headers and the corresponding content of each GTP packet header can be directly parsed from the second GTP packet, the efficiency of parsing the second GTP packet can be improved.

[0193] The IP header of the second GTP packet includes a first field, which indicates the total length of the second GTP packet.

[0194] For each first GTP packet, the GTP header of the first GTP packet includes a second field, which indicates the length of the GTP header and content of the first GTP packet. For example, the second field may be... Figure 4 The total length field shown.

[0195] When the second device receives and parses the second GTP packet, it can determine whether there will be a subsequent first GTP packet based on the first field in the IP header and the second field in the parsed GTP header. For example, if there is no subsequent first GTP packet, the length information indicated by the first field matches the length information indicated by the second field in the parsed GTP header. This matching can be understood as the length information indicated by the first field being equal to the length information indicated by the second field in the parsed GTP header, or it can be understood as a correspondence between the length information indicated by the first field and the length information indicated by the second field in the parsed GTP header.

[0196] In this embodiment, since the IP header of the second GTP packet includes a first field, which is used to indicate the total length of the second GTP packet, and the GTP header of each first GTP packet includes a second field, which is used to indicate the GTP header and content of the first GTP packet, the second device can determine whether the second GTP packet has been received completely based on the first field and the second field, thereby ensuring the accuracy of data reception.

[0197] In another possible implementation, when the second device parses the second GTP packet, it may parse n second fields, n third fields, and p fourth fields from the header of the second GTP packet, and parse n remaining fields of the GTP packet header and n content parts from the content of the second GTP packet. The remaining fields include all fields in the GTP packet header except for the second, third, and fourth fields. Then, the second fields, third fields, fourth fields, remaining fields, and content parts are merged to obtain n first GTP packets.

[0198] Specifically, when the first device merges n first GTP packets, it merges the second, third, and fourth fields in the GTP packet header of each of the n first GTP packets to obtain a merged GTP packet header. Then, it merges the remaining fields and content of each of the n first GTP packets to obtain a merged content. Finally, it adds the merged content to the merged GTP packet header to obtain a second GTP packet. Correspondingly, when the second device parses, it parses n second fields, n third fields, and p fourth fields from the packet header of the second GTP packet, and then parses the remaining fields of the n GTP packet headers and n content parts from the content of the second GTP packet.

[0199] The second field can be the total length field, the third field can be the extension header flag field, the sequence number flag field, the N-PDU number flag field, and the TEID flag field, and the fourth field can be the message type field.

[0200] It should be noted that when the first device merges the GTP packet header and the corresponding content of each header in the first GTP packet, it merges them in a one-to-one order. For example, when merging the GTP packet headers, it does so in the order of GTP packet 1, GTP packet 2, ..., GTP packet n. Similarly, when merging the GTP content, it does so in the order of GTP packet 1, GTP packet 2, ..., GTP packet n. This ensures that the second device will not make mistakes when parsing the second GTP packet, thus improving the accuracy of data parsing.

[0201] Let's take two first GTPs as examples to illustrate, such as... Figure 6 As shown, the extension header flag, sequence number flag, N-PDU number flag, TEID flag, total length, and message type fields included in the GTP headers of the first and second GTP packets can be parsed from the GTP header of the second GTP packet. The remaining fields in the GTP headers of the first and second GTP packets, along with their corresponding content portions, can be parsed from the content portion of the second GTP packet. The obtained GTP headers and corresponding content portions are then merged to obtain the two first GTP packets before merging.

[0202] It is worth noting that, as described in the previous embodiments, if there are multiple first GTP packets with the same message type, only the message type field in the first first GTP packet can be retained, and the message type fields in other first GTP packets can be deleted. Therefore, the above message type field can be only one or multiple, that is, the number of message type fields is less than or equal to n.

[0203] In this embodiment, the second device can improve the efficiency of data parsing by parsing n second fields, n third fields, and p fourth fields, then parsing the remaining fields of n GTP packet headers and n content parts, and then merging the second fields, third fields, fourth fields, remaining fields, and content parts to obtain n first GTP packets.

[0204] In another possible implementation, when the second device parses the second GTP packet, it may parse the remaining fields of the GTP packet header and the n content parts sequentially from the extended header of the second GTP packet. The remaining fields include all fields in the GTP packet header except for the second, third, and fifth fields. Then, it may parse the second field, the third field, and the fifth field sequentially from the extended header of the second GTP packet. Finally, it may merge the second field, the third field, the fifth field, the remaining fields, and the content parts to obtain n first GTP packets.

[0205] The second field can be the total length field; the third field can be the extension header flag, sequence number flag, N-PDU number flag, and TEID flag field; and the fifth field can be the TEID field. The remaining fields include the version number, protocol type, message type, and TEID hash value.

[0206] For example, if the first device merges n first GTP packets by sequentially merging the second, third, and fifth fields from the GTP headers of the n first GTP packets into the extended header of the first first GTP packet, and then sequentially merging the remaining fields and content portions from the GTP headers of the n first GTP packets into the extended header of the first first GTP packet, resulting in the second GTP packet, then when the second device parses, it uses the GTP header of the second GTP packet as the GTP header of the first first GTP packet, and sequentially parses the second, third, and fifth fields from the extended header of the first first GTP packet, and then parses the remaining fields and the content portions corresponding to each GTP header from the extended header.

[0207] Let's take three first GTPs as examples to illustrate, such as... Figure 7As shown, the GTP header of the second GTP packet can be used as the GTP header of the first GTP packet. The total length field, extension header flag, sequence number flag, N-PDU number flag, TEID flag, and TEID field of the second and third GTP packets can be parsed from the extension header of the first GTP packet. Then, the remaining fields and corresponding content parts of the GTP headers of each first GTP packet can be parsed from the extension header of the first GTP packet. The obtained GTP headers and corresponding content parts are then merged to obtain the two first GTP packets before merging.

[0208] In this embodiment, since the header of the second GTP packet is of a fixed length, it is beneficial to improve the parsing efficiency of the second device when parsing the second GTP packet.

[0209] Furthermore, since the first device replaces the TEID in the GTP header with the corresponding mapping value to save space occupied by the GTP header of the first GTP packet, in order to obtain the correct first GTP packet, the second device, after parsing the second GTP packet and obtaining n first GTP packets, will, for each of the n first GTP packets, query a hash table to see if there is a target TEID corresponding to the mapping value, where the hash table includes multiple correspondences between TEIDs and mapping values; if there is a target TEID corresponding to the mapping value in the hash table, then the mapping value included in the first GTP packet is replaced with the corresponding target TEID, resulting in the processed first GTP packet, wherein the space occupied by the mapping value is smaller than the space occupied by the target TEID.

[0210] Specifically, the hash table contains multiple correspondences between TEIDs and mapping values. The second device queries the hash table to determine whether there is a TEID in the hash table that corresponds to the mapping value included in the first GTP packet. If it does, the queried TEID is used to replace the mapping value included in the first GTP packet, thereby obtaining the correct first GTP packet.

[0211] Furthermore, since both the first and second devices maintain the same hash table, if the hash table maintained by the second device does not contain a TEID corresponding to a mapping value included in a first GTP packet, it indicates that the mapping value in that first GTP packet was newly determined by the first device. To enable the second device to determine the correct TEID, the first device can also send the newly determined mapping value and TEID correspondence to the second device when sending the second GTP packet. In this way, the second device can determine the TEID corresponding to the mapping value included in the first GTP packet based on the received correspondence, and thus replace the mapping value with the corresponding TEID.

[0212] In this embodiment, since the space occupied by the mapping value is smaller than the space occupied by the target TEID, the space occupied by the GTP packet header can be reduced. Furthermore, the second device replaces the mapping value included in the first GTP packet with the queried target TEID by querying a hash table, thereby ensuring the accuracy of the reconstructed first GTP packet.

[0213] This embodiment provides a method for processing GTP packets. It determines n first GTP packets to be sent, where each packet has the same destination IP address (n is a positive integer). The GTP headers and contents of these n first GTP packets are merged to obtain a second GTP packet. The destination IP address of the second GTP packet is then used as the destination IP address of the second GTP packet, and the second GTP packet is sent to a second device. The second device parses the second GTP packet to obtain the n first GTP packets. Since the first device can merge the GTP headers and contents of the n first GTP packets after determining them, it can compress and merge the first GTP packets while maintaining compatibility with the traditional GTP protocol. This ensures that the original GTP header information is preserved during transmission, reducing the amount of data transmitted and significantly improving network bandwidth utilization.

[0214] Figure 10 For a schematic diagram of a GPRS tunneling protocol GTP packet processing device 10 provided in this application embodiment, please refer to [link / reference]. Figure 10 As shown, the processing device 10 for the GPRS tunneling protocol GTP packets may include:

[0215] Processing unit 11 is used to determine n first GTP packets to be sent, the n first GTP packets having the same destination network protocol IP address, where n is a positive integer; processing unit 11 is also used to merge the GTP packet headers and contents of the n first GTP packets to obtain a second GTP packet; sending unit 12 is used to use the destination IP address as the destination IP address of the second GTP packet and send the second GTP packet to the second device.

[0216] Optionally, the processing unit 11 is specifically used to: merge the GTP packet headers and contents of the n first GTP packets, excluding the first first GTP packet, into the content portion of the first first GTP packet to obtain the second GTP packet.

[0217] Optionally, the IP header of the second GTP packet includes a first field that indicates the total length of the second GTP packet.

[0218] Optionally, for each first GTP packet, the GTP header of the first GTP packet includes a second field, which is used to indicate the length of the GTP header and content of the first GTP packet.

[0219] Optionally, the processing unit 11 is specifically configured to: merge the GTP headers of each of the n first GTP packets to obtain a merged GTP header; merge the content portions of each of the n first GTP packets to obtain a merged content; and add the merged content to the merged GTP header to obtain the second GTP packet.

[0220] Optionally, the processing unit 11 is specifically configured to: merge the second, third, and fourth fields in the GTP header of each of the n first GTP packets to obtain a merged GTP header, wherein the third field is used to indicate a flag bit, the second field is used to indicate the length of the GTP header and content of the first GTP packet, and the fourth field is used to indicate the message type of the first GTP packet; merge the remaining fields in the GTP header of each of the n first GTP packets and the content portion to obtain the merged content; wherein the remaining fields include other fields in the GTP header besides the second, third, and fourth fields.

[0221] Optionally, the processing unit 11 is specifically configured to: sequentially merge the second, third, and fifth fields in the GTP headers of the n first GTP packets into the extended header of the first first GTP packet, and then sequentially merge the remaining fields and content portions in the GTP headers of the n first GTP packets into the extended header of the first first GTP packet to obtain the second GTP packet, wherein the remaining fields include other fields in the GTP header besides the second, third, and fifth fields.

[0222] Optionally, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.

[0223] Optionally, the processing unit 11 is specifically used to: compress the Target Tunnel Endpoint Identifier (TEID) field included in each of the n first GTP packets to obtain n compressed first GTP packets; and merge the GTP packet headers and contents of the n compressed first GTP packets to obtain the second GTP packet.

[0224] Optionally, the processing unit 11 is specifically configured to: query a hash table for a mapping value corresponding to each target TEID, based on the target TEID included in each of the n first GTP packets, wherein the hash table includes a correspondence between multiple TEIDs and mapping values; if a mapping value corresponding to each target TEID exists in the hash table, then the target TEID included in each of the n first GTP packets is replaced with the corresponding mapping value, wherein the size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID.

[0225] Optionally, the processing unit 11 is specifically configured to: if there is no mapping value corresponding to the first target TEID in the hash table, determine the target mapping value corresponding to the first target TEID, and store the correspondence between the first target TEID and the target mapping value in the hash table, wherein the first target TEID is any one of multiple target TEIDs; correspondingly, the sending unit 12 is specifically configured to: send the correspondence between the first target TEID and the target mapping value, as well as the second GTP packet, to the second device.

[0226] Optionally, the processing unit 11 is specifically used to: determine whether there are target first GTP packets with the same message type field among the n first GTP packets; if there are target first GTP packets with the same message type field, retain the message type field in the first target first GTP packet and delete the message type field in the other target first GTP packets.

[0227] Optionally, the sending unit 12 is specifically used to: put the second GTP packet into a buffer queue; and when the length of the buffer queue reaches a preset length or the waiting time exceeds a preset value, send the second GTP packet in the buffer queue to the second device.

[0228] Optionally, the processing unit 11 is specifically configured to: reduce the length of the buffer queue if all m consecutive second GTP packets are sent when the waiting time exceeds a preset value, where m is a positive integer; or increase the length of the buffer queue if the second GTP packets are sent t consecutively when the length of the buffer queue reaches a preset length, where t is a positive integer.

[0229] The GPRS tunneling protocol GTP packet processing device 10 shown in this application embodiment can execute the technical solution of the GPRS tunneling protocol GTP packet processing method shown in any of the above embodiments. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0230] Figure 11 A schematic diagram of a GPRS tunneling protocol GTP packet processing device 20 provided in this application embodiment is shown below. Figure 11 As shown, the GPRS tunneling protocol GTP packet processing device 20 may include:

[0231] The receiving unit 21 is used to receive a second GTP packet sent by the first device. The second GTP packet is obtained by merging the GTP packet headers and contents of n first GTP packets. The processing unit 22 is used to parse the second GTP packet to obtain n first GTP packets, which have the same destination IP address.

[0232] Optionally, the processing unit 22 is specifically used to: parse n GTP headers and the content portion corresponding to each GTP header from the second GTP packet; and merge each GTP header and the content portion corresponding to the GTP header to obtain the n first GTP packets.

[0233] Optionally, the IP header of the second GTP packet includes a first field that indicates the total length of the second GTP packet.

[0234] Optionally, for each first GTP packet, the GTP header of the first GTP packet includes a second field, which is used to indicate the length of the GTP header and content of the first GTP packet.

[0235] Optionally, the processing unit 22 is specifically configured to: parse n second fields, n third fields, and p fourth fields from the header of the second GTP packet; where p is a positive integer less than or equal to n; parse n remaining fields of the GTP packet header and n content portions from the content of the second GTP packet, where the remaining fields include other fields in the GTP packet header besides the second, third, and fourth fields; and merge the second, third, fourth, remaining fields, and content portions to obtain n first GTP packets.

[0236] Optionally, the processing unit 22 is specifically configured to: sequentially parse n remaining fields of the GTP packet header and n content portions from the extended header of the second GTP packet, wherein the remaining fields include other fields in the GTP packet header besides the second field, the third field, and the fifth field; sequentially parse n second fields, n third fields, and n fifth fields from the extended header of the second GTP packet; and merge the second field, the third field, the fifth field, the remaining fields, and the content portions respectively to obtain n first GTP packets.

[0237] Optionally, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.

[0238] Optionally, the processing unit 22 is specifically configured to: for each of the n first GTP packets, query a hash table to see if there is a target tunnel endpoint identifier (TEID) corresponding to the mapping value, based on the mapping value in the first GTP packet; the hash table includes multiple correspondences between TEIDs and mapping values; if there is a target TEID corresponding to the mapping value in the hash table, replace the mapping value included in the first GTP packet with the corresponding target TEID to obtain the processed first GTP packet; wherein the size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID.

[0239] Optionally, the device further includes a receiving unit 23, which is used to receive the correspondence between the target TEID and the mapping value from the first device.

[0240] The GPRS tunneling protocol GTP packet processing device 20 shown in this application embodiment can execute the technical solution of the GPRS tunneling protocol GTP packet processing method shown in any of the above embodiments. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0241] It should be noted that the division of the various units in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these units can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some units can be implemented in software via processing element calls, while others are implemented in hardware. For example, the receiving unit can be a separate processing element, or it can be integrated into a chip in the GPRS Tunnel Protocol (GTP) packet processing device. Alternatively, it can be stored as a program in the memory of the GPRS Tunnel Protocol (GTP) packet processing device, and its function can be called and executed by a processing element of the GPRS Tunnel Protocol (GTP) packet processing device. The implementation of other units is similar. Moreover, these units can be fully or partially integrated together, or they can be implemented independently. The processing element mentioned here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above units can be completed through hardware integrated logic circuits in the processor element or software instructions. Furthermore, the above receiving unit is a control receiving unit that can receive information through the receiving device of the GPRS Tunnel Protocol (GTP) packet processing device.

[0242] These units can be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs). For example, when one of these units is implemented via a processing element scheduler, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor capable of calling programs. Furthermore, these units can be integrated together to implement a system-on-a-chip (SOC).

[0243] Figure 12 This is a schematic diagram of the structure of a network device provided in an embodiment of this application. Figure 12As shown, the network device includes: an antenna 110, a radio frequency (RF) device 120, and a baseband device 130. The antenna 110 is connected to the RF device 120. In the uplink direction, the RF device 120 receives information sent by the terminal through the antenna 110 and transmits the information sent by the terminal device to the baseband device 130 for processing. In the downlink direction, the baseband device 130 processes the information from the terminal device and sends it to the RF device 120. The RF device 120 processes the information from the terminal device and then transmits it to the terminal device through the antenna 110.

[0244] In one implementation, the above units are implemented through a processing element scheduler. For example, the baseband device 130 includes a processing element 131 and a storage element 132. The processing element 131 calls the program stored in the storage element 132 to execute the method in the above method embodiments. In addition, the baseband device 130 may also include an interface 133 for interacting with the radio frequency device 120. This interface is, for example, a common public radio interface (CPRI).

[0245] In another implementation, these units can be one or more processing elements configured to implement the above methods, located on the baseband device 130. These processing elements can be integrated circuits, such as one or more ASICs, one or more DSPs, or one or more FPGAs, etc. These integrated circuits can be integrated together to form a chip.

[0246] For example, the above modules can be integrated together to implement a system-on-a-chip (SOC). For instance, the baseband device 130 includes an SOC chip for implementing the above methods. This chip can integrate a processing element 131 and a storage element 132, with the processing element 131 calling the stored program in the storage element 132 to implement the above methods or the functions of the above units. Alternatively, the chip can integrate at least one integrated circuit to implement the above methods or the functions of the above units. Or, a combination of the above implementation methods can be used, with some units' functions implemented by the processing element calling a program, and some units' functions implemented by an integrated circuit.

[0247] Regardless of the method used, the above network device includes at least one processing element, a storage element, and a communication interface, wherein at least one processing element is used to execute the method provided in the above method embodiments. The processing element can execute some or all of the steps in the above method embodiments in a first manner: that is, by executing the program stored in the storage element; or it can execute some or all of the steps in the above method embodiments in a second manner: that is, by combining instructions with the integrated logic circuits of the hardware in the processor element; of course, the method provided in the above method embodiments can also be executed in combination with the first and second methods.

[0248] The processing element here, as described above, can be a general-purpose processor, such as a central processing unit (CPU), or one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), etc.

[0249] A storage element can be a single memory or a collective term for multiple storage elements.

[0250] Figure 13 This is a schematic diagram of the SGW provided in an embodiment of this application. Figure 13 As shown, the SGW may include a transmitter 30, a processor 31, a memory 32, a receiver 34, and at least one communication bus 33. It should be understood that the transmitter 30 and receiver 34 may be a combined module, such as a transceiver, which simultaneously functions as both the transmitter 30 and the receiver 34. The communication bus 33 is used to implement communication connections between components. The memory 32 may include high-speed RAM or non-volatile memory (NVM), such as at least one disk storage device. The memory 32 may store various computer programs for performing various processing functions and implementing the method steps of any of the foregoing embodiments. For example, the memory 32 may be used to store implementations of the above method embodiments, or... Figure 11 The processor 31 calls the program of each unit in the illustrated embodiment to execute the operations of the above method embodiments to achieve... Figure 11 The functions of each unit are shown. The transceiver can be connected to an antenna. The transceiver can receive information sent by network devices and send the information to processor 31 for processing.

[0251] This application also provides a processing apparatus for GPRS Tunneling Protocol (GTP) packets. The apparatus includes a processor and a memory. The memory stores a computer program. The processor executes the computer program stored in the memory to cause the apparatus to perform the GPRS Tunneling Protocol (GTP) packet processing method as provided in any of the foregoing embodiments.

[0252] This application also provides a processing device for GPRS tunneling protocol GTP packets, including: a processor and an interface circuit;

[0253] The interface circuit is used to receive code instructions and transmit them to the processor;

[0254] The processor is configured to run the code instructions to execute the GPRS tunneling protocol GTP packet processing method provided in any of the foregoing embodiments.

[0255] This application also provides a system for processing GPRS tunneling protocol GTP packets, including, as follows: Figure 10 The network devices shown and such Figure 11 The SGW shown is shown.

[0256] This application also provides a readable storage medium for storing instructions that, when executed, enable the processing method of GPRS tunneling protocol GTP packets as provided in any of the foregoing embodiments.

[0257] This application also provides a program product comprising a computer program (i.e., executable instructions) stored in a readable storage medium. At least one processor of a network device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the network device to implement the GPRS Tunneling Protocol GTP packet processing method provided in the foregoing embodiments.

[0258] This application also provides a processing device for GPRS tunneling protocol GTP packets, including at least one storage element and at least one processing element. The at least one storage element is used to store a program, which, when executed, causes the processing device for GPRS tunneling protocol GTP packets to perform the operation of the network device in any of the above embodiments.

[0259] This application also provides a readable storage medium for storing instructions that, when executed, enable the processing method of GPRS tunneling protocol GTP packets as provided in any of the foregoing embodiments.

[0260] This application also provides a program product comprising a computer program (i.e., executable instructions) stored in a readable storage medium. At least one processor of the SGW can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the SGW to implement the GPRS tunneling protocol GTP packet processing method provided in the foregoing embodiments.

[0261] This application also provides a processing apparatus for GPRS tunneling protocol GTP packets, including at least one storage element and at least one processing element. The at least one storage element is used to store a program, which, when executed, causes the processing apparatus for GPRS tunneling protocol GTP packets to perform the SGW operation in any of the above embodiments.

[0262] This application also provides a readable storage medium for storing instructions that, when executed, enable the processing method of GPRS tunneling protocol GTP packets as provided in any of the foregoing embodiments.

[0263] This application also provides a program product comprising a computer program (i.e., executable instructions) stored in a readable storage medium. At least one processor of the SGW can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the SGW to implement the GPRS tunneling protocol GTP packet processing method provided in the foregoing embodiments.

[0264] This application also provides a processing apparatus for GPRS tunneling protocol GTP packets, including at least one storage element and at least one processing element. The at least one storage element is used to store a program, which, when executed, causes the processing apparatus for GPRS tunneling protocol GTP packets to perform the SGW operation in any of the above embodiments.

[0265] All or part of the steps in the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof.

Claims

1. A method for processing GPRS tunneling protocol GTP packets, characterized in that, Applied to a first device, the method comprises: determining n first GTP packets to be sent, the n first GTP packets having the same destination Internet Protocol (IP) address, n being a positive integer; compressing a target Tunnel Endpoint Identifier (TEID) field included in each of the n first GTP packets, comprising: querying a hash table for whether a mapping value corresponding to each target TEID exists, according to the target TEID included in each of the n first GTP packets, the hash table including a correspondence between a plurality of TEIDs and mapping values; if the mapping value corresponding to each target TEID exists in the hash table, replacing the target TEID included in each of the n first GTP packets with the corresponding mapping value, wherein the mapping value occupies a space smaller than the target TEID; if the mapping value corresponding to the first target TEID does not exist in the hash table, determining a target mapping value corresponding to the first target TEID, and storing the correspondence between the first target TEID and the target mapping value in the hash table, the first target TEID being any one of the plurality of target TEIDs; merging the GTP packet header and content in the n compressed first GTP packets to obtain a second GTP packet; sending the second GTP packet to a second device, comprising: putting the second GTP packet into a buffer queue; sending the second GTP packet in the buffer queue to the second device when the length of the buffer queue reaches a preset length or the waiting time exceeds a preset value; if m consecutive second GTP packets are all sent when the waiting time exceeds the preset value, decreasing the length of the buffer queue, wherein m is a positive integer; or if the second GTP packet is sent t times in a row when the length of the buffer queue reaches the preset length, increasing the length of the buffer queue, wherein t is a positive integer. the merging of the GTP packet header and content in the n compressed first GTP packets to obtain a second GTP packet, comprising:

2. The method of claim 1, wherein, respectively merging the GTP packet header and content of each of the n first GTP packets other than the first first GTP packet into the content part of the first first GTP packet in turn to obtain the second GTP packet. the second GTP packet includes a first field in the IP header, the first field being used to indicate the total length of the second GTP packet.

3. The method of claim 1, wherein, for each first GTP packet, the GTP packet header of the first GTP packet includes a second field, the second field being used to indicate the length of the GTP packet header and content of the first GTP packet.

4. The method of claim 1, wherein, the merging of the GTP packet header and content in the n compressed first GTP packets to obtain a second GTP packet, comprising:

5. The method of claim 1, wherein, ​ merge the GTP packet header of each of the n first GTP packets respectively to obtain a merged GTP packet header; merge the content part of each of the n first GTP packets respectively to obtain a merged content; add the merged content behind the merged GTP packet header to obtain the second GTP packet.

6. The method of claim 5, wherein, The method further comprises: determining whether there are target first GTP packets with the same message type field in the n first GTP packets; if there are target first GTP packets with the same message type field, retaining the message type field in the first target first GTP packet and deleting the message type field in other target first GTP packets. The method applied to the second device comprises:

7. The method of claim 1, wherein, ​ ​ 8. The method according to any one of claims 1 to 7, characterized in that, ​ 9. The method according to any one of claims 1 to 7, characterized in that, ​ ​ ​ 10. A method for processing a GPRS Tunneling Protocol (GTP) packet, the method comprising: ​ receiving a second GTP packet sent by a first device, the second GTP packet being obtained by merging a GTP header and content of n first GTP packets, the first device putting the second GTP packet into a buffer queue when sending the second GTP packet to a second device; sending the second GTP packet in the buffer queue to the second device when a length of the buffer queue reaches a preset length or a waiting time exceeds a preset value; reducing the length of the buffer queue if m consecutive second GTP packets are all sent when the waiting time exceeds the preset value, m being a positive integer; or increasing the length of the buffer queue if t consecutive second GTP packets are all sent when the length of the buffer queue reaches the preset length, t being a positive integer; parsing the second GTP packet to obtain n first GTP packets, the n first GTP packets having the same destination IP address; The method further comprises: For each of the n first GTP packets, querying a hash table to determine whether a target TEID corresponding to a mapping value in the first GTP packet exists in the hash table, the hash table including a correspondence between a plurality of TEIDs and mapping values; If the target TEID corresponding to the mapping value exists in the hash table, replacing the mapping value included in the first GTP packet with the corresponding target TEID to obtain a processed first GTP packet; wherein a size of a space occupied by the mapping value is smaller than a size of a space occupied by the target TEID. The method further comprises: Receiving, from the first device, a correspondence between the target TEID and the mapping value.

11. The method of claim 10, wherein, The parsing of the second GTP packet to obtain n first GTP packets comprises: Parsing n GTP headers and content corresponding to each of the n GTP headers from the second GTP packet; Merging each GTP header and the content corresponding to the GTP header to obtain the n first GTP packets.

12. The method of claim 11, wherein, The IP header of the second GTP packet includes a first field, the first field being used to indicate a total length of the second GTP packet.

13. The method according to any one of claims 10-12, characterized in that, For each first GTP packet, a GTP header of the first GTP packet includes a second field, the second field being used to indicate a length of the GTP header and content of the first GTP packet.

14. The method of claim 10, wherein, The parsing of the second GTP packet to obtain n first GTP packets comprises: Parsing n second fields, n third fields and p fourth fields from a header of the second GTP packet, p being a positive integer less than or equal to n; Parsing remaining fields of n GTP headers and n content portions from content of the second GTP packet, the remaining fields including other fields of the GTP headers other than the second fields, the third fields and the fourth fields; Merging the second fields, the third fields, the fourth fields, the remaining fields and the content portions to obtain the n first GTP packets.

15. The method of claim 10, wherein, The second GTP packet is parsed to obtain n first GTP packets, including: n content parts and n remaining fields of GTP packet headers are parsed from the extension header of the second GTP packet in sequence, wherein the remaining fields include other fields in the GTP packet header except the second field, the third field and the fifth field; n second fields, n third fields and n fifth fields are parsed from the extension header of the second GTP packet in sequence; The second field, the third field, the fifth field, the remaining field and the content part are combined respectively to obtain n first GTP packets.

16. The method of any one of claims 10-12, 14-15, wherein, A total length field included in the GTP packet header of each first GTP packet in the n first GTP packets occupies 1 byte.

17. A processing apparatus for GPRS tunneling protocol GTP packets, characterized in that, Comprising: A processing unit is configured to determine n first GTP packets to be sent, the n first GTP packets have the same destination Internet Protocol (IP) address, and n is a positive integer; The processing unit is further configured to compress a target Tunnel Endpoint Identifier (TEID) field included in each first GTP packet in the n first GTP packets, including: querying a hash table to determine whether a mapping value corresponding to each target TEID exists in the hash table according to the target TEID included in each first GTP packet in the n first GTP packets, the hash table includes a correspondence between a plurality of TEIDs and mapping values; if the mapping value corresponding to each target TEID exists in the hash table, the target TEID included in each first GTP packet in the n first GTP packets is replaced with the corresponding mapping value, wherein the size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID; if the mapping value corresponding to the first target TEID does not exist in the hash table, a target mapping value corresponding to the first target TEID is determined, and the correspondence between the first target TEID and the target mapping value is stored in the hash table, the first target TEID is any one of the plurality of target TEIDs; The GTP packet header and the content in the n first GTP packets after compression are combined to obtain a second GTP packet; A sending unit is configured to send the first target TEID and the correspondence between the target mapping value to a second device, and the second GTP packet with the destination IP address as the destination IP address of the second GTP packet; The sending unit is configured to put the second GTP packet into a buffer queue, and send the second GTP packet in the buffer queue to the second device when the length of the buffer queue reaches a preset length or the waiting time exceeds a preset value; The processing unit is further configured to decrease the length of the buffer queue if m consecutive second GTP packets are sent when the waiting time exceeds the preset value, wherein m is a positive integer; or increase the length of the buffer queue if t consecutive second GTP packets are sent when the length of the buffer queue reaches the preset length, wherein t is a positive integer.

18. A processing apparatus for GPRS tunneling protocol GTP packets, characterized in that, Comprising: The receiving unit is configured to receive a second GTP packet sent by a first device, the second GTP packet being obtained by combining GTP packet headers and contents in n first GTP packets, and the first device being configured to put the second GTP packet into a buffer queue when sending the second GTP packet to a second device; when a length of the buffer queue reaches a preset length or a waiting time exceeds a preset value, the second GTP packet in the buffer queue is sent to the second device; if m consecutive second GTP packets are all sent when the waiting time exceeds the preset value, the length of the buffer queue is reduced, where m is a positive integer; or if t consecutive second GTP packets are all sent when the length of the buffer queue reaches the preset length, the length of the buffer queue is increased, where t is a positive integer; The processing unit is configured to parse the second GTP packet to obtain n first GTP packets, and the n first GTP packets have the same destination IP address; The processing unit is specifically configured to, for each of the n first GTP packets, query a hash table to determine whether a target TEID corresponding to a mapping value in the first GTP packet exists in the hash table, the hash table including a correspondence between a plurality of TEIDs and mapping values; If the target TEID corresponding to the mapping value exists in the hash table, the mapping value included in the first GTP packet is replaced with the target TEID to obtain a processed first GTP packet, and a size of a space occupied by the mapping value is smaller than a size of a space occupied by the target TEID. The receiving unit is further configured to receive, from the first device, a correspondence between the target TEID and the mapping value.

19. A processing apparatus for GPRS tunneling protocol GTP packets, characterized in that, The apparatus includes a processor and a memory, the memory storing a computer program, and the processor executes the computer program stored in the memory to cause the apparatus to perform the method of any one of claims 1 to 16.

20. A processing apparatus of a GPRS Tunneling Protocol (GTP) packet, characterized by, The apparatus includes: a processor and an interface circuit; the interface circuit is configured to receive code instructions and transmit the code instructions to the processor; the processor is configured to run the code instructions to perform the method of any one of claims 1 to 16.

21. A readable storage medium for storing instructions, when the instructions are executed, causing the method of any one of claims 1 to 16 to be implemented.

Citation Information

Patent Citations

  • Method and apparatus for transmitting data package of GPRS tunnel protocol

    CN101388825A

  • Packet transmission method, system and device for general packet wireless service tunnel protocol

    CN101420369A