Embodiment
Embodiments provide a kind of matching process and coupling accelerator of IP packet, for improving the matching efficiency of IP packet and packet filter.
For making 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 present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, the embodiments described below are only the present invention's part embodiments, and not all embodiments.Based on the embodiment in the present invention, the every other embodiment that those skilled in the art obtains, all belongs to the scope of protection of the invention.
The matching process of the IP packet that the embodiment of the present 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 then saved to respectively in x cache blocks of IP header parameter buffer.
Wherein n, x is positive integer, n refers to the number of the IP packet comprised in IP traffic, x refers to the number of the cache blocks comprised in IP header parameter buffer, it should be noted that, the n occurred in the embodiment of the present invention, what the m of x and follow-up appearance referred to is all quantity, and can be the applied environment according to reality and the quantitative value changed, n, x, m not refers to n, x, of these letters of m itself, can certainly replace with other arbitrary letter or numeral, just show packet herein, cache blocks, the number of packet filter, herein for illustrative purposes only, do not limit.
It should be noted that, in the embodiment of the present invention, n and x does not have corresponding relation, n is likely less than x, n is likely greater than x, not necessarily all cache blocks in IP header parameter buffer are filled up when initially starting buffer memory IP packet and go coupling again, likely buffer memory packet or several packet just start the process of coupling, do not limit herein for illustrative purposes only.
In embodiments of the present invention, mate accelerator to comprise: IP header parameter buffer, main control module, matching module, transmit buffer, wherein, IP header parameter buffer comprises: x cache blocks, and matching module comprises m packet filter.Explanation about x, m refers to aforementioned description, repeats no more herein.
In embodiments of the present invention, IP header parameter buffer, for depositing header parameter value and the structure address of IP packet, is supplied to matching module and carries out PF coupling.It should be noted that, the IP header parameter buffer now described includes x cache blocks, a kth cache blocks and (k+1) individual cache blocks is only described in subsequent step, workflow and implementation just in order to each cache blocks clearly can be described, certain IP header parameter buffer also can comprise multiple cache blocks, but the implementation of multiple cache blocks remains the workflow of a kth cache blocks that the repetition embodiment of the present invention provides and (k+1) cache blocks, is still just included among the embodiment of the present 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 IP header parameter and extracting, matching module in the embodiment of the present invention also carries out matching treatment at the same time, the speed extracted when IP header parameter is less than PF rate matched in matching module, the situation that buffer memory is not enough would not be there is in IP header parameter buffer, in order to reduce hardware resource cost, cache blocks herein in IP header parameter buffer is specifically as follows 16, namely the cache blocks that IP header parameter buffer comprises is the 1st cache blocks, 2nd cache blocks, 16th cache blocks.
In embodiments of the present invention, IP traffic comprises n IP packet, but usually can comprise multiple IP packet in an IP traffic (also can be an IP Data-Link) in actual applications, it should be noted that, the IP traffic now described comprises n IP packet just in order to clearly describe processed workflow and the implementation of each IP packet, certain IP traffic also can comprise multiple IP packet, but the processed flow process to the IP packet preserved in the IP packet preserved in a kth cache blocks and (k+1) individual cache blocks that the repetition embodiment of the present invention provides is remained to the implementation of multiple IP packet, still just be included among the embodiment of the present invention.Header parameter value and the IP packet structure body address of IP packet is included in each IP packet, a such as IP packet just includes an IP data packet header parameter value and an IP packet structure body address, and the 2nd IP packet just includes the 2nd IP data packet header 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 multiple cache blocks, multiple IP data packet header parameter value and structure address can be kept in idle cache blocks herein.
202, the header parameter value of the match attribute value of i-th packet filter with the IP packet preserved in a kth cache blocks is mated by i-th packet filter of matching module, if the match is successful, triggered step 203 performs, if mate unsuccessful, triggered step 204 performs.
Wherein, matching module comprises m packet filter, and wherein, 1≤i < (i+1) < m, i, k, m are positive integers.I, k, (i+1) be all positive integer, i, (i+1) satisfy condition 1≤i < (i+1) < m, wherein i refers to i-th packet filter in matching module, (i+1) (i+1) individual packet filter in matching module is referred to, k refers to a kth cache blocks in IP header parameter buffer, it should be noted that, the i occurred in the embodiment of the present invention, k, and (k+1) of follow-up appearance refer to is all some packet filters or cache blocks (i+1), if such as i value is 3, what then refer to is the 3rd packet filter in matching module, k value is 1, that then refer to is the 1st cache blocks, in addition i in IP header parameter register, k, (i+1) and (k+1) of follow-up appearance can be applied environment according to reality and the quantitative value changed, i, k, (i+1), (k+1) not i is referred to, k, (i+1), (k+1) these letters is own, can certainly replace, just show which packet filter herein with other arbitrary letter or numeral, which cache blocks, does not limit herein for illustrative purposes only.
In embodiments of the present invention, main control module is used for the control to IP header parameter buffer, matching module, transmit buffer, whether enable such as main control module control matching module, IP header parameter buffer, transmit buffer, only when enable, its excess-three module could normal work.
In embodiments of the present invention, matching module comprises m packet filter, the implementation method of i-th packet filter is only described in step 202, it should be noted that, i-th packet filter in the matching module now described is just in order to can the workflow of a packet filter clearly in profile matching module and implementation, certain matching module also can comprise multiple packet filter, but the multiple points of implementations making filter remain the workflow of i-th packet filter that the repetition embodiment of the present invention provides, still just be included among the embodiment of the present invention.
In embodiments of the present invention, matching module is main functional module, matching ratio is carried out comparatively for IP packet and network being joined the effective packet filter given, and EPS bearing identification (EBI, EPSBearerIdentity) corresponding for the packet filter that the match is successful is write in the structure of IP packet.Wherein, the matching principle of IP packet can mate according to priority is high to Low, therefore the design of packet filtering device also can be mated according to the order high to Low from priority.
It should be noted that, in the invention process, priority index (the EPI of i-th packet filter, EvaluationPrecedenceIndex) can higher than the EPI of (i+1) individual packet filter, each packet filter is identified by unique packet filter identifier (PFID), 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 using identical ip addresses and APN, the priority span of priority index is 0 ~ 255, wherein 0 representative is that priority is the highest, 255 representative be that priority is minimum.
In embodiments of the present invention, the header parameter value of the match attribute value of i-th packet filter with the IP packet preserved in a kth cache blocks is mated by i-th packet filter, wherein, match attribute value comprises at least one of following property value: far-end address and subnet mask property value, Security Parameter Index property value, flow label property value, local port scope attribute value, remote port scope attribute value, Internet protocol the 4th edition (IPv4, InternetProtocolversion4) COS or Internet protocol sixth version (IPv6 in, InternetProtocolversion6) grade of service property value in, next property value in protocol number or IPV6 in IPV4.
All packet filters and EPS can be carried by EBI and mutually map, each EPS carries corresponding EBI parameter and TFT.Corresponding packet filter can not had in each TFT, but PDN can only have at most in a TFT in connecting and not have packet filter, if that is default bearing does not have packet filter so PDN connect all must packet filter in corresponding all coupling accelerators.
In view of packet filter in the embodiment of the present invention is to the matching process of IP packet, the advantage increasing IP header parameter buffer is:
(1), the header parameter value of other IP packets in IP traffic can be extracted at matching module while Match IP packet, thus improve matching efficiency;
(2), can reduce the hardware spending of matching module and matching ratio compared with time IP data packet header parameter copy number of times, were it not for the IP header parameter buffer that the embodiment of the present invention proposes, need in each PF so in matching module to open up another memory space for depositing IP data packet header parameter for each matching ratio comparatively, each like this PF needs to increase large space same with property value register again, for 256 PF, whole matching module just needs extra increase by 256 registers, adds hardware spending; Secondly, when IP packet in previous PF, fail that the match is successful need be sent to next PF mate, there are two kinds of methods, one again from IP packet, takes out IP data packet header parameter, but because relate to the parameter of two not fixed positions in these header parameter, so the expense of again peeking is larger than copying from the register of the header parameter of previous PF storing IP packet; Another kind copies from a upper PF, considers limiting case, then need copy 256 times.More both can reduce hardware spending also can reduce copy number of times so the match attribute value in the IP header parameter buffer directly using the embodiment of the present invention to provide and PF carries out matching ratio, improve matching efficiency.
It should be noted that in addition, for a kth cache blocks and i-th packet filter in step 202, the effective cache blocks all referred to and the packet filter of enable free time (namely can carry out the cache blocks read and the packet filter that can carry out mating), comprise the packet filter that (i+1) individual packet filter of occurring in subsequent step and (k+1) individual cache blocks also refer to effective cache blocks and enable free time, also be the packet filter for the enable free time, (i+1) individual packet filter might not be that packet filter adjacent with i-th packet filter, same (k+1) individual cache blocks also might not be that cache blocks adjacent with a kth cache blocks.In brief, for cache blocks: idle expression can write header parameter value and the structure address of IP packet inside, effectively represent that the header parameter value that can read in cache blocks is mated with PF; For matching module, the enable free time represents can mate with the header parameter value in next valid cache block.
If the match is successful for the header parameter value of the IP packet preserved in the match attribute value of 203 i-th packet filters and a kth cache blocks, the evolved packet system of i-th packet filter carrying index EBI writes in the structure of IP packet corresponding to a kth cache blocks by main control module, main control module by the structure address of IP packet of preserving in a kth cache blocks stored in transmit buffer.
In embodiments of the present invention, if the match is successful for the header parameter value of the IP packet preserved in the match attribute value of i-th packet filter and a kth cache blocks, the EBI of i-th packet filter writes in the structure of the IP packet preserved in a kth cache blocks by main control module, main control module by the structure address of IP packet of preserving in a kth cache blocks stored in transmit buffer, wherein, transmit buffer is 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 buffer space does not need to open up, to reduce hardware spending.
It should be noted that, in embodiments of the present invention, one must be comprised in order to store the member of corresponding EBI value in IP packet structure body, as IP packet and PF, the match is successful or unsuccessfully need corresponding EBI value to write wherein, namely the EBI of packet filter is write in member corresponding to IP packet structure body when the match is successful, all packet filters all data packet matched with IP failed time the EBI in main control module is write in member corresponding to IP packet structure body.
It should be noted that, in actual applications, main control module by the structure address of IP packet of preserving in the kth cache blocks that the match is successful stored in after in transmit buffer, step can also be comprised: whether master control module judges meets preset down trigger condition, if meet, main control module triggered interrupts, protocol stack is exported in the structure address of the IP packet preserved in transmit buffer by transmit buffer, to make the structure address of protocol stack to IP packet process, if do not meet, main control module is triggered interrupts not.Such as, main control module is that transmit buffer arranges down trigger condition, when interrupting trigger condition and meeting, main control module triggered interrupts, protocol stack is exported in the IP packet structure body address of preserving in transmit buffer by transmit buffer, to meet in IP traffic the IP packet structure body address priority treatment that the match is successful.
In actual applications, the down trigger condition that main control module is preset specifically can comprise: the number of the IP packet structure body address of preserving in transmit buffer is not less than preset number; Or, meet the condition of idle triggered interrupts, wherein, the condition of idle triggered interrupts comprises: the number that in IP header parameter buffer, all cache blocks all m packet filters that are idle, matching module are all in the structure address of the IP packet preserved in enable idle condition, transmit buffer is greater than zero.
If it fails to match for the header parameter value of the IP packet preserved in the match attribute value of 204 i-th packet filters and a kth cache blocks, the header parameter value of the match attribute value of (i+1) individual packet filter with the IP packet preserved in a kth cache blocks is mated by (i+1) individual packet filter of matching module.
In embodiments of the present invention, when it fails to match for the header parameter value of the IP packet preserved in i-th packet filter and a kth cache blocks, continued to mate with the IP data packet header parameter value preserved in a kth cache blocks by (i+1) individual packet filter.This is a process constantly continuing to carry out, if containing multiple packet filter in matching module, then when it fails to match for previous packet filter, needs to proceed coupling by follow-up packet filter.
It should be noted that, in embodiments of the present invention, a kind of attainable situation is, after the match attribute value of (i+1) individual packet filter is mated with the header parameter value of the IP packet preserved in a kth cache blocks by (i+1) individual packet filter of matching module, can also comprise the steps:
As (i+1)=m, if it fails to match for the header parameter value of the IP packet preserved in the match attribute value of (i+1) individual packet filter and a kth cache blocks, evolved packet system carrying index EBI in main control module writes in the structure of IP packet corresponding to a kth cache blocks by main control module, main control module by the structure address of IP packet of preserving in a kth cache blocks stored in transmit buffer.
That is, if the m that matching module a comprises packet filter is when all it fails to match, then the EBI in main control module writes in the IP packet preserved in a kth cache blocks by main control module, main control module by the structure address of IP packet of preserving in a kth cache blocks stored in transmit buffer.
Below citing is described, in actual applications, the priority span of priority index is 0 ~ 255, matching module specifically can comprise 256 packet filter PF, according to PF priority sequence design from high to low, namely PF0 corresponds to the PF that priority is 0, PFk deposits and preferentially corresponds to the PF that priority is k, first mated by PF0, if it fails to match, mated by PF1, if it fails to match for PF1, continue to be mated by PF2, until mated by PF255, if it fails to match for PF255, then the EBI of main control module writes in the structure of the IP packet preserved in a kth cache blocks by main control module, main control module by the structure address of the IP packet in a kth cache blocks stored in transmit buffer.
205, after the match attribute value of i-th packet filter is mated with the header parameter value of the IP packet preserved in a kth cache blocks by i-th packet filter of matching module, the match attribute value of i-th packet filter is mated with the header parameter value of the IP packet preserved in (k+1) individual cache blocks by i-th packet filter.
In embodiments of the present invention, after the match attribute value of i-th packet filter is mated with the header parameter value of the IP packet preserved in a kth cache blocks by i-th packet filter of matching module, the match attribute value of i-th packet filter is mated with the header parameter value of the IP packet preserved in (k+1) individual cache blocks by i-th packet filter, due to i-th packet filter enable idle time just can proceed coupling work, and do not need m packet filter in by the time matching module all mated after just can mate, therefore the matching way that walks abreast can be realized, improve matching efficiency.
It should be noted that, in embodiments of the present invention, step 205 can also comprise the steps: before performing
(i+1) individual packet filter whether enable free time of master control module judges matching module, if so, main control module triggers (i+1) individual packet filter and performs the function of carrying out with the header parameter value of the IP packet preserved in a kth cache blocks mating.Namely, before (i+1) individual packet filter starts to mate, the state of master control module judges once (i+1) individual packet filter, if (i+1) individual packet filter is effective, main control module triggers (i+1) individual packet filter again to start to mate work.
It should be noted that, in the embodiment of the present invention, before the match attribute value of i-th packet filter is mated with the header parameter value of the IP packet preserved in (k+1) individual cache blocks by i-th packet filter of matching module, also comprise: in master control module judges IP header parameter buffer, whether (k+1) individual cache blocks is effective, if so, main control module triggers i-th packet filter and mates with the header parameter value of the IP packet preserved in (k+1) individual cache blocks.
In embodiments of the present invention, first IP header parameter buffer extracts header parameter value and the structure address of each IP packet respectively from the n of IP traffic IP packet, then be saved in x cache blocks in IP header parameter buffer respectively, the header parameter value of the match attribute value of the i-th packet filter with the IP packet preserved in a kth cache blocks is mated by i-th packet filter of matching module, then the match attribute value of i-th packet filter is entered to mate with the header parameter value of the IP packet preserved in (k+1) individual cache blocks by i-th packet filter, visible, in embodiments of the present invention, i-th packet filter is after the header parameter value of having mated the IP packet preserved in a kth cache blocks, just can mate the header parameter value of the IP packet preserved in (k+1) individual cache blocks again, and do not need that m packet filter in by the time matching module is all data packet matched with the IP that preserves in a kth cache blocks completely to carry out afterwards again, that is, in the embodiment of the present invention, each packet filter in matching module can parallel processing to the coupling of the IP packet preserved in each cache blocks in IP header parameter buffer, the matching efficiency of IP packet and packet filter can be improved.
Above embodiment describes the matching process of the IP packet that the embodiment of the present invention provides, next the device that method that the embodiment of the present invention provides is corresponding is introduced: 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, for extracting header parameter value and the structure address of each IP packet from n IP packet of IP traffic respectively, then be saved to respectively in x cache blocks of described IP header parameter buffer, wherein, n is positive integer;
Matching module 303 comprises m packet filter, wherein, 1≤i < (i+1) < m, i, m are positive integers;
I-th packet filter 3031 of matching module, for the header parameter value of the match attribute value of i-th packet filter 3031 with the IP packet preserved in a kth cache blocks 3011 being mated, wherein, k is positive integer;
Main control module 302, if for the header parameter value of IP packet of preserving in the match attribute value of i-th packet filter 3031 and a kth cache blocks 3011, the match is successful, the evolved packet system of i-th packet filter 3031 carrying index EBI is write in the structure of the IP packet of a kth cache blocks 3011 correspondence, by the structure address of the IP packet in a kth cache blocks 3011 stored in transmit buffer 304;
Transmit buffer 304, for preserve main control module 302 stored in a kth cache blocks in the structure address of IP packet of preserving;
(i+1) individual packet filter 3032 of matching module, if for the header parameter value of IP packet of preserving in the match attribute value of i-th packet filter 3031 and a kth cache blocks, it fails to match, the match attribute value of individual to (i+1) packet filter 3032 mated with the IP data packet header parameter value preserved in a kth cache blocks;
I-th packet filter 3031 of matching module, after the match attribute value of i-th packet filter 3031 is mated with the header parameter value of the IP packet preserved in a kth cache blocks 3011, the header parameter value of the match attribute value of i-th packet filter 3031 with the IP packet preserved in (k+1) individual cache blocks 3012 is mated.
It should be noted that, for main control module 302 and (i+1) individual packet filter 3032, in actual applications, main control module 302, also for working as (i+1)=m, if it fails to match for the header parameter value of the IP packet preserved in the match attribute value of (i+1) individual packet filter 3032 and a kth cache blocks 3011, evolved packet system carrying index EBI in main control module 302 is write in the structure of the IP packet of a kth cache blocks 3011 correspondence, by the structure address of the IP packet of preservation in a kth cache blocks 3011 stored in transmit buffer 304.
It should be noted that, for main control module 302 and transmit buffer 304, in actual applications, main control module 302, also meets preset down trigger condition for judging whether, if meet, triggered interrupts;
Transmit buffer 304, also for protocol stack is exported in the structure address of the IP packet preserved in transmit buffer 304, processes to make the structure address of protocol stack to the IP packet preserved in transmit buffer 304.
It should be noted that, for main control module 302 and IP header parameter buffer 301, in actual applications, main control module 302, also for the structure address of IP packet that will preserve in a kth cache blocks 3011 stored in after in transmit buffer 304, a kth cache blocks 3011 of IP header parameter register 301 is reset;
IP header parameter buffer 301, also for extracting the header parameter value of the IP packet do not preserved and structure address and be saved to the kth cache blocks 3011 of IP header parameter buffer from IP traffic.
It should be noted that, for main control module 302, in actual applications, main control module 302, also before performing at (i+1) individual packet filter 3032, carry out judging (i+1) individual packet filter 3032 whether enable free time, if so, trigger (i+1) individual packet filter 3032 to perform.
What needs were said is, main control module 302, also before performing at i-th packet filter, judge that whether (i+1) individual cache blocks is effective, if so, trigger i-th packet filter 3031 to mate with the header parameter value of the IP packet preserved in (k+1) individual cache blocks 3012.
It should be noted that, the content such as information interaction, implementation between each module/unit of said apparatus, due to the inventive method embodiment based on same design, its technique effect brought is identical with the inventive method embodiment, particular content see describing in the present invention's embodiment of the method as shown in Figure 1, can repeat no more herein.
In the embodiment of the present invention, first IP header parameter buffer extracts header parameter value and the structure address of each IP packet respectively from the n of IP traffic IP packet, then be saved in x cache blocks in IP header parameter buffer respectively, the header parameter value of the match attribute value of the i-th packet filter with the IP packet preserved in a kth cache blocks is mated by i-th packet filter of matching module, then the match attribute value of i-th packet filter is entered to mate with the header parameter value of the IP packet preserved in (k+1) individual cache blocks by i-th packet filter, visible, in embodiments of the present invention, i-th packet filter is after the header parameter value of having mated the IP packet preserved in a kth cache blocks, just can mate the header parameter value of the IP packet preserved in (k+1) individual cache blocks again, and do not need that m packet filter in by the time matching module is all data packet matched with the IP that preserves in a kth cache blocks completely to carry out afterwards again, that is, in the embodiment of the present invention, each packet filter in matching module can parallel processing to the coupling of the IP packet preserved in each cache blocks in IP header parameter buffer, the matching efficiency of IP packet and packet filter can be improved.
Next, be described in detail to the coupling accelerator that the embodiment of the present invention proposes with an actual application scenarios, as shown in Figure 4, 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, in order to the enable work of all PF in matching module can be made, so n value should be 256, because IP header parameter buffer is when carrying out IP header parameter and extracting, matching module also matching treatment at the same time, the speed extracted when IP header parameter is less than PF rate matched in matching module, the inadequate situation of buffer memory would not be there is in IP header parameter buffer, in order to reduce hardware resource cost, herein in IP header parameter buffer cache blocks for 16.Wherein, each cache blocks in IP header parameter buffer at least should comprise three parts, as shown in Figure 4, only depict in Fig. 4 in cache blocks 1 and include IP packet structure body address register, match attribute value register, status register, other cache blocks as cache blocks 2 ..., cache blocks n includes this 3 parts, specifically comprise in each cache blocks: one for depositing the structure address register including IP packet information; Another is for depositing the match attribute value register of the header parameter extracted from IP packet, also has one to be used to indicate the whether effective status register of current cache block.Wherein the read-write of cache blocks operates successively according to the operating state of cache blocks, for writing cache blocks when preserving header parameter value and the structure address of IP packet in the cache blocks in IP header parameter buffer, the free buffer block writing cache blocks nearest backward from last time in existing free buffer block carries out write operation; For reading cache blocks when IP header parameter is mated with matching module, the valid cache block reading cache blocks nearest backward from last time in existing valid cache block carries out read operation.
Main control module comprises: trigger register, length register, EBI register, configuration register, status register, next introduces one by one respectively.
Trigger register: in conjunction with the space size of transmit buffer, configure interrupt produces trigger condition;
Length register: when interrupting producing for storing, the number of the IP packet structure body address of extracting from transmit buffer.
EBI register: for storing EBI corresponding to EBI when all it fails to match (namely all PF) that do not have PF, under same PDN connects, if all carryings (comprising default bearing and dedicated bearer) are all assigned PF, then this EBI register is set to an invalid value;
Configuration register: for storing the configuration informations such as coupling accelerator is enable, matching module is enable and trigger register is enable;
Status register: the work state informations such as interrupt status, IP header parameter buffer, matching module;
It should be noted that, if there are other functional requirements, register number can be increased for different control.
Matching module comprises 256 PF, according to PF priority sequence design from high to low, be respectively PF0, PF1, PF2 ..., PF255, namely PF0 corresponds to the PF that priority is 0, and PFk deposits and preferentially corresponds to the PF that priority is k, and PFk refers to a kth PF.At least there are five parts in each PF:
Comparator: compare with the match attribute value of PF for IP data packet header parameter value;
Status register: the state informations such as record PF operating state;
EBI register: deposit the EPS bearing identification (EBI) that PF is corresponding;
Configuration register: the enable control bit depositing PF match attribute principle and matching module, PF match attribute principle is wherein according to bitmap (bitmap) design, and each bit represents a kind of validity of PF match attribute;
Property value register: the match attribute value depositing corresponding PF, can as in following table 1 design:
Wherein far-end address and far-end address subnet mask belong to same match attribute, therefore a shared bit represents.
Only depict PF0 in the diagram and include comparator, status register, EBI register, configuration register, property value register, but other PF also includes this five part, is omitted in the diagram.
Transmit buffer: for depositing the IP pack arrangement body address after the match is successful.Data buffer area design should be noted: it is excessive that buffer space does not advise opening up, to reduce hardware spending;
The workflow of following introduction coupling accelerator as shown in Figure 4.
Down trigger creation of condition can according to trigger condition or idle triggered interrupts creation of condition, trigger condition is: just produce interruption when the IP packet stored in transmit buffer reaches trigger condition, this interrupt notification mode can avoid that often the match is successful, and an IP packet just produces an inefficient situation of interrupting, interrupt processing too frequently can be reduced, save system resource, improve system effectiveness.Idle triggered interrupts condition is: in actual use, the number of the IP packet of last transmission does not probably reach the number of the IP packet producing triggered interrupts, for solving the situation of this tail effect, gone out by last part IP Packet Generation by idle triggered interrupts, the Production conditions of idle triggered interrupts is that following three conditions are set up simultaneously: the number that in IP header parameter buffer, all cache blocks free time, all enable PF of matching module are in IP packet in enable free time, transmit buffer is greater than 0.
It should be noted that, herein following four conditions of hypothesis in application scenarios: in (1) this example, the node number of each IP Data-Link is 10, and namely 10 IP packets form an IP Data-Link; (2) cache blocks of IP header parameter buffer has 16 pieces; (3) suppose that the trigger condition in trigger register is set to 12; (4) one must be comprised in IP Data-Link in IP packet structure body in order to store the member of corresponding EBI value, when the match is successful or it fails to match with whole PF for IP packet and PF, corresponding EBI is written in member corresponding to IP packet, this can reduce the treating capacity interrupting producing rear protocol stack, and saves data buffer space.Next the workflow of coupling accelerator is introduced in detail:
First, initial phase
1, matching module: according to receive PDN connect in the match attribute value of all upstream packet filter PF carry out in configurations match module configuration register, comprise the match attribute principle of each PF and enable configuration, configure the corresponding EBI register of each PF.
2, main control module:
A), configuration EBI register: store the EBI without the carrying correspondence of PF, under same PDN connects, if all carryings (comprising default bearing and dedicated bearer) are all assigned PF, then this EBI register is set to an invalid value.
B), configuration register and trigger register configuration: configure interrupt is enable, matching module is enable, and trigger condition is arranged.
C), status register resets.
D), enable coupling accelerator.
Then, matching stage
1, the handling process of single IP packet in coupling accelerator is first simply introduced, as shown in Figure 5:
1.1, IP packet enters coupling accelerator, and first check that whether the coupling accelerator enable bit in main control module in configuration register is effective, be namely confirmed whether to set up default bearing, if not enable, coupling end is exited; If just enter next step enable, the cache blocks of IP header parameter buffer is put in extraction IP data packet header parameter and IP packet structure body address, enters 1.2;
1.2, in the configuration register in main control module, whether matching module enable bit is effective, if not enable, then transmit buffer is put in IP packet structure body address, simultaneously by the corresponding member of EBI value write IP packet structure body in main control module, coupling end is exited; If enable, then IP packet sent into matching module and mate, enter 1.3;
1.3, from IP header parameter buffer, IP data packet header parameter value is extracted, matching treatment is carried out in matching module, judge that whether PF0 is enable, not enable, enter PF1 module coupling, until there is enable PF module, if PF0 is enable, IP data packet header parameter value is mated with the match attribute value in PF0 and carries out, enter 1.4;
If 1.4 the match is successful, by IP packet structure body address stored in transmit buffer, main control module is by corresponding member in corresponding for PF0 EBI value write IP packet structure body simultaneously, and the cache blocks state storing this IP data packet header parameter in cache blocks 1 in IP header parameter buffer is reset, represent that this cache blocks 1 is idle, new IP data packet header parameter can be stored, and the PF0 state in matching module is reset, represent the PF0 enable free time, now PF0 can mate next IP packet, and matching process terminates; If it fails to match, enter next PF and mate, each PF afterwards does the process identical with PF0, enters 1.5;
1.5, suppose to match PF254 still unsuccessful, it is different from PF above to enter PF255 process, judges that whether PF255 enable, if not enable with 1.2 process identical, if enable, IP data packet header parameter value is mated with the matching principle property value in PF255, the match is successful then by IP packet structure body address stored in transmit buffer, simultaneously by corresponding member in corresponding for PF255 EBI value write IP packet structure body, and the cache blocks state storing this IP data packet header parameter in the cache blocks 1 in IP header parameter buffer is reset, represent that this cache blocks 1 is idle, new IP data packet header parameter can be stored, and PF255 state is reset, represent the PF0 enable free time, now PF255 can mate next IP packet, coupling end is exited, if it fails to match still do to process with 1.2 identical.
2, multiple IP Data-Link carries out the workflow that processes simultaneously, as shown in Fig. 6 (a), Fig. 6 (b), Fig. 6 (c), wherein, Fig. 6 (a) to carry out the schematic diagram of matching treatment for multiple IP Data-Link in the Ti moment, Fig. 6 (b) to carry out the schematic diagram of matching treatment for multiple IP Data-Link in the Ti+1 moment, Fig. 6 (c) to carry out the schematic diagram of matching treatment for multiple IP Data-Link in the Ti+2 moment, wherein
2.1, when IP Data-Link 1 is come, first by all IP data packet header parameter values in IP Data-Link 1 and IP packet structure body address extraction out and be stored in each cache blocks of IP header parameter buffer together, when being checked through IP header parameter buffer and there is IP header parameter information, matching module extracts the match attribute value matching ratio of IP data packet header parameter value in cache blocks 1 and PF0 comparatively from IP header parameter buffer;
If 2.2 at this moment IP Data-Link 2 arrive, IP header parameter buffer is checked through available free cache blocks, continues by the IP data packet header parameter value in IP Data-Link 2 and IP packet structure body address extraction out and to be stored in cache blocks idle in IP header parameter buffer until all IP data packet header parameter values and structure address extraction terminate in IP Data-Link 2 together;
2.3, as shown in Fig. 6 (a), in the Ti moment, IP1 starts to mate with PF0, if it fails to match, sends in next effectively PF and PF1 and mates; Otherwise the match is successful then stores IP1 packet structure body address stored in transmit buffer, EBIx corresponding for PF0 is write corresponding member in IP1 packet structure body simultaneously; Suppose IP1 and PFO herein the match is successful and be sent in transmit buffer and store; Cache blocks 1 state depositing in IP1 data packet header parameter value in IP header parameter buffer is reset simultaneously, represent that cache blocks 1 is idle, next IP data packet header parameter value can be stored, and read the IP data packet header parameter value of IP17 in IP Data-Link 2 and IP packet structure body address is left in IP header parameter buffer.As long as PF0 module is in enable idle condition, matching module continues to compare with the matching principle property value of the PF0 in matching module mate leaving in IP header parameter buffer next IP2 data packet header parameter value in; Make IP data packet header parameter extraction and Data Matching parallel running;
2.4, the matching treatment of IP packet in other PF is undertaken by the handling process of IP1 packet in PF0, parameter extraction and Data Matching walk abreast and carry out simultaneously, this IP packet is just present in the structure address write transmit buffer of IP header parameter buffer by the data packet matched success of any one PF and IP, simultaneously by corresponding member in this IP of EBI value corresponding for this PF write packet structure body; Cache blocks corresponding in IP header parameter buffer is reset simultaneously and identify into the enable free time with corresponding PF in matching module.
2.5, as shown in Fig. 6 (b), in the Ti+1 moment, the match is successful deposits in transmit buffer for the IP12 of IP8, IP2 and IP Data-Link 2 of IP Data-Link 1, the cache blocks state depositing in the packet header parameter value depositing IP8, IP2, IP12 in IP header parameter buffer is reset simultaneously, represent that this three cache blocks is idle, can storing IP data packet header parameter value and IP packet structure body address, and will the data packet matched successful PF state of three IP reset therewith, represent this three PF enable free time; Suppose IP2 the match is successful yet in PF255 then the EBI value simultaneously read in main control module in IP packet structure body address write transmit buffer to be write corresponding member in IP packet structure body;
2.6, as shown in Fig. 6 (c), in the Ti+2 moment, the number of the IP packet structure body address stored in transmit buffer meets trigger condition, is namely filled with 12 IP packet structure body addresses and produces an interrupt notification protocol stack deal with data; The IP packet structure body now read out from transmit buffer is dispersion, after protocol stack process, the IP packet in transmit buffer is formed a new IP Data-Link and transmits.By this kind of interrupt mode process, meet in IP Data-Link the PF high priority demand that first the match is successful sends;
2.7, in addition, there is a tail effect here, namely in IP Data-Link, the number of the IP packet of last transmission does not probably reach the IP packet number producing triggered interrupts, in IP header parameter buffer, in idle, the matching module of all cache blocks, all PF are in IP packet number in enable free time, transmit buffer and are greater than 0 these three conditions and set up simultaneously, produce idle triggered interrupts, just can avoid this tail effect.
One of ordinary skill in the art will appreciate that all or part of step realized in above-described embodiment method is that the hardware that can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be read-only memory, disk or CD etc.
Above the matching process of a kind of IP packet provided by the present invention is described in detail with coupling accelerator, for one of ordinary skill in the art, according to the thought of the embodiment of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.