CN100589448C - Method for realizing data package compression/decompression - Google Patents
Method for realizing data package compression/decompression Download PDFInfo
- Publication number
- CN100589448C CN100589448C CN200710123415A CN200710123415A CN100589448C CN 100589448 C CN100589448 C CN 100589448C CN 200710123415 A CN200710123415 A CN 200710123415A CN 200710123415 A CN200710123415 A CN 200710123415A CN 100589448 C CN100589448 C CN 100589448C
- Authority
- CN
- China
- Prior art keywords
- message
- zsr
- data message
- compression
- parcel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
The method includes: determining message to be sent through interface of sending end in ZCP-enable router is message in large packet or message in small packet; if it is large packet, then compress process in single packet is carried out; if it is small packet, then compress process in multiple packets is carried out; determining whether length of compressed message exceeds uncompressed message ornot; if yes, then original message is to be sent; if not; then the compressed message is to be sent; a ZCH compress head is added to the message to be sent; then, using interface of sending end in router carries out packaging and sending operation; the said ZCH compress head is in use for marking whether message is compressed or not as well as whether it is compressed message of multiple packets,and number of compressed packet. Taking full advantage of current resources of interface, the invention expands bandwidth through process of compressing/decompressing data message.
Description
Technical field
The present invention relates to the Network Transmission field, be specifically related to a kind of method that realizes the packet compression/de-compression, be applied in point-to-point link and the tunnel links.
Background technology
Low end router is applied to places such as enterprise, government bodies, traditional industries more, transmits the realization network communication by traditional 2M link even lower link between a lot of branch office routers and the last level router.Described 2M link even lower link realize that network communication more and more can not satisfy the growing demand of user, so it is very natural, the user expects carrying out the link dilatation to network, expand bandwidth, but what come but is extra capital investment thereupon, also will buy the link that more router interface is realized transmission link because the link dilatation needs the user to remove to rent more transmission link.
Purpose itself that use low end router is exactly in order to save resource, alleviate economic pressures, then need to add hardware facility, strengthened fund input if carry out the link dilatation, increased very big financial burden to the user, restricted like this that network is popularized and the development of data, services.
Summary of the invention
The purpose of this invention is to provide a kind of method that realizes the packet compression/de-compression, additionally do not adding on the basis of hardware, make full use of the existing interface resource, by the data message is carried out compression/decompression processes, to realize expanding the purpose of bandwidth.
In order to realize the foregoing invention purpose, the present invention specifically is achieved in that
A kind of method that realizes the packet compression comprises the steps:
Step 3 is carried out the processing of contracting of many bag pressures to the message of described parcel, changes step 4 then over to;
Step 4 judges whether the message length after the compression has surpassed not compressed packet, if surpass, then with former message as the message that will send, if do not surpass, the message that the message conduct after then will compressing will send;
Step 5 is added a ZSR compressing head before the described message that will send, the transmitting terminal interface by router encapsulates transmission then;
Whether described ZSR compressing head is used for the mark message and whether has passed through compression, and be the contract numbers of message and compressed package of many bag pressures.
In the method for realization packet compression of the present invention, before described step 1, increase following steps:
Step 11 judges whether the current message that will send is protocol massages, if, then change step 5 over to, otherwise, change step 12 over to;
Whether step 12, the utilance of transmitting terminal interface of judging the router that the current ZSR of having compression protocol enables less than threshold values,
If less than threshold values, judge then in the ZSR compression protocol formation of transmitting terminal interface of current router whether the data message of parcel is arranged,, then change step 5 over to if there is not the data message of parcel, if the data message of parcel is arranged, then judge whether to have only a data message,, then change step 5 over to if having only a data message, otherwise, a more than data message is then merged into these messages a message, changes step 5 then over to;
If be not less than threshold values, then change step 1 over to.
In the method for realization packet compression of the present invention, described step 2 further comprises the steps:
Judge the data message whether parcel is arranged in the ZSR compression protocol formation of transmitting terminal interface of the router that the current ZSR of having compression protocol enables, if do not have, then carrying out single bag pressure contracts, change step 4 then over to, if have, then earlier the data message of parcel is gone out team and compress, the data message that will wrap greatly carries out single bag pressure and contracts then, changes step 4 then over to.
In the method for realization packet compression of the present invention, described data message with parcel goes out team and compresses, and specifically is meant:
Whether the data message of judging the parcel in the ZSR compression protocol formation of transmitting terminal interface of the router that the current ZSR of having compression protocol enables has only one, if have only a data message, then carry out the processing of contracting of single bag pressure, change step 4 then over to, otherwise, a more than data message then carries out the processing of contracting of many bag pressures, changes step 4 then over to.
In the method for realization packet compression of the present invention, described many bag pressures contract to handle and specifically are meant:
Whether the number of judging the data message of the parcel in the ZSR compression protocol formation of transmitting terminal interface of the router that the current ZSR of having compression protocol enables reaches the upper limit, if reach the upper limit, then all messages in the formation are gone out team, merging into a message then compresses, otherwise, do not reach the upper limit, then do not process.
In the method for realization packet of the present invention compression, timer is set, every interval certain hour is judged the data message whether parcel of buffer memory is arranged in the ZSR compression protocol formation of transmitting terminal interface of the router that the current ZSR of having compression protocol enables,
If the data message of the parcel of buffer memory is arranged, then judge in the ZSR compression protocol formation of transmitting terminal interface of the router that the current ZSR of having compression protocol enables and whether have only a data message, if have only a data message, then this data message is carried out the processing of contracting of single bag pressure; If a more than data message compresses processing after then these messages being combined into a message;
If do not have the data message of the parcel of buffer memory, then do not deal with.
The present invention also provides a kind of method that realizes that packet decompresses, and comprises the steps:
Compared with prior art, the present invention is applied on the router device in the point-to-point link and tunnel links, its two layer message or three-tier message are carried out compression/decompression processes, realized additionally not adding under the situation of hardware, make full use of the existing interface resource, present 2M link is expanded to about 4M, reach the purpose of expanding bandwidth, saved resource greatly, improved the utilance of resource, and owing to adopted ZCP (ZSRCompress Protocol) compression, the message that transmits in the network is the message after the compression, increased by stealing the difficulty of message in the transmission network, thereby increased the safety of network, promoted to a certain extent that network is popularized and the development of data, services.
Description of drawings
Fig. 1 adopts the two ends router to enable the networking diagram of message compression;
Figure 21 is the form schematic diagram of ZCH compressing head;
Figure 22 is single bag pressure form schematic diagram that contracts;
Figure 23 is many bag pressures form schematic diagrames that contract;
Fig. 3 is a message compression process schematic diagram;
Fig. 4 is that system forces the data message of the parcel in the ZCP formation to go out the schematic flow sheet of team;
Fig. 5 is a message decompression flow process schematic diagram.
Embodiment
Major technique thought of the present invention is, on the basis that does not increase hardware, on router device, its two layers or three-tier message done compression according to given compression algorithm handle described compression algorithm support software compression algorithm and hardware-compressed.
The main performing step of the method for the invention is as follows:
In the described step 1, when message is compressed, message size is judged, determined that promptly the bag of message is long whether greater than 255 bytes, if greater than 255 bytes, then message is big bag, does not carry out many packet delay compressions, otherwise message is a parcel, then needs to enter many packet delay compressions.
Step 3, (described message can be the message after the compression before message, whether or former message) a preceding byte ZCH (the ZSR Compress Header) compressing head that adds is used for this message of mark and whether has passed through compression, and be the contract numbers of message and compressed package of many bag pressures;
Step 4 when the end-to-end router interface receives message, is carried out decompression, gets first byte ZCH of message, judges that according to the mark on this byte carrying out the multipacket message decompression still is single packet voice decompression;
Step 5 is submitted to two layers of processing module with the message behind the decompress(ion) or three layers of processing module are handled.
As shown in figure 21, ZCH compressing head (Compress head) is a byte length, be positioned at the compressed package content before, the implication of each mark:
Bit 7:C Flag field represents whether message compresses, if 1, representing follow-up is compressed packet, if 0 represents that follow-up is non-compressed packet.
Bit 6:M Flag field represents whether be that many bag pressures contract, and wherein 0 is expressed as single bag pressure and contracts, and follow-up is compressed packet, and 1 is expressed as many bag pressures contracts, and then needs the number according to compressed package, and message is handled.
Bit 5~bit 3:packet num field is represented the number of compressed package, according to the number of compressed package, takes out the length and the compressed content of compressed package respectively.
As shown in figure 22, single bag pressure form that contracts: the content of compressing head+compressed package.
As shown in figure 23, many bag pressures form that contracts: the content of the message length+compressed package before compressing head+compressed package does not compress.
Be message compression process schematic diagram as shown in Figure 3:
Whether step 3 judges utilance on the current router interface less than threshold values,
If the router interface utilance is lower than threshold values, judge then whether the ZCP formation of current router interface has data message,
If do not have data message in the ZCP formation of current router interface, then current data message is not done compression, directly stamp the ZCH compressing head, the C mark puts 0, and the M mark puts 0, and packet num field is filled out 1 encapsulation back and is sent;
If in the ZCP formation of current router interface data message is arranged, then judge in the ZCP formation of current router interface whether have only a data message,
If have only a data message, then this data message is directly stamped the ZCH compressing head, wherein the C mark puts 0, and the M mark puts 0, and packet num field fills out 1, and the encapsulation back sends,
If the individual data message of n (n is an integer, and n>1), then this n data message is combined into a message after, directly stamp the ZCH compressing head, wherein the C mark puts 0, the M mark puts 1, packet num field is filled out n, the encapsulation back sends.
If the interface utilance is not less than threshold values, then carry out step 4;
Step 4, judge that current data message to be processed is big that wrap or parcel, if the data message of parcel, the processing of then joining the team, carry out step 7, if the data message of big bag, then judge the data message whether parcel is arranged in the ZCP formation of current router interface, if there is not the data message of parcel, then carry out step 5, single bag pressure of the data message that wraps greatly contracts, if the data message of parcel is arranged, earlier the data message of parcel is carried out message and go out team, again the message of big bag is entered single bag pressure and contract, then carry out step 6;
Step 5 is done the processing of contracting of single bag pressure with current data message, if the message after the compression is not more than the message before the compression, then use the message after compressing, stamp the ZCH compressing head, the C mark puts 1, the M mark puts 0, and packet num field fills out 1, and the encapsulation back sends, if the message after the compression, then uses the message before the compression greater than the preceding message of compression, stamp the ZCH compressing head, the C mark puts 0, the M mark puts 0, and packet num field fills out 1, and the encapsulation back sends;
Step 6 judges in the ZCP formation of current router interface whether have only the data message of a parcel, if having only the data message of a parcel, then changes step 5 over to, if the data message of the individual parcel of m (m is an integer, and m>1) then changes step 7 over to;
Step 7 judges whether the data message number m of the parcel of buffer memory in the ZCP formation of current router interface reaches the upper limit, if reach the upper limit, then the data message with the parcel in the ZCP formation goes out team, carry out step 8, otherwise, need not out team;
The described upper limit is meant the number of the data message of the parcel of buffer memory in the ZCP formation, can be configured it according to actual conditions, if but the number of configuration is very big, then can strengthen the time delay of data message, therefore when configuration, should make full use of bandwidth, carry out reasonable disposition, then can not influence user's normal use.
Step 8 is combined into described m data message and carries out the processing of contracting of single bag pressure behind the data message, if the message of the message after the compression before less than compression, then use the message after compressing, stamp the ZCH compressing head, the C mark puts 1, the M mark puts 1, and packet num field is filled out m, and the encapsulation back sends, if the message after the compression, then uses the message before the compression greater than the preceding message of compression, stamp the ZCH compressing head, the C mark puts 0, the M mark puts 1, and packet num field is filled out m, and the encapsulation back sends.
Be that system forces the data message of the parcel in the ZCP formation to go out the flow process of team as shown in Figure 4, in order to prevent that message from stopping up, forced message goes out team, system is provided with a timer, every interval certain hour (for example being 10ms) is judged the data message whether parcel of buffer memory is arranged in the ZCP formation, if the data message of the parcel of buffer memory is arranged, then judge in the ZCP formation of current router interface and whether have only a data message, if have only a data message, then this data message is carried out the processing of contracting of single bag pressure, stamp the ZCH compressing head, the C mark puts 1, the M mark puts 0, and packet num field fills out 1, and the encapsulation back sends; If the individual message of a (a is an integer, and a>1) is arranged in the ZCP formation of current router interface, then this a message is combined into and carries out the processing of contracting of many bag pressures behind the message, stamp the ZCH compressing head, the C mark puts 1, and the M mark puts 1, packet num field is filled out a, and the encapsulation back sends.
As shown in Figure 5 be message decompression flow process schematic diagram:
If not compressing message, judge that then whether this message is the message after a plurality of messages merge,
Message after merging if not a plurality of messages, then get first byte ZCH compressing head of message, if C is labeled as 0, M is labeled as 0, and the expression message is not done compression, and then being offset a byte backward is two layers of head or three layers of head, message length is deducted 1 byte, submit to two layers of processing module or three layers of processing module, remove the ZCH compressing head, walk follow-up packet receiving handling process;
If the message after a plurality of messages merging, then take out the packet number field in the ZCH compressing head, can be offset according to the value of packet number field and to obtain unpressed message, equally, the bag that can obtain each compressed package in the ZCH compressing head according to packetnumber is long, and the message after will merging according to bag length decomposes message, submits two layers of processing module or three layers of processing module then to, remove the ZCH compressing head, carry out follow-up packet receiving handling process.
If the message that compressed then carry out step 3.
Step 3 judges whether the message that compressed is that single bag pressure contracts,
If single bag pressure contracts, then get first byte ZCH compressing head of current message, if C is labeled as 1, M is labeled as 0, represents this message through overcompression, then is offset 1 byte backward and carries out decompression processing, remove the ZCH head, and the message decompress(ion) that will compress comes out, walk follow-up packet receiving handling process;
If many bag pressures contract, get first byte ZCH compressing head of current message, if C is labeled as 1, M is labeled as 1, then take out the packet number field in the ZCH head, value skew according to the packetnumber field in the ZCH compressing head obtains compressed packet, carries out decompression, removes the ZCH compressing head, value according to packet number field, the bag of obtaining each compressed package in the ZCH compressing head is long, according to bag is long message behind the decompress(ion) is decomposed, and walks follow-up packet receiving handling process.
Being example below in conjunction with Fig. 1 with the CE1 interface is further described the enforcement of technical scheme:
The first step: the CE1 interface of two ends router starts ZCP
R1(config-subif)#zcp-enable
R2(config-subif)#zcp-enable
Second step: two ends router selection algorithm
R1(config-subif)#compress?algorithm?lzs
R2(config-subif)#compress?algorithm?lzs
After the two ends configuration of routers is good, all can compress processing, improve bandwidth utilization by the data of two ends CE1 interface.
Claims (7)
1, a kind of method that realizes the packet compression is characterized in that, comprises the steps:
Step 1, judge that the message that current transmitting terminal interface with router that intelligent integrated multiservice router ZSR compression protocol enables will send is the message of big bag or the message of parcel, if the message of big bag then changes step 2 over to, if the message of parcel then changes step 3 over to;
Step 2 is carried out the processing of contracting of single bag pressure to the message of described big bag, changes step 4 then over to;
Step 3 is carried out the processing of contracting of many bag pressures to the message of described parcel, changes step 4 then over to;
Step 4 judges whether the message length after the compression has surpassed not compressed packet, if surpass, then with former message as the message that will send, if do not surpass, the message that the message conduct after then will compressing will send;
Step 5 is added a ZSR compressing head before the described message that will send, the transmitting terminal interface by router encapsulates transmission then;
Whether described ZSR compressing head is used for the mark message and whether has passed through compression, and be the contract numbers of message and compressed package of many bag pressures.
2, the method for realization packet compression as claimed in claim 1 is characterized in that, increases following steps before described step 1:
Step 11 judges whether the current message that will send is protocol massages, if, then change step 5 over to, otherwise, change step 12 over to;
Whether step 12, the utilance of transmitting terminal interface of judging the router that the current ZSR of having compression protocol enables less than threshold values,
If less than threshold values, judge then in the ZSR compression protocol formation of transmitting terminal interface of current router whether the data message of parcel is arranged,, then change step 5 over to if there is not the data message of parcel, if the data message of parcel is arranged, then judge whether to have only a data message,, then change step 5 over to if having only a data message, otherwise, a more than data message is then merged into these messages a message, changes step 5 then over to;
If be not less than threshold values, then change step 1 over to.
3, the method for realization packet compression as claimed in claim 1 is characterized in that described step 2 further comprises the steps:
Judge the data message whether parcel is arranged in the ZSR compression protocol formation of transmitting terminal interface of the router that the current ZSR of having compression protocol enables, if do not have, then carrying out single bag pressure contracts, change step 4 then over to, if have, then earlier the data message of parcel is gone out team and compress, the data message that will wrap greatly carries out single bag pressure and contracts then, changes step 4 then over to.
4, the method for realization packet compression as claimed in claim 3 is characterized in that described data message with parcel goes out team and compresses, and specifically is meant:
Whether the data message of judging the parcel in the ZSR compression protocol formation of transmitting terminal interface of the router that the current ZSR of having compression protocol enables has only one, if have only a data message, then carry out the processing of contracting of single bag pressure, change step 4 then over to, otherwise, a more than data message then carries out the processing of contracting of many bag pressures, changes step 4 then over to.
As the method for claim 1 or 4 described realization packet compressions, it is characterized in that 5, described many bag pressures contract to handle and specifically are meant:
Whether the number of judging the data message of the parcel in the ZSR compression protocol formation of transmitting terminal interface of the router that the current ZSR of having compression protocol enables reaches the upper limit, if reach the upper limit, then all messages in the formation are gone out team, merging into a message then compresses, otherwise, do not reach the upper limit, then do not process.
6, as the method for described realization packet compression as described in claim 3 or 4, it is characterized in that,
Timer is set, and every interval certain hour is judged the data message whether parcel of buffer memory is arranged in the ZSR compression protocol formation of transmitting terminal interface of the router that the current ZSR of having compression protocol enables,
If the data message of the parcel of buffer memory is arranged, then judge in the ZSR compression protocol formation of transmitting terminal interface of the router that the current ZSR of having compression protocol enables and whether have only a data message, if have only a data message, then this data message is carried out the processing of contracting of single bag pressure; If a more than data message compresses processing after then these messages being combined into a message;
If do not have the data message of the parcel of buffer memory, then do not deal with.
7, a kind of method that realizes that packet decompresses is characterized in that, comprises the steps:
Step 1, judge whether the message that the receiving terminal interface of the router that the current ZSR of having compression protocol enables is received is compressed packet, if not, judge then whether described message is the message that a plurality of messages merge, if not, after then the length of described message being offset a byte backward, go compressing head to handle; If, then take out " compressed package number " field in the ZSR compressing head, value skew according to described field obtains unpressed message, the bag that obtains compressed package according to ZSR compressing head content is long, according to bag is long message after the described merging is decomposed into a plurality of messages, submit processing module to, remove the ZSR compressing head; If compressed packet then changes step 2 over to;
Step 2 judges that described compressed packet is that single bag pressure contracts or many bag pressures contract, if single bag pressure contracts, then described message length is offset backward a byte and carries out decompress(ion), and do compressing head and handle; If many bag pressures contract, then get first byte ZSR compressing head of message, take out " compressed package number " field in the ZSR compressing head, value skew according to described field obtains compressed packet, decompress, the bag that obtains compressed package according to ZSR compressing head content is long, and the message after decompressing is decomposed into a plurality of messages, submit processing module to, remove the ZSR compressing head.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200710123415A CN100589448C (en) | 2007-06-22 | 2007-06-22 | Method for realizing data package compression/decompression |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200710123415A CN100589448C (en) | 2007-06-22 | 2007-06-22 | Method for realizing data package compression/decompression |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101072188A CN101072188A (en) | 2007-11-14 |
CN100589448C true CN100589448C (en) | 2010-02-10 |
Family
ID=38899182
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN200710123415A Active CN100589448C (en) | 2007-06-22 | 2007-06-22 | Method for realizing data package compression/decompression |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100589448C (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103825869A (en) * | 2012-11-19 | 2014-05-28 | 中兴通讯股份有限公司 | Compression and decompression method for Ethernet message header, and compression and decompression device thereof |
CN111083208B (en) * | 2019-12-03 | 2022-10-28 | 华为技术有限公司 | Network structure, message sending method and receiving method between network elements in network |
CN112566180B (en) * | 2020-12-09 | 2023-03-24 | 东方通信股份有限公司 | Method for improving packet data transmission rate of TETRA system |
-
2007
- 2007-06-22 CN CN200710123415A patent/CN100589448C/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN101072188A (en) | 2007-11-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1615618B (en) | A bi-directional packet data transmission system and method | |
WO2010020197A1 (en) | Data transmission method, communication equipment and communication system | |
CN102882879A (en) | Internet protocol (IP) data compression transmission method applicable to satellite channel | |
WO2013167013A2 (en) | Compression and decompression method of ethernet header and device of same | |
CN103973645A (en) | Data transmission method and data transmission device | |
CN102571572A (en) | Short message satellite communication-based data transmission method and device | |
CN102088460B (en) | Method, device and system for transmitting streaming media data in restricted networks | |
CN104580158A (en) | Distributed platform file and content distribution method and distributed platform file and content distribution system | |
CN101860904B (en) | Method for calculating checksums based on data packet IP (Internet Protocol) hearder compression technology | |
CN101453463B (en) | Data packet packing, transmitting and receiving method for mobile multimedia broadcast system | |
CN101568144A (en) | Header compression method applicable to wireless ad hoc network | |
WO2011079785A1 (en) | Method and apparatus for transmitting data packets | |
US7330902B1 (en) | Header compression | |
KR100807455B1 (en) | Method and apparatus for reducing transmission overhead in a communication system | |
WO2015168840A1 (en) | Data processing method and apparatus | |
US11743364B2 (en) | Method for interconversion between protocols | |
CN100589448C (en) | Method for realizing data package compression/decompression | |
US8559463B2 (en) | Systems and methods for providing efficient bandwidth utilization in packet switched networks | |
CN104394117A (en) | RTP packet transmission method and device | |
CN104811265A (en) | Base-band frame encapsulation method and de-encapsulation method | |
CN101197825B (en) | Method, system and device for compression message transmission | |
CN107835150A (en) | A kind of full media customer service dispatching method and system | |
CN101453465A (en) | IP packet compression, decompression method for mobile multimedia broadcast system | |
WO2021051673A1 (en) | Data transmission method and apparatus, computer device, and storage medium | |
CN110636035B (en) | Communication method, device and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C41 | Transfer of patent application or patent right or utility model | ||
TR01 | Transfer of patent right |
Effective date of registration: 20151130 Address after: 230088 No. 334 Fuyang North Road, Hefei, Anhui Patentee after: Anhui Province postal communication electricity limited company Address before: 518057 Nanshan District Guangdong high tech Industrial Park, South Road, science and technology, ZTE building, Ministry of Justice Patentee before: ZTE Corporation |