CN104052680B - A kind of IP datagram processing method and processing device - Google Patents

A kind of IP datagram processing method and processing device Download PDF

Info

Publication number
CN104052680B
CN104052680B CN201410265868.4A CN201410265868A CN104052680B CN 104052680 B CN104052680 B CN 104052680B CN 201410265868 A CN201410265868 A CN 201410265868A CN 104052680 B CN104052680 B CN 104052680B
Authority
CN
China
Prior art keywords
datagram
header information
data flow
result
segmentation markers
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
Application number
CN201410265868.4A
Other languages
Chinese (zh)
Other versions
CN104052680A (en
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.)
Zhuhai Seal Interest Technology Co Ltd
Original Assignee
Zhuhai Juntian Electronic Technology 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 Zhuhai Juntian Electronic Technology Co Ltd filed Critical Zhuhai Juntian Electronic Technology Co Ltd
Priority to CN201410265868.4A priority Critical patent/CN104052680B/en
Publication of CN104052680A publication Critical patent/CN104052680A/en
Application granted granted Critical
Publication of CN104052680B publication Critical patent/CN104052680B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the invention discloses a kind of IP datagram processing method and processing device.Wherein, this method includes receiving the IP datagram that sender sends;According to the header information of the IP datagram, the IP datagram is forwarded.Implement the embodiment of the present invention, the problem of network is obstructed can be avoided, network connectivity efficiency is improved.Further, when MTU is more than the size of the IP datagram, the attribute field then checked in the IP datagram header information, according to the different value of segmentation markers in identification field, and the header information for the IP datagram for belonging to same data flow with the IP datagram that is stored with preset tables of data, directly it can be forwarded according to the information of a upper IP datagram for same data flow, so as to improve network data transmission efficiency.

Description

A kind of IP datagram processing method and processing device
Technical field
The present invention relates to communication technical field, and in particular to a kind of IP datagram processing method and processing device.
Background technology
At present, such as campus dormitory, family place, possess many mobile devices such as smart mobile phone, palm PC, notes The equipment of the accessible network such as sheet, e-book, how to realize the connection between these equipment is urgent problem to be solved.
In the prior art, the network share service such as carried more than notebook computer using operating system, passes through wired or nothing The mode of line sets up network connection, multiple devices is constituted a LAN, but open and lose when the network share mechanism of system When losing, or when receiving the datagram that other equipment is sent, do not carry out address conversion and be just sent to far by the network port Server is held, so as to cause network service unavailable;Or when receiving the excessive data frame of sender's transmission, it is impossible in time Processing, so as to reduce network connectivity efficiency and data transmission efficiency.
The content of the invention
Technical problem to be solved of the embodiment of the present invention is to provide a kind of IP datagram processing method and processing device, for carrying High network connectivity efficiency, and improve data transmission efficiency.
The embodiment of the present invention provides a kind of IP datagram processing method, including:
Receive the IP datagram that sender sends;
According to the header information of the IP datagram, the IP datagram is forwarded.
Wherein, after the IP datagram for receiving sender's transmission, and the header according to the IP datagram Information, is forwarded before the IP datagram, methods described also includes:
Detect whether the MTU MTU that NIC is indicated is less than the size of the IP datagram, if detecting As a result it is yes, then abandons the IP datagram, and encapsulate an Internet Control Message Protocol ICMP datagram;
Send the ICMP data offer sender so that described sender according to the ICMP datagrams to the IP numbers It is segmented according to report and sends the IP datagram after segmentation.
Wherein, methods described also includes:
If testing result is no, triggering performs the header information according to the IP datagram, forwards the IP numbers The step of according to report.
Wherein, attribute field includes segmentation markers in the header information of the IP datagram, wherein, the segmentation markers are used In indicating whether that the IP datagram can be segmented, when the segmentation markers are the first value, the IP datagram is point Segment data report;When the segmentation markers are second value, then the IP datagram is not segment data report.
As a kind of alternatively embodiment, the header information according to the IP datagram forwards the IP data Report, including:
The attribute field checked in the IP datagram header information;
If the segmentation markers that the result checked is attribute field are second value, according to the header of the IP datagram Information, sends the IP datagram.
Wherein, methods described also includes:
If the segmentation markers that the result checked is attribute field are the first value, inquire about in preset tables of data whether Be stored with the header information of the IP datagram for belonging to same data flow with the IP datagram;
If the Query Result is no, the header information of the IP datagram is stored into the preset tables of data, And according to the header information of the IP datagram, send the IP datagram.
Wherein, methods described also includes:
If the Query Result is yes, according to the IP numbers for belonging to same data flow with the IP datagram of the storage According to the header information of report, the IP datagram is sent.
As another alternatively embodiment, methods described also includes:
If the segmentation markers that the result checked is the attribute field are the first value, the IP datagram is stored Into caching;
According to the header information of the IP datagram, whether it is stored with and belongs to the IP datagram in the inquiry caching All IP datagrams of same data flow;
If so, then according to the header information of the IP datagram, sending and belonging to same data flow with the IP datagram All IP datagrams.
Wherein, the header information according to the IP datagram, sends and belongs to same data flow with the IP datagram All IP datagrams, including:
The described and IP datagram is belonged to same data flow by the offset in the IP datagram header information All IP datagrams be reassembled as an IP datagram;
According to the header information of the IP datagram, the IP datagram of the restructuring is sent.
Wherein, the header information according to the IP datagram, sends the IP datagram, including:
Change the header information of the IP datagram;
The recipient that the header information that the IP datagram is sent into the modification is indicated.
Correspondingly, the embodiment of the present invention also provides a kind of IP datagram processing unit, it is characterised in that including:
Receiving module, the IP datagram for receiving sender's transmission;
Forwarding module, for the header information according to the IP datagram, forwards the IP datagram.
Wherein, described device also includes:
Detection module, for detecting whether the MTU MTU that NIC is indicated is less than the IP datagram Size;
First processing module, if the testing result for the detection unit is is, abandons the IP datagram, and seal Fill an Internet Control Message Protocol ICMP datagram;
Sending module, sender is offered so that described sender is according to the ICMP data for sending the ICMP data Report is segmented to the IP datagram and sends the IP datagram after segmentation.
Wherein, described device also includes:
Second processing module, if the testing result for the detection module is no, triggers the retransmission unit and performs According to the header information of the IP datagram, the step of forwarding the IP datagram.
Wherein, attribute field includes segmentation markers in the header information of the IP datagram, wherein, the segmentation markers are used In indicating whether that the IP datagram can be segmented, when the segmentation markers are the first value, the IP datagram is point Segment data report;When the segmentation markers are second value, then the IP datagram is not segment data report.
Wherein, the forwarding module, including:
Unit is checked, for checking the attribute field in the IP datagram header information;
First transmitting element, if being second for the segmentation markers that the result for checking that unit is checked is attribute field Value, then according to the header information of the IP datagram, send the IP datagram.
As a kind of alternatively embodiment, the forwarding module also includes:
First query unit, if being first for the segmentation markers that the result for checking that unit is checked is attribute field Value, then inquire about in preset tables of data the header for the IP datagram for belonging to same data flow with the IP datagram that whether is stored with Information;
First memory cell, if being no for the result that first query unit is inquired about, by the IP datagram Header information is stored into the preset tables of data;
Second transmitting element, for the header information according to the IP datagram, sends the IP datagram.
Wherein, the forwarding module also includes:
3rd transmitting element, if being yes for the result that first query unit is inquired about, according to being stored and institute The header information that IP datagram belongs to the IP datagram of same data flow is stated, the IP datagram is sent.
As another alternatively embodiment, the forwarding module also includes:
Second memory cell, if being for the segmentation markers that the result for checking that unit is checked is the attribute field One value, then by IP datagram storage into caching;
Whether the second query unit, for the header information according to the IP datagram, inquire about and be stored with the caching Belong to all IP datagrams of same data flow with the IP datagram;
4th transmitting element, if the Query Result for second query unit is yes, according to the IP datagram Header information, send and belong to all IP datagrams of same data flow with the IP datagram.
Wherein, the 4th transmitting element, including:
Subelement is recombinated, will the described and IP datagram for the offset in the IP datagram header information All IP datagrams for belonging to same data flow are reassembled as an IP datagram;
First transmission sub-unit, for the header information according to the IP datagram, sends the IP datagram of the restructuring.
Wherein, first transmitting element, including:
Change subelement, the header information for changing the IP datagram;
Second transmission sub-unit, for the IP datagram to be sent to the reception that the header information of the modification is indicated Side.
The embodiment of the present invention receives the IP datagram of sender's transmission first, is then believed according to the header of the IP datagram Breath, forwards the IP datagram, with the prior art, sending IP datagram mode using grid shared service and comparing, carry High network connectivity efficiency and data transmission efficiency.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to institute in embodiment The accompanying drawing needed to use is briefly described, it should be apparent that, drawings in the following description are only some implementations of the present invention Example, for those of ordinary skill in the art, on the premise of not paying creative work, can also be obtained according to these accompanying drawings Obtain other accompanying drawings.
Fig. 1 is a kind of schematic flow sheet of IP datagram processing method disclosed in the embodiment of the present invention;
Fig. 2 is the schematic flow sheet of another IP datagram processing method disclosed in the embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of ICMP bags form disclosed in the embodiment of the present invention;
The schematic flow sheet of another IP datagram processing method disclosed in Fig. 4 embodiment of the present invention;
Fig. 5 is a kind of structural representation of IP datagram processing unit disclosed in the embodiment of the present invention;
Fig. 6 is the structural representation of another IP datagram processing unit disclosed in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made Embodiment, belongs to the scope of protection of the invention.
A kind of IP datagram processing method and processing device is provided in the embodiment of the present invention, network connectivity efficiency can be improved, and Improve data transmission efficiency.It is described in detail individually below.
Embodiment one:
Fig. 1 is referred to, Fig. 1 is a kind of schematic flow sheet of IP datagram processing method provided in an embodiment of the present invention, such as Shown in Fig. 1, this method comprises the following steps:
S101, terminal receives the IP datagram that sender sends.
S102, terminal forwards IP datagram according to the header information of IP datagram.
Specifically, terminal is according to the header information of IP datagram, and the process of forwarding IP datagram is IP first to receiving Datagram is modified, and then by instruction of the amended IP datagram according to its header information, is sent.
Further, after the IP datagram of sender's transmission is received, terminal detection NIC is indicated most Whether big transmission unit MTU is less than the size of the IP datagram, if testing result is yes, abandons the IP datagram, and An Internet Control Message Protocol ICMP datagram is encapsulated, the ICMP data is sent and offers sender so that the transmission Root is segmented to the IP datagram according to the ICMP datagrams and sends the IP datagram after segmentation;If testing result is No, then triggering performs the header information according to the IP datagram, the step of forwarding the IP datagram.
Wherein, attribute field includes segmentation markers in the header information of the IP datagram, wherein, the segmentation markers are used In indicating whether that the IP datagram can be segmented, when the segmentation markers are the first value, the IP datagram is point Segment data report;When the segmentation markers are second value, then the IP datagram is not segment data report.
Specifically, terminal is further comprising the steps of when performing step S102:
The attribute field checked in the IP datagram header information;
If the segmentation markers that the result checked is attribute field are second value, according to the header of the IP datagram Information, sends the IP datagram;
As a kind of alternatively embodiment, if the segmentation markers that the result checked is attribute field are the first value, The header for then inquiring about in preset tables of data the IP datagram for belonging to same data flow with the IP datagram that whether is stored with is believed Breath, if the Query Result is no, stores the header information of the IP datagram into the preset tables of data, and according to The header information of the IP datagram, sends the IP datagram;If the Query Result is yes, according to the storage with The IP datagram belongs to the header information of the IP datagram of same data flow, sends the IP datagram;
As another alternatively embodiment, if the segmentation markers that the result checked is the attribute field are One value, then by IP datagram storage into caching, according to the header information of the IP datagram, inquiring about in the caching is No be stored with belongs to all IP datagrams of same data flow with the IP datagram, if so, then according to the IP datagram Header information, sends all IP datagrams for belonging to same data flow with the IP datagram.
Wherein, the header information according to the IP datagram, sends and belongs to same data flow with the IP datagram All IP datagrams, including:Offset in the IP datagram header information described will belong to the IP datagram An IP datagram is reassembled as in all IP datagrams of same data flow;According to the header information of the IP datagram, send The IP datagram of the restructuring.
The embodiment of the present invention receives the IP datagram of sender's transmission first, is then believed according to the header of the IP datagram Breath, forwards the IP datagram, with the prior art, sending IP datagram mode using grid shared service and comparing, carry High network connectivity efficiency and data transmission efficiency.
Embodiment two:
Fig. 2 is referred to, Fig. 2 is the schematic flow sheet of another IP datagram processing method disclosed in the embodiment of the present invention, It is that further optimization is obtained for method described in Fig. 1, specifically, as shown in Fig. 2 this method comprises the following steps:
S201, terminal receives the IP datagram that sender sends;
Whether S202, the MTU MTU that terminal detection NIC is indicated is less than the big of the IP datagram It is small;
Wherein, MTU (Maximum Transmission Unit, MTU) refers on a certain layer of communication protocol The maximum data report size (in units of byte) that face can pass through, the parameter is relevant with communication interface, such as NIC, string Mouthful etc..
It is due to a data when station terminal has substantial amounts of data to be sent to another main frame to perform step S202 The a series of IP datagram transmission of Shi Zuowei, the IP datagram is preferably provided with the path from source point to point of destination need not The full-size of burst, if having perform following steps S203 and S204 so that avoid perform IP datagram processing terminal without Method realizes that Internet Control Message Protocol (Internet Control Message Protocol, ICMP) unloading causes net The problem of network is obstructed.
S203, if terminal detects that MTU is less than the size of the IP datagram, abandons the IP datagram, and seal Fill an Internet Control Message Protocol ICMP datagram;
S204, terminal sends the ICMP data and offers sender so that described sender is according to the ICMP datagrams pair The IP datagram is segmented and sends the IP datagram after segmentation;
Specifically, Fig. 3 is referred to, Fig. 3 is a kind of preferred ICMP bags, and its particular content includes type, code, inspection With, unused (being necessary for 0), in MTU, IP stem (including option) of next stop network and original ip datagram data preceding 8 Byte, wherein, first five items content accounts for 8 bytes altogether.
S205, if terminal detects that MTU is more than the size of the IP datagram, checks the IP datagram header letter Attribute field in breath;
If terminal detects that MTU is more than the size of the IP datagram, check in the IP datagram header information Attribute field, header information is modified, then forward, specifically refers to following steps S206 to S209.
S206, if the segmentation markers that the result checked is attribute field are second value, terminal is according to the IP numbers According to the header information of report, the IP datagram is sent;
S207, if the segmentation markers that the result checked is attribute field are the first value, the preset number of terminal inquiry The header information for the IP datagram for belonging to same data flow with the IP datagram according to whether being stored with table;
S208, if the Query Result is no, the header information of IP datagram described in terminal storage is to described preset In tables of data, and according to the header information of the IP datagram, the IP datagram is sent;
S209, if the Query Result is yes, terminal belongs to same number according to the storage with the IP datagram According to the header information of the IP datagram of stream, the IP datagram is sent.
For example, identification field accounts for 3 in the header information of IP datagram, the 1st is used as reservation;Second (DF) is to divide Segment mark position, if the segmentation markers take second value (as being 1), represents that the IP datagram is not segmented, directly can basis Header information, after being modified to header information, is forwarded, if the segmentation markers take the first value (as being 0), represents the IP Datagram is segment data report;3rd (More fragments) more segmentations, for representing that the IP datagram is data flow In which be segmented, if value is that 1 can represent that data flow is not complete, subsequently also have segment data report, if value is 0, then it represents that this is Unique segmentation, for example the IP datagram is not segment data report, is not segmented.In a word, second (DF) is segmentation markers Position is different, and the processing of corresponding IP datagram is also different, specific such as step S206 to S209 processing.
In embodiments of the present invention, terminal is received after the IP datagram of sender's transmission, by detecting NIC Whether the MTU MTU of instruction is less than the size of the IP datagram, it is determined that the next step to the IP datagram is handled, So as to avoid the problem of network is obstructed, network connectivity efficiency is improved.Further, when sizes of the MTU more than the IP datagram, The attribute field then checked in the IP datagram header information, when segmentation markers are the first value in identification field, and it is preset Tables of data in be stored with the header information of the IP datagram for belonging to same data flow with the IP datagram, can be directly according to same The information of a upper IP datagram for data flow is forwarded, so as to improve network data transmission efficiency.
Embodiment three:
Fig. 4 is referred to, Fig. 4 is the schematic flow sheet of another IP datagram processing method disclosed in the embodiment of the present invention, Method described in Fig. 4 is to optimize what is obtained on the basis of the embodiment described in Fig. 1, as shown in figure 4, this method include with Lower step:
S301, terminal receives the IP datagram that sender sends;
Whether S302, the MTU MTU that terminal detection NIC is indicated is less than the big of the IP datagram It is small;
S303, if testing result is yes, terminal abandons the IP datagram, and encapsulates an Internet control messages association Discuss ICMP datagrams;
S304, terminal sends the ICMP data and offers sender so that described sender is according to the ICMP datagrams pair The IP datagram is segmented and sends the IP datagram after segmentation;
S305, if testing result is no, the attribute field that terminal is checked in the IP datagram header information;
Attribute field includes segmentation markers in the header information of the IP datagram, wherein, the segmentation markers are used to refer to Whether can to the IP datagram be segmented, when the segmentation markers are the first value, the IP datagram is segments if showing According to report;When the segmentation markers are second value, then the IP datagram is not segment data report.
S306, if the segmentation markers that the result checked is attribute field are second value, terminal is according to the IP numbers According to the header information of report, the IP datagram is sent;
S307, if the segmentation markers that the result checked is the attribute field are the first value, terminal is by the IP Datagram is stored into caching;
Whether S308, terminal is inquired about and is stored with and the IP in the caching according to the header information of the IP datagram Datagram belongs to all IP datagrams of same data flow;
S309, if so, then terminal sends according to the header information of the IP datagram and belongs to same with the IP datagram All IP datagrams of data flow.
Wherein, the terminal sends according to the header information of the IP datagram and belongs to same number with the IP datagram It is specially according to all IP datagrams of stream:Offset of the terminal in the IP datagram header information will the described and IP All IP datagrams that datagram belongs to same data flow are reassembled as an IP datagram;Believed according to the header of the IP datagram Breath, sends the IP datagram of the restructuring.
Specifically, when segmentation markers are the first value, then when from source address to destination address, due to network delay or The relation of different transmission path, when reaching destination host, during such as this terminal, the IP datagram of these segmentations is not always orderly Arrangement, it is possible in unordered state, therefore perform the terminal of IP datagram and need to belong to same with the IP datagram All IP datagrams of data flow are all stored in caching, and the offset further according to all IP datagrams in the data flow (should Offset bit is in the header information of IP datagram) all IP datagrams are reassembled as an IP datagram, the wherein restructuring IP datagram includes all IP datagrams for belonging to same data flow.
In the embodiment of the present invention, terminal-pair segmentation markers are that the processing mode and foregoing invention of the IP datagram of the first value are real The difference in example is applied, two kinds of processing modes can exist in the terminal for performing IP datagram processing simultaneously, by terminal according to not Different processing modes are selected with setting or information.
Compared with foregoing invention embodiment, the embodiment of the present invention, which can equally be realized, avoids the problem of network is obstructed, improves Network connectivity efficiency and network data transmission efficiency.Further, the embodiment of the present invention with IP datagram by that will belong to same All IP datagrams of one data flow all arrive after caching by storage, then recombinated, forwarded, and alleviates the processing load of terminal.
Example IV:
Fig. 5 is referred to, Fig. 5 is a kind of structural representation of IP datagram processing unit publicly of the embodiment of the present invention, such as Shown in Fig. 5, the device is included with lower module and unit.
Receiving module 1, the IP datagram for receiving sender's transmission;
Forwarding module 2, for the header information of the IP datagram received according to the receiving module 1, forwards the IP numbers According to report.
Wherein, described device also include detection module, for detect NIC indicate MTU MTU be The no size less than the IP datagram;First processing module, if the testing result for the detection module is is, is abandoned The IP datagram, and encapsulate an Internet Control Message Protocol ICMP datagram;Sending module, it is described for sending ICMP data offer sender so that described sender carries out being segmented concurrently according to the ICMP datagrams to the IP datagram Send the IP datagram after segmentation;Second processing module, if the testing result for the detection module is no, triggering is described to be turned Bill member performs the header information according to the IP datagram, the step of forwarding the IP datagram.
Wherein, attribute field includes segmentation markers in the header information of the IP datagram, wherein, the segmentation markers are used In indicating whether that the IP datagram can be segmented, when the segmentation markers are the first value, the IP datagram is point Segment data report;When the segmentation markers are second value, then the IP datagram is not segment data report.
As a kind of alternatively embodiment, the forwarding module also includes:
First query unit, if being first for the segmentation markers that the result for checking that unit is checked is attribute field Value, then inquire about in preset tables of data the header for the IP datagram for belonging to same data flow with the IP datagram that whether is stored with Information;
First memory cell, if being no for the result that first query unit is inquired about, by the IP datagram Header information is stored into the preset tables of data;
Second transmitting element, for the header information according to the IP datagram, sends the IP datagram.
3rd transmitting element, if being yes for the result that first query unit is inquired about, according to being stored and institute The header information that IP datagram belongs to the IP datagram of same data flow is stated, the IP datagram is sent.
As another alternatively embodiment, the forwarding module also includes:Second memory cell, if being looked into for described See that the segmentation markers that result that unit is checked is the attribute field are the first value, then by IP datagram storage to caching In;Second query unit, for the header information according to the IP datagram, inquire about whether be stored with the caching with it is described IP datagram belongs to all IP datagrams of same data flow;4th transmitting element, if looking into for second query unit It is yes to ask result, then according to the header information of the IP datagram, sends the institute for belonging to same data flow with the IP datagram There is IP datagram.Wherein, the 4th transmitting element, including:Subelement is recombinated, for according to the IP datagram header information In offset all IP datagrams for belonging to same data flow with the IP datagram are reassembled as an IP datagram; First transmission sub-unit, for the header information according to the IP datagram, sends the IP datagram of the restructuring.
Wherein, first transmitting element, including:Change subelement, the header information for changing the IP datagram; Second transmission sub-unit, for the IP datagram to be sent to the recipient that the header information of the modification is indicated.
IP datagram processing unit described in the embodiment of the present invention can receive the IP datagram of sender's transmission first, then According to the header information of the IP datagram, the IP datagram is forwarded, and in the prior art, using grid shared service Send IP datagram mode to compare, terminal can improve network connectivity efficiency and data transmission efficiency.
Fig. 6 is referred to, Fig. 6 is the structural representation of another IP datagram processing unit disclosed in the embodiment of the present invention, Device shown in Fig. 6 is that further optimization is obtained Fig. 5 shown devices, specifically, as shown in fig. 6, the device includes following mould Block and unit.
Receiving module 1, the IP datagram for receiving sender's transmission.
Forwarding module 2, for the header information of the IP datagram received according to the receiving module, forwards the IP data Report.
Detection module 3, for detecting whether the MTU MTU that NIC is indicated is less than the IP datagram Size.
Wherein, MTU (Maximum Transmission Unit, MTU) refers on a certain layer of communication protocol The maximum data report size (in units of byte) that face can pass through, the parameter is relevant with communication interface, such as NIC, string Mouthful etc..
Due to when a station terminal has substantial amounts of data to be sent to another main frame, as a series of during data IP datagram transmission, the IP datagram is preferably provided with the maximum chi that need not be segmented on the path from source point to point of destination It is very little, if the testing result of detection module 3 is yes, it can avoid performing by first processing module 4 and sending module 5 as described below The terminal of IP datagram processing can not realize Internet Control Message Protocol (Internet Control Message Protocol, ICMP) unloading cause the problem of network is obstructed.
First processing module 4, if the testing result for the detection module is is, abandons the IP datagram, and Encapsulate an Internet Control Message Protocol ICMP datagram;
Sending module 5, sender is offered so that described sender is according to the ICMP numbers for sending the ICMP data The IP datagram is segmented according to report and the IP datagram after segmentation is sent.
Specifically, Fig. 3 is referred to, Fig. 3 is a kind of preferred ICMP bags, and its particular content includes type, code, inspection With, unused (being necessary for 0), in MTU, IP stem (including option) of next stop network and original ip datagram data preceding 8 Byte, wherein, first five items content accounts for 8 bytes altogether.
In addition, described device also includes:
Second processing module 6, if the testing result for the detection module is no, triggers the retransmission unit and performs According to the header information of the IP datagram, the step of forwarding the IP datagram.
Wherein, attribute field includes segmentation markers in the header information of the IP datagram, wherein, the segmentation markers are used In indicating whether that the IP datagram can be segmented, when the segmentation markers are the first value, the IP datagram is point Segment data report;When the segmentation markers are second value, then the IP datagram is not segment data report.
For example, identification field accounts for 3 in the header information of IP datagram, the 1st is used as reservation;Second (DF) is to divide Segment mark position, if the segmentation markers take second value (as being 1), represents that the IP datagram is not segmented, directly can basis Header information, after being modified to header information, is forwarded, if the segmentation markers take the first value (as being 0), represents the IP Datagram is segment data report;3rd (More fragments) more segmentations, for representing that the IP datagram is data flow In which be segmented, if value is that 1 can represent that data flow is not complete, subsequently also have segment data report, if value is 0, then it represents that this is Unique segmentation, for example the IP datagram is not segment data report, is not segmented.In a word, second (DF) is segmentation markers Position is different, and the processing of corresponding IP datagram is also different, specifically as the unit or subelement included by forwarding module 2 as described below Handled.
As a kind of alternatively embodiment, the forwarding module 2, including:
Unit 21 is checked, for checking the attribute field in the IP datagram header information;
First transmitting element 22, if being second for the segmentation markers that the result for checking that unit is checked is attribute field Value, then according to the header information of the IP datagram, send the IP datagram.
First query unit 23, if being first for the segmentation markers that the result for checking that unit is checked is attribute field Value, then inquire about in preset tables of data the header for the IP datagram for belonging to same data flow with the IP datagram that whether is stored with Information;
First memory cell 24, if being no for the result that first query unit is inquired about, by the IP datagram Header information store into the preset tables of data;
Second transmitting element 25, for the header information according to the IP datagram, sends the IP datagram.
3rd transmitting element 26, if for first query unit inquire about result be it is yes, according to stored with The IP datagram belongs to the header information of the IP datagram of same data flow, sends the IP datagram.
As another alternatively embodiment, the forwarding module 2 also includes:
Second memory cell 27, if for the segmentation markers that the result for checking that unit 21 is checked is the attribute field For the first value, then the IP datagram is stored into caching;
Whether the second query unit 28, for the header information according to the IP datagram, inquire about and stored in the caching There are all IP datagrams for belonging to same data flow with the IP datagram;
4th transmitting element 29, if the Query Result for second query unit is yes, according to the IP data The header information of report, sends all IP datagrams for belonging to same data flow with the IP datagram.
Wherein, the 4th transmitting element 29, including:
Subelement is recombinated, will the described and IP datagram for the offset in the IP datagram header information All IP datagrams for belonging to same data flow are reassembled as an IP datagram;
First transmission sub-unit, for the header information according to the IP datagram, sends the IP datagram of the restructuring.
Further, first transmitting element 22, including:
Change subelement, the header information for changing the IP datagram;
Second transmission sub-unit, for the IP datagram to be sent to the reception that the header information of the modification is indicated Side.
Specifically, when segmentation markers are the first value, then when from source address to destination address, due to network delay or The relation of different transmission path, when reaching destination host, as described in the present embodiment of the invention during IP datagram processing unit, these The IP datagram of segmentation not always orderly arrangement, it is possible in unordered state, therefore need will be with the IP for the device All IP datagrams that datagram belongs to same data flow are all stored in caching, further according to all IP data in the data flow The offset (offset bit is in the header information of IP datagram) of report is reassembled as an IP datagram, the wherein IP of the restructuring Datagram includes belonging to all IP datagrams of same data flow.
It is further noted that IP datagram processing unit can include forwarding module 2 simultaneously in the embodiment of the present invention Two kinds of alternatively embodiments, or both alternatively any of embodiment, the i.e. embodiment of the present invention are not done to this Limit.
In embodiments of the present invention, IP datagram processing unit is received after the IP datagram of sender's transmission, passes through inspection Whether the MTU MTU for surveying NIC instruction is less than the size of the IP datagram, it is determined that to the IP datagram Next step processing, so as to avoid the problem of network is obstructed, improve network connectivity efficiency.Further, when MTU is more than the IP The size of datagram, the then attribute field checked in the IP datagram header information, according to segmentation markers in identification field Different value, when such as the first value, and is stored with preset tables of data and belongs to the IP data of same data flow with the IP datagram During the header information of report, such as purpose IP address, IP datagram processing unit can be directly according to the upper IP numbers of same data flow Forwarded according to the information of report, so as to improve network data transmission efficiency;Or, IP datagram processing unit will be with IP datagram All IP datagrams for belonging to same data flow are all stored to after caching, then are recombinated, forwarded, and mitigate processing load.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means to combine specific features, structure, material or the spy that the embodiment or example are described Point is contained at least one embodiment of the present invention or example.In this manual, to the schematic representation of above-mentioned term not Identical embodiment or example must be directed to.Moreover, specific features, structure, material or the feature of description can be with office Combined in an appropriate manner in one or more embodiments or example.In addition, in the case of not conflicting, the skill of this area Art personnel can be tied the not be the same as Example or the feature of example and non-be the same as Example or example described in this specification Close and combine.
In addition, term " first ", " second " are only used for describing purpose, and it is not intended that indicating or implying relative importance Or the implicit quantity for indicating indicated technical characteristic.Thus, define " first ", the feature of " second " can express or Implicitly include at least one this feature.In the description of the invention, " multiple " are meant that at least two, such as two, three It is individual etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, represent to include Module, fragment or the portion of the code of one or more executable instructions for the step of realizing specific logical function or process Point, and the scope of the preferred embodiment of the present invention includes other realization, wherein can not be by shown or discussion suitable Sequence, including according to involved function by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should be of the invention Embodiment person of ordinary skill in the field understood.
Represent in flow charts or logic and/or step described otherwise above herein, for example, being considered use In the order list for the executable instruction for realizing logic function, it may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system including the system of processor or other can be held from instruction The system of row system, device or equipment instruction fetch and execute instruction) use, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicate, propagate or pass Defeated program is for instruction execution system, device or equipment or the dress for combining these instruction execution systems, device or equipment and using Put.The more specifically example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wirings Connecting portion (electronic installation), portable computer diskette box (magnetic device), random access memory (RAM), read-only storage (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device, and portable optic disk is read-only deposits Reservoir (CDROM).In addition, can even is that can be in the paper of printing described program thereon or other are suitable for computer-readable medium Medium, because can then enter edlin, interpretation or if necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each several part of the present invention can be realized with hardware, software, firmware or combinations thereof.Above-mentioned In embodiment, the software that multiple steps or method can in memory and by suitable instruction execution system be performed with storage Or firmware is realized.If, and in another embodiment, can be with well known in the art for example, realized with hardware Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal Discrete logic, the application specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene Programmable gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method is carried Rapid to can be by program to instruct the hardware of correlation to complete, described program can be stored in a kind of computer-readable storage medium In matter, the program upon execution, including one or a combination set of the step of embodiment of the method.
In addition, each functional unit in each embodiment of the invention can be integrated in a processing module, can also That unit is individually physically present, can also two or more units be integrated in a module.Above-mentioned integrated mould Block can both be realized in the form of hardware, it would however also be possible to employ the form of software function module is realized.The integrated module is such as Fruit is realized using in the form of software function module and as independent production marketing or in use, can also be stored in a computer In read/write memory medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..Although having been shown and retouching above Embodiments of the invention are stated, it is to be understood that above-described embodiment is exemplary, it is impossible to be interpreted as the limit to the present invention System, one of ordinary skill in the art can be changed to above-described embodiment, change, replace and become within the scope of the invention Type.

Claims (6)

1. a kind of IP datagram processing method, it is characterised in that including:
Receive the IP datagram that sender sends;
According to the header information of the IP datagram, the IP datagram is forwarded;
Wherein, after the IP datagram for receiving sender's transmission, and the header information according to the IP datagram, Forward before the IP datagram, methods described also includes:
Detect whether the MTU MTU of NIC instruction is less than the size of the IP datagram, if testing result It is yes, then abandons the IP datagram, and encapsulate an Internet Control Message Protocol ICMP datagram;
Send the ICMP data offer sender so that described sender according to the ICMP datagrams to the IP datagram It is segmented and sends the IP datagram after segmentation;
If testing result is no, triggering performs the header information according to the IP datagram, forwards the IP datagram The step of;
Attribute field includes segmentation markers in the header information of the IP datagram, wherein, the segmentation markers are for instruction No that the IP datagram can be segmented, when the segmentation markers are the first value, the IP datagram is segment data report; When the segmentation markers are second value, then the IP datagram is not segment data report;
The header information according to the IP datagram, forwards the IP datagram, including:
The attribute field checked in the IP datagram header information;
If the segmentation markers that the result checked is attribute field are second value, believed according to the header of the IP datagram Breath, sends the IP datagram;
If the segmentation markers that the result checked is attribute field are the first value, inquire about in preset tables of data and whether store There is the header information for the IP datagram for belonging to same data flow with the IP datagram;
If the Query Result is no, the header information of the IP datagram is stored into the preset tables of data, and root According to the header information of the IP datagram, the IP datagram is sent;
If the Query Result is yes, according to the IP datagram for belonging to same data flow with the IP datagram of the storage Header information, send the IP datagram;
If the segmentation markers that the result checked is the attribute field are the first value, by IP datagram storage to slow In depositing;
According to the header information of the IP datagram, whether it is stored with the inquiry caching and belongs to same with the IP datagram All IP datagrams of data flow;
If so, then sending according to the header information of the IP datagram and belonging to all of same data flow with the IP datagram IP datagram.
2. the method as described in claim 1, it is characterised in that the header information according to the IP datagram, send with The IP datagram belongs to all IP datagrams of same data flow, including:
Offset in the IP datagram header information belongs to the described and IP datagram institute of same data flow There is IP datagram to be reassembled as an IP datagram;
According to the header information of the IP datagram, the IP datagram of the restructuring is sent.
3. the method as described in claim 1, it is characterised in that the header information according to the IP datagram, sends institute IP datagram is stated, including:
Change the header information of the IP datagram;
The recipient that the header information that the IP datagram is sent into the modification is indicated.
4. a kind of IP datagram processing unit, it is characterised in that including:
Receiving module, the IP datagram for receiving sender's transmission;
Forwarding module, for the header information of the IP datagram received according to the receiving module, forwards the IP datagram;
Wherein, described device also includes:
Detection module, for detecting whether the MTU MTU that NIC is indicated is less than the big of the IP datagram It is small;
First processing module, if the testing result for the detection module is is, abandons the IP datagram, and encapsulate one Individual Internet Control Message Protocol ICMP datagrams;
Sending module, sender is offered so that described sender is according to the ICMP datagrams pair for sending the ICMP data The IP datagram is segmented and sends the IP datagram after segmentation;
Second processing module, if the testing result for the detection module is no, triggers the retransmission unit and performs basis The header information of the IP datagram, the step of forwarding the IP datagram;
Wherein, attribute field includes segmentation markers in the header information of the IP datagram, wherein, the segmentation markers are used to refer to Whether can to the IP datagram be segmented, when the segmentation markers are the first value, the IP datagram is segments if showing According to report;When the segmentation markers are second value, then the IP datagram is not segment data report;
Wherein, the forwarding module, including:
Unit is checked, for checking the attribute field in the IP datagram header information;
First transmitting element, if being second value for the segmentation markers that the result for checking that unit is checked is attribute field, According to the header information of the IP datagram, the IP datagram is sent;
Wherein, the forwarding module also includes:
First query unit, if being the first value for the segmentation markers that the result for checking that unit is checked is attribute field, Inquire about the header information for the IP datagram for belonging to same data flow with the IP datagram that whether is stored with preset tables of data;
First memory cell, if being no for the result that first query unit is inquired about, by the header of the IP datagram Information is stored into the preset tables of data;
Second transmitting element, for the header information according to the IP datagram, sends the IP datagram;
Wherein, the forwarding module also includes:
3rd transmitting element, if being yes for the result that first query unit is inquired about, according to being stored and the IP Datagram belongs to the header information of the IP datagram of same data flow, sends the IP datagram;
Wherein, the forwarding module also includes:
Second memory cell, if being first for the segmentation markers that the result for checking that unit is checked is the attribute field Value, then by IP datagram storage into caching;
Whether the second query unit, for the header information according to the IP datagram, inquire about and be stored with and institute in the caching State all IP datagrams that IP datagram belongs to same data flow;
4th transmitting element, if the Query Result for second query unit is yes, according to the report of the IP datagram Header, sends all IP datagrams for belonging to same data flow with the IP datagram.
5. device as claimed in claim 4, it is characterised in that the 4th transmitting element, including:
Subelement is recombinated, is belonged to for the offset in the IP datagram header information by described with the IP datagram All IP datagrams of same data flow are reassembled as an IP datagram;
First transmission sub-unit, for the header information according to the IP datagram, sends the IP datagram of the restructuring.
6. device as claimed in claim 4, it is characterised in that first transmitting element, including:
Change subelement, the header information for changing the IP datagram;
Second transmission sub-unit, for the IP datagram to be sent to the recipient that the header information of the modification is indicated.
CN201410265868.4A 2014-06-13 2014-06-13 A kind of IP datagram processing method and processing device Active CN104052680B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410265868.4A CN104052680B (en) 2014-06-13 2014-06-13 A kind of IP datagram processing method and processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410265868.4A CN104052680B (en) 2014-06-13 2014-06-13 A kind of IP datagram processing method and processing device

Publications (2)

Publication Number Publication Date
CN104052680A CN104052680A (en) 2014-09-17
CN104052680B true CN104052680B (en) 2017-11-07

Family

ID=51505062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410265868.4A Active CN104052680B (en) 2014-06-13 2014-06-13 A kind of IP datagram processing method and processing device

Country Status (1)

Country Link
CN (1) CN104052680B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112714504B (en) * 2020-12-16 2021-11-05 北京连山科技股份有限公司 End-to-end real-time data transmission method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710880A (en) * 2004-06-17 2005-12-21 国际商业机器公司 Method and apparatus for discovering path maximum transmission unit (PMTU)
CN102014067A (en) * 2010-12-14 2011-04-13 北京星网锐捷网络技术有限公司 Message fragment sending method, device and network equipment
CN103079232A (en) * 2013-01-16 2013-05-01 大唐移动通信设备有限公司 Method and device for determining maximum capacity of message

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8121135B2 (en) * 2009-06-23 2012-02-21 Juniper Networks, Inc. Discovering path maximum transmission unit size

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710880A (en) * 2004-06-17 2005-12-21 国际商业机器公司 Method and apparatus for discovering path maximum transmission unit (PMTU)
CN102014067A (en) * 2010-12-14 2011-04-13 北京星网锐捷网络技术有限公司 Message fragment sending method, device and network equipment
CN103079232A (en) * 2013-01-16 2013-05-01 大唐移动通信设备有限公司 Method and device for determining maximum capacity of message

Also Published As

Publication number Publication date
CN104052680A (en) 2014-09-17

Similar Documents

Publication Publication Date Title
CN103888386B (en) The transmission method and device, system of expansible virtual local area network packet
CN103391256B (en) A kind of base station user face data processing optimization method based on linux system
CN103490961B (en) Network equipment
CN103259725B (en) Messaging method and network equipment
CN103259726B (en) Method, device and system for storing and sending MAC address table entries
US20140233565A1 (en) Systems and methods for path maximum transmission unit discovery
EP2912810A1 (en) Network system and method for improving routing capability
CN103685006A (en) Packet forwarding method for edge device and edge device
CN103118149B (en) Communication control method between same tenant's server and the network equipment
CN110505147A (en) The fragments for packet of no recombination forwards
CN109698788A (en) Flow forwarding method and flow forwarding device
CN104954271A (en) Data packet processing method and data packet processing device in SDN network
CN106878181A (en) A kind of message transmitting method and device
CN103685032B (en) Message forwarding method and network address translation services device
CN110505152A (en) Route filtering method, device and electronic equipment
CN103685060B (en) data packet sending method and device
CN106921578A (en) The generation method and device of a kind of forwarding-table item
CN106330779A (en) Server, physical switch, and communication system
CN105099919B (en) Message processing method and device
CN104683428A (en) Network service processing method and device
CN104135548A (en) Static NAT realization method and device based on FPGA
CN107547430A (en) A kind of file transmitting method and device
CN107196834A (en) Message processing method and equipment
CN105207858B (en) Access device and method for connecting user equipment to network executed by access device
CN107682446A (en) A kind of message mirror-image method, device and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20181205

Address after: Room 105-53811, No. 6 Baohua Road, Hengqin New District, Zhuhai City, Guangdong Province

Patentee after: Zhuhai Seal Interest Technology Co., Ltd.

Address before: 519070, six level 601F, 10 main building, science and technology road, Tangjia Bay Town, Zhuhai, Guangdong.

Patentee before: Zhuhai Juntian Electronic Technology Co.,Ltd.

TR01 Transfer of patent right