CN104348760B - A kind of method realized IP fragmentation and sequentially sent piecewise - Google Patents

A kind of method realized IP fragmentation and sequentially sent piecewise Download PDF

Info

Publication number
CN104348760B
CN104348760B CN201410534905.7A CN201410534905A CN104348760B CN 104348760 B CN104348760 B CN 104348760B CN 201410534905 A CN201410534905 A CN 201410534905A CN 104348760 B CN104348760 B CN 104348760B
Authority
CN
China
Prior art keywords
field
region
write
reproducible
point
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
CN201410534905.7A
Other languages
Chinese (zh)
Other versions
CN104348760A (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.)
BEIJING ZHONGCHUANG TENGRUI TECHNOLOGY Co Ltd
Original Assignee
BEIJING ZHONGCHUANG TENGRUI 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 BEIJING ZHONGCHUANG TENGRUI TECHNOLOGY Co Ltd filed Critical BEIJING ZHONGCHUANG TENGRUI TECHNOLOGY Co Ltd
Priority to CN201410534905.7A priority Critical patent/CN104348760B/en
Publication of CN104348760A publication Critical patent/CN104348760A/en
Application granted granted Critical
Publication of CN104348760B publication Critical patent/CN104348760B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention provides a kind of method sequentially sent piecewise to IP fragmentation, and it writes region and not reproducible write region by being divided into the field area for pointing to packet structure to repeat;When sending data, script is needed to be placed in advance in the not reproducible of sensing packet structure during IP fragmentation and reassembly by searching Hash table and the getable information of session ability and write multiplexing region, then the mode sent piecewise to IP fragmentation, to solve the problems, such as in the prior art due to the competition of multinuclear lock and session timeout may be caused in transmitting procedure, and again to needing to search Hash table and session during packet progress IP fragmentation and reassembly, the problem of reducing and take so as to the performance brought.

Description

A kind of method realized IP fragmentation and sequentially sent piecewise
【Technical field】
The present invention relates to IP fragmentation restructuring and IP fragmentation to send field.
【Background technology】
Existing IP fragmentation recombinant technique basis carries out IP fragmentation restructuring according to IP fragmentation agreement.IP fragmentation packet is through overweight Group is processed into a whole bag, has saved operation of the user to IP fragmentation packet, facilitates user's bag whole to IP fragmentation to handle.
Traditional IP IP fragmentation and reassembly technology comparative maturity.When IP fragmentation packet reaches, network communication equipment can basis The information (such as source IP address, purpose IP address, IP version and IP id) got from IP fragmentation packet carries out lookup Hash Table, find associated session.Carry out inserting the operation such as IP fragmentation packet in session chained list, the process for inserting session chained list is similar In insertion sort, the out of order IP fragmentation packet of possibility of entrance is sorted successively according to the ascending of its offset.It is last straight Being recombinated followed by copy for first packet segment is connected on, i.e., the IP fragmentation packet by second and below copies to Behind first IP fragmentation packet, a whole bag is really formed, so as to subsequent module (such as HFA, ZIP) processing.
With the continuous development of network, requirement of the user for packet is more and more, and user no longer meets to transmit The packet that the IP fragmentation and reassembly to come over is crossed, some users, which are more desirable to directly obtain packet segment, to be analyzed.Therefore, piecewise During transmission is handled, it is necessary to search session chained list again, find the size of first sheet data bag, and next IP fragmentation The pointer of packet is sent piecewise.
Existing scheme is characterized by searches session again, finds required information.So for network communication equipment Performance can have a huge impact.This is also that this programme needs to solve the problems, such as.
Again following influence can be brought to the equipment performance of network service by searching the operation of session:First, to reacquire The information (such as source IP address, purpose IP address, IP version and IP id) of bag is recombinated, this partial properties reduces seldom;Connect down Come Hash table to be searched and session, (such as OcteonII CN68801.0GHz processors, there is 32 especially for polycaryon processor Individual core), Hash table and session structure are all that multinuclear is shared, if to search again, are certain to bring between core and core and lock Race problem;For the time-out time of session, also to reset, 6s time-out before must extend, otherwise session chained list In packet segment all deleted because of session overtime;Even if without above mentioned problem, Hash table and session are searched again Still very consumption can.
【The content of the invention】
This programme will solve the problems, such as to be exactly to be not re-start a series of operation such as Hash table and session, by needed for The pointer wanted, which is put into, to be pointed in packet structure.It is repeatable by carrying out repartitioning the field area for pointing to packet structure Write multiplexing region and it is not reproducible write multiplexing region, Hash table will be required to look up originally and information that session obtains is in IP fragmentation and reassembly During be placed in advance in it is not reproducible write multiplexing region.So avoid above-mentioned all problems.
The invention provides a kind of method realized IP fragmentation and sequentially sent piecewise, it is characterised in that:
The field area for pointing to packet structure is divided into and repeatable write region and not reproducible writes region;
When sending data, script is needed to be placed in advance in sensing by searching Hash table and the getable information of session Packet structure is not reproducible to write multiplexing region;
In IP fragmentation sequentially piecewise in transmission flow, relevant information is directly obtained, realizes and efficiently sends.
Preferably, the field area for pointing to packet structure is divided into by multiple regions by space cut-point.
Preferably, it is determined that the time beginning cut-point of the field of packet structure and last time cut-point are pointed to, wherein when beginning Between cut-point be time that the field starts to be write for the first time, last time cut-point is the time that field last time is read.
Preferably, if the handling process between the time cut-point that certain field occurs in pairs is corresponding with other fields Handling process between time cut-point is not occured simultaneously, then the field, which is placed into repeat, writes region.
Preferably, if handling process between the time cut-point that certain field occurs in pairs, another field is included Handling process, or have common factor with another field handling process, then the field be put into and not reproducible write multiplexing region.
Preferably, if certain field is that can not cover the field of duplex type, also, certain part of the field is write It was multiplexed once, then the field is placed into not reproducible write and is multiplexed region.
Preferably, the adjustment of each field is it is noted that byte-aligned, the length of each field is the integer of byte length Times.
Preferably, the target that instructs that packet structure is pointed in the adjustment is that data structure is divided into repeat to write multiplexing Region is two pieces of continuous regions with not reproducible multiplexing region of writing, or, although it is repeatable write multiplexing region with it is not reproducible It is the region that polylith disperses to write multiplexing region, but these scattered regions are more preferable than the continuity before adjustment.
Advantages of the present invention:Without first obtaining the information of whole bag again, then Hash table and session are searched, so as to obtain IP points Piece information, so save the development amount of code.As long as whole bag can directly extracts information, without because by information Place the competition of the lock that brings of other structures, search Hash table and performance that session is brought reduces, send out multiple whole that wrap etc. must for same core The problem of must considering, the performance of product is effectively improved, and stable performance.
【Brief description of the drawings】
Fig. 1 is the duplex type divided in the prior art according to texture field;
Fig. 2 is the present invention using division schematic diagram of the space cut-point to region;
Fig. 3 is the schematic diagram using time cut-point to interfield handling process relation of the present invention;
Fig. 4 is that the repeatable of the present invention writes multiplexing region and the not reproducible division schematic diagram for writing multiplexing region.
【Embodiment】
This programme will solve the problems, such as to be exactly to be not re-start a series of operation such as Hash table and session, by institute The pointer needed is put into the structure for pointing to packet.The field area of packet structure is pointed to as can by repartition Repetition write multiplexing region and it is not reproducible write multiplexing region, Hash table will be required to look up originally and information that session obtains is in burst Not reproducible write is placed in advance in during restructuring and is multiplexed region.So avoid above-mentioned all problems.
The difficult point of this programme, which is how correctly to divide, repeatable to be write multiplexing region and not reproducible writes multiplexing region.Because For pointing to packet structure, the particularly internal platform used, by the size immobilization of this data structure, with Increasing for the processing of module, modules can all use each field in structure, or even all multiple in intermodule and module With field, plus the numerous and diverse of service logic, required information can be put into sensing number by the process of original IP fragmentation restructuring According in pack arrangement, but the process for sending packet segment piecewise being finished in restructuring, field had been re-used several times, this Allow for again that multiplexing field becomes extremely difficult again, can only carry out looking into the treating method of Hash table and session.
For the field multiplex mode in code flow, following classification can be done:
It is reading or modification according to field contents, is divided into reading multiplexing and writes multiplexing.
According to field duplex type, it is divided into address multiplex and title multiplexing.Wherein address multiplex is divided into address offset multiplexing Change and be multiplexed with forced type;Title multiplexing, which is divided into, can cover multiplexing and can not cover multiplexing.Multiplexed form is illustrated, and points to data Pack arrangement is assumed to be WQE structures, and the part that modules are often multiplexed is the packet_data arrays in WQE.
Address offset is multiplexed:(packet_data+88)=xxx, for another example form such as packet_data [80]=yyy.
Forced type conversion multiplexing:(gtp_msg*) form such as packet_data=zzz.
It is most common form that multiplexing, which can be covered,:packet_data->Ip_hdr=xxx.
It can not cover that multiplexing is similar can to cover multiplexing:packet_data->Pckt_flag |=AAA, wherein packet_ In data arrays pckt_flag represent bag processing flag bit, single treatment can only with a flag bit, be not with it is all Flag bit, so being referred to as that multiplexing can not be covered.
The signal of texture field multiplexed classification is as shown in Figure 1.
Except IP fragmentation module, other modules can be split with installation space and be clicked through to the address multiplex of sensing packet structure Row segmentation, the region that packet_data arrays can be divided into by two kinds of address multiplex completely are as shown in Figure 2.
The scope of address multiplex is divided by paired space cut-point, A10 and A11, A20 and A21, A30 and A31 etc. Packet_data arrays space is divided, wherein paired space cut-point (such as A30 and A31) splits two spaces Space between point is multiplexed region for repeatable write, complete if the region between two paired space cut-points is continuous New repeatable writes can be formed entirely and is multiplexed region, as what A10 and A11, A20 and the component cutpoints of A21 two divided repeats It is continuous to write multiplexing region, can be multiplexed region by new repeatable write of merger.For between azygous space cut-point Region, then for it is not reproducible write multiplexing region.So our cans substantially distinguish repeatable write and are multiplexed region and can not weigh Manifolding multiplexing region, but this is only to have determined a basis.
The essence of space cut-point is address.The head-end and tail point of one structure are two special spaces segmentations Point, they are not belonging to any pair of space cut-point, and they form not reproducible write again with the space cut-point away from its nearest neighbours Use region.
Space cut-point has determined region substantially, and really for code service logic, space cut-point is not Repeatable multiplexing region of writing not is really not reproducible writes!So time cut-point is needed to determine not space cut-point Repeatable multiplexing region of writing further divides.
In actual demand, some fields need to be retained always.Such as just needed in IP fragmentation reorganization in this programme Retain the size of first fragment message, the field such as pointer of second burst.So we are it has to be ensured that these fields After being assigned in IP fragmentation reorganization flow, until the whole bag of IP fragmentation restructuring can not be by between the flow sent piecewise Write multiplexing.I.e. certain field from write for the first time last time read during can not be write multiplexing, only this field again Not reproducible write can be just put into the specific period (field value needs the period retained always) and is multiplexed region.
Time cut-point is also to occur in pairs, and the definition foundation of time cut-point is the classification being multiplexed according to title.Word Section starts to be written as the time beginning cut-point of the field for the first time, and field last time is read as the segmentation of last time of the field Point.As shown in figure 3, field bi is read to be multiplexed and write multiplexing between paired cut-point Bi0 and Bi1.
It is easy to draw following principle from the definition of time cut-point and foundation and Fig. 3:
The certain field of principle one corresponds to the handling process time segmentation corresponding with other fields between paired time cut-point Handling process between point is not occured simultaneously, then field can be multiplexed by corresponding field in other handling processes.If some word Section is not the field that needs to retain for a long time, then writes multiplexing area of space it is recommended that field is put into repeat.Such as field B1 and field b2, which can be placed in repeat, writes multiplexing area of space.
Principle two includes another field handling process for the handling process of certain field, or the field flow with it is another One field handling process has common factor, then two fields be not multiplexed in identical address area.The particularly field Multiplexing field is write to be not reproducible, and another field is write multiplexing.But if two fields have been association's multiplexings, then It not take apart, unless reader can adjust the method for field multiplexing simultaneously.As shown in Figure 3:Field b3 read-write flow includes word Section b4 read-write flow, it is multiplexed so field b3 can not read and write with field b4 in same region of memory;Field b5's and field b6 Handling process has common factor, is multiplexed so field b5 and field b6 can not read and write in same region of memory.
Principle three is for that can not cover the field of duplex type, as long as certain part of the field, which is only write, was multiplexed one Secondary, the field can be put into not reproducible write and be multiplexed region completely.
Further divided according to the not reproducible multiplexing region of writing that mentioned above principle can divide to space cut-point. Finally also to carry out last division according to business to adjust, preferably follow following principle:
All adjustment of principle one come from service logic, and the division of the above is not complete inflexible, and different multiplexings is complete It can be converted entirely, so the grasp being for service logic of division at all!
The byte-aligned of principle two, different field have different length, but preferably byte polishing.Although actual items may not have There is the directly division of in ideal structure is repeatable to write multiplexing region and the not reproducible situation for writing multiplexing region Liang Kuai regions, It is scattered sometimes.
For principle three it is noted that the continuity in region, this needs the big small end for considering byte-aligned and syllable sequence, best Repeatable multiplexing region of writing is adjusted to together, not reproducible multiplexing region of writing is adjusted to one piece.
Principle four is paid attention to if two different sensing packet structures, such as one of data for pointing to reality Bag, another is used as timer, then the field of same position may be multiplexed.
Divided by space cut-point described above and time cut-point, and mentioned above principle and service logic are entered The further subdivision of row, it can make intactly marking off and repeatable write multiplexing region and not reproducible write multiplexing region.This hair The not reproducible of the area schematic below figure 4 of bright division, wherein green area representative writes the field that multiplexing region is the region Content can retain always;The not reproducible multiplexing region of writing that yellow area represents is that there are currently no can not weigh for the field in the region The demand of multiplexing is made carbon copies, does not continue adjustment order temporarily;The repeatable field contents for writing multiplexing region that red area represents can With multiplexing.In view of the big end storage problem of byte-aligned and network sequence, and same type of regional address is connected as far as possible Continue, particularly bit field, the repeatable multiplexing region of writing of part fritter can be caused to be multiplexed in not reproducible write in region.
By dividing mode above, IP fragmentation sends the information needed and retained, and is sent piecewise so as to IP fragmentation Function is expeditiously realized, it is not necessary to is reacquired package informatin, is searched the operation such as Hash table and session and be transmitted data Bag.Both the workload of code development had been saved, it is often more important that improve the performance and stability of product.

Claims (8)

  1. A kind of 1. method realized IP fragmentation and sequentially sent piecewise, it is characterised in that:
    The field area for pointing to packet structure is divided into and repeatable write region and not reproducible writes region;
    When sending data, will need originally by search Hash table and session just getable information be placed in advance in it is not reproducible Write multiplexing region;The structure of packet is pointed to by adjusting, and letter is transmitted using the not reproducible multiplexing region of writing in this structure Breath;
    In IP fragmentation sequentially piecewise in transmission flow, relevant information is directly obtained, realizes and efficiently sends.
  2. 2. according to the method for claim 1, it is characterised in that also include:Data inclusion will be pointed to by space cut-point The field area of structure is divided into multiple regions, ensures the continuous principle in area type address as far as possible, the structure to pointing to packet It is adjusted.
  3. 3. according to the method for claim 1, it is characterised in that also include:Determine the time beginning cut-point and Mo Shi of field Between cut-point, wherein the time cut-point that begins is time that the field starts to be write for the first time, last time cut-point be the field most The time once read afterwards.
  4. 4. according to the method for claim 3, it is characterised in that also include:If the time that certain field occurs in pairs point The handling process between handling process time cut-point corresponding with other fields between cutpoint is not occured simultaneously, then the field quilt It is put into repeat and writes region.
  5. 5. according to the method for claim 3, it is characterised in that also include:If the time that certain field occurs in pairs point Handling process between cutpoint, the handling process comprising another field, or have common factor with another field handling process, then The field is put into not reproducible write and is multiplexed region.
  6. 6. according to the method for claim 1, it is characterised in that also include:If certain field is that can not cover multiplexing class The field of type, also, certain part of the field is only write and was multiplexed once, then and the field is placed into not reproducible write and is multiplexed area Domain.
  7. 7. according to the method for claim 1, the adjustment of each field is it is noted that byte-aligned, the length of each field are The integral multiple of byte length.
  8. 8. the final goal that according to the method for claim 1, packet structure is pointed in the adjustment is that data structure is drawn Be divided into it is repeatable to write multiplexing region with not reproducible multiplexing region of writing be two pieces of continuous regions, or, although it is repeatable write it is multiple It is the scattered region of polylith with region and not reproducible multiplexing region of writing, but these scattered regions are than the continuity before adjustment More preferably.
CN201410534905.7A 2014-10-11 2014-10-11 A kind of method realized IP fragmentation and sequentially sent piecewise Active CN104348760B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410534905.7A CN104348760B (en) 2014-10-11 2014-10-11 A kind of method realized IP fragmentation and sequentially sent piecewise

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410534905.7A CN104348760B (en) 2014-10-11 2014-10-11 A kind of method realized IP fragmentation and sequentially sent piecewise

Publications (2)

Publication Number Publication Date
CN104348760A CN104348760A (en) 2015-02-11
CN104348760B true CN104348760B (en) 2017-12-26

Family

ID=52503586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410534905.7A Active CN104348760B (en) 2014-10-11 2014-10-11 A kind of method realized IP fragmentation and sequentially sent piecewise

Country Status (1)

Country Link
CN (1) CN104348760B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108415869B (en) * 2018-02-28 2020-06-26 北京零壹空间科技有限公司 Method and device for sending serial data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1494274A (en) * 2002-10-31 2004-05-05 ����ͨѶ�ɷ����޹�˾ Method of realizing IP message partition and recombination based on network processor
CN101645851A (en) * 2009-09-03 2010-02-10 中兴通讯股份有限公司 Recombination method for IP fragment messages and device thereof
CN101674234A (en) * 2009-08-21 2010-03-17 曙光信息产业(北京)有限公司 Fragments-reassembling method of IP messages and device thereof
CN102123090A (en) * 2011-02-23 2011-07-13 中国人民解放军国防科学技术大学 IP (Internet protocol) fragment processing method based on two-level table storage and transport layer information inquiry

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1494274A (en) * 2002-10-31 2004-05-05 ����ͨѶ�ɷ����޹�˾ Method of realizing IP message partition and recombination based on network processor
CN101674234A (en) * 2009-08-21 2010-03-17 曙光信息产业(北京)有限公司 Fragments-reassembling method of IP messages and device thereof
CN101645851A (en) * 2009-09-03 2010-02-10 中兴通讯股份有限公司 Recombination method for IP fragment messages and device thereof
CN102123090A (en) * 2011-02-23 2011-07-13 中国人民解放军国防科学技术大学 IP (Internet protocol) fragment processing method based on two-level table storage and transport layer information inquiry

Also Published As

Publication number Publication date
CN104348760A (en) 2015-02-11

Similar Documents

Publication Publication Date Title
US7813342B2 (en) Method and apparatus for writing network packets into computer memory
CN102427446B (en) Packet coalescing
US7936755B2 (en) Ingress processing optimization via traffic classification and grouping
US8681819B2 (en) Programmable multifield parser packet
KR20210127898A (en) Apparatus and method of generating lookups and making decisions for packet modifying and forwarding in software-defined network engine
CN101656659B (en) Method for caching mixed service flow and method and device for storing and forwarding mixed service flow
CN103246730B (en) File memory method and equipment, document sending method and equipment
CN101485152B (en) Method, system, and computer program product for resequencing of high performance binding
US8774194B2 (en) Method and apparatus for a high-speed frame tagger
US7464201B1 (en) Packet buffer management apparatus and method
CN103888449A (en) Method and device for packet reassembly
EP0905983B1 (en) Data match detecting apparatus, and data selecting apparatus
CN104915148B (en) System and method for the efficient content caches in crossfire storage device
CN109977822B (en) Data supply method, model training method, device, system, equipment and medium
CN1433543A (en) Method and system for frame and protocol classification
CN115905061B (en) Data transfer device, DMA device, electronic apparatus, and data transfer method
CN101841474A (en) Device for realizing access control lists
CN104348760B (en) A kind of method realized IP fragmentation and sequentially sent piecewise
CN109842652A (en) A kind of method for uploading of file, terminal, Cloud Server and computer storage medium
US6687715B2 (en) Parallel lookups that keep order
CN105099957A (en) Data packet forwarding method based on software table look-up
CN109688606A (en) Data processing method, device, computer equipment and storage medium
CN105357148A (en) Method and system for preventing output message of network exchange chip from being disordered
CN102595621B (en) Method and apparatus for parameter storage control at uplink receiving terminal
CN106790320A (en) A kind of method that multi-application inter-system data is pushed

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