Movatterモバイル変換


[0]ホーム

URL:


CN113518386A - GPRS tunneling protocol GTP packet processing method and device - Google Patents

GPRS tunneling protocol GTP packet processing method and device
Download PDF

Info

Publication number
CN113518386A
CN113518386ACN202010275193.7ACN202010275193ACN113518386ACN 113518386 ACN113518386 ACN 113518386ACN 202010275193 ACN202010275193 ACN 202010275193ACN 113518386 ACN113518386 ACN 113518386A
Authority
CN
China
Prior art keywords
gtp
packet
field
gtp packet
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
Application number
CN202010275193.7A
Other languages
Chinese (zh)
Inventor
唐飞龙
胡伟华
李汉成
吴广雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co LtdfiledCriticalHuawei Technologies Co Ltd
Priority to CN202010275193.7ApriorityCriticalpatent/CN113518386A/en
Priority to PCT/CN2021/085422prioritypatent/WO2021204090A1/en
Publication of CN113518386ApublicationCriticalpatent/CN113518386A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本申请提供一种GPRS隧道协议GTP包的处理方法和装置,该方法包括:确定待发送的n个第一GTP包,所述n个第一GTP包具有相同目的网络协议IP地址,n为正整数;将所述n个第一GTP包中的GTP包头及内容进行合并,得到第二GTP包;将所述目的IP地址作为所述第二GTP包的目的IP地址,并向第二设备发送所述第二GTP包。本申请提供的GPRS隧道协议GTP包的处理方法和装置可以减少数据的传输量,从而可以大大提高网络的带宽利用率。

Figure 202010275193

The present application provides a method and device for processing GPRS tunneling protocol GTP packets, the method includes: 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; combine the GTP headers and contents in the n first GTP packets to obtain a second GTP packet; take the destination IP address as the destination IP address of the second GTP packet, and send it to the second device the second GTP packet. The method and device for processing the GPRS tunneling protocol GTP packet provided by the present application can reduce the amount of data transmission, thereby greatly improving the bandwidth utilization rate of the network.

Figure 202010275193

Description

GPRS tunneling protocol GTP packet processing method and device
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 onenetwork device 10 and at least one terminal device located within the coverage area of thenetwork 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 thenetwork device 10 and the terminal device is explained. Specifically, thenetwork device 10 may be a sender, and may send downlink information to one or some terminal devices from theterminal devices 11 to 16. Accordingly, theterminal devices 11 to 15 capable of directly communicating with thenetwork device 10 may also transmit the uplink information to thenetwork 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, theterminal devices 14 to 16 may also form a device-to-device communication system, in the device-to-device communication system, theterminal device 15 may serve as a sender and may send information to one or more terminal devices of theterminal devices 14 and 16, and accordingly, theterminal devices 14 and 16 may send data to theterminal 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 toposition 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 theGTP packet 1 and theGTP packet 2 … GTP packet n, and when merging the GTP content part, the first device also proceeds in the order of theGTP packet 1 and theGTP 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 aprocessing device 10 for a GPRS tunneling protocol GTP packet according to an embodiment of the present application, please refer to fig. 10, where theprocessing device 10 for the GPRS tunneling protocol GTP packet may include:
aprocessing 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; theprocessing 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 sendingunit 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, theprocessing 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, theprocessing 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, theprocessing 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, theprocessing 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, theprocessing 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, theprocessing 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, theprocessing 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 sendingunit 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, theprocessing 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 sendingunit 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, theprocessing 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.
Theprocessing 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 aprocessing device 20 for a GPRS tunneling protocol GTP packet according to an embodiment of the present application, please refer to fig. 11, where theprocessing device 20 for the GPRS tunneling protocol GTP packet may include:
a receivingunit 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; theprocessing 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, theprocessing 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, theprocessing 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, theprocessing 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, theprocessing 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 receivingunit 23, the receivingunit 23, configured to receive a correspondence between the target TEID and the mapping value from the first device.
Theprocessing 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, andbaseband device 130. Theantenna 110 is connected to therf device 120. In the uplink direction, therf device 120 receives information transmitted by the terminal through theantenna 110, and transmits the information transmitted by the terminal equipment to thebaseband device 130 for processing. In the downlink direction, thebaseband device 130 processes the information of the terminal device and sends the information to therf device 120, and therf device 120 processes the information of the terminal device and sends the processed information to the terminal device through theantenna 110.
In one implementation, the above units are implemented in the form of a processing element scheduler, for example, thebaseband device 130 includes aprocessing element 131 and astorage element 132, and theprocessing element 131 calls a program stored in thestorage element 132 to execute the method in the above method embodiment. Thebaseband device 130 may further include aninterface 133 for exchanging information with therf 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 thebaseband 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, thebaseband device 130 includes an SOC chip for implementing the above method. The chip can integrate theprocessing element 131 and thestorage element 132, and theprocessing element 131 calls the stored program of thestorage 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 atransmitter 30, aprocessor 31, amemory 32, areceiver 34, and at least onecommunication bus 33. It should be understood that thetransmitter 30 and thereceiver 34 may be one combined module, which may be, for example, a transceiver having both the functions of thetransmitter 30 and thereceiver 34. Thecommunication bus 33 is used to realize communication connection between the elements. Thememory 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, thememory 32 is used to store a program for implementing the above method embodiment or each unit in the embodiment shown in fig. 11, and theprocessor 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 theprocessor 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)

Translated fromChinese
1.一种GPRS隧道协议GTP包的处理方法,其特征在于,应用于第一设备,所述方法包括:1. a processing method of GPRS tunneling protocol GTP packet, is characterized in that, is applied to the first equipment, and described method comprises:确定待发送的n个第一GTP包,所述n个第一GTP包具有相同目的网络协议IP地址,n为正整数;Determine 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;将所述n个第一GTP包中的GTP包头及内容进行合并,得到第二GTP包;Merging the GTP header and content in the n first GTP packets to obtain the second GTP packet;将所述目的IP地址作为所述第二GTP包的目的IP地址,并向第二设备发送所述第二GTP包。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.2.根据权利要求1所述的方法,其特征在于,所述将所述n个第一GTP包中的GTP包头及内容进行合并,得到第二GTP包,包括:2. The method according to claim 1, wherein the GTP header and the content in the n first GTP packets are combined to obtain the second GTP packet, comprising:分别将所述n个第一GTP包中除第一个第一GTP包之外的其他第一GTP包的GTP包头及内容,依次合并到第一个第一GTP包的内容部分,得到所述第二GTP包。Respectively merge the GTP headers and contents of other first GTP packets other than the first first GTP packet in the n first GTP packets into the content part of the first first GTP packet in turn to obtain the Second GTP packet.3.根据权利要求1或2所述的方法,其特征在于,所述第二GTP包的IP头中包括第一字段,所述第一字段用于指示所述第二GTP包的总长度。The method according to claim 1 or 2, wherein the IP header of the second GTP packet includes a first field, and the first field is used to indicate the total length of the second GTP packet.4.根据权利要求1-3任一项所述的方法,其特征在于,针对每个第一GTP包,所述第一GTP包的GTP包头中包括第二字段,所述第二字段用于指示所述第一GTP包的GTP包头及内容的长度。4. The method according to any one of claims 1-3, wherein, for each first GTP packet, a GTP packet header of the first GTP packet includes a second field, and the second field is used for Indicates the length of the GTP header and content of the first GTP packet.5.根据权利要求1所述的方法,其特征在于,所述将所述n个第一GTP包中的GTP包头及内容进行合并,得到第二GTP包,包括:5. The method according to claim 1, wherein the GTP header and the content in the n first GTP packets are combined to obtain the second GTP packet, comprising:分别将所述n个第一GTP包中每个第一GTP包的GTP包头进行合并,得到合并后的GTP包头;Respectively merge the GTP headers of each first GTP package in the n first GTP packages to obtain the combined GTP header;分别将所述n个第一GTP包中每个第一GTP包的内容部分进行合并,得到合并后的内容;The content parts of each first GTP bag in the n first GTP bags are respectively merged to obtain the merged content;将所述合并后的内容添加到所述合并后的GTP包头后面,得到所述第二GTP包。The combined content is added to the back of the combined GTP packet header to obtain the second GTP packet.6.根据权利要求5所述的方法,其特征在于,所述分别将所述n个第一GTP包中每个第一GTP包的GTP包头进行合并,得到合并后的GTP包头,包括:6. The method according to claim 5, wherein the GTP header of each first GTP package in the n first GTP packages is merged respectively, and the combined GTP header is obtained, comprising:分别将所述n个第一GTP包中每个第一GTP包的GTP包头中的第二字段、第三字段和第四字段进行合并,得到合并后的GTP包头,其中,所述第三字段用于指示标志位,所述第二字段用于指示第一GTP包的GTP包头及内容的长度,所述第四字段用于指示所述第一GTP包的消息类型;Respectively combine the second field, the third field and the fourth field in the GTP header of each of the n first GTP packets to obtain a combined GTP header, wherein the third field Used to indicate a flag bit, the second field is used to indicate the length of the GTP header and content of the first GTP packet, and the fourth field is used to indicate the message type of the first GTP packet;相应的,所述分别将所述n个第一GTP包中每个第一GTP包的内容部分进行合并,得到合并后的内容,包括:Correspondingly, the content parts of each first GTP packet in the n first GTP packets are respectively merged to obtain the merged content, including:分别将所述n个第一GTP包中每个第一GTP包的GTP包头中剩余字段,以及内容部分进行合并,得到所述合并后的内容;其中,所述剩余字段包括所述GTP包头中除所述第二字段、所述第三字段和所述第四字段之外的其他字段。Respectively combine the remaining fields and content parts in the GTP header of each first GTP packet in the n first GTP packets to obtain the combined content; wherein, the remaining fields include in the GTP header Fields other than the second field, the third field and the fourth field.7.根据权利要求1所述的方法,其特征在于,所述将所述n个第一GTP包中的GTP包头及内容进行合并,得到第二GTP包,包括:7. The method according to claim 1, wherein the GTP header and the content in the n first GTP packets are combined to obtain the second GTP packet, comprising:分别将所述n个第一GTP包的GTP包头中的第二字段、第三字段及第五字段,依次合并到第一个第一GTP包的扩展头中,再分别将所述n个第一GTP包的GTP包头中剩余字段以及内容部分,依次合并到所述第一个第一GTP包的扩展头后,得到所述第二GTP包,其中,所述剩余字段包括所述GTP包头中除所述第二字段、所述第三字段和所述第五字段之外的其他字段。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 first GTP packet, and then the n first GTP packets are respectively After the remaining fields and content parts in the GTP header of a GTP packet are sequentially merged into the extended header of the first first GTP packet, the second GTP packet is obtained, wherein the remaining fields include the remaining fields in the GTP header Fields other than the second field, the third field and the fifth field.8.根据权利要求1-7任一项所述的方法,其特征在于,所述n个第一GTP包中每个第一GTP包的GTP包头中所包括的总长度字段占1字节。8 . The method according to claim 1 , wherein the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte. 9 .9.根据权利要求1-8任一项所述的方法,其特征在于,所述将所述n个第一GTP包中的GTP包头及内容进行合并,得到第二GTP包,包括:9. The method according to any one of claims 1-8, wherein the GTP header and content in the n first GTP packets are combined to obtain the second GTP packet, comprising:对所述n个第一GTP包中每个第一GTP包所包括的目标隧道端点标识TEID字段进行压缩,得到n个压缩后的第一GTP包;compressing the target tunnel endpoint identification TEID field included in each first GTP packet in the n first GTP packets to obtain n compressed first GTP packets;将所述n个压缩后的第一GTP包中的GTP包头及内容进行合并,得到所述第二GTP包。The GTP packet headers and contents in the n compressed first GTP packets are combined to obtain the second GTP packet.10.根据权利要求9所述的方法,其特征在于,对所述n个第一GTP包中每个第一GTP包所包括的目标隧道端点标识TEID字段进行压缩,包括:10. The method according to claim 9, wherein the target tunnel endpoint identification TEID field included in each of the n first GTP packets is compressed, comprising:根据所述n个第一GTP包中每个第一GTP包所包括的目标TEID,查询散列表中是否存在与各目标TEID对应的映射值,所述散列表中包括多个TEID和映射值之间的对应关系;According to the target TEID included in each of the n first GTP packets, query whether there is a mapping value corresponding to each target TEID in the hash table, where the hash table includes a plurality of TEIDs and mapping values Correspondence between;若所述散列表中存在与各目标TEID对应的映射值,则将所述n个第一GTP包中每个第一GTP包所包括的目标TEID替换为对应的映射值,其中,所述映射值所占空间的大小小于所述目标TEID所占空间的大小。If there is a mapping value corresponding to each target TEID in the hash table, replace the target TEID included in each of the n first GTP packets with the corresponding mapping value, wherein the mapping The size of the space occupied by the value is smaller than the size of the space occupied by the target TEID.11.根据权利要求10所述的方法,其特征在于,所述方法还包括:11. The method of claim 10, wherein the method further comprises:若所述散列表中不存在与第一目标TEID对应的映射值,则确定所述第一目标TEID对应的目标映射值,并将所述第一目标TEID和所述目标映射值之间的对应关系存入所述散列表中,所述第一目标TEID为多个目标TEID中的任意一个TEID;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 calculated. The relationship is stored in the hash table, and the first target TEID is any one of the multiple target TEIDs;相应的,所述向第二设备发送所述第二GTP包,包括:Correspondingly, the sending the second GTP packet to the second device includes:向所述第二设备发送所述第一目标TEID和所述目标映射值之间的对应关系,以及所述第二GTP包。Send the correspondence between the first target TEID and the target mapping value, and the second GTP packet to the second device.12.根据权利要求1-11任一项所述的方法,其特征在于,所述方法还包括:12. The method according to any one of claims 1-11, wherein the method further comprises:确定所述n个第一GTP包中是否存在消息类型字段相同的目标第一GTP包;Determine whether there is a target first GTP packet with the same message type field in the n first GTP packets;若存在消息类型字段相同的目标第一GTP包,则保留第一个目标第一GTP包中的消息类型字段,并删除其他目标第一GTP包中的消息类型字段。If there is a target first GTP packet with the same message type field, the message type field in the first target first GTP packet is retained, and the message type fields in other target first GTP packets are deleted.13.根据权利要求1-12任一项所述的方法,其特征在于,所述向第二设备发送所述第二GTP包,包括:13. The method according to any one of claims 1-12, wherein the sending the second GTP packet to the second device comprises:将所述第二GTP包放入缓冲队列;putting the second GTP packet into the buffer queue;在所述缓冲队列的长度到达预设长度或等待时间超过预设值时,将所述缓冲队列中的第二GTP包发送给所述第二设备。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.14.根据权利要求13所述的方法,其特征在于,所述方法还包括:14. The method of claim 13, wherein the method further comprises:若连续m个第二GTP包均为等待时间超过预设值时发送的,则减小所述缓冲队列的长度,其中,m为正整数;或者,If m consecutive second GTP packets are sent when the waiting time exceeds the preset value, the length of the buffer queue is reduced, where m is a positive integer; or,所述第二GTP包在连续t次均为所述缓冲队列的长度到达预设长度时发送的,则增大所述缓冲队列的长度,其中,t为正整数。If the second GTP packet is sent t consecutive times when the length of the buffer queue reaches a preset length, the length of the buffer queue is increased, where t is a positive integer.15.一种GPRS隧道协议GTP包的处理方法,其特征在于,应用于第二设备,所述方法包括:15. A method for processing a GPRS tunneling protocol GTP packet, characterized in that, applied to a second device, the method comprising:接收第一设备发送的第二GTP包,所述第二GTP包为将n个第一GTP包中的GTP包头及内容进行合并后得到的;Receive the second GTP packet sent by the first device, where the second GTP packet is obtained by merging the GTP headers and contents in the n first GTP packets;对所述第二GTP包进行解析,获得n个第一GTP包,所述n个第一GTP包具有相同目的IP地址。The second GTP packet is parsed to obtain n first GTP packets, and the n first GTP packets have the same destination IP address.16.根据权利要求15所述的方法,其特征在于,所述对所述第二GTP包进行解析,获得n个第一GTP包,包括:16. The method according to claim 15, wherein the analyzing the second GTP packet to obtain n first GTP packets, comprising:从所述第二GTP包中解析出n个GTP包头,以及与n个GTP包头中每个GTP包头对应的内容部分;Parse out n GTP packet headers from the second GTP packet, and a content portion corresponding to each GTP packet header in the n GTP packet headers;分别将每个GTP包头和与所述GTP包头对应的内容部分进行合并,得到所述n个第一GTP包。The n first GTP packets are obtained by combining each GTP packet header and the content part corresponding to the GTP packet header respectively.17.根据权利要求16所述的方法,其特征在于,所述第二GTP包的IP头中包括第一字段,所述第一字段用于指示所述第二GTP包的总长度。The method according to claim 16, wherein the IP header of the second GTP packet includes a first field, and the first field is used to indicate the total length of the second GTP packet.18.根据权利要求15-17任一项所述的方法,其特征在于,针对每个第一GTP包,所述第一GTP包的GTP包头中包括第二字段,所述第二字段用于指示所述第一GTP包的GTP包头及内容的长度。18. The method according to any one of claims 15-17, wherein, for each first GTP packet, a GTP packet header of the first GTP packet includes a second field, and the second field is used for Indicates the length of the GTP header and content of the first GTP packet.19.根据权利要求15所述的方法,其特征在于,所述对所述第二GTP包进行解析,获得n个第一GTP包,包括:19. The method according to claim 15, wherein the analyzing the second GTP packet to obtain n first GTP packets, comprising:从所述第二GTP包的包头中解析出n个第二字段、n个第三字段和p个第四字段;其中,p为小于或等于n的正整数;Parse out 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;从所述第二GTP包的内容中解析出n个GTP包头的剩余字段以及n个内容部分,其中,所述剩余字段包括所述GTP包头中除所述第二字段、所述第三字段和所述第四字段之外的其他字段;Parse out the remaining fields of n GTP packet headers and n content parts from the content of the second GTP packet, wherein the remaining fields include the second field, the third field and other fields than the fourth field;分别将第二字段、第三字段、第四字段、剩余字段以及内容部分进行合并,得到n个第一GTP包。The second field, the third field, the fourth field, the remaining fields and the content part are respectively combined to obtain n first GTP packets.20.根据权利要求15所述的方法,其特征在于,所述对所述第二GTP包进行解析,获得n个第一GTP包,包括:20. The method according to claim 15, wherein the analyzing the second GTP packet to obtain n first GTP packets, comprising:从所述第二GTP包的扩展头后依次解析出n个GTP包头的剩余字段以及n个内容部分,其中,所述剩余字段包括所述GTP包头中除第二字段、第三字段和第五字段之外的其他字段;From the extension header of the second GTP packet, the remaining fields of n GTP packet headers and n content parts are sequentially parsed, wherein the remaining fields include the second field, the third field and the fifth field in the GTP packet header. fields other than fields;从所述第二GTP包的扩展头中依次解析出n个第二字段、n个第三字段和n个第五字段;From the extension header of the second GTP packet, sequentially parse out n second fields, n third fields and n fifth fields;分别将所述第二字段、所述第三字段、所述第五字段、剩余字段以及内容部分进行合并,得到n个第一GTP包。The second field, the third field, the fifth field, the remaining fields and the content part are respectively combined to obtain n first GTP packets.21.根据权利要求15-20任一项所述的方法,其特征在于,所述n个第一GTP包中每个第一GTP包的GTP包头中所包括的总长度字段占1字节。21. The method according to any one of claims 15-20, wherein the total length field included in the GTP header of each of the n first GTP packets occupies 1 byte.22.根据权利要求15-20任一项所述的方法,其特征在于,所述方法还包括:22. The method according to any one of claims 15-20, wherein the method further comprises:针对所述n个第一GTP包中的每个第一GTP包,根据所述第一GTP包中的映射值,查询散列表中是否存在与所述映射值对应的目标隧道端点标识TEID,所述散列表中包括多个TEID和映射值之间的对应关系;For each first GTP packet in the n first GTP packets, according to the mapping value in the first GTP packet, query whether there is a target tunnel endpoint identifier TEID corresponding to the mapping value in the hash table. The hash table includes the correspondence between multiple TEIDs and mapping values;若所述散列表中存在与所述映射值对应的目标TEID,则将所述第一GTP包中所包括的映射值替换为对应的目标TEID,得到处理后的第一GTP包;其中,所述映射值所占空间的大小小于所述目标TEID所占空间的大小。If there is a target TEID corresponding to the mapping value in the hash table, replace the mapping value included in the first GTP packet with the corresponding target TEID to obtain the processed first GTP packet; The size of the space occupied by the mapping value is smaller than the size of the space occupied by the target TEID.23.根据权利要求22所述的方法,其特征在于,所述方法还包括:23. The method of claim 22, wherein the method further comprises:从所述第一设备接收目标TEID和所述映射值之间的对应关系。The correspondence between the target TEID and the mapped value is received from the first device.24.一种GPRS隧道协议GTP包的处理装置,其特征在于,包括:24. A processing device of a GPRS tunneling protocol GTP packet, characterized in that, comprising:处理单元,用于确定待发送的n个第一GTP包,所述n个第一GTP包具有相同目的网络协议IP地址,n为正整数;a processing unit, configured to determine 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;所述处理单元,还用于将所述n个第一GTP包中的GTP包头及内容进行合并,得到第二GTP包;The processing unit is also used to combine the GTP headers and contents in the n first GTP packets to obtain a second GTP packet;发送单元,用于将所述目的IP地址作为所述第二GTP包的目的IP地址,并向第二设备发送所述第二GTP包。A sending unit, configured to use the destination IP address as the destination IP address of the second GTP packet, and send the second GTP packet to the second device.25.一种GPRS隧道协议GTP包的处理装置,其特征在于,包括:25. A processing device of a GPRS tunneling protocol GTP packet, characterized in that, comprising:接收单元,用于接收第一设备发送的第二GTP包,所述第二GTP包为将n个第一GTP包中的GTP包头及内容进行合并后得到的;a receiving unit, configured to receive the second GTP packet sent by the first device, where the second GTP packet is obtained by merging the GTP packet headers and contents in the n first GTP packets;处理单元,用于对所述第二GTP包进行解析,获得n个第一GTP包,所述n个第一GTP包具有相同目的IP地址。A processing unit, 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.26.一种GPRS隧道协议GTP包的处理装置,其特征在于,所述装置包括处理器和存储器,所述存储器中存储有计算机程序,所述处理器执行所述存储器中存储的计算机程序,以使所述装置执行如权利要求1至23任一项所述的方法。26. A processing device for a GPRS tunneling protocol GTP packet, characterized in that the device comprises a processor and a memory, and a computer program is stored in the memory, and the processor executes the computer program stored in the memory, to The apparatus is caused to perform a method as claimed in any one of claims 1 to 23.27.一种GPRS隧道协议GTP包的处理装置,其特征在于,包括:处理器和接口电路;27. A device for processing a GPRS tunneling protocol GTP packet, comprising: a processor and an interface circuit;所述接口电路,用于接收代码指令并传输至所述处理器;the interface circuit for receiving code instructions and transmitting them to the processor;所述处理器,用于运行所述代码指令以执行如权利要求1至23中任一项所述的方法。The processor for executing the code instructions to perform the method of any one of claims 1-23.28.一种可读存储介质,用于存储有指令,当所述指令被执行时,使如权利要求1至23中任一项所述的方法被实现。28. A readable storage medium storing instructions which, when executed, cause the method of any one of claims 1 to 23 to be implemented.
CN202010275193.7A2020-04-092020-04-09GPRS tunneling protocol GTP packet processing method and devicePendingCN113518386A (en)

Priority Applications (2)

Application NumberPriority DateFiling DateTitle
CN202010275193.7ACN113518386A (en)2020-04-092020-04-09GPRS tunneling protocol GTP packet processing method and device
PCT/CN2021/085422WO2021204090A1 (en)2020-04-092021-04-02Method and apparatus for processing gprs tunneling protocol (gtp) packets

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010275193.7ACN113518386A (en)2020-04-092020-04-09GPRS tunneling protocol GTP packet processing method and device

Publications (1)

Publication NumberPublication Date
CN113518386Atrue CN113518386A (en)2021-10-19

Family

ID=78023992

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010275193.7APendingCN113518386A (en)2020-04-092020-04-09GPRS tunneling protocol GTP packet processing method and device

Country Status (2)

CountryLink
CN (1)CN113518386A (en)
WO (1)WO2021204090A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2025152681A1 (en)*2024-01-172025-07-24华为技术有限公司Communication method and apparatus

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115297074B (en)*2022-08-022024-08-16卓望数码技术(深圳)有限公司Method and device for monitoring micro-service application
CN118555252B (en)*2024-06-072025-01-14北京开源芯片研究院 Routing method, system, electronic device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101212389A (en)*2006-12-302008-07-02华为技术有限公司 A burst convergence control method, corresponding device, and communication equipment
US20090016334A1 (en)*2007-07-092009-01-15Nokia CorporationSecured transmission with low overhead
CN101388825A (en)*2007-09-122009-03-18华为技术有限公司 A method and device for transmitting GPRS tunnel protocol data packets
CN101420369A (en)*2007-10-242009-04-29华为技术有限公司Packet transmission method, system and device for general packet wireless service tunnel protocol

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101350812B (en)*2008-08-222012-06-27上海华为技术有限公司Data transmission method, communication apparatus and communication system
US10057391B2 (en)*2014-12-272018-08-21Hughes Network Systems, LlcAcceleration of GTP traffic flows, over a satellite link, in a terrestrial wireless mobile communications system
US11025541B2 (en)*2017-12-152021-06-01Hewlett Packard Enterprises Development LPTransporting a GTP message to a termination device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101212389A (en)*2006-12-302008-07-02华为技术有限公司 A burst convergence control method, corresponding device, and communication equipment
US20090016334A1 (en)*2007-07-092009-01-15Nokia CorporationSecured transmission with low overhead
CN101388825A (en)*2007-09-122009-03-18华为技术有限公司 A method and device for transmitting GPRS tunnel protocol data packets
CN101420369A (en)*2007-10-242009-04-29华为技术有限公司Packet transmission method, system and device for general packet wireless service tunnel protocol

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2025152681A1 (en)*2024-01-172025-07-24华为技术有限公司Communication method and apparatus

Also Published As

Publication numberPublication date
WO2021204090A1 (en)2021-10-14

Similar Documents

PublicationPublication DateTitle
US20230090232A1 (en)Terminal device and network device
CN104685920B (en) Method, device and system for transmitting data
JP7683702B2 (en) Method of buffer status reporting, method and device for configuring a buffer status report - Patents.com
CN103814596B (en)Transmit the methods, devices and systems of data
CN110505714B (en)Multi-link communication method, equipment and terminal
US12376160B2 (en)Relay communication method and related device
EP3585120B1 (en)Method and device for processing media access control protocol data unit
KR20190132459A (en) Data display method, device and communication system
WO2021204090A1 (en)Method and apparatus for processing gprs tunneling protocol (gtp) packets
CN113261337A (en)Method and apparatus for replicated data transmission
EP4156778A1 (en)Mobile edge computing processing method, and related device
US10701591B2 (en)Data transmission method, apparatus, and system
CN104982062B (en)Transmit the methods, devices and systems of data
EP3920654B1 (en)Wireless communication method, terminal device, chip, computer readable storage medium and computer program product
US20220377541A1 (en)Key Management Method and Communication Apparatus
CN115835198A (en)Method and device for controlling security function, network equipment and terminal equipment
KR102337701B1 (en) Data transmission methods and devices
CN112868249B (en)Wireless communication method, terminal equipment and access network equipment
US20230217426A1 (en)Resource allocation 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
CN116762365A (en) Sidelink transmission method, terminal equipment and network equipment
WO2021243608A1 (en)Wireless communication method, terminal device, and network device
WO2016106744A1 (en)Data transmission method, wireless access device and communication system
WO2020062240A1 (en)Information transmission method and apparatus, and communication device

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp