CN108696492A - The processing method and device of IP packet - Google Patents
The processing method and device of IP packet Download PDFInfo
- Publication number
- CN108696492A CN108696492A CN201710237487.9A CN201710237487A CN108696492A CN 108696492 A CN108696492 A CN 108696492A CN 201710237487 A CN201710237487 A CN 201710237487A CN 108696492 A CN108696492 A CN 108696492A
- Authority
- CN
- China
- Prior art keywords
- packet
- address
- heading
- type
- ipv4
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Abstract
The present invention relates to wireless communication fields, disclose a kind of processing method and device of IP packet.In embodiment of the present invention, when receiving IP packet, the address of the type of message of IP packet and the heading of IP packet is obtained to the index value in corresponding address list, address is to including source address and destination address;It is stored after the heading of IP packet is replaced with default heading, default heading includes heading and compressed data portion;Wherein, heading is used to store the type identifier of index value and the type of message for being used to indicate IP packet;Compressed data portion is in the heading of IP packet except the compressed data of information that address is external for storing compressed data, compressed data.Embodiment of the present invention so that in the IP packet that storage receives, the memory space that the heading of IP packet occupies is preferably minimized as far as possible, to save more memory spaces to preserve more IP packets.
Description
Technical field
The present invention relates to wireless communication field, more particularly to the processing method and device of a kind of IP packet.
Background technology
With the development of information network technique, Internet of Things is considered as that will change people's lives, work, amusement and trip
" the next industrial revolution " of line mode, Internet of Things are the connected internets of object object, it by Intellisense, identification technology with it is general
The communication cognition technology such as suitable calculating, is widely used in the fusion of network, is also therefore referred to as after computer, internet
The third wave of world information industry development.The essence of Internet of Things is exactly object and internet, if internet has solved most
Afterwards 1 kilometer the problem of, that Internet of Things will solve the problems, such as it is last 100 meters, this, which means that, will thousands of terminal
Equipment is linked by short haul connection mode in internet has wireless communication, small, low work(come, these usual equipment
The features such as consumption, low cost, while the own processing capabilities of this this equipment and memory space are held in the case usually than relatively limited
Carrying the storage of the message of the data information in communication process seems additional important.
IP (Internet Protocol, Internet Protocol) message is used to carry out data moreover, Internet of Things Network Communication is generally acknowledged
Transmission, the then storage of IP packet seem additional important, however, it is generally the case that the IP packet of actual data information is not transmitted
Heading occupy in bigger memory space, especially Internet of Things certain node devices (such as:Various sensors)
Actual transmissions data information it is smaller in the case of, the heading of IP packet is then opposite to occupy exhausted large space, this is for depositing
Heavy load for the smaller equipment in space is stored up, causes it that can not preserve more valid data informations, currently, being typically profit
The method for covering older IP packet is gone with newest IP packet, i.e., only preserves nearest a small amount of IP packet, it is empty to solve storage
Between smaller equipment the problem of can not preserving more IP packets.
However, in the implementation of the present invention, the inventors of the present application found that in communication process, equipment itself needs
Want continual transmitting data information, equipment when something goes wrong, generally require the longer time IP packet carry out case study
It will cause problem analysis and position inaccurate, or can not complete to ask only by the nearest a small amount of IP packet extracted with positioning
The analysis and positioning of topic.
Invention content
Embodiment of the present invention is designed to provide a kind of processing method and device of IP packet so that is received in storage
When the IP packet arrived, the memory space that the heading of IP packet occupies is preferably minimized as far as possible, it is empty to save more storages
Between to preserve more IP packets, can be according to more convenient for follow-up research and development and maintenance personnel when carrying out case study with positioning
More IP packets extracts useful information as much as possible, to realize accurate case study and positioning.
In order to solve the above technical problems, embodiments of the present invention provide a kind of processing method of IP packet, including:
When receiving IP packet, the address pair of the type of message of the IP packet and the heading of the IP packet is obtained
Index value in corresponding address list, described address is to including source address and destination address;
It is stored after the heading of the IP packet is replaced with default heading, the default heading includes message
Stem and compressed data portion;
Wherein, the heading is used to store the class of the index value and the type of message for being used to indicate the IP packet
Type identifier;The compressed data portion for storing compressed data, the compressed data be the IP packet heading in remove
The compressed data of the external information of described address.
Embodiments of the present invention additionally provide a kind of processing unit of IP packet, including:
Acquisition module, type of message and the IP packet for when receiving IP packet, obtaining the IP packet
The address of heading is to the index value in corresponding address list, and described address is to including source address and destination address;
Processing module, for the heading of the IP packet to be replaced with default heading, the default heading includes
Heading and compressed data portion, wherein the heading is for storing the index value and being used to indicate the IP packet
Type of message type identifier;It is reported for the IP for storing compressed data, the compressed data in the compressed data portion
Except the compressed data of information that described address is external in the heading of text.
Memory module, for storing the IP packet after replacing with the default heading.
Embodiment of the present invention in terms of existing technologies, when receiving IP packet, obtains the message class of IP packet
The address of the heading of type and IP packet to the index value in corresponding address list, address to include source address with target
Location replaces with the heading of IP packet pre- convenient for subsequently directly type of message and index value are stored in default heading
If being stored after heading, default heading includes heading and compressed data portion, wherein heading is for storing rope
Draw value and be used to indicate the type identifier of the type of message of IP packet, compressed data portion compresses number for storing compressed data
According to the external compressed data of information in address are removed in the heading for IP packet, the report of IP packet is replaced with default heading
Literary head, on the one hand, default heading replaces the message of IP packet with the index value for occupying the minimum characterization address pair of memory space
Address pair in head significantly reduces the memory space that default heading occupies, and on the other hand, will be removed in the heading of IP packet
The external information in address is compressed, and compressed data are deposited in default heading, further reduces default message
The memory space that head occupies saves more to which the memory space for occupying the heading of IP packet is preferably minimized as far as possible
Memory space to preserve more IP packets, convenient for subsequently research and develop and be maintained in carry out positioning problems when, can be according to more
IP packet extract useful information as much as possible, to realize accurate case study with positioning.
In addition, the address of the type of message for obtaining the IP packet and the heading of the IP packet is to corresponding
Index value in address list, specifically includes:According to the version number of the heading of the IP packet, the report of the IP packet is confirmed
Literary type;Judge whether the type of message is IPv4;If the type of message is IPv4, the report of the IP packet is inquired
The address of literary head is to the index value in IPv4 address lists;Otherwise, inquire the address of the heading of the IP packet to
Index value in IPv6 address lists.It, can be fast and accurately in corresponding address list according to the type of message of IP packet
Obtain the index value of the address pair of the heading of IP packet.
In addition, the address of the heading of the inquiry IP packet is to the index value in IPv4 address lists, specifically
Including:Judge to whether there is described address pair in the IPv4 address lists;If existed in the IPv4 address lists described
Address pair then obtains described address to the index value in the IPv4 address lists;Otherwise, by described address to being added to
It states in IPv4 address lists, and obtains described address to the index value in the IPv4 address lists.It not only ensure that inquiry
As a result accuracy, and realize the continuous renewal of address list.
In addition, judging whether the default heading is extracted;If the default heading is extracted, will be described pre-
If heading reverts to the heading of the IP packet.Convenient for follow-up research staff and maintenance personnel when carrying out positioning problems,
The message header of corresponding IP packet can be got in time.
In addition, the heading that the default heading is reverted to the IP packet, specifically includes:Acquisition is stored in
The type identifier of the heading;According to the type identifier, corresponding address list is obtained;According to being stored in
The index value of the heading inquires corresponding address pair in corresponding described address list;Decompress the pressure
Contracting data portion obtains decompression data;According to the format of the heading of the IP packet, with described by the decompression data
Location pair reverts to the IP packet head.To which default heading accurately to be reverted to the heading of corresponding IP packet.
Description of the drawings
Fig. 1 is the process flow figure according to a kind of IP packet of first embodiment of the invention;
Fig. 2 is pair according to the address pair and appropriate address list of the heading of the IP packet of first embodiment of the invention
Answer relational graph;
Fig. 3 is the format signal according to the heading that the type of message of IP packet in first embodiment of the invention is IPv4
Figure;
Fig. 4 is the format signal according to the heading that the type of message of IP packet in first embodiment of the invention is IPv6
Figure;
Fig. 5 is the correspondence figure of the heading and default heading according to the IP packet of first embodiment of the invention;
Fig. 6 is the process flow figure according to a kind of IP packet of second embodiment of the invention;
Fig. 7 is the structural schematic diagram according to a kind of processing unit of IP packet of third embodiment of the invention;
Fig. 8 is the structural schematic diagram according to a kind of processing unit of IP packet of four embodiment of the invention.
Specific implementation mode
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to each reality of the present invention
The mode of applying is explained in detail.However, it will be understood by those skilled in the art that in each embodiment of the present invention,
In order to make the reader understand this application better, many technical details are proposed.But even if without these technical details and base
In the various changes and modifications of following embodiment, the application technical solution claimed can also be realized.
First embodiment of the invention is related to a kind of processing method of IP packet.Detailed process is as shown in Figure 1.
In a step 101, the type of message of IP packet is obtained.
Specifically, terminal device when receiving IP packet, obtains the type of message of IP packet, wherein type of message
Including IPv4 and IPv6, type of message is determined according to the version number of the heading of IP packet, when version number is " 0100 ", message
Type is IPv4, when version number is " 0110 ", type of message IPv6.
In a step 102, judge whether type of message is IPv4, if so, 103 are thened follow the steps, it is no to then follow the steps
104。
Specifically, terminal device judges whether the type of message of IP packet is IPv4, if type of message is IPv4,
Step 103 is executed, judges the address of the heading of IP packet to whether in IPv4 address lists, otherwise, i.e., type of message is
Whether IPv6 thens follow the steps 104, judge the address of the heading of IP packet in IPv6 address lists, wherein IP packet
Address pair and the IPv4 address lists of heading, IPv6 address lists correspondence as shown in Fig. 2, according to the report of IP packet
Literary type can fast and accurately realize the matching of address pair and appropriate address list.
In step 103, the address of the heading of IP packet is judged to whether in IPv4 address lists, if it is,
Step 105 is executed, it is no to then follow the steps 106.
Specifically, terminal device judges the address of the heading of IP packet to whether there is in IPv4 address lists,
IPv4 address lists i.e. shown in Fig. 2, if the address of the heading of IP packet is executed to being present in IPv4 address lists
Step 105, the address is obtained to the index value in IPv4 address lists, if the address of the heading of IP packet is to being not present
In IPv4 address lists, 106 are thened follow the steps, by the address to being added in IPv4 address lists, and obtains the address pair
Index value, wherein address is to including source address and destination address.Further, when type of message is IPv4, IP packet
The source address of heading respectively accounts for 4 bytes with destination address, i.e., address is to occupying 8 bytes.
At step 104, the address of the heading of IP packet is judged to whether in IPv6 address lists, if it is,
Step 107 is executed, it is no to then follow the steps 108.
Specifically, terminal device judges the address of the heading of IP packet to whether there is in IPv6 address lists,
IPv6 address lists i.e. shown in Fig. 2, if the address of the heading of IP packet is executed to being present in IPv6 address lists
Step 107, the address is obtained to the index value in IPv6 address lists, if the address of the heading of IP packet is to being not present
In IPv6 address lists, 108 are thened follow the steps, by the address to being added in IPv6 address lists, and obtains the address pair
Index value.Wherein, address is to including source address and destination address, when type of message is IPv6, the heading of IP packet
Source address respectively accounts for 16 bytes with destination address, i.e., address is to occupying 32 bytes.
In step 105, the address is obtained to the index value in IPv4 address lists.
Specifically, when terminal device judges the address of the heading of IP packet to being present in IPv4 address lists,
The address is obtained to the index value in IPv4 address lists, wherein address is to the array index in IPv4 address lists
For its index value, the accurate lookup of index value is realized.
In step 106, by the address to being added in IPv4 address lists, and the index value of the address pair is obtained.
Specifically, when terminal device judges the address of the heading of IP packet to being not present in IPv4 address lists
When, by the address to being added in IPv4 address lists, and obtain the index value of the address pair, wherein address is in IPv4
Array index in the list of location is its index value, not only realizes the accurate lookup of index value, but also make address list not
Disconnected update.
In step 107, the address is obtained to the index value in IPv6 address lists.
Specifically, when terminal device judges the address of the heading of IP packet to being present in IPv6 address lists,
The address is obtained to the index value in IPv6 address lists, wherein address is to the array index in IPv6 address lists
For its index value, the accurate lookup of index value is realized.
In step 108, by the address to being added in IPv6 address lists, and the index value of the address pair is obtained.
Specifically, when terminal device judges the address of the heading of IP packet to being not present in IPv6 address lists
When, by the address to being added in IPv6 address lists, and obtain the index value of the address pair, wherein address is in IPv6
Array index in the list of location is its index value, not only realizes the accurate lookup of index value, but also make address list not
Disconnected update.
In step 109, the index value of the type identifier of the type of message of IP packet and address pair is stored in default
The heading of heading.
Specifically, default heading includes heading and compressed data portion, wherein heading occupies N number of byte,
The type identifier of the index value and the type of message for being used to indicate IP packet of address pair for storing above-mentioned acquisition, N are just
Integer, the specific value of N can accordingly be selected according to specific terminal device, for example, N is enabled to take 1, N is enabled to take 2 etc..Into one
Step ground is said, in order to realize conveniently, can the type identifier of IPv4 be denoted as 1, the type identifier of IPv6 is denoted as 0, certainly
The type identifier of IPv4 can also be denoted as 0, and the type identifier of IPv6 is denoted as 1, wherein, can in specific storage
Type identification to be deposited in a bit of heading, such as first bit, by the index value of the address pair of acquisition
It deposits in the remaining bits of heading, for example, when N takes 1, index value is deposited in remaining 7 bit.
In step 110, the external information in address will be removed in the heading of IP packet to compress.
Specifically, except the external information in address is the version number of heading, header length, clothes in the heading of IP packet
Service type, total length, identifier, mark, piece offset, life cycle, protocol domain and header check and, alternatively, for heading
Version number, transport-type, stream label, payload length, next heading and hop count limit.Wherein, in the heading of IP packet
Except the external information in address is also relevant with the type of message of IP packet, when the type of message of IP packet is IPv4, IP reports
In the heading of text except version number that the external information in address is heading, header length, service type, total length, identifier,
Mark, piece offset, life cycle, protocol domain and header check and, when the type of message of IP packet be IPv4 when, the report of IP packet
Except the external information in address is the version number of heading, transport-type, stream label, payload length, next heading in literary head
It is limited with hop count, concrete condition, the heading lattice of the heading format IPv6 as shown in fig. 4 of IPv4 shown in Figure 3
Formula.
It further says, when being compressed except the external information in address in the heading by IP packet, can combine and work as
Any one compression algorithm is compressed below preceding application feature selecting:Dictionary algorithm, Run- Length Coding algorithm or Huffman encoding
Algorithm.Below for the heading data (part marked with underscore) of IPv6 shown in following table 1, one is briefly introduced
Under, dictionary algorithm, Run- Length Coding algorithm and Huffman encoding algorithm specific coding process.
First, dictionary compression algorithm can there are one dictionary lists, such as:00=middle-school, 01=student,
Source text:I am a middle-school student are then after compressed encoding:I am a 00 01.Then, it is waited in table 1
8 bytes " 6000000000403a 40 " of the heading of the IPv6 of compression, can carry out following dictionary encoding, i.e. 01=
60 00 00 00 00 40,02=3a 40.
Secondly, the coding rule of Run- Length Coding algorithm is:Number of repetition+character, such as:Text-string:A A A B B
B C C C C D D D D are then after compressed encoding:3A 3B 4C 4D.Then, the heading of IPv6 to be compressed in table 1
8 bytes " 60 00 00 00 00 40 3a 40 ", through Run- Length Coding compression algorithm coding after be:60 4 00 40 3a 40.
Finally, Huffman encoding algorithm is that new coded sequence is generated to compression section, is preserved by newly encoded sequence,
Huffman Hash table can uniformly be generated to all messages of entire file, it is better, but can also increase compression reconciliation simultaneously
The complexity of compression processing flow, 8 byte " 60 00 00 00 00 40 3a of the heading of IPv6 to be compressed in table 1
40 ", be after Huffman encoding compression algorithm coding:10 000 11 110 111, totally 13.
60 00 00 00 00 40 3a 40 | 20 01 0d a8 20 04 10 00 |
02 02 01 16 01 60 00 42 | 20 01 0d a8 20 04 10 00 |
02 02 01 16 01 60 00 41 | 81 00 6d 5a 00 01 00 02 |
a7 fe ce 12 e3 45 08 00 | 08 09 0a 0b 0c 0d 0e 0f |
10 11 12 13 14 15 16 17 | 18 19 1a 1b 1c 1d 1e 1f |
20 21 22 23 24 25 26 27 | 28 29 2a 2b 2c 2d 2e 2f |
Table 1
In step 111, compressed data is stored in the compressed data portion of default heading.
Specifically, default heading includes heading and compressed data portion, wherein compressed data portion is for storing IP
Except the compressed data of information that address is external in the heading of message, compressed data is stored in the compression of default heading
After data portion, just obtain completely presetting heading.
In step 112, the heading of IP packet is replaced with into default heading.
Specifically, terminal device replaces the message of the IP packet received with the default heading for occupying the empty very little of storage
Head significantly reduces the memory space of heading occupancy during stored messages, saves more memory spaces to preserve more
More IP packet, wherein the heading of IP packet and the correspondence of default heading are as shown in Figure 5.
In step 113, storage replaces with the IP packet after default heading.
Specifically, the IP packet after replacing with default heading is stored in corresponding memory space by terminal device, just
In follow-up research and development and maintenance personnel when carrying out case study with positioning, corresponding IP packet can be got in time.
Compared with prior art, in the present embodiment, terminal device obtains the report of IP packet when receiving IP packet
Literary type, subsequently fast and accurately to search index value in appropriate address list according to type of message;Judge type of message
Whether it is IPv4, if type of message is IPv4, inquires the address of the heading of IP packet in IPv4 address lists
Otherwise index value inquires the address of the heading of IP packet to the index value in IPv6 address lists, is existed according to type of message
The index value of address pair is searched in the address list to match, it is ensured that the accuracy of index value;Judge the heading of IP packet
Address to whether in IPv4 address lists, if there are addresses pair in IPv4 address lists, obtaining address in IPv4
Otherwise index value in address list by address to being added in IPv4 address lists, and obtains address in IPv4 address columns
Index value in table, not only ensure that the accuracy of query result, and realize the continuous renewal of address list;By what is got
The type identifier of index value and the type of message of instruction IP packet is stored in the heading of default heading, by IP packet
Except the external compressed data of information in address are stored in the compressed data portion of default heading in heading, default report is used in combination
Literary head replaces the heading of IP packet, and the memory space that the heading of IP packet occupies is preferably minimized as far as possible, greatly reduces
The memory space that IP packet occupies, to saving more memory spaces to preserve more IP packets, convenient for subsequently grinding
When sending out and be maintained in progress positioning problems, useful information as much as possible can be extracted according to more IP packets, to real
Now accurate case study and positioning.
Second embodiment of the invention is related to a kind of processing method of IP packet.Second embodiment is in first embodiment
On the basis of be further improved, mainly the improvement is that:Further include that will preset in second embodiment of the invention
Heading reverts to the detailed process of the heading of IP packet, as shown in Figure 6.
In step 601, the type of message of IP packet is obtained.
In step 602, judge whether type of message is IPv4, if so, 603 are thened follow the steps, it is no to then follow the steps
604。
In step 603, the address of the heading of IP packet is judged to whether in IPv4 address lists, if it is,
Step 605 is executed, it is no to then follow the steps 606.
In step 603, the address of the heading of IP packet is judged to whether in IPv6 address lists, if it is,
Step 607 is executed, it is no to then follow the steps 608.
In step 605, the address is obtained to the index value in IPv4 address lists.
In step 606, by the address to being added in IPv4 address lists, and the index value of the address pair is obtained.
In step 607, the address is obtained to the index value in IPv6 address lists.
In step 608, by the address to being added in IPv6 address lists, and the index value of the address pair is obtained.
In step 609, the index value of the type identifier of the type of message of IP packet and address pair is stored in default
The heading of heading.
In step 610, the external information in address will be removed in the heading of IP packet to compress.
In step 611, compressed data is stored in the compressed data portion of default heading.
In step 612, the heading of IP packet is replaced with into default heading.
In step 613, storage replaces with the IP packet after default heading.
In step 614, judge to replace with whether the IP packet after default heading is extracted, if it is, executing step
Rapid 615, otherwise return to step 614.
Specifically, terminal device judges to replace with whether the IP packet after default heading is extracted, if replaced with
IP packet after default heading is extracted, and thens follow the steps 615, otherwise return to step 614, lasting to judge to replace with default report
Whether the IP packet after literary head is extracted.
In step 615, default heading is reverted to the heading of IP packet.
Specifically, terminal device obtains the type identifier for being stored in heading, and according to type identifier, obtain
Corresponding address list in corresponding address list, inquires corresponding address further according to the index value for being stored in heading
It is right, while compressed data portion is decompressed, obtaining decompression data will decompress finally according to the format of the heading of IP packet
Data and address pair, revert to the heading of IP packet, wherein and above-mentioned recovery process can carry out on this terminal device,
The IP packet after default heading, IPv4 address lists, IPv6 can will be first replaced with according to the needs of research and development and maintenance personnel
Address list and other relevant documents import other terminal devices successively, carry out conversion processing further according to the above process, obtain IP
The heading of message.
In present embodiment, default heading is reverted to the heading of IP packet so that research and development and maintenance personnel can
Accurate case study and positioning are intuitively carried out according to the heading of IP packet.
The step of various methods divide above, be intended merely to describe it is clear, when realization can be merged into a step or
Certain steps are split, multiple steps are decomposed into, as long as including identical logical relation, all in the protection domain of this patent
It is interior;To either adding inessential modification in algorithm in flow or introducing inessential design, but its algorithm is not changed
Core design with flow is all in the protection domain of the patent.
Third embodiment of the invention is related to a kind of processing unit of IP packet, as shown in fig. 7, comprises:Acquisition module 71,
Processing module 72 and memory module 73, wherein acquisition module 71 specifically includes:Type of message confirms that submodule 711, type judge
Submodule 712, first inquires submodule 713 and second and inquires submodule 714, and the first inquiry submodule 713 further comprises:The
One address obtains subelement 7132 and second to judgment sub-unit 7131, first and obtains subelement 7133, the second inquiry submodule
714 further comprise:Second address obtains subelement 7142 and the 4th to judgment sub-unit 7141, third and obtains subelement
7143。
Acquisition module 71, the heading of type of message and IP packet for when receiving IP packet, obtaining IP packet
Address to the index value in corresponding address list, address is to including source address and destination address.
Type of message confirms submodule 711, is used for the version number of the heading according to IP packet, confirms the message of IP packet
Type.
Type judging submodule 712, for judging whether type of message is IPv4.
First inquiry submodule 713, for when type of message is IPv4, inquire the address of the heading of IP packet to
Index value in IPv4 address lists.
First address whether there is the address pair to judgment sub-unit 7131, for judging in IPv4 address lists.
First obtains subelement 7132, for there are the address clock synchronization, obtain in the IPv4 address lists address to
Index value in IPv4 address lists.
Second obtains subelement 7133, not there is no the address clock synchronization in IPv4 address lists for working as, by the address to adding
It is added in IPv4 address lists, and obtains the address to the index value in IPv4 address lists.
Second inquiry submodule 714, for as the non-IPv4 of type of message, inquire the address of the heading of IP packet to
Index value in IPv6 address lists.
Second address whether there is the address pair to judgment sub-unit 7141, for judging in IPv6 address lists.
Third obtains subelement 7142, for there are the address clock synchronization, obtain in the IPv6 address lists address to
Index value in IPv6 address lists.
4th obtains subelement 7143, not there is no the address clock synchronization in IPv6 address lists for working as, by the address to adding
It is added in IPv6 address lists, and obtains the address to the index value in IPv6 address lists.
Processing module 72, for the heading of IP packet to be replaced with default heading, default heading includes message head
Portion and compressed data portion, wherein heading is used to store the type mark of index value and the type of message for being used to indicate IP packet
Know symbol;Compressed data portion is in the heading of IP packet except the information warp that address is external for storing compressed data, compressed data
Compressed data.
Memory module 73, for storing the IP packet after replacing with default heading.
It is not difficult to find that present embodiment is system embodiment corresponding with first embodiment, present embodiment can be with
First embodiment is worked in coordination implementation.The relevant technical details mentioned in first embodiment still have in the present embodiment
Effect, in order to reduce repetition, which is not described herein again.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable in
In first embodiment.
It is noted that each module involved in present embodiment is logic module, and in practical applications, one
A logic unit can be a physical unit, can also be a part for a physical unit, can also be with multiple physics lists
The combination of member is realized.In addition, in order to protrude the innovative part of the present invention, it will not be with solution institute of the present invention in present embodiment
The technical issues of proposition, the less close unit of relationship introduced, but this does not indicate that there is no other single in present embodiment
Member.
Four embodiment of the invention is related to a kind of processing unit of IP packet.4th embodiment is in third embodiment
On the basis of be further improved, mainly the improvement is that:Include not only obtaining in four embodiment of the invention
Module 71, processing module 72 and memory module 73, wherein acquisition module 71 specifically includes:Type of message confirmation submodule 711,
Type judging submodule 712, first inquires submodule 713 and second and inquires submodule 714, the first inquiry submodule 713 into one
Step includes:First address obtains subelement 7132 and second to judgment sub-unit 7131, first and obtains subelement 7133, and second looks into
Submodule 714 is ask to further comprise:Second address obtains subelement 7142 and the 4th to judgment sub-unit 7141, third and obtains son
Unit 7143, further includes judgment module 74 and recovery module 75, as shown in Figure 8.
Acquisition module 71, the heading of type of message and IP packet for when receiving IP packet, obtaining IP packet
Address to the index value in corresponding address list, address is to including source address and destination address.
Type of message confirms submodule 711, is used for the version number of the heading according to IP packet, confirms the message of IP packet
Type.
Type judging submodule 712, for judging whether type of message is IPv4.
First inquiry submodule 713, for when type of message is IPv4, inquire the address of the heading of IP packet to
Index value in IPv4 address lists.
First address whether there is the address pair to judgment sub-unit 7131, for judging in IPv4 address lists.
First obtains subelement 7132, for there are the address clock synchronization, obtain in the IPv4 address lists address to
Index value in IPv4 address lists.
Second obtains subelement 7133, not there is no the address clock synchronization in IPv4 address lists for working as, by the address to adding
It is added in IPv4 address lists, and obtains the address to the index value in IPv4 address lists.
Second inquiry submodule 714, for as the non-IPv4 of type of message, inquire the address of the heading of IP packet to
Index value in IPv6 address lists.
Second address whether there is the address pair to judgment sub-unit 7141, for judging in IPv6 address lists.
Third obtains subelement 7142, for there are the address clock synchronization, obtain in the IPv6 address lists address to
Index value in IPv6 address lists.
4th obtains subelement 7143, not there is no the address clock synchronization in IPv6 address lists for working as, by the address to adding
It is added in IPv6 address lists, and obtains the address to the index value in IPv6 address lists.
Processing module 72, for the heading of IP packet to be replaced with default heading, default heading includes message head
Portion and compressed data portion, wherein heading is used to store the type mark of index value and the type of message for being used to indicate IP packet
Know symbol;Compressed data portion is in the heading of IP packet except the information warp that address is external for storing compressed data, compressed data
Compressed data.
Memory module 73, for storing the IP packet after replacing with default heading.
Judgment module 74, for judging to replace with whether the IP packet after default heading is extracted.
When being extracted for the IP packet after replacing with default heading, default heading is restored for recovery module 75
For the heading of IP packet.
Specifically, recovery module 75 obtains the type identifier for being stored in heading, and according to type identifier, obtain
Corresponding address list is taken, further according to the index value for being stored in heading, in corresponding address list, inquiry is correspondingly
Location pair, while compressed data portion is decompressed, obtaining decompression data will decompress finally according to the format of the heading of IP packet
Contracting data and address pair, revert to the heading of IP packet.
Since second embodiment is corresponded with present embodiment, present embodiment can be mutual with second embodiment
Match implementation.The relevant technical details mentioned in second embodiment are still effective in the present embodiment, implement second
The attainable technique effect of institute similarly may be implemented in the present embodiment in mode, no longer superfluous here in order to reduce repetition
It states.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable in second embodiment.
It will be appreciated by those skilled in the art that it is that can pass through to implement the method for the above embodiments
Program is completed to instruct relevant hardware, which is stored in a storage medium, including some instructions are used so that one
A equipment (can be microcontroller, chip etc.) or processor (processor) execute each embodiment the method for the application
All or part of step.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
It will be understood by those skilled in the art that the respective embodiments described above are to realize specific embodiments of the present invention,
And in practical applications, can to it, various changes can be made in the form and details, without departing from the spirit and scope of the present invention.
Claims (12)
1. a kind of processing method of IP packet, which is characterized in that including:
When receiving IP packet, the address of the type of message of the IP packet and the heading of the IP packet is obtained in phase
Index value in the address list answered, described address is to including source address and destination address;
It is stored after the heading of the IP packet is replaced with default heading, the default heading includes heading
With compressed data portion;
Wherein, the heading is used to store the type mark of the index value and the type of message for being used to indicate the IP packet
Know symbol;The compressed data portion is in the heading of the IP packet except described for storing compressed data, the compressed data
The compressed data of the external information in address.
2. the processing method of IP packet according to claim 1, which is characterized in that the type of message include IPv4 with
IPv6, wherein the type identifier of the IPv4 is 1, and the type identifier of the IPv6 is 0.
3. the processing method of IP packet according to claim 2, which is characterized in that the message for obtaining the IP packet
The address of the heading of type and the IP packet specifically includes the index value in corresponding address list:
According to the version number of the heading of the IP packet, the type of message of the IP packet is confirmed;
Judge whether the type of message is IPv4;
If the type of message is IPv4, the address of the heading of the IP packet is inquired in IPv4 address lists
Index value;Otherwise, the address of the heading of the IP packet is inquired to the index value in IPv6 address lists.
4. the processing method of IP packet according to claim 3, which is characterized in that the message of the inquiry IP packet
The address of head specifically includes the index value in IPv4 address lists:
Judge to whether there is described address pair in the IPv4 address lists;
If there are described address pair in the IPv4 address lists, described address is obtained in the IPv4 address lists
Index value;Otherwise, by described address to being added in the IPv4 address lists, and described address is obtained in the IPv4
Index value in address list.
5. the processing method of IP packet head according to claim 2, which is characterized in that removed in the heading of the IP packet
The external information of described address, it is inclined for the version number of heading, header length, service type, total length, identifier, mark, piece
Shifting, life cycle, protocol domain and header check and;
Alternatively, except the external information of described address in the heading of the IP packet, be the version number of heading, transport-type,
Stream label, payload length, next heading and hop count limit.
6. the processing method of IP packet head according to claim 1, which is characterized in that the compressed data is through following
It anticipates a kind of compression algorithm, compressed data is carried out to removing the external information of described address in the heading of the IP packet:
Dictionary algorithm, Run- Length Coding algorithm or Huffman encoding algorithm.
7. the processing method of IP packet according to claim 1, which is characterized in that in the message by the IP packet
Head replaces with stored after default heading after, further include:
Judge to replace with whether the IP packet after default heading is extracted;
If replacing with the IP packet after default heading to be extracted, the default heading is reverted into the IP and is reported
The heading of text.
8. the processing method of IP packet according to claim 7, which is characterized in that described to restore the default heading
For the heading of the IP packet, specifically include:
Obtain the type identifier for being stored in the heading;
According to the type identifier, corresponding address list is obtained;
According to the index value for being stored in the heading corresponding address is inquired in corresponding described address list
It is right;
The compressed data portion is decompressed, decompression data are obtained;
The decompression data and described address pair are reverted into the IP reports according to the format of the heading of the IP packet
The heading of text.
9. a kind of processing unit of IP packet, which is characterized in that including:
Acquisition module, the message of type of message and the IP packet for when receiving IP packet, obtaining the IP packet
The address of head is to the index value in corresponding address list, and described address is to including source address and destination address;
Processing module, for the heading of the IP packet to be replaced with default heading, the default heading includes message
Stem and compressed data portion, wherein the heading is for storing the index value and the report for being used to indicate the IP packet
The type identifier of literary type;The compressed data portion is the IP packet for storing compressed data, the compressed data
Except the compressed data of information that described address is external in heading;
Memory module, for storing the IP packet after replacing with the default heading.
10. the processing unit of IP packet according to claim 9, which is characterized in that the type of message include IPv4 with
IPv6, wherein the type identifier of the IPv4 is 1, and the type identifier of the IPv6 is 0.
11. the processing unit of IP packet according to claim 10, which is characterized in that the acquisition module specifically includes:
Type of message confirms submodule, type judging submodule, the first inquiry submodule and the second inquiry submodule;
The type of message confirms submodule, is used for the version number of the heading according to the IP packet, confirms the IP packet
Type of message;
The type judging submodule, for judging whether the type of message is IPv4;
The first inquiry submodule, for when the type of message is IPv4, inquiring the ground of the heading of the IP packet
Location is to the index value in IPv4 address lists;
The second inquiry submodule, for as the non-IPv4 of the type of message, inquiring the ground of the heading of the IP packet
Location is to the index value in IPv6 address lists.
12. the processing unit of IP packet according to claim 11, which is characterized in that the first inquiry submodule is specific
Including:First address obtains subelement and second to judgment sub-unit, first and obtains subelement;
First address whether there is described address pair to judgment sub-unit, for judging in the IPv4 address lists;
First obtains subelement, for working as in the IPv4 address lists there are described address clock synchronization, obtain described address to
Index value in the IPv4 address lists;
Second obtains subelement, there is no described address clock synchronization for working as in the IPv4 address lists, by described address to adding
It is added in the IPv4 address lists, and obtains described address to the index value in the IPv4 address lists.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710237487.9A CN108696492B (en) | 2017-04-12 | 2017-04-12 | Method and device for processing IP message |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710237487.9A CN108696492B (en) | 2017-04-12 | 2017-04-12 | Method and device for processing IP message |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108696492A true CN108696492A (en) | 2018-10-23 |
CN108696492B CN108696492B (en) | 2020-12-22 |
Family
ID=63843898
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710237487.9A Active CN108696492B (en) | 2017-04-12 | 2017-04-12 | Method and device for processing IP message |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108696492B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110650079A (en) * | 2019-10-18 | 2020-01-03 | 深信服科技股份有限公司 | Information transmission method, device, terminal, system and storage medium |
CN110690943A (en) * | 2019-09-26 | 2020-01-14 | 中兴通讯股份有限公司 | Data encoding method, decoding method, encoding and decoding method, device and storage medium |
CN111031027A (en) * | 2019-12-09 | 2020-04-17 | 广州信天翁信息科技有限公司 | Efficient data transmission method and heterogeneous data transmission layer |
CN111865963A (en) * | 2020-07-16 | 2020-10-30 | 郑州信大捷安信息技术股份有限公司 | IP data packet processing method and system based on IP option |
CN112347377A (en) * | 2020-10-13 | 2021-02-09 | 咪咕视讯科技有限公司 | IP address field searching method, service scheduling method, device and electronic equipment |
CN112532563A (en) * | 2019-09-17 | 2021-03-19 | 华为技术有限公司 | Message sending method and device |
CN114489505A (en) * | 2022-01-21 | 2022-05-13 | 北京安天网络安全技术有限公司 | Data message storage method and device and computer equipment |
CN115150308A (en) * | 2022-07-19 | 2022-10-04 | 天翼云科技有限公司 | Traffic statistical method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050063382A1 (en) * | 1989-06-16 | 2005-03-24 | Fenner Investments, Ltd. | Packet switching node |
WO2006125726A1 (en) * | 2005-05-25 | 2006-11-30 | International Business Machines Corporation | Network system and management method thereof, communication terminal and method for sending packet |
CN101534291A (en) * | 2008-03-13 | 2009-09-16 | 华为技术有限公司 | Method for sending and receiving IP message and device thereof |
CN102811227A (en) * | 2012-08-30 | 2012-12-05 | 重庆大学 | Administration mechanism for standard way access control list (ACL) rule under internet protocol security (IPsec) protocol |
CN103179031A (en) * | 2011-12-23 | 2013-06-26 | 上海博达数据通信有限公司 | Multi-service transmission and processing method based on streaming mode |
CN103179094A (en) * | 2011-12-22 | 2013-06-26 | 中兴通讯股份有限公司 | Sending method, receiving method, sending device and receiving device of Internet Protocol (IP) message headers |
-
2017
- 2017-04-12 CN CN201710237487.9A patent/CN108696492B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050063382A1 (en) * | 1989-06-16 | 2005-03-24 | Fenner Investments, Ltd. | Packet switching node |
WO2006125726A1 (en) * | 2005-05-25 | 2006-11-30 | International Business Machines Corporation | Network system and management method thereof, communication terminal and method for sending packet |
CN101534291A (en) * | 2008-03-13 | 2009-09-16 | 华为技术有限公司 | Method for sending and receiving IP message and device thereof |
CN103179094A (en) * | 2011-12-22 | 2013-06-26 | 中兴通讯股份有限公司 | Sending method, receiving method, sending device and receiving device of Internet Protocol (IP) message headers |
CN103179031A (en) * | 2011-12-23 | 2013-06-26 | 上海博达数据通信有限公司 | Multi-service transmission and processing method based on streaming mode |
CN102811227A (en) * | 2012-08-30 | 2012-12-05 | 重庆大学 | Administration mechanism for standard way access control list (ACL) rule under internet protocol security (IPsec) protocol |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112532563A (en) * | 2019-09-17 | 2021-03-19 | 华为技术有限公司 | Message sending method and device |
CN112532563B (en) * | 2019-09-17 | 2022-04-05 | 华为技术有限公司 | Message sending method and device |
CN110690943B (en) * | 2019-09-26 | 2020-06-26 | 中兴通讯股份有限公司 | Data encoding method, decoding method, encoding and decoding method, device and storage medium |
WO2021057326A1 (en) * | 2019-09-26 | 2021-04-01 | 中兴通讯股份有限公司 | Data encoding method, data decoding method, data encoding and decoding method, device, and storage medium |
CN110690943A (en) * | 2019-09-26 | 2020-01-14 | 中兴通讯股份有限公司 | Data encoding method, decoding method, encoding and decoding method, device and storage medium |
CN110650079A (en) * | 2019-10-18 | 2020-01-03 | 深信服科技股份有限公司 | Information transmission method, device, terminal, system and storage medium |
CN111031027A (en) * | 2019-12-09 | 2020-04-17 | 广州信天翁信息科技有限公司 | Efficient data transmission method and heterogeneous data transmission layer |
CN111865963A (en) * | 2020-07-16 | 2020-10-30 | 郑州信大捷安信息技术股份有限公司 | IP data packet processing method and system based on IP option |
CN112347377A (en) * | 2020-10-13 | 2021-02-09 | 咪咕视讯科技有限公司 | IP address field searching method, service scheduling method, device and electronic equipment |
CN112347377B (en) * | 2020-10-13 | 2023-10-20 | 咪咕视讯科技有限公司 | IP address field searching method, service scheduling method, device and electronic equipment |
CN114489505A (en) * | 2022-01-21 | 2022-05-13 | 北京安天网络安全技术有限公司 | Data message storage method and device and computer equipment |
CN114489505B (en) * | 2022-01-21 | 2024-02-27 | 北京安天网络安全技术有限公司 | Data message storage method and device and computer equipment |
CN115150308A (en) * | 2022-07-19 | 2022-10-04 | 天翼云科技有限公司 | Traffic statistical method and device |
CN115150308B (en) * | 2022-07-19 | 2023-10-10 | 天翼云科技有限公司 | Flow statistics method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108696492B (en) | 2020-12-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108696492A (en) | The processing method and device of IP packet | |
CN106170921B (en) | It is related to the source code and decoding method and device of the data of sign compression | |
CN103685589B (en) | Binary coding-based domain name system (DNS) data compression and decompression methods and systems | |
US10547324B2 (en) | Data compression coding method, apparatus therefor, and program therefor | |
US20090016453A1 (en) | Combinatorial coding/decoding for electrical computers and digital data processing systems | |
CN103379136A (en) | Compression method and decompression method of log acquisition data, compression apparatus and decompression apparatus of log acquisition data | |
US7764202B2 (en) | Lossless data compression with separated index values and literal values in output stream | |
US20090201180A1 (en) | Compression for deflate algorithm | |
CN103369593B (en) | A kind of method compressing reconciliation compressed ethernet message and network element device | |
EP2472813A1 (en) | Method and device for user datagram protocol packet compression and decompression | |
US8909813B2 (en) | Efficient processing of compressed communication traffic | |
CN109075798B (en) | Variable size symbol entropy-based data compression | |
CN100546201C (en) | Based on huffman coding and coding/decoding method and equipment to the segmentation of huffman coding tree | |
CN106802927A (en) | A kind of date storage method and querying method | |
CN103036641A (en) | Method and system of data exchange and deserialization method | |
CN113312325B (en) | Track data transmission method, device, equipment and storage medium | |
JP2012124679A (en) | Apparatus and method for decoding encoded data | |
CN107564075A (en) | A kind of dense graph adjacency list compression method | |
CN106027521A (en) | Compression method, decompression method, compression device and decompression device | |
CN101110638A (en) | Chain table encoding method and system | |
EP2731374B1 (en) | Robust header compression processing method and robust header compression processor | |
CN110166318A (en) | A kind of data statistical approach and device | |
US10742783B2 (en) | Data transmitting apparatus, data receiving apparatus and method thereof having encoding or decoding functionalities | |
RU2437148C1 (en) | Method to compress and to restore messages in systems of text information processing, transfer and storage | |
US6466144B1 (en) | Data decompressor for use with a data compressor implemented with limited length character tables and compact string codes |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |