Embodiment
The embodiment of the invention provides a kind of matching process and coupling accelerator of IP packet, is used for improving the matching efficiency of IP packet and packet filter.
For make goal of the invention of the present invention, feature, advantage can be more obvious and understandable, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, the embodiments described below only are the present invention's part embodiment, but not whole embodiment.Based on the embodiment among the present invention, the every other embodiment that those skilled in the art obtains belongs to the scope of protection of the invention.
The matching process of the IP packet that the embodiment of the invention provides as shown in Figure 2, comprising:
201, IP header parameter buffer extracts header parameter value and the structure address of each IP packet respectively from n IP packet of IP traffic, is saved to respectively then in x the cache blocks of IP header parameter buffer.
N wherein, x is positive integer, n refers to the number of the IP packet that comprises in the IP traffic, x refers to the number of the cache blocks that comprises in the IP header parameter buffer, need to prove, the n that occurs in the embodiment of the invention, what the m of x and follow-up appearance referred to all is quantity, and can be the quantitative value that the applied environment according to reality changes, n, x, m refers to n, x, of these letters of m itself, can certainly letter or numeral replace arbitrarily with other, just show packet herein, cache blocks, the number of packet filter for illustrative purposes only, is not done restriction herein.
Need to prove, n and x do not have corresponding relation in the embodiment of the invention, n might be less than x, n might be greater than x, when initially beginning buffer memory IP packet, not necessarily all cache blocks in the IP header parameter buffer are filled up and go coupling again, might packet of buffer memory or several packet just begin the process of mating, for illustrative purposes only, do not do restriction herein.
In embodiments of the present invention, the coupling accelerator comprises: IP header parameter buffer, main control module, matching module, transmit buffer, wherein, IP header parameter buffer comprises: x cache blocks, matching module comprise m packet filter.Explanation about x, m sees aforementioned description for details, repeats no more herein.
In embodiments of the present invention, IP header parameter buffer offers matching module and carries out the PF coupling for header parameter value and the structure address of depositing the IP packet.Need to prove, the IP header parameter buffer that describe this moment has comprised x cache blocks, k cache blocks and (k+1) individual cache blocks have only been described in subsequent step, just in order clearly to describe workflow and the implementation of each cache blocks, certainly IP header parameter buffer also can comprise a plurality of cache blocks, but k cache blocks that the implementation of a plurality of cache blocks remains that the repetition embodiment of the invention provides and the workflow of (k+1) cache blocks still just are included among the embodiment of the invention.In actual applications, IP header parameter buffer can comprise x cache blocks, x is positive integer, because IP header parameter buffer is when carrying out the extraction of IP header parameter, matching module in the embodiment of the invention also carries out matching treatment at the same time, the speed of extracting when the IP header parameter is less than the PF rate matched in the matching module, the not enough situation of buffer memory just can not appear in IP header parameter buffer, in order to reduce the hardware resource expense, cache blocks in the IP header parameter buffer is specifically as follows 16 herein, and namely the cache blocks that comprises in the IP header parameter buffer is the 1st cache blocks, the 2nd cache blocks, ..., the 16th cache blocks.
In embodiments of the present invention, IP traffic comprises n IP packet, but can comprise a plurality of IP packets usually in the IP traffic (also can be an IP data chain) in actual applications, need to prove, the IP traffic of describing this moment comprises that n IP packet is just in order clearly to describe processed workflow and the implementation of each IP packet, certain IP traffic also can comprise a plurality of IP packets, but the processed flow process to the IP packet preserved in the IP packet preserved in k the cache blocks and (k+1) individual cache blocks to the implementation of a plurality of IP packets remains that the repetition embodiment of the invention provides still just is included among the embodiment of the invention.In each IP packet, all include header parameter value and the IP packet structure body address of IP packet, for example an IP packet just includes an IP packet head parameter value and an IP packet structure body address, and the 2nd IP packet just includes the 2nd IP packet head parameter value and the 2nd IP packet structure body address.
In embodiments of the present invention, IP header parameter buffer extracts header parameter value and structure address respectively and is saved to x cache blocks of IP header parameter buffer respectively from n IP packet of IP traffic, if IP header parameter buffer includes a plurality of cache blocks, a plurality of IP packet head parameter values and structure address can be kept in the idle cache blocks herein.
202, i packet filter of matching module mates the header parameter value of the IP packet preserved in the match attribute value of i packet filter and k the cache blocks, if the match is successful, trigger step 203 and carry out, if not success of coupling triggers step 204 and carries out.
Wherein, matching module comprises m packet filter, wherein, and 1≤i<(i+1)<m, i, k, m are positive integers.I, k, (i+1) all be positive integer, i, (i+1) 1≤i<(the i+1)<m that satisfies condition, wherein i refers to i packet filter in the matching module, (i+1) refer to (i+1) individual packet filter in the matching module, k refers to k cache blocks in the IP header parameter buffer, need to prove, the i that occurs in the embodiment of the invention, k, (i+1) and (k+1) of follow-up appearance refer to all is some packet filters or cache blocks, if for example the i value is 3, what then refer to is the 3rd packet filter in the matching module, the k value is 1, what then refer to is the 1st cache blocks in the IP header parameter register, i in addition, k, (i+1) and (k+1) of follow-up appearance can be the quantitative value that the applied environment according to reality changes, i, k, (i+1), (k+1) be not to refer to i, k, (i+1), (k+1) these letters is own, can certainly letter or numeral replace arbitrarily with other, just show which packet filter herein, which cache blocks, for illustrative purposes only, do not do restriction herein.
In embodiments of the present invention, main control module is used for the control to IP header parameter buffer, matching module, transmit buffer, for example main control module to matching module, IP header parameter buffer, transmit buffer whether enable control, only under situation about enabling, its excess-three module could operate as normal.
In embodiments of the present invention, matching module comprises m packet filter, the implementation method of i packet filter has just been described in the step 202, need to prove, i packet filter in the matching module of describing this moment is just in order clearly to describe workflow and the implementation of a packet filter in the matching module, certainly matching module also can comprise a plurality of packet filters, but a plurality of branches are made the workflow that the implementation of filter remains i the packet filter that the repetition embodiment of the invention provides, and still just are included among the embodiment of the invention.
In embodiments of the present invention, matching module is main functional module, be used for that IP packet and network are joined the effective packet filter that gives and carry out matching ratio, and the EPS bearing identification (EBI, EPS Bearer Identity) of the packet filter correspondence that the match is successful is write in the structure of IP packet.Wherein, the matching principle of IP packet can mate to low according to priority is high, so the design of packet filtering device also can be according to mating to low order from the priority height.
Need to prove, in the invention process, the priority index of i packet filter (EPI, Evaluation Precedence Index) can be higher than the EPI of (i+1) individual packet filter, each packet filter is identified by unique packet filter identifier (PF ID), each packet filter includes a priority index simultaneously, the match attribute principle that the packet filter that each EPI is different adopts may be different, the value of EPI is only under the same direction (specifically referring to up direction or down direction) of all EPS carryings of using identical ip addresses and APN, the priority span of priority index is 0~255, wherein 0 the representative be that priority is the highest, 255 the representative be that priority is minimum.
In embodiments of the present invention, i packet filter mates the header parameter value of the IP packet preserved in the match attribute value of i packet filter and k the cache blocks, wherein, the match attribute value comprises at least one of following property value: far-end address and subnet mask property value, the Security Parameter Index property value, the flow label property value, the local port scope attribute value, the remote port scope attribute value, the 4th edition (IPv4 of Internet protocol, Internet Protocol version 4) grade of service property value in COS or the Internet protocol sixth version (IPv6, Internet Protocol version 6) in, next property value among protocol number or the IPV6 among the IPV4.
Can be with all packet filters and EPS carrying mutual mapping by EBI, each EPS carries corresponding EBI parameter and TFT.Can there be corresponding packet filter among each TFT, but can only have at most among the TFT during PDN connects and not have packet filter, that is to say if do not have on the default bearing packet filter so PDN connect in all corresponding coupling accelerators and all must have packet filter.
In view of the matching process of packet filter in the embodiment of the invention to the IP packet, the advantage that increases IP header parameter buffer is:
(1), in the Match IP packet, can extract the header parameter value of other IP packets in the IP traffic at matching module, thus improve matching efficiency;
(2), can reduce the hardware spending of matching module and matching ratio than the time IP packet head parameter the copy number of times, were it not for the IP header parameter buffer that the embodiment of the invention proposes, need open up another memory space so among each PF in the matching module and be used for depositing IP packet head parameter to be used for each matching ratio, each PF needs to increase the space same big with the property value register again like this, for 256 PF, whole matching module just needs extra 256 registers that increase, and has increased hardware spending; Secondly, the match is successful need be sent under the situation of next PF coupling when the IP packet is failed in previous PF, two kinds of methods are arranged, a kind of is to take out IP packet head parameter again from the IP packet, but because relate to two not parameters of fixed position in these header parameter, so the expense of peek ratio copy from the register of the header parameter of previous PF storing IP packet is bigger again; Another kind is to copy from a last PF, considers limiting case, then needs to copy 256 times.More both can reduce hardware spending and also can reduce the copy number of times so directly use IP header parameter buffer that the embodiment of the invention provides and the match attribute value among the PF to carry out matching ratio, improve matching efficiency.
Need to prove in addition, in the step 202 for k cache blocks and i packet filter, the effective cache blocks that all refers to and the packet filter that enables the free time (the just cache blocks that can read and the packet filter that can mate), comprise that (i+1) individual packet filter and (k+1) individual cache blocks of occurring in the subsequent step also refer to effective cache blocks and enable idle packet filter, also be for enabling idle packet filter, (i+1) individual packet filter might not be and i that packet filter that packet filter is adjacent that same (k+1) individual cache blocks also might not be and k that cache blocks that cache blocks is adjacent.In brief, for cache blocks: idle expression can write header parameter value and the structure address of IP packet inside, and effectively expression can be read header parameter value and the PF coupling in the cache blocks; For matching module, enable idle expression can with next valid cache piece in the header parameter value mate.
203, if the match is successful for the header parameter value of the IP packet of preserving in the match attribute value of i packet filter and k the cache blocks, main control module writes the evolved packet system of i packet filter carrying index EBI in the structure of k cache blocks corresponding IP data bag, and main control module deposits the structure address of the IP packet preserved in k the cache blocks in the transmit buffer in.
In embodiments of the present invention, if the match is successful for the header parameter value of the IP packet of preserving in the match attribute value of i packet filter and k the cache blocks, main control module writes the EBI of i packet filter in the structure of the IP packet of preserving in k the cache blocks, main control module deposits the structure address of the IP packet preserved in k the cache blocks in the transmit buffer in, wherein, transmit buffer is used for depositing the IP packet structure body address after the match is successful, the design of transmit buffer should be noted: it is excessive that the buffer area space does not need to open up, to reduce hardware spending.
Need to prove, in embodiments of the present invention, must comprise one in the IP packet structure body in order to store the member of corresponding EBI value, the match is successful or failure need write corresponding EBI value wherein as IP packet and PF, EBI with packet filter when namely the match is successful writes among the member of IP packet structure body correspondence, and all packet filters write the EBI in the main control module among the corresponding member of IP packet structure body during all with the data packet matched failure of IP.
Need to prove, in actual applications, after main control module deposits in the structure address of the IP packet preserved in k the cache blocks that the match is successful in the transmit buffer, can also comprise step: whether master control module judges satisfies the down trigger condition that presets, if satisfying then, main control module triggers interruption, protocol stack is exported in the structure address of the IP packet that transmit buffer will be preserved in transmit buffer, so that protocol stack is handled the structure address of IP packet, main control module does not trigger interruption if do not satisfy then.For example, main control module is that transmit buffer arranges the down trigger condition, when the interruption trigger condition satisfies, main control module triggers and interrupts, protocol stack is exported in the IP packet structure body address that transmit buffer will be preserved in transmit buffer, to satisfy in the IP traffic IP packet structure body address priority treatment to the match is successful.
In actual applications, the down trigger condition that presets of main control module specifically can comprise: the number of the IP packet structure body address of preserving in the transmit buffer is not less than preset number; Or, satisfy the idle condition of interrupting that triggers, wherein, the condition of idle triggering terminal comprises: all m packet filter of all cache blocks free time, matching module all is in the number of the structure address that enables the IP packet preserved in idle condition, the transmit buffer greater than zero in the IP header parameter buffer.
204, if it fails to match for the header parameter value of the IP packet of preserving in the match attribute value of i packet filter and k the cache blocks, (i+1) individual packet filter of matching module mates the header parameter value of the IP packet preserved in the match attribute value of (i+1) individual packet filter and k the cache blocks.
In embodiments of the present invention, when the header parameter value of the IP packet of preserving in i packet filter and k cache blocks when it fails to match, by (i+1) individual packet filter continue with k cache blocks in the IP packet head parameter value preserved mate.This is a process that constantly continues to carry out, if contain a plurality of packet filters in the matching module, then when it fails to match, need proceed coupling at previous packet filter by the subsequent packets filter.
Need to prove, in embodiments of the present invention, a kind of attainable situation is, (i+1) individual packet filter of matching module can also comprise the steps: after the header parameter value of the IP packet preserved in the match attribute value of (i+1) individual packet filter and k the cache blocks is mated
As (i+1)=m, if it fails to match for the header parameter value of the IP packet of preserving in the match attribute value of (i+1) individual packet filter and k the cache blocks, main control module writes the evolved packet system in main control module carrying index EBI in the structure of k cache blocks corresponding IP data bag, and main control module deposits the structure address of the IP packet preserved in k the cache blocks in the transmit buffer in.
That is to say, when all it fails to match as if m the packet filter that comprises in the matching module, then main control module writes the EBI in the main control module in the IP packet of preserving in k the cache blocks, and main control module deposits the structure address of the IP packet preserved in k the cache blocks in the transmit buffer in.
Below describe for example, in actual applications, the priority span of priority index is 0~255, matching module specifically can comprise 256 packet filter PF, according to the order design from high to low of PF priority, be that to correspond to priority be 0 PF to PF0, PFk deposits and preferentially corresponds to the PF that priority is k, at first mated by PF0, if it fails to match, mated by PF1, it fails to match as if PF1, continuation is mated by PF2, ..., up to being mated by PF255, it fails to match as if PF255, then main control module writes the EBI of main control module in the structure of the IP packet of preserving in k the cache blocks, and main control module deposits the structure address of the IP packet in k the cache blocks in the transmit buffer in.
205, after i packet filter of matching module mated the header parameter value of the IP packet preserved in the match attribute value of i packet filter and k the cache blocks, i packet filter mated the header parameter value of the IP packet preserved in the match attribute value of i packet filter and (k+1) individual cache blocks.
In embodiments of the present invention, after i packet filter of matching module mates the header parameter value of the IP packet preserved in the match attribute value of i packet filter and k the cache blocks, i packet filter mates the header parameter value of the IP packet preserved in the match attribute value of i packet filter and (k+1) individual cache blocks, because i packet filter just can be proceeded coupling work when enabling the free time, just can not mate afterwards and do not need m packet filter in the matching module by the time all to mate to finish, so can realize the matching way that walks abreast, improve matching efficiency.
Need to prove that in embodiments of the present invention, step 205 can also comprise the steps: before carrying out
Whether (i+1) individual packet filter of master control module judges matching module enables the free time, if, main control module trigger (i+1) individual packet filter carry out with k cache blocks in the header parameter value of the IP packet the preserved function of mating.Namely, before (i+1) individual packet filter begins to mate, master control module judges is the state of (i+1) individual packet filter once, if (i+1) individual packet filter is effective, main control module triggers (i+1) individual packet filter again and begins coupling work.
Need to prove, in the embodiment of the invention, before i packet filter of matching module mates the header parameter value of the IP packet preserved in the match attribute value of i packet filter and (k+1) individual cache blocks, also comprise: whether (k+1) individual cache blocks is effective in the master control module judges IP header parameter buffer, if the header parameter value that main control module triggers the IP packet of preserving in i packet filter and (k+1) individual cache blocks is mated.
In embodiments of the present invention, IP header parameter buffer at first extracts header parameter value and the structure address of each IP packet respectively from n IP packet of IP traffic, be saved to respectively then in x the cache blocks in the IP header parameter buffer, i packet filter of matching module mates the header parameter value of the IP packet preserved in the match attribute value of i packet filter and k the cache blocks, i packet filter advances coupling with the header parameter value of the IP packet preserved in the match attribute value of i packet filter and (k+1) individual cache blocks then, as seen, in embodiments of the present invention, after the header parameter value of the IP packet that i packet filter preserved in having mated k cache blocks, the header parameter value that just can mate the IP packet of preserving in (k+1) individual cache blocks again, and do not need in the matching module by the time m packet filter all with k cache blocks in data packet matched the finishing of IP that preserve carry out again afterwards, that is to say, in the embodiment of the invention, each packet filter in the matching module can parallel processing to the coupling of the IP packet preserved in each cache blocks in the IP header parameter buffer, can improve the matching efficiency of IP packet and packet filter.
Above embodiment has introduced the matching process of the IP packet that the embodiment of the invention provides, next introduce the corresponding device of method that the embodiment of the invention provides: the coupling accelerator, as shown in Figure 3, a kind of coupling accelerator 300, comprise: IP header parameter buffer 301, main control module 302, matching module 303, transmit buffer 304, wherein
IP header parameter buffer 301 comprises: x cache blocks, and wherein x is positive integer;
IP header parameter buffer 301, be used for from header parameter value and structure address that n IP packet of IP traffic extracts each IP packet respectively, be saved to respectively then in x the cache blocks of described IP header parameter buffer, wherein, n is positive integer;
Matching module 303 comprises m packet filter, wherein, and 1≤i<(i+1)<m, i, m are positive integers;
The i packet filter 3031 of matching module is used for the header parameter value of the IP packet of the match attribute value of i packet filter 3031 and k cache blocks 3011 preservations is mated, and wherein, k is positive integer;
Main control module 302, be used for if the match is successful for the header parameter value of the IP packet of the match attribute value of i packet filter 3031 and k cache blocks 3011 preservations, EBI writes in the structure of k cache blocks 3011 corresponding IP data bags with the evolved packet system of i packet filter 3031 carrying index, and the structure address of the IP packet in k the cache blocks 3011 is deposited in the transmit buffer 304;
Transmit buffer 304, the structure address of be used for preserving the IP packet that k cache blocks that main control module 302 deposits in preserve;
(i+1) individual packet filter 3032 of matching module, be used for if it fails to match for the header parameter value of the IP packet that the match attribute value of i packet filter 3031 and k cache blocks are preserved, the IP packet head parameter value of preserving in the match attribute value of (i+1) individual packet filter 3032 and k the cache blocks is mated;
I packet filter 3031 of matching module, after being used for the match attribute value of i packet filter 3031 mated with the header parameter value of the IP packet of k cache blocks 3011 preservations, the header parameter value of the IP packet of preservation in the match attribute value of i packet filter 3031 and (k+1) individual cache blocks 3012 is mated.
Need to prove, for main control module 302 and (i+1) individual packet filter 3032, in actual applications, main control module 302, also be used for as (i+1)=m, if it fails to match for the header parameter value of the IP packet of preservation in the match attribute value of (i+1) individual packet filter 3032 and k the cache blocks 3011, EBI writes in the structure of k cache blocks 3011 corresponding IP data bags with the evolved packet system in the main control module 302 carrying index, and the structure address of the IP packet of preservation in k the cache blocks 3011 is deposited in the transmit buffer 304.
Need to prove that for main control module 302 and transmit buffer 304, in actual applications, main control module 302 also is used for judging whether to satisfy the down trigger condition that presets, and interrupts if satisfy then to trigger;
Transmit buffer 304, protocol stack is exported in the structure address that also is used for the IP packet that will preserve at transmit buffer 304, so that protocol stack is handled the structure address of the IP packet preserved in the transmit buffer 304.
Need to prove, for main control module 302 and IP header parameter buffer 301, in actual applications, main control module 302, also be used for after structure address with the IP packet of k cache blocks 3011 preservations deposits in the transmit buffer 304, with k cache blocks 3011 zero clearings of IP header parameter register 301;
IP header parameter buffer 301 also is used for extracting header parameter value and the structure address of an IP packet of not preserving and being saved to k cache blocks 3011 of IP header parameter buffer from IP traffic.
Need to prove, for main control module 302, in actual applications, main control module 302, also be used for before (i+1) individual packet filter 3032 is carried out, judging whether (i+1) individual packet filter 3032 enables the free time, if trigger (i+1) individual packet filter 3032 and carry out.
What need say is, main control module 302, also be used for before i packet filter carried out, judging whether (i+1) individual cache blocks is effective, if the header parameter value that triggers the IP packet of preserving in i packet filter 3031 and (k+1) individual cache blocks 3012 is mated.
Need to prove, contents such as the information interaction between each module/unit of said apparatus, implementation, since with the inventive method embodiment based on same design, its technique effect that brings is identical with the inventive method embodiment, particular content can repeat no more referring to the narration among the present invention method embodiment as shown in Figure 1 herein.
In the embodiment of the invention, IP header parameter buffer at first extracts header parameter value and the structure address of each IP packet respectively from n IP packet of IP traffic, be saved to respectively then in x the cache blocks in the IP header parameter buffer, i packet filter of matching module mates the header parameter value of the IP packet preserved in the match attribute value of i packet filter and k the cache blocks, i packet filter advances coupling with the header parameter value of the IP packet preserved in the match attribute value of i packet filter and (k+1) individual cache blocks then, as seen, in embodiments of the present invention, after the header parameter value of the IP packet that i packet filter preserved in having mated k cache blocks, the header parameter value that just can mate the IP packet of preserving in (k+1) individual cache blocks again, and do not need in the matching module by the time m packet filter all with k cache blocks in data packet matched the finishing of IP that preserve carry out again afterwards, that is to say, in the embodiment of the invention, each packet filter in the matching module can parallel processing to the coupling of the IP packet preserved in each cache blocks in the IP header parameter buffer, can improve the matching efficiency of IP packet and packet filter.
Next, with the application scenarios of a reality coupling accelerator that the embodiment of the invention proposes is elaborated, as shown in Figure 4, the coupling accelerator comprises: IP header parameter buffer, main control module, matching module, transmit buffer, wherein,
IP header parameter buffer comprises: cache blocks 1, cache blocks 2, ..., cache blocks n, this IP header parameter buffer comprises n cache blocks, all PF enable work in the matching module in order to make, the n value should be 256 so, because IP header parameter buffer is when carrying out the extraction of IP header parameter, matching module is matching treatment at the same time also, the speed of extracting when the IP header parameter is less than the PF rate matched in the matching module, the not enough situation of buffer memory just can not appear in IP header parameter buffer, in order to reduce the hardware resource expense, cache blocks is example with 16 in the IP header parameter buffer herein.Wherein, each cache blocks in the IP header parameter buffer should comprise three parts at least, as shown in Figure 4, only drawn among Fig. 4 and comprised IP packet structure body address register, match attribute value register, status register in the cache blocks 1, other cache blocks such as cache blocks 2 ..., cache blocks n comprised this 3 parts, specifically comprise in each cache blocks: one is used for depositing the structure address register that includes the IP packet information; The match attribute value register that another is used for depositing the header parameter of extracting from the IP packet also has one to be used to indicate whether effectively status register of current cache piece.Wherein the read-write of cache blocks is operated successively according to the operating state of cache blocks, when preserving the header parameter value of IP packet and structure address in the cache blocks in the IP header parameter buffer for writing cache blocks, to have now in the free buffer piece from last time write cache blocks backward nearest free buffer piece carry out write operation; When IP header parameter and matching module mate for reading cache blocks, in the existing valid cache piece from last time read cache blocks backward nearest valid cache piece carry out read operation.
Main control module comprises: trigger register, length register, EBI register, configuration register, status register, next do respectively to introduce one by one.
Trigger register: in conjunction with the space size of transmit buffer, configure interrupt produces trigger condition;
Length register: when being used for storage interruption generation, the number of the IP packet structure body address of from transmit buffer, extracting.
The EBI register: be used for storage and do not have the corresponding EBI of the EBI of PF when all it fails to match (i.e. all PF), same PDN connects down, if all carryings (comprising default bearing and dedicated bearer) all are assigned PF, then this EBI register is set to an invalid value;
Configuration register: be used for that storage coupling accelerator enables, matching module enables with trigger register and configuration information such as enable;
Status register: work state informations such as interrupt status, IP header parameter buffer, matching module;
Need to prove, if other functional requirements are arranged, can increase the register number and be used for different control.
Matching module comprises 256 PF, according to the order design from high to low of PF priority, be respectively PF0, PF1, PF2 ..., PF255, namely to correspond to priority be 0 PF to PF0, PFk deposits and preferentially corresponds to the PF that priority is k, PFk refers to k PF.There are five parts at least in each PF:
Comparator: be used for the match attribute value of IP packet head parameter value and PF relatively;
Status register: state informations such as record PF operating state;
EBI register: the EPS bearing identification (EBI) of depositing the PF correspondence;
Configuration register: deposit the control bit that enables of PF match attribute principle and matching module, PF match attribute principle wherein is according to bitmap (bitmap) design, and each bit represents a kind of validity of PF match attribute;
The property value register: deposit the match attribute value of corresponding PF, can as in the following table 1 design:
Wherein far-end address and far-end address subnet mask belong to same match attribute, represent so share a bit.
The PF0 that only drawn in Fig. 4 has comprised comparator, status register, EBI register, configuration register, property value register, but other PF has also comprised this five part, has all omitted in Fig. 4.
Transmit buffer: be used for depositing the IP pack arrangement body address after the match is successful.Data buffer area design should be noted: it is excessive that the buffer area space does not advise opening up, to reduce hardware spending;
Next introduce the workflow of coupling accelerator as shown in Figure 4.
The down trigger creation of condition can be according to trigger condition or the idle generation that triggers interrupt condition, trigger condition is: just produce when the IP packet of storing in the transmit buffer reaches trigger condition and interrupt, this interrupt notification mode can avoid that whenever the match is successful, and an IP packet just produces the inefficient situation of an interruption, can reduce and interrupt too frequently handling, save system resource, improve system effectiveness.The idle interrupt condition that triggers is: the number of the IP packet of last transmission does not probably reach and produces the number that triggers the IP packet that interrupts in actual the use, for solving the situation of this tail effect, can trigger interrupt last part IP packet is sent by the free time, idle to trigger the generation condition of interrupting be that following three conditions are set up simultaneously: all cache blocks free time in the IP header parameter buffer, matching module all enable PF be in enable IP packet in free time, the transmit buffer number greater than 0.
Need to prove, herein following four conditions of hypothesis in the application scenarios: the node number of each IP data chain is 10 in (1) this example, and just 10 IP packets are formed an IP data chain; (2) cache blocks of IP header parameter buffer has 16; (3) suppose that the trigger condition in the trigger register is made as 12; (4) must comprise one in the IP data chain in the IP packet structure body in order to store the member of corresponding EBI value, the match is successful or with whole PF when it fails to match as IP packet and PF, corresponding EBI is written among the member of IP packet correspondence, this can reduce the treating capacity of interrupting producing the back protocol stack, and has saved the data buffer space.Next introduce the workflow of coupling accelerator in detail:
At first, initial phase
1, matching module: according to receiving to such an extent that the match attribute value of PDN all upstream packet filter PF in connecting is come configuration register in the configurations match module, comprise the match attribute principle of each PF and enable configuration, dispose the corresponding EBI register of each PF.
2, main control module:
A), configuration EBI register: the EBI of the carrying correspondence of the no PF of storage, same PDN connect down, if all carryings (comprising default bearing and dedicated bearer) all are assigned PF, then this EBI register is set to an invalid value.
B), configuration register and trigger register configuration: configure interrupt enables, matching module enables, the trigger condition setting.
C), status register zero clearing.
D), enable to mate accelerator.
Then, matching stage
1, at first simply introduce the handling process of single IP packet in the coupling accelerator, as shown in Figure 5:
1.1, the IP packet enters the coupling accelerator, checks at first whether the coupling accelerator enable bit in the configuration register effective in the main control module, namely confirms whether to set up default bearing, if enable, coupling finishes to withdraw from; If enabled just to enter next step, extract the cache blocks that IP header parameter buffer is put in IP packet head parameter and IP packet structure body address, enter 1.2;
1.2, whether the matching module enable bit effective in the configuration register in the main control module, if do not enable, then transmit buffer is put in IP packet structure body address, simultaneously the EBI value in the main control module is write the corresponding member of IP packet structure body, coupling finishes to withdraw from; If enable, then the IP packet is sent into matching module and mate, enter 1.3;
1.3, from IP header parameter buffer, extract IP packet head parameter value, in matching module, carry out matching treatment, judge whether PF0 enables, do not enable then to enter PF1 module coupling, until enabling the PF module, if PF0 enables then the coupling of the match attribute value among IP packet head parameter value and the PF0 to be carried out, enter 1.4;
1.4, if the match is successful then IP packet structure body address is deposited in the transmit buffer, main control module writes corresponding member in the IP packet structure body with the corresponding EBI value of PF0 simultaneously, and the cache blocks state zero clearing of this IP packet head parameter will be stored in the cache blocks 1 in the IP header parameter buffer, represent 1 free time of this cache blocks, can store new IP packet head parameter, and with the PF0 state zero clearing in the matching module, expression PF0 enables the free time, this moment, PF0 can mate next IP packet, and matching process finishes; Then enter next PF as if it fails to match and mate, each PF afterwards does the processing identical with PF0, enters 1.5;
1.5, suppose to match PF254 success yet, enter PF255 and handle differently with the PF of front, judge whether PF255 enables, identical with 1.2 processing as if not enabling; If enable then the matching principle property value among IP packet head parameter value and the PF255 to be mated, the match is successful then deposits IP packet structure body address in the transmit buffer in, simultaneously the corresponding EBI value of PF255 is write corresponding member in the IP packet structure body, and the cache blocks state zero clearing of this IP packet head parameter will be stored in the cache blocks 1 in the IP header parameter buffer, represent 1 free time of this cache blocks, can store new IP packet head parameter, and with the zero clearing of PF255 state, expression PF0 enables the free time, this moment, PF255 can mate next IP packet, and coupling finishes to withdraw from; Still work is identical with 1.2 processing if it fails to match.
2, the workflow handled simultaneously of a plurality of IP data chains, shown in Fig. 6 (a), Fig. 6 (b), Fig. 6 (c), wherein, Fig. 6 (a) carries out the schematic diagram of matching treatment constantly at Ti for a plurality of IP data chains, Fig. 6 (b) carries out the schematic diagram of matching treatment constantly at Ti+1 for a plurality of IP data chains, Fig. 6 (c) carries out the schematic diagram of matching treatment for a plurality of IP data chains constantly at Ti+2, wherein
2.1, come when IP data chain 1, at first all the IP packet head parameter values in the IP data chain 1 and IP packet structure body address extraction are come out and be stored in together in each cache blocks of IP header parameter buffer, when being checked through IP header parameter buffer and having IP header parameter information, matching module extracts IP packet head parameter value in the cache blocks 1 and PF0 from IP header parameter buffer match attribute value matching ratio;
2.2, if at this moment IP data chain 2 arrives, IP header parameter buffer is checked through idle cache blocks, continues the IP packet head parameter value in the IP data chain 2 and IP packet structure body address extraction come out and is stored in together in the cache blocks idle in the IP header parameter buffer that all IP packet head parameter values and structure address extraction finish in IP data chain 2;
2.3, shown in Fig. 6 (a), at Ti constantly, IP1 begins the coupling with PF0, if it fails to match then send into next effectively PF and mate among the PF1; Otherwise the match is successful then deposits IP1 packet structure body address in the transmit buffer in and stores, and the EBIx with the PF0 correspondence writes corresponding member in the IP1 packet structure body simultaneously; Suppose IP1 and PFO herein the match is successful and be sent in the transmit buffer and store; To deposit in the cache blocks 1 state zero clearing of IP1 packet head parameter value in the IP header parameter buffer simultaneously, expression 1 free time of cache blocks, can store next IP packet head parameter value, and IP packet head parameter value and the IP packet structure body address of reading IP17 in the IP data chain 2 are left in the IP header parameter buffer in.As long as the PF0 module is in and enables idle condition, the matching principle property value that matching module continues to leave in the PF0 in the next IP2 packet head parameter value and matching module in the IP header parameter buffer compares coupling; Make IP packet head parameter extraction and Data Matching parallel running;
2.4, the matching treatment of IP packet in other PF undertaken by the handling process of IP1 packet in PF0, parameter extraction and Data Matching are parallel simultaneously carries out, the structure address that the data packet matched success of any one PF and IP just is present in this IP packet IP header parameter buffer writes in the transmit buffer, simultaneously the EBI value of this PF correspondence is write in this IP packet structure body among the corresponding member; Simultaneously corresponding PF in corresponding cache blocks zero clearing in the IP header parameter buffer and the matching module is identified into and enable the free time.
2.5, shown in Fig. 6 (b), at Ti+1 constantly, the match is successful deposits in the transmit buffer for the IP12 of IP8, the IP2 of IP data chain 1 and IP data chain 2, to deposit in the cache blocks state zero clearing of the packet header parameter value of depositing IP8, IP2, IP12 in the IP header parameter buffer simultaneously, represent this three cache blocks free time, but storing IP packet head parameter value and IP packet structure body address, and with the data packet matched successful PF state zero clearing of three IP therewith, represent that these three PF enable the free time; Suppose IP2 the match is successful yet in PF255 that then IP packet structure body address being write the EBI value that reads simultaneously in the transmit buffer in the main control module writes corresponding member in the IP packet structure body;
2.6, shown in Fig. 6 (c), at Ti+2 constantly, the number of the IP packet structure body address of storing in the transmit buffer satisfies trigger condition, namely is filled with 12 IP packet structure body addresses and produces an interrupt notification protocol stack deal with data; The IP packet structure body that read out from transmit buffer this moment disperses, and after protocol stack is handled the IP packet in the transmit buffer is formed a new IP data chain and transmits.Handle by this kind interrupt mode, satisfy in the IP data chain the PF high priority demand that the match is successful sends earlier;
2.7, in addition, there is a tail effect here, the number that is the IP packet of last transmission in the IP data chain does not probably reach the IP packet number that produces the triggering interruption, in the IP header parameter buffer in all cache blocks free time, the matching module all PF all be in and enable in free time, the transmit buffer IP packet number and set up simultaneously greater than 0 these three conditions and then produce idle the triggering and interrupt, just can avoid this tail effect.
One of ordinary skill in the art will appreciate that all or part of step that realizes in above-described embodiment method is to instruct relevant hardware to finish by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
More than the matching process of a kind of IP packet provided by the present invention and coupling accelerator are described in detail, for one of ordinary skill in the art, thought according to the embodiment of the invention, part in specific embodiments and applications all can change, in sum, this description should not be construed as limitation of the present invention.