CN113518386A - GPRS tunneling protocol GTP packet processing method and device - Google Patents
GPRS tunneling protocol GTP packet processing method and device Download PDFInfo
- Publication number
- CN113518386A CN113518386A CN202010275193.7A CN202010275193A CN113518386A CN 113518386 A CN113518386 A CN 113518386A CN 202010275193 A CN202010275193 A CN 202010275193A CN 113518386 A CN113518386 A CN 113518386A
- Authority
- CN
- China
- Prior art keywords
- gtp
- gtp packet
- packet
- field
- packets
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000005641 tunneling Effects 0.000 title claims abstract description 62
- 238000003672 processing method Methods 0.000 title claims abstract description 19
- 238000012545 processing Methods 0.000 claims abstract description 141
- 238000000034 method Methods 0.000 claims abstract description 91
- 238000013507 mapping Methods 0.000 claims description 123
- 238000004590 computer program Methods 0.000 claims description 20
- 230000005540 biological transmission Effects 0.000 abstract description 20
- 230000006870 function Effects 0.000 description 34
- 238000010586 diagram Methods 0.000 description 27
- 238000004891 communication Methods 0.000 description 26
- 230000002829 reductive effect Effects 0.000 description 23
- 230000009286 beneficial effect Effects 0.000 description 8
- 238000013461 design Methods 0.000 description 8
- 230000011664 signaling Effects 0.000 description 7
- 230000008859 change Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 230000006835 compression Effects 0.000 description 4
- 238000007906 compression Methods 0.000 description 4
- 230000003068 static effect Effects 0.000 description 4
- 235000019800 disodium phosphate Nutrition 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 239000003795 chemical substances by application Substances 0.000 description 2
- 238000007405 data analysis Methods 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 238000004806 packaging method and process Methods 0.000 description 2
- 230000036961 partial effect Effects 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000002360 explosive Substances 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- DJGAAPFSPWAYTJ-UHFFFAOYSA-M metamizole sodium Chemical compound [Na+].O=C1C(N(CS([O-])(=O)=O)C)=C(C)N(C)N1C1=CC=CC=C1 DJGAAPFSPWAYTJ-UHFFFAOYSA-M 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000001228 spectrum Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/06—Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/06—Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information
- H04W28/065—Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information using assembly or disassembly of packets
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application provides a method and a device for processing a GPRS tunneling protocol GTP packet, wherein the method comprises the following steps: 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 the contents in the n first GTP packets to obtain a second GTP packet; and taking 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 the GPRS tunneling protocol GTP packet processing device can reduce the transmission quantity of data, and therefore the bandwidth utilization rate of a network can be greatly improved.
Description
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a method and a device for processing a GPRS tunneling protocol GTP packet.
Background
In order to deal with the explosive mobile data traffic increase in the future, the device connection of mass mobile communication, and various new services and application scenarios which are continuously emerging, how to improve the utilization rate of bandwidth is a hot issue discussed in the industry.
At present, in order to improve the bandwidth utilization rate, a way of compressing a packet header is usually adopted to transmit a data packet, specifically, n Real-time Transport Protocol (RTP) messages with the same length are sequentially placed in a load of a User Datagram Protocol (UDP) message to serve as compressed messages, so that an Internet Protocol (IP) packet header and a UDP packet header corresponding to n-1 messages are saved; after receiving the message, the receiving device reads the content from the UDP load according to the fixed length as an RTP message. And because the messages with fixed length are merged, the length of each segment does not need to be processed when the messages are compressed and analyzed. The compression method described above uses two attributes of most types of RTP streams: (1) most fields in the IP, UDP and RTP headers, which do not change during the lifetime of the RTP session, may be represented by fewer bits with the session context during transmission; (2) RTP header fields such as sequence numbers and time stamps add a constant amount for consecutive packets in the stream.
However, since a constant amount is not added to a header field of a Packet in a General Packet Radio Service (GPRS) tunneling Protocol (GTP), the above compression method is not suitable for a GTP Packet, and therefore, how to improve a utilization rate of a bandwidth when transmitting the GTP Packet is a technical problem that needs to be solved at present.
Disclosure of Invention
The embodiment of the application provides a method and a device for processing a GPRS tunneling protocol GTP packet, which can reduce the transmission amount of data, thereby greatly improving the bandwidth utilization rate of a network.
In a first aspect, an embodiment of the present application provides a method for processing a GPRS tunneling protocol GTP packet, where the method is applied to a first device, and 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 the contents in the n first GTP packets to obtain a second GTP packet; and taking the destination IP address as the destination IP address of the second GTP packet, and sending the second GTP packet to the second device.
Because the first device can combine the GTP packet headers and the contents in the n first GTP packets after determining the n first GTP packets to be sent, the first GTP packets can be compressed and combined on the premise of being compatible with the conventional GTP protocol, and the transmission amount of data can be reduced on the basis of maintaining the original GTP packet header information in the transmission process, thereby greatly improving the bandwidth utilization rate of the network.
In a possible implementation manner, the merging the GTP header and the content in the n first GTP packets to obtain a second GTP packet includes: respectively combining the GTP packet headers and the contents of the other first GTP packets except the first GTP packet in the n first GTP packets to the content part of the first GTP packet in sequence to obtain the second GTP packet.
In the scheme, the GTP packet headers and the contents of the other first GTP packets except the first GTP packet in the n first GTP packets are respectively and sequentially merged to the content part of the first GTP packet, so as to obtain the merged second GTP packet.
In a possible implementation manner, the IP header of the second GTP packet includes a first field, and the first field is used for indicating the total length of the second GTP packet.
In one possible implementation manner, for each first GTP packet, the GTP header of the first GTP packet includes a second field, and the second field is used to indicate the GTP header of the first GTP packet and the length of the content.
In this scheme, the IP header of the second GTP packet includes a first field, where the first field is used to indicate the total length of the second GTP packet, and the GTP packet header of each first GTP packet includes a second field, where the second field is used to indicate the GTP packet header and the content of the first GTP packet, so that the second device may determine whether the second GTP packet is received completely according to the first field and the second field, and may ensure the accuracy of data reception.
In a possible implementation manner, the merging the GTP header and the content in the n first GTP packets to obtain a second GTP packet includes: respectively merging the GTP packet headers of each first GTP packet in the n first GTP packets to obtain merged GTP packet headers; respectively merging the content part of each first GTP packet in the n first GTP packets to obtain merged content; and adding the merged content to the merged GTP packet header to obtain the second GTP packet.
In addition, as the GTP packet headers in the first GTP packets are placed in a concentrated mode, the GTP contents in the first GTP packets are placed in a concentrated mode, so that the parallel processing of the messages can be realized, and the efficiency of message processing is improved.
In a possible implementation manner, the merging the GTP packet headers of each of the n first GTP packets to obtain a merged GTP packet header includes: respectively combining a second field, a third field and a fourth field in the GTP packet header of each of the n first GTP packets to obtain a combined GTP packet header, where the third field is used to indicate a flag bit, the second field is used to indicate the GTP packet header of the first GTP packet and the length of the content, and the fourth field is used to indicate the message type of the first GTP packet; correspondingly, the merging the content part of each of the n first GTP packets to obtain merged content includes: respectively merging the residual fields and the content parts in the GTP packet header of each first GTP packet in the n first GTP packets to obtain merged content; wherein the remaining fields include other fields in the GTP header except for the second field, the third field, and the fourth field.
In addition, as the GTP packet headers in the first GTP packets are placed in a concentrated mode, the GTP contents in the first GTP packets are placed in a concentrated mode, so that the parallel processing of the messages can be realized, and the efficiency of message processing is improved.
In a possible implementation manner, the merging the GTP header and the content in the n first GTP packets to obtain a second GTP packet includes: and respectively combining a second field, a third field and a fifth field in the GTP packet headers of the n first GTP packets into an extension header of the first GTP packet, and then combining the remaining fields and content parts in the GTP packet headers of the n first GTP packets into an extension header of the first GTP packet to obtain the second GTP packet, wherein the remaining fields include other fields except the second field, the third field and the fifth field in the GTP packet header.
The merging mode in the scheme has the advantages that on one hand, the header part of the second GTP packet obtained after merging is divided into the fixed length, so that the parsing efficiency of the second GTP packet by the second equipment is favorably improved, on the other hand, the GTP packet headers in the first GTP packets are intensively placed, and the GTP contents in the first GTP packets are intensively placed, so that the parallel processing of the messages can be realized, the efficiency of message processing is favorably improved, on the other hand, the packaging change of the existing GTP packets is small by the packaging mode, and the efficiency of message processing is improved.
In one possible implementation, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.
In the scheme, the total length field occupies 1 byte, so that the space occupied by the first GTP packet can be reduced.
In a possible implementation manner, the merging the GTP header and the content in the n first GTP packets to obtain a second GTP packet includes: compressing a target Tunnel Endpoint Identifier (TEID) field included in each first GTP packet in the n first GTP packets to obtain n compressed first GTP packets; and merging the GTP packet headers and the contents in the n compressed first GTP packets to obtain the second GTP packet.
In the scheme, the target TEID field included in each first GTP packet is compressed, so that the overhead of the packet header can be saved.
In one possible implementation manner, compressing a target tunnel endpoint identification TEID field included in each of the n first GTP packets includes: according to the target TEID included in each first GTP packet in the n first GTP packets, inquiring whether a mapping value corresponding to each target TEID exists in a hash table or not, wherein the hash table comprises a plurality of TEIDs and corresponding relations between the mapping values; and if the mapping value corresponding to each target TEID exists in the hash table, replacing the target TEID included in each first GTP packet in the n first GTP packets with the corresponding mapping value, wherein the size of the space occupied by the mapping value is smaller than that of the space occupied by the target TEID.
In the scheme, the space occupied by the mapping value is smaller than that occupied by the target TEID, so that after the target TEID included in the first GTP packet is replaced by the mapping value, the overhead of a GTP packet head of the first GTP packet can be reduced, the space occupied by the second GTP packet is reduced, and the utilization rate of the bandwidth is improved.
In one possible implementation, the method further includes: 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 corresponding relation between the first target TEID and the target mapping value into the hash table, wherein the first target TEID is any one of a plurality of target TEIDs; correspondingly, the sending the second GTP packet to the second device includes: and sending the corresponding relation between the first target TEID and the target mapping value and the second GTP packet to the second device.
In the scheme, the corresponding relation between the first target TEID and the target mapping value is stored in the hash table, so that the target mapping value corresponding to the first target TEID is not calculated again in the next query, and the target mapping value is directly used for replacing the first target TEID, thereby improving the efficiency of compressing the target TEID field in the GTP packet.
In one possible implementation, the method further includes: determining whether a target first GTP packet with the same message type field exists in the n first GTP packets or not; if the target first GTP packets with the same message type field exist, the message type field in the first target first GTP packet is reserved, and the message type fields in other target first GTP packets are deleted.
In the scheme, if a plurality of target first GTP packets with the same message type field exist, the message type field in the first target first GTP packet is reserved, and the message type fields in other target first GTP packets are deleted, so that the space occupied by the GTP packet head of the first GTP packet can be saved, and the utilization rate of the bandwidth is improved.
In a possible implementation manner, the sending the second GTP packet to the second device includes: putting 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, sending the second GTP packet in the buffer queue to the second equipment.
In the scheme, when the length of the buffer queue reaches the preset length, the second GTP packet in the buffer queue is sent to the second device, so that the utilization rate of the bandwidth can be improved. In addition, when the waiting time exceeds the preset value, the second GTP packet in the buffer queue is sent to the second device, so that the waiting time delay can be reduced, and the sending efficiency of the GTP packet can be improved.
In one possible implementation, the method further includes: when the waiting time of the m continuous second GTP packets exceeds a preset value, reducing the length of the buffer queue, wherein m is a positive integer; or, the second GTP packet is sent when the length of the buffer queue reaches a preset length for consecutive times, the length of the buffer queue is increased, where t is a positive integer.
In the scheme, the length and the waiting time of the buffer queue are dynamically adjusted, so that the efficiency balance between the waiting time delay and the combining efficiency can be completed in real time according to the continuous link packet receiving and sending conditions, and the dynamic property and the flexibility of GTP packet sending are improved. In addition, under the condition that the sending rate of the GTP packets is not high, the maximum queue length of the buffer queue can be dynamically reduced, and the merging degree of the first GTP packets is reduced, so that the system bandwidth can be efficiently utilized. Under the condition that the sending rate of the GTP packets is higher, the combination degree of the first GTP packets can be increased by increasing the length of the buffer queue and reducing the waiting time, so that the utilization rate of the link bandwidth is further increased.
In a second aspect, an embodiment of the present application provides a method for processing a GPRS tunneling protocol GTP packet, where the method is applied to a second device, and the method includes: receiving a second GTP packet sent by the first device, wherein the second GTP packet is obtained by combining GTP packet headers and contents in the n first GTP packets; and analyzing the second GTP packet to obtain n first GTP packets, wherein the n first GTP packets have the same destination IP address.
Because the first device can combine the GTP packet headers and the contents in the n first GTP packets after determining the n first GTP packets to be sent, the first GTP packets can be compressed and combined on the premise of being compatible with the conventional GTP protocol, and the transmission amount of data can be reduced on the basis of maintaining the original GTP packet header information in the transmission process, thereby greatly improving the bandwidth utilization rate of the network.
In a possible implementation manner, the parsing the second GTP packet to obtain n first GTP packets includes: analyzing n GTP packet headers and a content part corresponding to each GTP packet header in the n GTP packet headers from the second GTP packet; and respectively combining each GTP packet header and the content part corresponding to the GTP packet header to obtain the n first GTP packets.
In the scheme, the n GTP packet headers and the content parts corresponding to the GTP packet headers can be directly analyzed from the second GTP packet, so that the efficiency of analyzing the second GTP packet can be improved.
In a possible implementation manner, the IP header of the second GTP packet includes a first field, and the first field is used for indicating the total length of the second GTP packet.
In one possible implementation manner, for each first GTP packet, the GTP header of the first GTP packet includes a second field, and the second field is used to indicate the GTP header of the first GTP packet and the length of the content.
In this scheme, the IP header of the second GTP packet includes a first field, where the first field is used to indicate the total length of the second GTP packet, and the GTP packet header of each first GTP packet includes a second field, where the second field is used to indicate the GTP packet header and the content of the first GTP packet, so that the second device may determine whether the second GTP packet is received completely according to the first field and the second field, and may ensure the accuracy of data reception.
In a possible implementation manner, the parsing the second GTP packet to obtain n first GTP packets includes: analyzing n second fields, n third fields and p fourth fields from the packet header of the second GTP packet; wherein p is a positive integer less than or equal to n; analyzing the remaining fields and the n content parts of the n GTP packet headers from the content of the second GTP packet, wherein the remaining fields comprise other fields except the second field, the third field and the fourth field in the GTP packet header; and respectively combining the second field, the third field, the fourth field, the residual field and the content part to obtain n first GTP packets.
In this scheme, the second device may analyze n second fields, n third fields, and p fourth fields, then analyze the remaining fields and n content parts of the n GTP packet headers, and then combine the second fields, the third fields, the fourth fields, the remaining fields, and the content parts, respectively, to obtain n first GTP packets, which is beneficial to improving the efficiency of data analysis.
In a possible implementation manner, the parsing the second GTP packet to obtain n first GTP packets includes: sequentially analyzing the remaining fields and the n content parts of the n GTP packet headers from the extension header of the second GTP packet, wherein the remaining fields comprise other fields except the second field, the third field and the fifth field in the GTP packet header; sequentially analyzing n second fields, n third fields and n fifth fields from the extension header of the second GTP packet; and respectively merging the second field, the third field, the fifth field, the residual field and the content part to obtain n first GTP packets.
In the scheme, the header part of the second GTP packet is of a fixed length, so that when the second GTP packet is analyzed, the efficiency of the second device in analyzing the second GTP packet is improved.
In one possible implementation, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.
In the scheme, the total length field occupies 1 byte, so that the space occupied by the first GTP packet can be reduced.
In one possible implementation, the method further includes: for each first GTP packet in the n first GTP packets, according to a mapping value in the first GTP packet, querying whether a target tunnel endpoint identifier TEID corresponding to the mapping value exists in a hash table, where the hash table includes a correspondence between a plurality of TEIDs and the mapping value; 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 the size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID.
In the scheme, the space occupied by the mapping value is smaller than that occupied by the target TEID, so that the space occupied by the GTP packet header can be reduced. In addition, the second device replaces the mapping value included in the first GTP packet with the queried target TEID by querying the hash table, so that the accuracy of the restored first GTP packet can be ensured.
In one possible implementation, the method further includes: a correspondence between the target TEID and the mapping value is received from the first device.
In a third aspect, an embodiment of the present application provides a device for processing a GPRS tunneling protocol GTP packet, including: the device comprises a processing unit, a sending unit and a receiving unit, wherein the processing unit is used for determining n first GTP packets to be sent, the n first GTP packets have the same destination network protocol IP address, and n is a positive integer; the processing unit is further configured to combine GTP packet headers and contents in the n first GTP packets to obtain a second GTP packet; and the sending unit is used for taking the destination IP address as the destination IP address of the second GTP packet and sending the second GTP packet to the second equipment.
In a possible implementation manner, the processing unit is specifically configured to: respectively combining the GTP packet headers and the contents of the other first GTP packets except the first GTP packet in the n first GTP packets to the content part of the first GTP packet in sequence to obtain the second GTP packet.
In a possible implementation manner, the IP header of the second GTP packet includes a first field, and the first field is used for indicating the total length of the second GTP packet.
In one possible implementation manner, for each first GTP packet, the GTP header of the first GTP packet includes a second field, and the second field is used to indicate the GTP header of the first GTP packet and the length of the content.
In a possible implementation manner, the processing unit is specifically configured to: respectively merging the GTP packet headers of each first GTP packet in the n first GTP packets to obtain merged GTP packet headers; respectively merging the content part of each first GTP packet in the n first GTP packets to obtain merged content; and adding the merged content to the merged GTP packet header to obtain the second GTP packet.
In a possible implementation manner, the processing unit is specifically configured to: respectively combining a second field, a third field and a fourth field in the GTP packet header of each of the n first GTP packets to obtain a combined GTP packet header, where the third field is used to indicate a flag bit, the second field is used to indicate the GTP packet header of the first GTP packet and the length of the content, and the fourth field is used to indicate the message type of the first GTP packet; respectively merging the residual fields and the content parts in the GTP packet header of each first GTP packet in the n first GTP packets to obtain merged content; wherein the remaining fields include other fields in the GTP header except for the second field, the third field, and the fourth field.
In a possible implementation manner, the processing unit is specifically configured to: and respectively combining a second field, a third field and a fifth field in the GTP packet headers of the n first GTP packets into an extension header of the first GTP packet, and then combining the remaining fields and content parts in the GTP packet headers of the n first GTP packets into an extension header of the first GTP packet to obtain the second GTP packet, wherein the remaining fields include other fields except the second field, the third field and the fifth field in the GTP packet header.
In one possible implementation, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.
In a possible implementation manner, the processing unit is specifically configured to: compressing a target Tunnel Endpoint Identifier (TEID) field included in each first GTP packet in the n first GTP packets to obtain n compressed first GTP packets; and merging the GTP packet headers and the contents in the n compressed first GTP packets to obtain the second GTP packet.
In a possible implementation manner, the processing unit is specifically configured to: according to the target TEID included in each first GTP packet in the n first GTP packets, inquiring whether a mapping value corresponding to each target TEID exists in a hash table or not, wherein the hash table comprises a plurality of TEIDs and corresponding relations between the mapping values; and if the mapping value corresponding to each target TEID exists in the hash table, replacing the target TEID included in each first GTP packet in the n first GTP packets with the corresponding mapping value, wherein the size of the space occupied by the mapping value is smaller than that of the space occupied by the target TEID.
In a possible implementation manner, the processing unit is specifically configured to: 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 corresponding relation between the first target TEID and the target mapping value into 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: and sending the corresponding relation between the first target TEID and the target mapping value and the second GTP packet to the second device.
In a possible implementation manner, the processing unit is specifically configured to: determining whether a target first GTP packet with the same message type field exists in the n first GTP packets or not; if the target first GTP packets with the same message type field exist, the message type field in the first target first GTP packet is reserved, and the message type fields in other target first GTP packets are deleted.
In a possible implementation manner, the sending unit is specifically configured to: putting 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, sending the second GTP packet in the buffer queue to the second equipment.
In a possible implementation manner, the processing unit is specifically configured to: when the waiting time of the m continuous second GTP packets exceeds a preset value, reducing the length of the buffer queue, wherein m is a positive integer; or, the second GTP packet is sent when the length of the buffer queue reaches a preset length for consecutive times, the length of the buffer queue is increased, where t is a positive integer.
In a fourth aspect, an embodiment of the present application provides a device for processing a GPRS tunneling protocol GTP packet, including: the receiving unit is used for receiving a second GTP packet sent by the first equipment, wherein the second GTP packet is obtained by combining GTP packet headers and contents in the n first GTP packets; and the processing unit is used for analyzing the second GTP packet to obtain n first GTP packets, and the n first GTP packets have the same destination IP address.
In a possible implementation manner, the processing unit is specifically configured to: analyzing n GTP packet headers and a content part corresponding to each GTP packet header in the n GTP packet headers from the second GTP packet; and respectively combining each GTP packet header and the content part corresponding to the GTP packet header to obtain the n first GTP packets.
In a possible implementation manner, the IP header of the second GTP packet includes a first field, and the first field is used for indicating the total length of the second GTP packet.
In one possible implementation manner, for each first GTP packet, the GTP header of the first GTP packet includes a second field, and the second field is used to indicate the GTP header of the first GTP packet and the length of the content.
In a possible implementation manner, the processing unit is specifically configured to: analyzing n second fields, n third fields and p fourth fields from the packet header of the second GTP packet; wherein p is a positive integer less than or equal to n; analyzing the remaining fields and the n content parts of the n GTP packet headers from the content of the second GTP packet, wherein the remaining fields comprise other fields except the second field, the third field and the fourth field in the GTP packet header; and respectively combining the second field, the third field, the fourth field, the residual field and the content part to obtain n first GTP packets.
In a possible implementation manner, the processing unit is specifically configured to: sequentially analyzing the remaining fields and the n content parts of the n GTP packet headers from the extension header of the second GTP packet, wherein the remaining fields comprise other fields except the second field, the third field and the fifth field in the GTP packet header; sequentially analyzing n second fields, n third fields and n fifth fields from the extension header of the second GTP packet; and respectively merging the second field, the third field, the fifth field, the residual field and the content part to obtain n first GTP packets.
In one possible implementation, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.
In a possible implementation manner, the processing unit is specifically configured to: for each first GTP packet in the n first GTP packets, according to a mapping value in the first GTP packet, querying whether a target tunnel endpoint identifier TEID corresponding to the mapping value exists in a hash table, where the hash table includes a correspondence between a plurality of TEIDs and the mapping value; 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 the size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID.
In one possible implementation, the apparatus further includes: a receiving unit, configured to receive, from the first device, a correspondence between the target TEID and the mapping value.
In a fifth aspect, an embodiment of the present application provides an apparatus for processing a GPRS tunneling protocol GTP packet, where the apparatus includes a processor and a memory, where the memory stores a computer program, and the processor executes the computer program stored in the memory, so as to cause the apparatus to perform the method according to the first aspect or the second aspect.
In a sixth aspect, an embodiment of the present application provides a device for processing a GPRS tunneling protocol GTP packet, including: a processor and an interface circuit; the interface circuit is used for receiving code instructions and transmitting the code instructions to the processor; the processor is configured to execute the code instructions to perform the method according to the first aspect or the second aspect.
The apparatus mentioned in the third aspect of the present application may be a network device, or may be a chip in the network device, where the network device or the chip has a function of implementing the method for processing the GPRS tunneling protocol GTP packet in the above aspects or any possible design thereof. The functions may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.
The network device includes: the network device comprises a processing unit and a transceiver unit, wherein the processing unit can be a processor, the transceiver unit can be a transceiver, the transceiver comprises a radio frequency circuit, and optionally, the network device further comprises a storage unit, and the storage unit can be a memory. When the network device comprises a storage unit, the storage unit is used for storing computer-executable instructions, the processing unit is connected with the storage unit, and the processing unit executes the computer-executable instructions stored by the storage unit, so that the network device executes the processing method of the GPRS tunneling protocol GTP packet in the above aspects or any possible design thereof.
The chip includes: the processing unit may be a processor, and the transceiving unit may be an input/output interface, a pin, a circuit, or the like on a chip. The processing unit may execute the computer executable instructions stored by the storage unit to cause the chip to perform the method for processing the GPRS tunneling protocol GTP packets in the above aspects or any possible design thereof. Alternatively, the storage unit may be a storage unit (e.g., a register, a cache, etc.) inside the chip, and the storage unit may also be a storage unit (e.g., a read-only memory (ROM)) located outside the chip inside the terminal device, or other types of static storage devices (e.g., a Random Access Memory (RAM)) that can store static information and instructions, and the like.
The aforementioned processor may be a Central Processing Unit (CPU), a microprocessor or an Application Specific Integrated Circuit (ASIC), or may be one or more integrated circuits for controlling the execution of programs of the processing method of the GPRS tunneling protocol GTP packet according to the above aspects or any possible design thereof.
The apparatus according to the fourth aspect of the present application may be a Serving Gateway (SGW), or may be a chip in the SGW, where the SGW or the chip has a function of implementing the method for processing the GPRS tunneling protocol GTP packet in the above aspects or any possible design thereof. The functions may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.
The SGW includes: the SGW may further comprise a processing unit, which may be a processor, and a transceiver unit, which may be a transceiver comprising radio frequency circuitry, and optionally a memory unit, which may be a memory, for example. When the SGW includes a storage unit, the storage unit is used for storing computer-executable instructions, the processing unit is connected with the storage unit, and the processing unit executes the computer-executable instructions stored in the storage unit, so that the SGW executes the processing method of the GPRS tunneling protocol GTP packet in the above aspects or any possible design thereof.
The chip includes: the processing unit may be a processor, and the transceiving unit may be an input/output interface, a pin, a circuit, or the like on a chip. The processing unit may execute the computer executable instructions stored by the storage unit to cause the chip to perform the method for processing the GPRS tunneling protocol GTP packets in the above aspects or any possible design thereof. Alternatively, the storage unit may be a storage unit (e.g., a register, a cache, etc.) inside the chip, and the storage unit may also be a storage unit (e.g., a read-only memory (ROM)) located outside the chip inside the SGW, or other types of static storage devices (e.g., a Random Access Memory (RAM)) that may store static information and instructions, and the like.
The aforementioned processor may be a Central Processing Unit (CPU), a microprocessor or an Application Specific Integrated Circuit (ASIC), or may be one or more integrated circuits for controlling the execution of programs of the processing method of the GPRS tunneling protocol GTP packet according to the above aspects or any possible design thereof.
In a seventh aspect, an embodiment of the present application provides a system for processing a GPRS tunneling protocol GTP packet, including a network device according to the third aspect and an SGW according to the fourth aspect.
In an eighth aspect, embodiments of the present application provide a readable storage medium storing instructions that, when executed, cause a method according to the first or second aspect to be implemented.
In a ninth aspect, the present application provides a computer program product containing instructions, which when run on a computer or a processor, causes the computer or the processor to execute the method for processing a GPRS tunneling protocol GTP packet provided in any of the first aspect to the second aspect of the present application.
The method and the device for processing the GTP packets of the GPRS tunneling protocol provided in the embodiment of the present application determine n first GTP packets to be sent, where the n first GTP packets have the same destination IP address and n is a positive integer, combine GTP packet headers and contents in the n first GTP packets to obtain a second GTP packet, use the destination IP address as a destination IP address of the second GTP packet, send the second GTP packet to a second device, and the second device parses the second GTP packet, so as to obtain the n first GTP packets. Because the first device can combine the GTP packet headers and the contents in the n first GTP packets after determining the n first GTP packets to be sent, the first GTP packets can be compressed and combined on the premise of being compatible with the conventional GTP protocol, and the transmission amount of data can be reduced on the basis of maintaining the original GTP packet header information in the transmission process, thereby greatly improving the bandwidth utilization rate of the network.
Drawings
Fig. 1 is a schematic architecture diagram of a communication system according to an embodiment of the present application;
fig. 2 is a schematic architecture diagram of another communication system according to an embodiment of the present application;
fig. 3 is a signaling interaction diagram of the GTP packet processing method of the present application;
fig. 4 is a schematic diagram of the structure of a first GTP packet;
fig. 5 is a schematic diagram of a structure of the merged second GTP packet;
fig. 6 is another structural diagram of the merged second GTP packet;
fig. 7 is a further schematic diagram of a merged second GTP packet;
fig. 8 is a diagram of a first GTP packet after compressing the TEID;
fig. 9 is a diagram illustrating a first GTP packet after compressing a message type field;
fig. 10 is a schematic structural diagram of a device for processing a GPRS tunneling protocol GTP packet according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a device for processing a GPRS tunneling protocol GTP packet according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of an SGW according to an embodiment of the present application.
Detailed Description
Hereinafter, some terms in the present application are explained to facilitate understanding by those skilled in the art.
1) Units in this application refer to functional units or logical units. It may be in the form of software whose function is carried out by a processor executing program code; but may also be in hardware.
2) "plurality" means two or more, and other terms are analogous. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. The ranges described as "above" or "below" and the like include boundary points.
In this application, the first device may be a network device, and the second device may be a Serving Gateway (SGW). Alternatively, the first device may be a device with transmitting capabilities and the second device may be a device with receiving capabilities. In the embodiments of the present application, a first device is taken as a network device, a second device is taken as an SGW for example, and for a case where the first device and the second device are other devices, the first device is a network device, and the second device is an SGW, which is similar to the case where the first device and the second device are other devices, details are not described in this application.
For clarity and conciseness of the following descriptions of the various embodiments, a brief introduction to the related art is first given:
the GTP packet processing method according to the following embodiments of the present application may be applied to a communication system. Fig. 1 is a schematic architecture diagram of a communication system according to an embodiment of the present application. As shown in fig. 1, 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 equipment may be fixed or mobile. Fig. 1 is a schematic diagram, and the communication system may further include other devices, such as a core network device, and the network device is connected to the core network device in a wireless or wired manner. The core network device and the network device may be separate physical devices, or the function of the core network device and the logic function of the network device may be integrated on the same physical device, or a physical device may be integrated with a part of the function of the core network device and a part of the function of the network device. In addition, other network devices, such as a wireless relay device and a wireless backhaul device, may also be included in the communication system, which are not shown in fig. 1. The embodiments of the present application do not limit the number of core network devices, and terminal devices included in the communication system.
In the communication system of the embodiment shown in fig. 1, the communication between the network device 10 and the terminal device is explained. Specifically, the network device 10 may be a sender, and may send downlink information to one or some terminal devices from the terminal devices 11 to 16. Accordingly, the terminal devices 11 to 15 capable of directly communicating with the network device 10 may also transmit the uplink information to the network device 10 separately or simultaneously.
The network device is an entity, such as a new generation base station (gbnodeb), in the network side for transmitting or receiving signals. The network device may be a device for communicating with the mobile device. The network device may be an 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 a Wideband Code Division Multiple Access (WCDMA), an evolved Node B (eNB, or eNodeB) in a Long Term Evolution (Long Term Evolution, LTE), or a relay station or an Access point, or a vehicle-mounted device, a wearable device, and a network device in a future 5G network or a network device in a future evolved Public Land Mobile Network (PLMN), or a network device in an NR system. In addition, in this embodiment of the present application, a network device provides a service for a cell, and a terminal device communicates with the network device through a transmission resource (for example, a frequency domain resource or a spectrum resource) used by the cell, where the cell may be a cell corresponding to the network device (for example, a base station), and the cell may belong to a macro base station or a base station corresponding to a small cell (small cell), and the small cell may include: urban cell (metro cell), micro cell (microcell), pico cell (pico cell), femto cell (femto cell), etc., and these small cells have the characteristics of small coverage and low transmission power, and are suitable for providing high-rate data transmission service. Furthermore, the network device may be other means for providing wireless communication functionality for the terminal device, where possible. The embodiments of the present application do not limit the specific technologies and the specific device forms used by the network devices. For convenience of description, in the embodiments of the present application, an apparatus for providing a wireless communication function for a terminal device is referred to as a network device.
The terminal device may be a wireless terminal device capable of receiving network device scheduling and indication information, and the wireless terminal device may be a device providing voice and/or data connectivity to a user, or a handheld device having a wireless connection function, or other processing device connected to a wireless modem. Wireless terminal devices, which may be mobile terminal devices such as mobile telephones (or "cellular" telephones), computers, and data cards, such as portable, pocket, hand-held, computer-included, or vehicle-mounted mobile devices, may communicate with one or more core networks or the internet via a radio access network (e.g., a RAN). For example, devices such as Personal Communication Services (PCS) phones, cordless phones, Session Initiation Protocol (SIP) phones, Wireless Local Loop (WLL) stations, Personal Digital Assistants (PDAs), tablet computers (pads), and computers with wireless transceiving functions. A wireless terminal device may also be referred to as a system, a subscriber unit (subscriber unit), a subscriber station (subscriber station), a mobile station (mobile station), a Mobile Station (MS), a remote station (remote station), an Access Point (AP), a remote terminal device (remote terminal), an access terminal device (access terminal), a user terminal device (user terminal), a user agent (user agent), a Subscriber Station (SS), a user terminal device (CPE), a terminal (terminal), a User Equipment (UE), a Mobile Terminal (MT), etc. The wireless terminal device may also be a wearable device as well as a next generation communication system, e.g. a terminal device in a 5G network or a terminal device in a future evolved PLMN network, a terminal device in a New Radio (NR) communication system, etc.
As shown in fig. 1, the terminal devices 14 to 16 may also form a device-to-device communication system, in the device-to-device communication system, the terminal device 15 may serve as a sender and may send information to one or more terminal devices of the terminal devices 14 and 16, and accordingly, the terminal devices 14 and 16 may send data to the terminal device 15 separately or simultaneously.
The network equipment and the terminal equipment can be deployed on land, including indoor or outdoor, handheld or vehicle-mounted; can also be deployed on the water surface; it may also be deployed on airborne airplanes, balloons, and satellites. The embodiment of the application does not limit the application scenarios of the network device and the terminal device.
Fig. 2 is a schematic architecture diagram of another communication system according to an embodiment of the present application. As shown in fig. 2, the LTE network may include: UE, Evolved UMTS Terrestrial Radio Access Network (E-UTRAN), signaling Management element (MME), SGW, Packet Data Network Gateway Entity (PGW), Policy and Charging Rule Function Entity (PCRF), Home Network Server (HSS), and IP services of an operator.
The core network of the LTE network mainly includes three logic functions, namely MME, SGW, and PGW, where the MME is a signaling management network element, and is responsible for Non-Access Stratum (NAS) signaling encryption, allocating a temporary identity to the UE, selecting core network elements such as SGW and PGW, and providing functions such as roaming, tracking, and security; the SGW is a mobility anchor point for switching between local eNBs and provides related functions of lawful interception; the PGW is responsible for the functions of user address allocation, scheme control, execution of charging rules, lawful interception and the like; the HSS is used for storing the subscription information of the user; the PCRF is used to provide the scheme and charging control rules.
When the method of the present application is applied to an LTE system, an Access and Mobility Management Function (AMF) entity and a Session Management Function (SMF) entity may be replaced by an MME, a User Plane Function (UPF) entity may be replaced by a PGW and an SGW in the LTE system, an authentication server Function (AUSF) entity and an ARPF entity are replaced by an HSS, and the HSS is configured to store subscription information, where the subscription information may be subscription information of a Subscriber Identity Module (SIM) card or a Universal Subscriber Identity Module (USIM) card. The MME is a signaling management network element and is responsible for NAS signaling encryption, temporary identity identification allocation for the UE, core network elements such as SGW and PGW selection and the like, roaming, tracking, safety and other functions; the SGW is a mobility anchor point for switching between eNBs and provides related functions of lawful interception; the PGW is responsible for IP address allocation, implementation of scheme control and charging rules, lawful interception related functions, and the like.
The communication system may be an LTE system, an LTE Advanced (LTE-a) system, or a 5G NR system. The embodiment of the present application may also be applied to other communication systems as long as the presentity in the communication system can determine n first GTP packets to be sent, where the n first GTP packets have the same destination IP address, merge GTP packet headers and contents in the n first GTP packets to obtain a second GTP packet, and then send the second GTP packet to another entity by using the destination IP address as the destination IP address of the second GTP packet. After the entity sends the second GTP packet, another entity may parse the second GTP packet to obtain n first GTP packets.
The system architecture and the service scenario described in the embodiment of the present application are for more clearly illustrating the technical solution of the embodiment of the present application, and do not form a limitation on the technical solution provided in the embodiment of the present application, and as a person of ordinary skill in the art knows that along with the evolution of the network architecture and the appearance of a new service scenario, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
At present, in order to improve the utilization rate of bandwidth, a way of compressing a packet header of a data packet is usually adopted for transmitting the data packet, specifically, n RTP packets with the same length are sequentially placed in a load of a UDP packet to be used as compressed packets, so that an IP packet header and a UDP packet header corresponding to n-1 packets are saved; after receiving the message, the receiving device reads the content from the UDP load as an RTP message according to the fixed length, in the above manner, because the RTP packet header and the payload are not processed and the fixed length messages are combined, the length of each segment does not need to be processed when the message is compressed and analyzed. The compression method described above uses two attributes of most types of RTP streams: (1) most fields in the IP, UDP and RTP headers, which do not change during the lifetime of the RTP session, may be represented by fewer bits with the session context during transmission; (2) RTP header fields such as sequence numbers and time stamps add a constant amount for consecutive packets in the stream.
However, since the GTP packet does not add a constant amount to the header field of the data packet, the above compression method is not suitable for the GTP packet, and therefore how to improve the utilization rate of the bandwidth when transmitting the GTP packet is a technical problem that needs to be solved at present.
In view of the above problems, an embodiment of the present application provides a method for processing GTP packets, where n first GTP packets to be sent are determined, where the n first GTP packets have the same destination IP address, and n is a positive integer, and GTP packet headers and contents in the n first GTP packets are merged to obtain a second GTP packet, and then the destination IP address is used as a destination IP address of the second GTP packet, and the second GTP packet is sent to a second device. After the first device determines the n first GTP packets to be sent, the first device may combine the GTP packet headers and the contents in the n first GTP packets, so that the amount of data to be transmitted may be reduced, and the utilization rate of the bandwidth may be improved.
The technical solution of the present application will be described in detail below with reference to specific examples. It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
Fig. 3 is a signaling interaction diagram of the GTP packet processing method of the present application. On the basis of the application scenarios shown in fig. 1-2, as shown in fig. 3, in this embodiment, the GTP packet processing method may include the following steps:
step 301: and determining n first GTP packets to be sent.
Wherein, n first GTP packets have the same destination IP address, and n is a positive integer.
In this step, the first device may continuously send GTP packets to the second device, where the n first GTP packets may be GTP packets that the first device continuously sends to the second device, and destination IP addresses included in the n first GTP packets are the same.
Step 302: and combining the GTP packet headers and the contents in the n first GTP packets to obtain a second GTP packet.
In this step, in order to reduce the amount of data to be transmitted, after determining n first GTP packets, the first device may combine the GTP packet headers and the content in the n first GTP packets, where the content in the first GTP packets may also be understood as a payload portion of the first GTP packets, which may include a user packet or user data.
In the following, several ways of combining the GTP header and the content in the n first GTP packets are described in detail:
in a possible implementation manner, the GTP packet headers and the contents in the n first GTP packets are merged, where the GTP packet headers and the contents of the other first GTP packets except the first GTP packet in the n first GTP packets are sequentially merged to the content portion of the first GTP packet, so as to obtain the second GTP packet.
Specifically, since the n first GTP packets have the same destination IP address, the n first GTP packets may multiplex an IP header and a UDP header, that is, when merging the GTP header and the content of the n first GTP packets, the GTP header and the content of the first GTP packet may be taken as a whole, so as to sequentially merge the GTP header and the content of the 2 nd to the nth GTP packets into the content portion of the 1 st GTP packet.
In the following, taking the merging of the GTP header and the content in the two first GTP packets as an example, the manner of merging the GTP header and the content of three or more first GTP packets is similar to the manner of merging the GTP header and the content in the two first GTP packets, and is not described herein again.
Fig. 4 is a schematic structural diagram of first GTP packets, and as shown in fig. 4, each first GTP packet includes an IP header, a UDP header, a GTP header and GTP content, where the GTP header includes a version number (version) field, a protocol type (protocol type) field, an extension message header flag (extension header flag) field, a sequence number flag (sequence number flag) field, an N-PDU number flag (number flag) field, a TEID flag (TEID flag) field, a total length (total length) field, a message type (message type) field, a TEID and a TEID hash value field, and the TEID field only exists when the value of the TEID flag (TEID flag) field is 1.
Fig. 5 is a structural schematic diagram of the merged second GTP packet, as shown in fig. 4 and 5, the 1 st first GTP packet and the 2 nd first GTP packet may multiplex the same IP header and UDP header, and merge the GTP header and the GTP content of the 2 nd first GTP packet into the GTP content of the 1 st first GTP packet, that is, merge the version number (version) field, the protocol type (protocol type) field, the extension message header flag (extension header flag) field, the sequence number flag (sequence number flag) field, the N-PDU number flag (number flag) field, the TEID flag (TEID flag) field, the total length (total length) field, the message type (message type) field, the TEID field, and the TEID value field of the first GTP packet, and merge GTP content into the GTP content of the 1 st first GTP packet.
In this embodiment, the GTP header and the content of the other first GTP packets except the first GTP packet in the n first GTP packets are sequentially merged to the content portion of the first GTP packet, so as to obtain the merged second GTP packet. Or the packet headers and the content parts of the n first GTP packets are combined to obtain a second GTP packet, and only one IP header and UDP header are needed after the combination, so that the space of the n-1 IP headers and UDP headers can be saved for the combined second GTP packet. The effects achieved by the above two methods are the same, and the first method is used for the following description.
Further, the IP header of the second GTP packet obtained after merging includes a first field, where the first field is used to indicate the total length of the second GTP packet.
For each first GTP packet, a second field is included in the GTP header of the first GTP packet, and the second field is used to indicate the length of the GTP header and the content of the first GTP packet, and for example, the second field may be a total length (total length) field shown in fig. 4.
It should be noted that, when the second device receives the second GTP packet and parses the second GTP packet, it may determine whether there is a first GTP packet subsequently according to the first field included in the IP header and the second field included in the parsed GTP packet header. For example, if there is no subsequent first GTP packet, the length information indicated by the first field is matched with the length information indicated by the second field included in the parsed GTP packet header. The matching may be understood that the length information indicated by the first field is equal to the length information indicated by the second field included in the parsed GTP packet header, or a correspondence relationship exists between the length information indicated by the first field and the length information indicated by the second field included in the parsed GTP packet header.
In this embodiment, since the IP header of the second GTP packet includes the first field, the first field is used to indicate the total length of the second GTP packet, and the GTP packet header of each first GTP packet includes the second field, and the second field is used to indicate the GTP packet header and the content of the first GTP packet, the second device may determine whether the second GTP packet is received completely according to the first field and the second field, so as to ensure the accuracy of data reception.
In another possible implementation manner, the GTP packet headers and the contents in the n first GTP packets may be merged, where the GTP packet headers of each of the n first GTP packets are merged to obtain a merged GTP packet header, the content portions of each of the n first GTP packets are merged to obtain merged contents, and then the merged contents are added to the back of the merged GTP packet header to obtain a second GTP packet.
Specifically, when the GTP header and the content in the n first GTP packets are merged, the GTP header in the n first GTP packets and the GTP content in the n first GTP packets may be merged separately. In addition, because the GTP packet headers in the first GTP packets are placed in a concentrated manner, and the GTP contents in the first GTP packets are placed in a concentrated manner, the parallel processing of the messages can be realized, and the efficiency of message processing is improved.
In another possible implementation manner, when merging GTP packet headers of the n first GTP packets, a second field, a third field, and a fourth field in the GTP packet header of each of the n first GTP packets may be merged to obtain a merged GTP packet header, where the third field is used to indicate a flag bit, the second field is used to indicate the length of the GTP packet header and the 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 part of each first GTP packet in the n first GTP packets is merged, so that the remaining fields in the GTP packet header of each first GTP packet in the n first GTP packets and the content part are merged to obtain merged content; wherein the remaining fields include other fields in the GTP header except for the second field, the third field, and the fourth field.
Next, the second field is a total length (total length) field, the third field includes an extension message header flag (extension header flag) field, a sequence number flag (sequence number flag) field, an N-PDU number flag (number flag) field, and a TEID flag (TEID flag) field, and the fourth field is a message type (message type) field.
As shown in fig. 4, the GTP header of the first GTP packet includes a version number (version) field, a protocol type (protocol type) field, an extension message header flag (extension header flag) field, a sequence number flag (sequence number flag) field, an N-PDU number flag (number flag) field, a TEID flag (TEID flag) field, a total length (total length) field, a message type (message type) field, a TEID field, and a TEID hash value field. Fig. 6 is another structural diagram of the merged second GTP packet, as shown in fig. 6, when merging GTP headers of N first GTP packets, an extension header flag (extension header flag) field, a sequence number flag (sequence number flag) field, an N-PDU number flag (number flag) field, a TEID flag (TEID flag) field, a total length (total length) field, and a message type (message type) field in the GTP headers of the first GTP packets may be split from the GTP headers, and the split fields from the GTP headers of each first GTP packet may be merged, so that the merged GTP header may be obtained, and the merged header may be placed at the header position of the second GTP packet. Then, the remaining fields and GTP content parts in the GTP header of each first GTP packet are merged and placed in the content part of the second GTP packet, which may also be understood as the remaining fields and content parts in the GTP headers of the n first GTP packets are placed in sequence after the merged header, thereby forming the content part of the second GTP packet. Wherein the remaining fields include a version number (version) field, a protocol type (protocol type) field, a TEID field, and a TEID hash value field.
In addition, because the GTP packet headers in the first GTP packets are placed in a concentrated manner, the GTP content in the first GTP packets is placed in a concentrated manner, so that parallel processing of the packets can be implemented, and the efficiency of packet processing is improved.
In another possible implementation manner, the GTP header and the content in the n first GTP packets are merged, where the second field, the third field, and the fifth field in the GTP header of the n first GTP packets are respectively merged into the extension header of the first GTP packet in sequence, and then the remaining fields and the content part in the GTP header of the n first GTP packets are merged into the extension header of the first GTP packet in sequence, so as to obtain the second GTP packet, where the remaining fields include other fields except the second field, the third field, and the fifth field in the GTP header.
Specifically, the second field may be a total length (total length) field, the third field may be an extension header flag (extension header flag) field, a sequence number flag (sequence number flag) field, an N-PDU number flag (number flag) field, and a TEID flag (TEID flag) field, and the fifth field may be a TEID field. The remaining fields include a version number (version) field, a protocol type (protocol type) field, a message type field, and a TEID hash value field.
In the merging method, the merged GTP packet header is mainly carried by the extension header of the first GTP packet. The following description will take the example of merging three first GTP packets, and the merging manner of other numbers of first GTP packets is similar to the merging manner of three first GTP packets, and is not described herein again. Fig. 7 is another structural diagram of the merged second GTP packet, and as shown in fig. 4 and 7, the GTP header of the first GTP packet GTP-U1 may be used as the GTP header of the second GTP packet, and the total length (total length) field, the extension message header flag (extension header flag) field, the sequence number flag (sequence number flag) field, the N-PDU number flag (number flag) field, the TEID flag (TEID flag) field, and the TEID field of the second first GTP packet GTP-U2 and the third first GTP packet GTP-U3 may be sequentially merged into the extension header of GTP-U1, that is, the above-mentioned fields in GTP-U2 and GTP-U3 are sequentially placed after the extension header field or the sequence number field of GTP-U1. In addition, as shown in fig. 7, after the extension header of GTP-U1, the content part of GTP-U1, the extension header part of GTP-U2, the content part of GTP-U2, the extension header part of GTP-U3, and the content part of GTP-U3 are placed in sequence, where the extension header part of GTP-U2 and the extension header part of GTP-U3 each include the remaining fields, i.e., a version number (version) field, a protocol type (protocol type) field, a message type field, and a TEID hash value field.
In the merging method in this embodiment, on one hand, the header portion of the second GTP packet obtained after merging is divided into a fixed length, which is beneficial to improving the parsing efficiency of the second GTP packet by the second device, and on the other hand, because the GTP header in each first GTP packet is placed in a concentrated manner, the GTP content in each first GTP packet is placed in a concentrated manner, so that parallel processing of the packet can be realized, which is beneficial to improving the efficiency of packet processing.
The combination modes can greatly reduce the bandwidth waste caused by the outer layer redundant IP head/UDP head band and improve the bandwidth utilization rate by multiplexing the UDP head and the IP head based on the tunnel end point IP.
Further, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.
It is understood that the third byte and the fourth byte in the first GTP packet represent the message length, wherein 16 bits can represent the range of 0 to 2161 byte. For GTP packets, the typical length is 20, 40-250 bytes, so only 8 bits, i.e. one byte, are needed to represent the length. Therefore, the total length field can be compressed, i.e. the total length field included in the GTP header occupies 1 byte, which can reduce the space occupied by the first GTP packet.
In another possible implementation manner, the GTP header and the content in the n first GTP packets are merged, which may be obtained by compressing the target TEID field included in each of the n first GTP packets to obtain n compressed first GTP packets, and merging the GTP header and the content in the n compressed first GTP packets to obtain the second GTP packet.
Specifically, the target TEID field included in the first GTP packet occupies four bytes, which usually occupies 50% of the entire GTP packet header size, and therefore, in order to save the overhead of the packet header, the target TEID field may be considered to be compressed. In an actual application process, a session is usually assigned a TEID. From the viewpoint of saving the header occupied by the TEID, and considering the need to be able to quickly recover the original TEID information at the receiving end, it is common to choose to use a Hash table (Hash mapping). The average time complexity of Hash mapping is O (1), and the requirement that the receiving end recovers the original TEID quickly can be met. In addition, the length of the mapped field can be generally allocated to 16 bits, namely 2bytes (byte) from the actual scene, so that the balance between resetting and reducing the field occupation after the Hash table is fully mapped can be achieved.
In addition, on one hand, as the TEID is compressed by adopting the Hash strategy, the TEID field is stably compressed to 2bytes on the premise of ensuring one-to-one correspondence, and compared with the original GTP packet, the TEID field space can be saved by 50%. On the other hand, since the hash algorithm has the reading efficiency of O (1), the bandwidth utilization rate can be improved as much as possible without increasing the delay hardly.
For example, when compressing the target TEID field included in each of the n first GTP packets, it may be determined whether a mapping value corresponding to each target TEID exists in a hash table according to the target TEID included in each of the n first GTP packets, where the hash table includes a correspondence between a plurality of TEIDs and the mapping value; and if the mapping value corresponding to each target TEID exists in the hash table, replacing the target TEID included in each first GTP packet in the n first GTP packets with the corresponding mapping value, wherein the size of the space occupied by the mapping value is smaller than that of the space occupied by the target TEID.
Specifically, a hash table is set in the first device, where the hash table includes at least one TEID and a mapping value corresponding to each TEID in the at least one TEID, and a size of a space occupied by the mapping value is smaller than a size of a space occupied by the corresponding TEID. For example, the mapping values typically occupy 2bytes of space, while the TEIDs typically occupy 4bytes of space.
For the target TEID included in each first GTP packet, the first device queries the hash table to determine whether a mapping value corresponding to the target TEID exists in the hash table, and if a mapping value corresponding to the target TEID exists in the hash table, replaces the target TEID included in the first GTP packet with the queried mapping value, and marks the TEID in the first GTP packet to position 1.
In this embodiment, since the size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID, after the target TEID included in the first GTP packet is replaced with the mapping value, the overhead of the GTP packet header of the first GTP packet can be reduced, and then the space occupied by the second GTP packet is reduced, thereby improving the utilization rate of the bandwidth.
Further, if there is no mapping value corresponding to the first target TEID in the hash table, 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, where the first target TEID is any one of the target TEIDs.
Specifically, if the first device queries the hash table, and determines that the hash table does not have a mapping value corresponding to the first target TEID included in the GTP header of a certain first GTP packet, the target mapping value corresponding to the first target TEID may be determined by a preset algorithm, for example, the target mapping value may be determined by a hash algorithm, and of course, the target mapping value may also be determined by other algorithms 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, which is not limited herein for the preset algorithm.
After determining the target mapping value corresponding to the first target TEID, the first device may replace the first target TEID in the first GTP packet with the determined target mapping value, and set the TEID flag bit field in the first GTP packet to 1. In addition, the corresponding relation between the first target TEID and the target mapping value can be stored in the hash table, so that the target mapping value corresponding to the first target TEID is not calculated any more in the next query, and the first target TEID is directly replaced by the target mapping value, thereby improving the efficiency of compressing the target TEID field in the GTP packet.
In addition, in order to enable the second device to correctly restore the first GTP packet, the first device further needs to send the correspondence between the first target TEID and the target mapping value to the second device.
It can be understood that the first device may simultaneously send the second GTP packet and the determined correspondence to the second device, may send the second GTP packet first and then send the correspondence, and may send the correspondence first and then send the second GTP packet. As to the sending method of the correspondence between the first target TEID and the target mapping value, the embodiment of the present application is not limited herein.
Further, in order to save storage space in the first device and the second device, when the content stored in the hash table exceeds a preset number of fields and the content in the hash table is updated more frequently, the content in the hash table may be cleared, so as to perform new mapping, that is, store a new correspondence between the TEID and the mapping value. Of course, the corresponding relation between the TEID and the mapping value may be deleted according to the storage time of the corresponding relation, the order of the storage time, the earliest storage time, or the like.
Fig. 8 is a schematic diagram of the first GTP packet after compressing the TEID, as shown in fig. 8, the first GTP packet comprises a version number (version) field, a protocol type (protocol type) field, an Extension message header flag (Extension header flag) field, a Sequence number flag (Sequence number flag) field, an N-PDU number flag (number flag) field, a TEID flag (TEID flag) field, a total Length field, a message type (message type) field, a TEID hash value field, a Sequence number (Sequence number) field, an N-PDU number field, an Extension content Length (Extension Context Length) field, a Next Extension message header type (Next Extension header type) field, and an Extension content (Extension Context), wherein, the total length field is 1 byte, and the TEID field in the GTP packet header is replaced with the TEID hash value, which is the mapping value.
It should be noted that, in the merging method shown in fig. 5 to fig. 7, the TEID in the GTP header may be replaced by a TEID hash value or a mapping value.
In addition, in order to further reduce the space occupied by the GTP header of the first GTP packet, the second device may further compress a message type field included in the GTP header of the first GTP packet. For example, it may be determined whether a target first GTP packet with the same message type field exists in the n first GTP packets, and if the target first GTP packet with the same message type field exists, the message type field in the first target first GTP packet may be retained, and the message type fields in other target first GTP packets may be deleted.
Specifically, a buffer pool is maintained in the first device, a plurality of buffer queues are maintained in the buffer pool, and the first GTP packet in each buffer queue can be merged and sent. Wherein, the buffer pool is maintained according to the destination IP address, and the buffer queue is maintained in the buffer pool according to the message type. In practical application, whether a target first GTP packet with the same message type exists in n first GTP packets to be sent may be determined, if the target first GTP packet with the same message type exists, multiple target first GTP packets with the same message type field are placed in the same buffer queue, and in the multiple target first GTP packets, only the message type field in the first target first GTP packet needs to be reserved, and the message type fields in other target first GTP packets may be deleted, so that a storage space of 1 byte (byte) may be saved.
Fig. 9 is a schematic diagram of the first GTP packet after compressing the message type field, and as shown in fig. 9, compared to the first GTP packet in fig. 8, the message type field may be deleted, so that 1 byte (byte) of storage space may be saved.
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 fields in other target first GTP packets are deleted, so that the space occupied by the GTP packet header of the first GTP packet can be saved, which is beneficial to improving the utilization rate of the bandwidth.
It should be noted that the above various combining manners can be combined with each other, so that after n first GTP packets are combined, n-1 spaces of UDP and IP headers and n-1 spaces of message type fields can be saved, and 3n bytes (bytes) of TEID fields can be reduced.
Step 303: and the destination IP address is used as the destination IP address of the second GTP packet, and the second GTP packet is sent to the second device.
In this step, the n merged first GTP packets of the first device have the same destination I P address, and after obtaining the second GTP packet, the first device may send the second GTP packet to the second device with the destination I P address as the destination I P address of the second GTP packet.
In a possible implementation manner, when the first device sends the second GTP packet to the second device, the second GTP packet may be placed in a buffer queue, and 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.
Specifically, a buffer pool is maintained in the first device, a plurality of buffer queues are maintained in the buffer pool, a plurality of first GTP packets in each buffer queue may be merged to obtain a second GTP packet, and the obtained second GTP packet is sent. The length of the buffer queue may be set to a preset length, and when the length of the second GTP packet in the buffer queue reaches the preset length, the second GTP packet in the buffer queue may be sent to the second device, or, to reduce the time delay, the second GTP packet in the buffer queue may also be sent to the second device when the waiting time exceeds the preset value.
The preset length and the preset value may be set according to actual conditions or experience, for example, the preset length may be set to 3, the preset value may be 5ms, and the like.
In this embodiment, when the length of the buffer queue reaches the preset length, the second GTP packet in the buffer queue may be sent to the second device, so that the utilization rate of the bandwidth may be improved. In addition, when the waiting time exceeds the preset value, the second GTP packet in the buffer queue is sent to the second device, so that the waiting time delay can be reduced, and the sending efficiency of the GTP packet can be improved.
Further, in order to improve flexibility of data transmission and adaptive adjustment of parameters to link conditions, in the embodiment of the present application, parameters of the buffer queue may be dynamically adjusted by recording a packet transmission state of a transmission buffer queue for a period of time, where the parameters of the buffer queue include a maximum number of packets allowed by the buffer queue and/or a maximum waiting time allowed by the packets. Specifically, if m consecutive second GTP packets are all sent when the waiting time exceeds a preset value, the length of the buffer queue is decreased, where m is a positive integer, or if the second GTP packets are sent when the length of the buffer queue reaches the preset length t consecutive times, the length of the buffer queue is increased, where t is a positive integer.
If m consecutive second GTP packets in a buffer queue are sent when the waiting time exceeds the preset value when the second GTP packets included in the buffer queue are sent, it indicates that the length of the buffer queue may be large, and at this time, the length of the buffer queue may be reduced. The value of m may be set according to actual conditions or experience, for example, may be 3, and for a specific value of m, the embodiment of the present application is not limited herein.
If the second GTP packet in a buffer queue is sent when the length of the buffer queue reaches the preset length for t consecutive times when the second GTP packet included in the buffer queue is sent, it indicates that the length of the buffer queue may be smaller, and at this time, the length of the buffer queue may be increased. The value of t may be set according to actual conditions or experience, for example, may be 3, and for a specific value of t, the embodiment of the present application is not limited herein.
Illustratively, a transmission state may be defined, which indicates whether to transmit when the waiting time exceeds a preset value or to transmit when the length of the buffer queue reaches a preset length. Two counters, cnt-queuefull and cnt-timeout, are usually set for each buffer queue, where a counter cnt-queuefull represents the number of consecutive GTP packets sent out by the buffer queue due to the queue being full, and a counter cnt-timeout represents the number of consecutive GTP packets sent out by the buffer queue due to the timeout. In addition, each buffer queue also maintains a sending waiting TIME (MIN-LENGTH, MAX-LENGTH) and a queue LENGTH interval (MIN-WAIT-TIME, MAX-WAIT-TIME). For increases and decreases in the buffer queue length, change factors a and b may be defined, identifying the value of each change in buffer queue length and latency, respectively. In a specific implementation process, the increase value and the decrease value of the buffer queue length may be determined as follows:
if m second GTP packets in the buffer Queue are all sent after the waiting time is reached, the length of the buffer Queue may be considered to be large, and at this time, the length Queue-length of the buffer Queue may be reduced according to formula (1) within a certain threshold range, and the waiting time of the second GTP packets may be increased according to formula (2):
Queue-length=Queue-length–a(Queue-length>MIN-LENGTH) (1)
Wait-time=Wait-time+b (Wait-time<MAX-WAIT-TIME) (2)
wherein m may be 3.
If the t consecutive times are sent when the length of the buffer Queue reaches the preset length, and the size of the current buffer Queue can not meet the merging requirement, the length Queue-length of the buffer Queue can be dynamically increased according to a formula (3), and meanwhile, the waiting time of a second GTP packet is reduced according to a formula (4):
Queue-length=Queue-length+a(Queue-length<MAX-LENGTH) (3)
Wait-time=Wait-time-b (Wait-time>MIN-WAIT-TIME) (4)
in this embodiment, by dynamically adjusting the length and the waiting time of the buffer queue, efficiency trade-off between waiting time delay and combining efficiency can be completed in real time according to the continuous link packet transceiving situation, and the dynamics and flexibility of GTP packet transmission are increased. In addition, under the condition that the sending rate of the GTP packets is not high, the maximum queue length of the buffer queue can be dynamically reduced, and the merging degree of the first GTP packets is reduced, so that the system bandwidth can be efficiently utilized. Under the condition that the sending rate of the GTP packets is higher, the combination degree of the first GTP packets can be increased by increasing the length of the buffer queue and reducing the waiting time, so that the utilization rate of the link bandwidth is further increased.
Step 304: and analyzing the second GTP packet to obtain n first GTP packets, wherein the n first GTP packets have the same destination IP address.
In this step, after receiving the second GTP packet, the second device parses the second GTP packet to restore the n first GTP packets before merging.
In a possible implementation manner, when the second device parses the second GTP packet, n GTP packet headers and content portions corresponding to each of the n GTP packet headers may be parsed from the second GTP packet, and then each GTP packet header and the content portion corresponding to the GTP packet header are respectively merged to obtain n first GTP packets.
Specifically, if the first device merges the GTP packet headers and the content of the other first GTP packets except the first GTP packet in the n first GTP packets respectively and sequentially merges the GTP packet headers and the content of the other first GTP packets except the first GTP packet into the content portion of the first GTP packet, so as to obtain the second GTP packet, the second device obtains the packet headers and the corresponding content portions of the other first GTP packets from the content portion of the first GTP packet.
Taking two first GTP packets as an example for explanation, as shown in fig. 5, since the GTP header and the GTP content of the 2 nd first GTP packet are merged into the GTP content of the 1 st 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, parses the second GTP header and the content portion corresponding to the second GTP header from the content portion, uses the remaining content portion as the content portion corresponding to the first GTP header, merges the first GTP header and the content portion corresponding to the first GTP header to obtain the first GTP packet, and merges the second GTP header and the content portion corresponding to the first GTP header to obtain the second first GTP packet.
In this embodiment, since the n GTP headers and the content portion corresponding to each GTP header can be directly analyzed from the second GTP packet, the efficiency of analyzing the second GTP packet can be improved.
And the IP header of the second GTP packet comprises a first field, and the first field is used for indicating the total length of the second GTP packet.
For each first GTP packet, a second field is included in the GTP header of the first GTP packet, and the second field is used to indicate the length of the GTP header and the content of the first GTP packet, and for example, the second field may be a total length (total length) field shown in fig. 4.
When the second device receives the second GTP packet and parses the second GTP packet, it may determine whether there is a subsequent first GTP packet according to the first field included in the IP header and the second field included in the parsed GTP packet header. For example, if there is no subsequent first GTP packet, the length information indicated by the first field is matched with the length information indicated by the second field included in the parsed GTP packet header. The matching may be understood that the length information indicated by the first field is equal to the length information indicated by the second field included in the parsed GTP packet header, or a correspondence relationship exists between the length information indicated by the first field and the length information indicated by the second field included in the parsed GTP packet header.
In this embodiment, since the IP header of the second GTP packet includes the first field, the first field is used to indicate the total length of the second GTP packet, and the GTP packet header of each first GTP packet includes the second field, and the second field is used to indicate the GTP packet header and the content of the first GTP packet, the second device may determine whether the second GTP packet is received completely according to the first field and the second field, so as to ensure the accuracy of data reception.
In another possible implementation manner, when the second device parses the second GTP packet, n second fields, n third fields, and p fourth fields may be parsed from the packet header of the second GTP packet, and the remaining fields and n content parts of the n GTP packet headers may be parsed from the content of the second GTP packet, where the remaining fields include other fields except for the second field, the third field, and the fourth field in the GTP packet header, and then the second field, the third field, the fourth field, the remaining fields, and the content parts are respectively combined to obtain n first GTP packets.
Specifically, if the first device merges n first GTP packets, the second field, the third field, and the fourth field in the GTP packet header of each of the n first GTP packets are merged to obtain a merged GTP packet header, the remaining fields and content portions in each of the n first GTP packets are merged to obtain merged content, the merged content is added to the back of the merged GTP packet header, so as to obtain a second GTP packet, and correspondingly, when the second device parses the second GTP packet, the n second fields, the n third fields, and the p fourth fields, and then the remaining fields and the n content portions of the n GTP packet headers are parsed from the packet header of the second GTP packet.
The second field may be a total length (total length) field, the third field may be an extension header flag (extension header flag) field, a sequence number flag (sequence number flag) field, an N-PDU number flag (number flag) field, and a TEID flag (TEID flag) field, and the fourth field may be a message type (message type) field.
It should be noted that, when merging the GTP header of the first GTP packet and the content part corresponding to each header, the first device merges the content parts in a one-to-one corresponding order, for example, when merging the GTP header, the first device proceeds in the order of the GTP packet 1 and the GTP packet 2 … GTP packet n, and when merging the GTP content part, the first device also proceeds in the order of the GTP packet 1 and the GTP packet 2 … GTP packet n, so that it is ensured that the second device does not make an error when parsing the second GTP packet, and the accuracy of data parsing is improved.
Taking two first GTP packets as an example, as shown in fig. 6, an extension message header flag (extension header flag) field, a sequence number flag (sequence number flag) field, an N-PDU number flag (number flag) field, a TEID flag (TEID flag) field, a total length (total length) field, and a message type (message type) field included in the GTP headers of the first and second first GTP packets may be parsed from the GTP header of the second GTP packet, and remaining fields in the GTP headers of the first and second first GTP packets and respective corresponding content parts may be parsed from the content part of the second GTP packet, so that the obtained GTP headers and the corresponding content parts are combined to obtain two first GTP packets before being combined.
It should be noted that, as described in the foregoing embodiment, if there are a plurality of first GTP packets with the same message type, only the message type field in the first GTP packet may be reserved, and the message type fields in other first GTP packets may be deleted, so that the number of the message type fields may be only 1, or may be multiple, that is, the number of the message type fields is less than or equal to n.
In this embodiment, the second device may analyze n second fields, n third fields, and p fourth fields, then analyze the remaining fields and n content parts of the n GTP packet headers, and then combine the second fields, the third fields, the fourth fields, the remaining fields, and the content parts, respectively, to obtain n first GTP packets, which is beneficial to improving the efficiency of data analysis.
In another possible implementation manner, when the second device parses the second GTP packet, it may sequentially parse, from an extension header of the second GTP packet, remaining fields and n content parts of the n GTP packet headers, where the remaining fields include other fields except for the second field, the third field, and the fifth field in the GTP packet header, sequentially parse, from the extension header of the second GTP packet, the n second fields, the n third fields, and the n fifth fields, and then combine the second fields, the third fields, the fifth fields, the remaining fields, and the content parts, respectively, to obtain the n first GTP packets.
The second field may be a total length (total length) field, the third field may be an extension header flag (extension header flag) field, a sequence number flag (sequence number flag) field, an N-PDU number flag (number flag) field, and a TEID flag (TEID flag) field, and the fifth field may be a TEID field. The remaining fields include a version number (version) field, a protocol type (protocol type) field, a message type field, and a TEID hash value field.
Illustratively, if the first device merges n first GTP packets, it merges the second field, the third field, and the fifth field in the GTP packet headers of the n first GTP packets into the extension header of the first GTP packet in sequence, then merges the remaining fields and the content parts in the GTP packet headers of the n first GTP packets into the extension header of the first GTP packet in sequence, so as to obtain the second GTP packet, and correspondingly, when the second device performs parsing, the second device parses the GTP packet header of the second GTP packet as the GTP packet header of the first GTP packet, and parses the second field, the third field, and the fifth field in sequence from the extension header of the first GTP packet, and parses the remaining fields and the content parts corresponding to the GTP packet headers after the extension header.
Taking three first GTP packets as an example, as shown in fig. 7, the GTP header of the second GTP packet may be used as the GTP header of the first GTP packet, the total length (total length) fields of the second GTP packet and the third first GTP packet, the extension header flag (extension header flag) field, the sequence number flag (sequence number flag) field, the N-PDU number flag (number flag) field, the TEID flag (TEID flag) field, and the TEID field may be parsed from the extension header of the first GTP packet, and the remaining fields and the corresponding content parts in the GTP header of each first GTP packet may be further parsed from the extension header of the first GTP packet, so that the obtained GTP header and the corresponding content parts are combined to obtain two first GTP packets before combining.
In this embodiment, since the packet header of the second GTP packet is divided into the fixed length, when the second GTP packet is analyzed, it is beneficial to improve the analysis efficiency of the second GTP packet by the second device.
Further, in order to save the space occupied by the GTP packet header of the first GTP packet, the first device replaces the TEID in the GTP packet header with the corresponding mapping value, so that, to obtain the correct first GTP packet, the second device analyzes the second GTP packet to obtain n first GTP packets, and then, for each first GTP packet in the n first GTP packets, queries, according to the mapping value in the first GTP packet, whether a target TEID corresponding to the mapping value exists in a hash table, where the hash table includes the corresponding relationship between multiple TEIDs and the mapping value; and 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 the processed first GTP packet, wherein the size of the space occupied by the mapping value is smaller than that of the space occupied by the target TEID.
Specifically, the hash table includes a plurality of correspondence relationships between the TEIDs and the mapping values, the second device determines whether a TEID corresponding to the mapping value included in the first GTP packet exists in the hash table by querying the hash table, and if the TEID exists, the queried TEID is used to replace the mapping value included in the first GTP packet, so that the correct first GTP packet can be obtained.
In addition, since the same hash tables are maintained in the first device and the second device, if there is no TEID corresponding to a mapping value included in a certain first GTP packet in the hash table maintained in the second device, it is described that the mapping value in the first GTP packet is newly determined by the first device, and in order to enable the second device to determine a correct TEID, when the first device transmits the second GTP packet to the second device, the first device may further transmit the correspondence between the newly determined mapping value and the TEID to the second device. Thus, the second device may determine, according to the received correspondence, the TEID corresponding to the mapping value included in the first GTP packet, so as to replace the mapping value with the corresponding TEID.
In this embodiment, since the size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID, the space occupied by the GTP header can be reduced. In addition, the second device replaces the mapping value included in the first GTP packet with the queried target TEID by querying the hash table, so that the accuracy of the restored first GTP packet can be ensured.
This embodiment provides a method for processing GTP packets, where n first GTP packets to be sent are determined, where the n first GTP packets have the same destination IP address, and n is a positive integer, and a GTP packet header and content in the n first GTP packets are merged to obtain a second GTP packet, and then the destination IP address is used as a destination IP address of the second GTP packet, and the second GTP packet is sent to a second device, and the second device parses the second GTP packet, so as to obtain n first GTP packets. Because the first device can combine the GTP packet headers and the contents in the n first GTP packets after determining the n first GTP packets to be sent, the first GTP packets can be compressed and combined on the premise of being compatible with the conventional GTP protocol, and the transmission amount of data can be reduced on the basis of maintaining the original GTP packet header information in the transmission process, thereby greatly improving the bandwidth utilization rate of the network.
Fig. 10 is a schematic structural diagram of a processing device 10 for a GPRS tunneling protocol GTP packet according to an embodiment of the present application, please refer to fig. 10, where the processing device 10 for the GPRS tunneling protocol GTP packet may include:
a processing unit 11, configured to determine n first GTP packets to be sent, where the n first GTP packets have the same destination network protocol IP address, and n is a positive integer; the processing unit 11 is further configured to combine GTP packet headers and contents in the n first GTP packets to obtain a second GTP packet; a sending unit 12, configured 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.
Optionally, the processing unit 11 is specifically configured to: respectively combining the GTP packet headers and the contents of the other first GTP packets except the first GTP packet in the n first GTP packets to the content part of the first GTP packet in sequence to obtain the second GTP packet.
Optionally, the IP header of the second GTP packet includes a first field, and the first field is used to indicate a total length of the second GTP packet.
Optionally, for each first GTP packet, a second field is included in the GTP header of the first GTP packet, where the second field is used to indicate the GTP header of the first GTP packet and the length of the content.
Optionally, the processing unit 11 is specifically configured to: respectively merging the GTP packet headers of each first GTP packet in the n first GTP packets to obtain merged GTP packet headers; respectively merging the content part of each first GTP packet in the n first GTP packets to obtain merged content; and adding the merged content to the merged GTP packet header to obtain the second GTP packet.
Optionally, the processing unit 11 is specifically configured to: respectively combining a second field, a third field and a fourth field in the GTP packet header of each of the n first GTP packets to obtain a combined GTP packet header, where the third field is used to indicate a flag bit, the second field is used to indicate the GTP packet header of the first GTP packet and the length of the content, and the fourth field is used to indicate the message type of the first GTP packet; respectively merging the residual fields and the content parts in the GTP packet header of each first GTP packet in the n first GTP packets to obtain merged content; wherein the remaining fields include other fields in the GTP header except for the second field, the third field, and the fourth field.
Optionally, the processing unit 11 is specifically configured to: and respectively combining a second field, a third field and a fifth field in the GTP packet headers of the n first GTP packets into an extension header of the first GTP packet, and then combining the remaining fields and content parts in the GTP packet headers of the n first GTP packets into an extension header of the first GTP packet to obtain the second GTP packet, wherein the remaining fields include other fields except the second field, the third field and the fifth field in the GTP packet header.
Optionally, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.
Optionally, the processing unit 11 is specifically configured to: compressing a target Tunnel Endpoint Identifier (TEID) field included in each first GTP packet in the n first GTP packets to obtain n compressed first GTP packets; and merging the GTP packet headers and the contents in the n compressed first GTP packets to obtain the second GTP packet.
Optionally, the processing unit 11 is specifically configured to: according to the target TEID included in each first GTP packet in the n first GTP packets, inquiring whether a mapping value corresponding to each target TEID exists in a hash table or not, wherein the hash table comprises a plurality of TEIDs and corresponding relations between the mapping values; and if the mapping value corresponding to each target TEID exists in the hash table, replacing the target TEID included in each first GTP packet in the n first GTP packets with the corresponding mapping value, wherein the size of the space occupied by the mapping value is smaller than that of the space occupied by the target TEID.
Optionally, the processing unit 11 is specifically configured to: 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 corresponding relation between the first target TEID and the target mapping value into the hash table, wherein the first target TEID is any one of a plurality of target TEIDs; correspondingly, the sending unit 12 is specifically configured to: and sending the corresponding relation between the first target TEID and the target mapping value and the second GTP packet to the second device.
Optionally, the processing unit 11 is specifically configured to: determining whether a target first GTP packet with the same message type field exists in the n first GTP packets or not; if the target first GTP packets with the same message type field exist, the message type field in the first target first GTP packet is reserved, and the message type fields in other target first GTP packets are deleted.
Optionally, the sending unit 12 is specifically configured to: putting 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, sending the second GTP packet in the buffer queue to the second equipment.
Optionally, the processing unit 11 is specifically configured to: when the waiting time of the m continuous second GTP packets exceeds a preset value, reducing the length of the buffer queue, wherein m is a positive integer; or, the second GTP packet is sent when the length of the buffer queue reaches a preset length for consecutive times, the length of the buffer queue is increased, where t is a positive integer.
The processing device 10 for a GPRS tunneling protocol GTP packet according to the embodiment of the present application may execute the technical solution of the processing method for a GPRS tunneling protocol GTP packet according to any one of the embodiments described above, and its implementation principle and beneficial effects are similar, and are not described herein again.
Fig. 11 is a schematic structural diagram of a processing device 20 for a GPRS tunneling protocol GTP packet according to an embodiment of the present application, please refer to fig. 11, where the processing device 20 for the GPRS tunneling protocol GTP packet may include:
a receiving unit 21, configured to receive a second GTP packet sent by the first device, where the second GTP packet is obtained by combining GTP packet headers and content in the n first GTP packets; the processing unit 22 is configured to parse the second GTP packet to obtain n first GTP packets, where the n first GTP packets have the same destination IP address.
Optionally, the processing unit 22 is specifically configured to: analyzing n GTP packet headers and a content part corresponding to each GTP packet header in the n GTP packet headers from the second GTP packet; and respectively combining each GTP packet header and the content part corresponding to the GTP packet header to obtain the n first GTP packets.
Optionally, the IP header of the second GTP packet includes a first field, and the first field is used to indicate a total length of the second GTP packet.
Optionally, for each first GTP packet, a second field is included in the GTP header of the first GTP packet, where the second field is used to indicate the GTP header of the first GTP packet and the length of the content.
Optionally, the processing unit 22 is specifically configured to: analyzing n second fields, n third fields and p fourth fields from the packet header of the second GTP packet; wherein p is a positive integer less than or equal to n; analyzing the remaining fields and the n content parts of the n GTP packet headers from the content of the second GTP packet, wherein the remaining fields comprise other fields except the second field, the third field and the fourth field in the GTP packet header; and respectively combining the second field, the third field, the fourth field, the residual field and the content part to obtain n first GTP packets.
Optionally, the processing unit 22 is specifically configured to: sequentially analyzing the remaining fields and the n content parts of the n GTP packet headers from the extension header of the second GTP packet, wherein the remaining fields comprise other fields except the second field, the third field and the fifth field in the GTP packet header; sequentially analyzing n second fields, n third fields and n fifth fields from the extension header of the second GTP packet; and respectively merging the second field, the third field, the fifth field, the residual field and the content part to obtain n first GTP packets.
Optionally, the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.
Optionally, the processing unit 22 is specifically configured to: for each first GTP packet in the n first GTP packets, according to a mapping value in the first GTP packet, querying whether a target tunnel endpoint identifier TEID corresponding to the mapping value exists in a hash table, where the hash table includes a correspondence between a plurality of TEIDs and the mapping value; 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 the size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID.
Optionally, the apparatus further comprises: a receiving unit 23, the receiving unit 23, configured to receive a correspondence between the target TEID and the mapping value from the first device.
The processing device 20 for a GPRS tunneling protocol GTP packet according to the embodiment of the present application may execute the technical solution of the processing method for a GPRS tunneling protocol GTP packet according to any one of the embodiments described above, and its implementation principle and beneficial effects are similar, and are not described herein again.
It should be noted that the division of each unit of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these units can be implemented entirely in software, invoked by a processing element; or may be implemented entirely in hardware; and part of the units can be realized in the form of calling by a processing element through software, and part of the units can be realized in the form of hardware. For example, the receiving unit may be a processing element that is set up separately, or may be implemented in a chip of the processing device of the GPRS tunneling protocol GTP packet, or may be stored in a memory of the processing device of the GPRS tunneling protocol GTP packet in the form of a program, and a function of the receiving unit may be invoked and executed by a processing element of the processing device of the GPRS tunneling protocol GTP packet. The other units are implemented similarly. In addition, all or part of the units can be integrated together or can be independently realized. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, the steps of the method or the units above may be implemented by hardware integrated logic circuits in a processor element or instructions in software. Further, the above receiving unit is a unit that controls reception, and information can be received by the receiving device of the processing device of the GPRS tunneling protocol GTP packet.
The above units may be one or more integrated circuits configured to implement the above methods, for example: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when the above units are implemented in the form of a processing element scheduler, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling programs. As another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 12 is a schematic structural diagram of a network device according to an embodiment of the present application. As shown in fig. 12, the network device includes: antenna 110, rf device 120, and baseband device 130. The antenna 110 is connected to the rf device 120. In the uplink direction, the rf device 120 receives information transmitted by the terminal through the antenna 110, and transmits the information transmitted by the terminal equipment to the baseband device 130 for processing. In the downlink direction, the baseband device 130 processes the information of the terminal device and sends the information to the rf device 120, and the rf device 120 processes the information of the terminal device and sends the processed information to the terminal device through the antenna 110.
In one implementation, the above units are implemented in the form of a processing element scheduler, for example, the baseband device 130 includes a processing element 131 and a storage element 132, and the processing element 131 calls a program stored in the storage element 132 to execute the method in the above method embodiment. The baseband device 130 may further include an interface 133 for exchanging information with the rf device 120, such as a Common Public Radio Interface (CPRI).
In another implementation, the units may be one or more processing elements configured to implement the above method, the processing elements are disposed on the baseband apparatus 130, and the processing elements may be integrated circuits, for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, etc. These integrated circuits may be integrated together to form a chip.
For example, the above modules may be integrated together and implemented in the form of a system-on-a-chip (SOC), for example, the baseband device 130 includes an SOC chip for implementing the above method. The chip can integrate the processing element 131 and the storage element 132, and the processing element 131 calls the stored program of the storage element 132 to realize the above method or the functions of the above units; or, at least one integrated circuit may be integrated in the chip, for implementing the above method or the functions of the above units; alternatively, the above implementation modes may be combined, the functions of the partial units are implemented in the form of a processing element calling program, and the functions of the partial units are implemented in the form of an integrated circuit.
In any case, the above network device comprises at least one processing element, a storage element and a communication interface, wherein the at least one processing element is configured to perform the method provided by the above method embodiments. The processing element may: i.e. the way the program stored by the storage element is executed, performs part or all of the steps in the above method embodiments; it is also possible to: that is, some or all of the steps in the above method embodiments are performed by integrated logic circuits of hardware in a processor element in combination with instructions; of course, the method provided by the above method embodiment can also be executed in combination with the first manner and the second manner.
The processing element may be a general-purpose processor, such as a Central Processing Unit (CPU), or may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others.
The storage element may be a memory or a combination of a plurality of storage elements.
Fig. 13 is a schematic structural diagram of an SGW according to an embodiment of the present application. As shown in fig. 13, 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 the receiver 34 may be one combined module, which may be, for example, a transceiver having both the functions of the transmitter 30 and the receiver 34. The communication bus 33 is used to realize communication connection between the elements. The memory 32 may comprise a high-speed RAM memory and may also include a non-volatile storage NVM, such as at least one disk memory, in which various computer programs may be stored for performing various processing functions and implementing the method steps of any of the preceding embodiments. For example, the memory 32 is used to store a program for implementing the above method embodiment or each unit in the embodiment shown in fig. 11, and the processor 31 calls the program to execute the operation of the above method embodiment to implement the corresponding function of each unit shown in fig. 11. The transceiver may be connected to an antenna. The transceiver may receive information transmitted by the network device and send the information to the processor 31 for processing.
The present application further provides a device for processing a GPRS tunneling protocol GTP packet, where the device includes a processor and a memory, where the memory stores a computer program, and the processor executes the computer program stored in the memory, so as to enable the device to perform the method for processing the GPRS tunneling protocol GTP packet according to any of the foregoing embodiments.
The application also provides a device for processing a GTP packet of a GPRS tunneling protocol, including: a processor and an interface circuit;
the interface circuit is used for receiving code instructions and transmitting the code instructions to the processor;
the processor is configured to execute the code instructions to perform the processing method of the GPRS tunneling protocol GTP packet provided in any of the foregoing embodiments.
The application also provides a system for processing a GPRS tunneling protocol GTP packet, which includes a network device shown in fig. 10 and an SGW shown in fig. 11.
The present application further provides a readable storage medium for storing instructions, which when executed, cause the method for processing a GPRS tunneling protocol GTP packet as provided in any of the foregoing embodiments.
The present application also provides a program product comprising a computer program (i.e. executing instructions), the computer program being stored in a readable storage medium. The computer program can be read from a readable storage medium by at least one processor of the network device, and the computer program can be executed by the at least one processor to enable the network device to implement the processing method of the GPRS tunneling protocol GTP packet provided by the foregoing various embodiments.
The embodiment of the present application further provides a processing apparatus for a GPRS tunneling protocol GTP packet, which includes at least one storage element and at least one processing element, where the at least one storage element is used to store a program, and when the program is executed, the processing apparatus for the GPRS tunneling protocol GTP packet is enabled to perform the operation of the network device in any of the above embodiments.
The present application further provides a readable storage medium for storing instructions, which when executed, cause the method for processing a GPRS tunneling protocol GTP packet as provided in any of the foregoing embodiments.
The present application also provides a program product comprising a computer program (i.e. executing instructions), the computer program being stored in a readable storage medium. The computer program can be read from a readable storage medium by at least one processor of the SGW, and the computer program can be executed by the at least one processor to enable the SGW to implement the processing method of the GPRS tunneling protocol GTP packets provided by the foregoing various embodiments.
The embodiment of the present application further provides a processing apparatus for a GPRS tunneling protocol GTP packet, which includes at least one storage element and at least one processing element, where the at least one storage element is used to store a program, and when the program is executed, the processing apparatus for the GPRS tunneling protocol GTP packet performs the operations of the SGW in any of the above embodiments.
The present application further provides a readable storage medium for storing instructions, which when executed, cause the method for processing a GPRS tunneling protocol GTP packet as provided in any of the foregoing embodiments.
The present application also provides a program product comprising a computer program (i.e. executing instructions), the computer program being stored in a readable storage medium. The computer program can be read from a readable storage medium by at least one processor of the SGW, and the computer program can be executed by the at least one processor to enable the SGW to implement the processing method of the GPRS tunneling protocol GTP packets provided by the foregoing various embodiments.
The embodiment of the present application further provides a processing apparatus for a GPRS tunneling protocol GTP packet, which includes at least one storage element and at least one processing element, where the at least one storage element is used to store a program, and when the program is executed, the processing apparatus for the GPRS tunneling protocol GTP packet performs the operations of the SGW in any of the above embodiments.
All or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The aforementioned program may be stored in a readable memory. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid state disk, magnetic tape (magnetic tape), floppy disk (optical disc), and any combination thereof.
Claims (28)
1. A processing method of a GPRS tunneling protocol GTP packet is applied to a first device, and the method comprises the following steps:
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 the contents in the n first GTP packets to obtain a second GTP packet;
and taking the destination IP address as the destination IP address of the second GTP packet, and sending the second GTP packet to a second device.
2. The method of claim 1, wherein the combining the GTP header and the content of the n first GTP packets to obtain a second GTP packet comprises:
and respectively combining the GTP packet headers and the contents of the other first GTP packets except the first GTP packet in the n first GTP packets to the content part of the first GTP packet in sequence to obtain the second GTP packet.
3. The method according to claim 1 or 2, wherein a first field is included in the IP header of the second GTP packet, and the first field is used to indicate the total length of the second GTP packet.
4. The method according to any of claims 1-3, wherein for each first GTP packet, a second field is included in the GTP packet header of the first GTP packet, and the second field is used to indicate the GTP packet header and the length of the content of the first GTP packet.
5. The method of claim 1, wherein the combining the GTP header and the content of the n first GTP packets to obtain a second GTP packet comprises:
respectively merging the GTP packet headers of each first GTP packet in the n first GTP packets to obtain merged GTP packet headers;
respectively merging the content part of each first GTP packet in the n first GTP packets to obtain merged content;
and adding the merged content to the back of the merged GTP packet header to obtain the second GTP packet.
6. The method of claim 5, wherein the combining the GTP packet headers of each of the n first GTP packets to obtain a combined GTP packet header comprises:
respectively combining a second field, a third field and a fourth field in the GTP packet header of each of the n first GTP packets to obtain a combined GTP packet header, where the third field is used to indicate a flag bit, the second field is used to indicate the GTP packet header of the first GTP packet and the length of the content, and the fourth field is used to indicate the message type of the first GTP packet;
correspondingly, the merging the content part of each of the n first GTP packets to obtain merged content includes:
respectively merging the residual fields and the content parts in the GTP packet header of each first GTP packet in the n first GTP packets to obtain merged content; wherein the remaining fields include other fields in the GTP packet header except for the second field, the third field and the fourth field.
7. The method of claim 1, wherein the combining the GTP header and the content of the n first GTP packets to obtain a second GTP packet comprises:
respectively merging a second field, a third field and a fifth field in the GTP packet headers of the n first GTP packets into an extension header of the first GTP packet in sequence, and then respectively merging the residual fields and content parts in the GTP packet headers of the n first GTP packets into the extension header of the first GTP packet in sequence to obtain the second GTP packet, wherein the residual fields comprise other fields except the second field, the third field and the fifth field in the GTP packet headers.
8. The method according to any of claims 1-7, wherein the total length field comprised in the GTP packet header of each of the n first GTP packets takes 1 byte.
9. The method according to any of claims 1-8, wherein the combining the GTP header and the content of the n first GTP packets to obtain a second GTP packet comprises:
compressing a target Tunnel Endpoint Identifier (TEID) field included in each first GTP packet in the n first GTP packets to obtain n compressed first GTP packets;
and combining the GTP packet headers and the contents in the n compressed first GTP packets to obtain the second GTP packet.
10. The method of claim 9, wherein compressing a target Tunnel Endpoint Identification (TEID) field included in each of the n first GTP packets comprises:
according to the target TEID included in each first GTP packet in the n first GTP packets, inquiring whether a mapping value corresponding to each target TEID exists in a hash table or not, wherein the hash table comprises a plurality of TEIDs and corresponding relations between the mapping values;
and if mapping values corresponding to the target TEIDs exist in the hash table, replacing the target TEIDs included in each first GTP packet in the n first GTP packets with corresponding mapping values, wherein the size of the space occupied by the mapping values is smaller than that occupied by the target TEIDs.
11. The method of claim 10, further comprising:
if a mapping value corresponding to a first target TEID does not exist in the hash table, determining a target mapping value corresponding to the first target TEID, and storing a corresponding relation between the first target TEID and the target mapping value into the hash table, wherein the first target TEID is any one of a plurality of target TEIDs;
correspondingly, the sending the second GTP packet to the second device includes:
and sending the corresponding relation between the first target TEID and the target mapping value and the second GTP packet to the second equipment.
12. The method according to any one of claims 1-11, further comprising:
determining whether a target first GTP packet with the same message type field exists in the n first GTP packets;
if the target first GTP packets with the same message type field exist, the message type field in the first target first GTP packet is reserved, and the message type fields in other target first GTP packets are deleted.
13. The method of any of claims 1-12, wherein said sending the second GTP packet to the second device comprises:
putting 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, sending the second GTP packets in the buffer queue to the second equipment.
14. The method of claim 13, further comprising:
if m continuous second GTP packets are sent when the waiting time exceeds a preset value, reducing the length of the buffer queue, wherein m is a positive integer; or,
and the second GTP packets are sent when the length of the buffer queue reaches a preset length for t times, and the length of the buffer queue is increased, wherein t is a positive integer.
15. A GPRS tunneling protocol GTP packet processing method is applied to a second device, and comprises the following steps:
receiving a second GTP packet sent by the first device, wherein the second GTP packet is obtained by combining GTP packet headers and contents in the n first GTP packets;
and analyzing the second GTP packet to obtain n first GTP packets, wherein the n first GTP packets have the same destination IP address.
16. The method of claim 15, wherein parsing the second GTP packet to obtain n first GTP packets comprises:
analyzing n GTP packet headers and a content part corresponding to each GTP packet header in the n GTP packet headers from the second GTP packet;
and respectively combining each GTP packet header and the content part corresponding to the GTP packet header to obtain the n first GTP packets.
17. The method of claim 16, wherein a first field is included in an IP header of the second GTP packet, and wherein the first field is used to indicate a total length of the second GTP packet.
18. The method according to any of claims 15-17, wherein for each first GTP packet, a second field is included in the GTP header of the first GTP packet, and the second field is used to indicate the length of the GTP header and the content of the first GTP packet.
19. The method of claim 15, wherein parsing the second GTP packet to obtain n first GTP packets comprises:
analyzing n second fields, n third fields and p fourth fields from the packet header of the second GTP packet; wherein p is a positive integer less than or equal to n;
analyzing the remaining fields and the n content parts of the n GTP packet headers from the content of the second GTP packet, wherein the remaining fields comprise other fields except the second field, the third field and the fourth field in the GTP packet header;
and respectively combining the second field, the third field, the fourth field, the residual field and the content part to obtain n first GTP packets.
20. The method of claim 15, wherein parsing the second GTP packet to obtain n first GTP packets comprises:
sequentially analyzing the remaining fields and the n content parts of the n GTP packet headers from the extension header of the second GTP packet, wherein the remaining fields comprise other fields except the second field, the third field and the fifth field in the GTP packet header;
sequentially analyzing n second fields, n third fields and n fifth fields from the extension header of the second GTP packet;
and respectively merging the second field, the third field, the fifth field, the residual field and the content part to obtain n first GTP packets.
21. The method according to any of claims 15-20, wherein the total length field comprised in the GTP header of each of the n first GTP packets is 1 byte.
22. The method according to any one of claims 15-20, further comprising:
for each first GTP packet in the n first GTP packets, according to a mapping value in the first GTP packet, querying whether a target Tunnel Endpoint Identifier (TEID) corresponding to the mapping value exists in a hash table or not, wherein the hash table comprises a plurality of corresponding relations between the TEIDs and the mapping value;
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.
23. The method of claim 22, further comprising:
receiving a correspondence between a target TEID and the mapping value from the first device.
24. A device for processing a GPRS tunneling protocol GTP packet, comprising:
the device comprises a processing unit, a sending unit and a receiving unit, wherein the processing unit is used for determining n first GTP packets to be sent, the n first GTP packets have the same destination network protocol IP address, and n is a positive integer;
the processing unit is further configured to combine GTP packet headers and contents in the n first GTP packets to obtain a second GTP packet;
and the sending unit is used for taking the destination IP address as the destination IP address of the second GTP packet and sending the second GTP packet to the second equipment.
25. A device for processing a GPRS tunneling protocol GTP packet, comprising:
the receiving unit is used for receiving a second GTP packet sent by the first equipment, wherein the second GTP packet is obtained by combining GTP packet headers and contents in the n first GTP packets;
and the processing unit is used for analyzing the second GTP packet to obtain n first GTP packets, and the n first GTP packets have the same destination IP address.
26. An apparatus for processing GPRS tunneling protocol, GTP, packets, the apparatus comprising a processor and a memory, the memory having a computer program stored therein, the processor executing the computer program stored in the memory to cause the apparatus to perform the method of any of claims 1 to 23.
27. A device for processing a GPRS tunneling protocol GTP packet, comprising: a processor and an interface circuit;
the interface circuit is used for receiving code instructions and transmitting the code instructions to the processor;
the processor configured to execute the code instructions to perform the method of any one of claims 1 to 23.
28. A readable storage medium storing instructions that, when executed, cause the method of any of claims 1-23 to be implemented.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010275193.7A CN113518386A (en) | 2020-04-09 | 2020-04-09 | GPRS tunneling protocol GTP packet processing method and device |
PCT/CN2021/085422 WO2021204090A1 (en) | 2020-04-09 | 2021-04-02 | Method and apparatus for processing gprs tunneling protocol (gtp) packets |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010275193.7A CN113518386A (en) | 2020-04-09 | 2020-04-09 | GPRS tunneling protocol GTP packet processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113518386A true CN113518386A (en) | 2021-10-19 |
Family
ID=78023992
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010275193.7A Pending CN113518386A (en) | 2020-04-09 | 2020-04-09 | GPRS tunneling protocol GTP packet processing method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113518386A (en) |
WO (1) | WO2021204090A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115297074B (en) * | 2022-08-02 | 2024-08-16 | 卓望数码技术(深圳)有限公司 | Method and device for monitoring micro-service application |
CN118555252A (en) * | 2024-06-07 | 2024-08-27 | 北京开源芯片研究院 | Routing method, system, electronic equipment and storage medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101388825B (en) * | 2007-09-12 | 2012-02-01 | 华为技术有限公司 | Method and apparatus for transmitting data package of GPRS tunnel protocol |
CN101420369A (en) * | 2007-10-24 | 2009-04-29 | 华为技术有限公司 | Packet transmission method, system and device for general packet wireless service tunnel protocol |
CN101350812B (en) * | 2008-08-22 | 2012-06-27 | 上海华为技术有限公司 | Data transmission method, communication apparatus and communication system |
US10057391B2 (en) * | 2014-12-27 | 2018-08-21 | Hughes Network Systems, Llc | Acceleration of GTP traffic flows, over a satellite link, in a terrestrial wireless mobile communications system |
US11025541B2 (en) * | 2017-12-15 | 2021-06-01 | Hewlett Packard Enterprises Development LP | Transporting a GTP message to a termination device |
-
2020
- 2020-04-09 CN CN202010275193.7A patent/CN113518386A/en active Pending
-
2021
- 2021-04-02 WO PCT/CN2021/085422 patent/WO2021204090A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
WO2021204090A1 (en) | 2021-10-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110505656B (en) | Data processing method, device and system | |
CN109005562B (en) | Method, device and system for transmitting data | |
CN110505714B (en) | Multi-link communication method, equipment and terminal | |
EP3585120B1 (en) | Method and device for processing media access control protocol data unit | |
KR102278948B1 (en) | Data display method, device and communication system | |
CN113691359B (en) | Method and apparatus for replicated data transmission | |
US20230090232A1 (en) | Terminal device and network device | |
US20230019346A1 (en) | Relay Communication Method and Related Device | |
WO2021204090A1 (en) | Method and apparatus for processing gprs tunneling protocol (gtp) packets | |
US20190104439A1 (en) | Data transmission method, apparatus, and system | |
KR102337701B1 (en) | Data transmission methods and devices | |
US20230354092A1 (en) | Method for buffer status report, method for configuring buffer status report and apparatuses thereof | |
EP3920654B1 (en) | Wireless communication method, terminal device, chip, computer readable storage medium and computer program product | |
WO2020062240A1 (en) | Information transmission method and apparatus, and communication device | |
WO2020062176A1 (en) | Wireless communication method, terminal device, and network device | |
US20230217426A1 (en) | Resource allocation method and apparatus and system | |
WO2016106744A1 (en) | Data transmission method, wireless access device and communication system | |
US20240244476A1 (en) | Wireless communication method, and devices | |
US20220272613A1 (en) | Information indication method and apparatus, terminal device, and network device | |
EP4422264A1 (en) | Routing method and apparatus, and system | |
WO2020172803A1 (en) | Wireless communication method, terminal device and network device | |
WO2022016452A1 (en) | Data forwarding for user equipment with data transmission | |
WO2021243608A1 (en) | Wireless communication method, terminal device, and network device | |
CN118250745A (en) | Data slicing method and device | |
CN117296369A (en) | Service quality control method, terminal equipment and network equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |