CN101159663B - Interface scheduling method and interface scheduling device - Google Patents

Interface scheduling method and interface scheduling device Download PDF

Info

Publication number
CN101159663B
CN101159663B CN2007101208651A CN200710120865A CN101159663B CN 101159663 B CN101159663 B CN 101159663B CN 2007101208651 A CN2007101208651 A CN 2007101208651A CN 200710120865 A CN200710120865 A CN 200710120865A CN 101159663 B CN101159663 B CN 101159663B
Authority
CN
China
Prior art keywords
interface
bitmap
bit
status
level
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2007101208651A
Other languages
Chinese (zh)
Other versions
CN101159663A (en
Inventor
郭玮维
李文群
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN2007101208651A priority Critical patent/CN101159663B/en
Publication of CN101159663A publication Critical patent/CN101159663A/en
Application granted granted Critical
Publication of CN101159663B publication Critical patent/CN101159663B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an interface scheduling method and an interface scheduling device. The method is suitable for supporting network equipment with multiple interfaces, and comprises recording whether any interface of the network equipment has a message in a preset interface state table; and the network equipment directly schedules the interface with the message through searching in the interface state table. The device is suitable for the network equipment with a plurality of interfaces, and comprises an interface state table module and an interface positioning module. The inventive method and the device prevent processing resource waste due to the network equipment polling at the interface without the message, and improve the interface scheduling efficiency.

Description

Interface dispatching method and interface dispatching device
Technical field
The present invention relates to the communication technology, relate in particular to a kind of interface dispatching method and interface dispatching device.
Background technology
Along with development of Communication Technique, the network equipment (as router) itself the network interface quantity that can support more and more huger; But because prior art can't overcome the contradiction between network equipment service quality (Quality of Service is called for short QOS) and the network device interface quantity, this has limited the network interface quantity that network equipment reality is supported.
Specifically, in the prior art, the network equipment by successively between its whole interfaces poll realize the interface scheduling: running into does not have the interface of message just to skip, and runs into the interface that message is arranged, then the message of this interface is handled, served next interface after finishing dealing with again.As can be seen, this scheme is suitable for the less relatively situation of interface quantity, and when interface quantity was very big, polling mechanism can cause the network equipment to spend the considerable time was not successively had the inquiry of message interface; Particularly in the network environment of reality, flow on each interface is uneven, there is not message in a large amount of interfaces, therefore, under the huge condition of interface quantity, adopt polling mechanism to carry out the scheduling of interface, to cause the actual forwarding performance of the network equipment to descend significantly, objectively limit the actual interface quantity that the network equipment can be supported.
In sum, how under the huge situation of interface quantity, realization interface scheduling rapidly and efficiently just becomes the key point of breaking current network equipment interface quantity bottleneck, and effective and feasible technical scheme is not provided in the prior art.
Summary of the invention
The purpose of this invention is to provide a kind of interface scheduling scheme, avoid the network equipment to carry out poll and waste the processing resource at the interface that does not have message.
For achieving the above object, embodiments of the invention provide a kind of interface dispatching method, are applicable to the network equipment of supporting many interfaces, may further comprise the steps:
Whether step 1, whether the record network equipment arbitrary interface exists message in a default Interface status table, have in the interface mask table of same-interface entry the arbitrary interface of the record network equipment at default and an Interface status table and dispatch;
Step 2, the described network equipment are directly dispatched an interface that not only has message but also be not scheduled by searching described Interface status table and described interface mask table.
Embodiments of the invention also provide a kind of interface dispatching device, are applicable to the network equipment that comprises a plurality of interfaces, comprise Interface status table module, interface locating module and interface mask table module; Described Interface status table module is connected with described a plurality of interfaces respectively, is used for the saving interface state table, and described Interface status table is used to write down each interface of the network equipment and whether has message; Described interface locating module, be connected with the central processing unit and the Interface status table module of the described network equipment, be used for according to the interface dispatch command, and the record of comprehensive described Interface status table module and interface mask table module, directly location one interface that not only has message but also be not scheduled is dispatched by the described network equipment; Described interface mask table module, be connected with the interface locating module with described Interface status table module respectively, be used to preserve the interface mask table that has the same-interface entry with the Interface status table, and whether dispatch according to the arbitrary interface of the positioning result record network equipment of interface locating module.
As shown from the above technical solution, the present invention adopts table look-at to locate the scheduling mode of the interface that not only has message but also be not scheduled by real time record network device interface situation, has following beneficial effect:
1, avoids the network equipment to carry out poll and the processing wasting of resources that causes, improved the treatment effeciency of interface scheduling at the interface that does not have message;
2, further by mask is set, guaranteed the interface scheduling fairness.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Description of drawings
Fig. 1 is the flow chart of interface dispatching method embodiment 1 provided by the present invention;
Fig. 2 is the flow chart of interface dispatching method embodiment 2 provided by the present invention;
Fig. 3 is the flow chart of interface dispatching method embodiment 3 provided by the present invention;
Fig. 4 is in the method shown in Figure 3, and the flow chart of Interface status bitmap one specific embodiment is set;
Fig. 5 is the schematic diagram of a secondary bitmap;
Fig. 6 is in the method shown in Figure 3, carries out a specific embodiment flow chart of interface scheduling;
Fig. 7 is the flow chart of interface dispatching method embodiment 4 provided by the present invention;
Fig. 8 is in the method shown in Figure 7, carries out a specific embodiment flow chart of interface scheduling;
Fig. 9 is the block diagram of interface dispatching device embodiment 1 provided by the present invention;
Figure 10 is the block diagram of interface dispatching device embodiment 2 provided by the present invention;
Figure 11 is the block diagram of interface dispatching device embodiment 3 provided by the present invention.
Embodiment
Carry out the wasting of resources that the interface dispatching office causes in order to overcome in the prior art by poll, the technical scheme that embodiments of the invention provide direct location to have the interface of message is to improve treatment effeciency.
Referring to Fig. 1, embodiment 1 flow chart for interface dispatching method provided by the present invention may further comprise the steps:
S1-1, whether the record network equipment arbitrary interface exists message in a default Interface status table;
Whether wherein, the form of Interface status table has diversified characteristics, can be tabulation, block or the like, as long as can be established to the real-time mapping relations of respective physical Interface status, promptly can exist message to get final product by record interface.
With the tabulation is example, and so-called record is generally real time record, is meant: be to enter an interface when message, and when making its Interface status become non-NULL, the list item value of the corresponding interface is for existing message, such as with this list item value set in the described Interface status table of real-time mark; When message goes out team from an interface, and when making its Interface status become sky, the list item value of the corresponding interface is not for existing message, such as with this list item value zero clearing in the described Interface status table of real-time mark.
Preferable, the Interface status table can adopt the mode of bitmap to realize, and this will be described in detail in embodiment 3 subsequently.
S3-1, the described network equipment be by searching described Interface status table, directly dispatches an interface that has a message.
Particularly, the network equipment is marked as the list item value that has message by searching in the Interface status table, just can locate corresponding interface fast, thereby be this interface service, comprises that continuation distinguishes the further scheduling of priority etc. to this interface internal queues; Because the scheduling of interface internal queues does not belong to the category that the embodiment of the invention is discussed, can therefore repeat no more by those skilled in the art according to existing techniques in realizing.
As can be seen, by the embodiment 1 of interface dispatching method provided by the present invention, can be under the huge situation of interface quantity, therefore dispatching rapidly and efficiently be applicable to the network equipment of supporting many interfaces.
But, in embodiment 1, may have fairness problem, such as under the tabulation situation, when the network equipment is after an interface service finishes, again the Retrieval Interface state table therefore may cause the part interface to be repeated to call, and other interfaces always can not get calling.In order to overcome this problem, can overcome by special invocation flags field is set under the corresponding interface item of Interface status table, promptly preferentially call the interface that is not labeled; Also can be, and when calling, corresponding reentry point is set for the Interface status table is provided with the retrieval order at every turn, thus make next time retrieval after reentry point, avoid repeating to call; Perhaps, guarantee scheduling fairness by a special interface mask table is set, its concrete technical scheme as shown in Figure 2, the flow chart for interface dispatching method embodiment 2 provided by the present invention may further comprise the steps:
S1-2, whether the record network equipment arbitrary interface exists message in a default Interface status table;
S2-2, have in the interface mask table of same-interface entry the arbitrary interface of the record network equipment at default and an Interface status table and whether dispatch;
S3-2, the described network equipment be by searching described Interface status table and described interface mask table, directly dispatches one and not only had message but also the interface that is not scheduled.
Wherein, in order to guarantee the equity dispatching of each interface, whether the arbitrary interface of the interface mask table record network equipment has been dispatched generally also is real time record to realize by following steps:
(1) when the initialization of interface mask table, whole interfaces of the described interface mask table of mark are the interface that is not scheduled;
(2) when interface is scheduled, the described interface of real-time mark is modulated degree interface;
(3) when not existing when not only having message but also not being scheduled interface, whole interfaces of the described interface mask table that resets are the interface that is not scheduled.
As can be seen,, in fact shielded the modulated non-null interface of using once, can leave dispatcher for be not scheduled non-null interface, reached the purpose of equity dispatching by the setting of interface mask table.
Further, because most at present network equipments is all supported the bitmap dependent instruction, as:
Dclz (Count Leading Zeros in Doubleword): be used for returning first position of double word (Doubleword) for the bit of " 1 ";
Dclo (Count Leading Ones in Doubleword): be used for returning first position of double word for the bit of " 0 ";
Clz (Count Leading Zeros): be used for returning first position of word (Word) for the bit of " 1 ";
Clo (Count Leading Ones): be used for returning first position of word for the bit of " 0 "; Or the like.
Because these bitmap instructions are realized that by hardware also can be described as the hardware bitmap instructions, its execution speed is very fast, therefore very be fit to be applied to interface dispatching method provided by the present invention.Referring to Fig. 3, be the flow chart of interface dispatching method embodiment 3 provided by the present invention, be applicable to the network equipment of supporting many interfaces, may further comprise the steps:
S1-3, whether the arbitrary interface of the real time record network equipment exists message in default Interface status bitmap;
Particularly, as shown in Figure 4, before this step S1-3, also comprise the step that the Interface status bitmap is set, comprising:
S1-3-1, to the interface of the network equipment be numbered 0,1,2......N;
Because what the hardware bitmap instructions was returned when positioning is the bit subscript, therefore need set up the mapping relations of the interface of the network equipment, to realize of the location and the scheduling of bitmap inquiry back to physical interface to the corresponding bits position.Concrete, in the present embodiment, the foundation of this mapping relations is by for the realization of network equipment number consecutively, and for the network equipment of n interface, its numbering can be for 0,1,2......N, N=n-1.
As can be seen, in the foregoing description 1,2, also can carry out in the Interface status table step of setting up with the mapping relations of physical interface; But because the Interface status table is not subjected to the restriction of return value, therefore also can directly adopt the physical interface ID of network device interface or the physical message of other recognition interfaces, need not to set up in advance mapping relations and can navigate to corresponding physical interface.
S1-3-2, according to the processing bit wide of network equipment CPU, it is the Interface status bitmap of B that memory capacity is set, described memory capacity is not more than the processing bit wide of described CPU;
Generally according to the system CPU bit wide, can select 32 word Word or 64 s' double word DoubleWord to be used as the minimum bit map unit of memory interface state.In present embodiment 3, to use 64 bit CPUs and to select for use 64 DoubleWord to be example, docking port state bitmap is described, that is the value of B is 64 in the present embodiment.
S1-3-3, M level Interface status bitmap is set, makes B (M-1)<n<B MWherein, the value of described M is a positive integer;
Why will judge whether that classification is provided with bitmap, be because be under the situation of n in the interface quantity of equipment support, needs to use
Figure B2007101208651D00051
Individual DoubleWord; But because the bitmap hardware instruction of CPU once can only act on a DoubleWord as instructions such as dclz, dclo, this just requires to adopt multistage bitmap under the situation of c>1.
S1-3-4, according to the different corresponding steps of carrying out of M value: when M=1, execution in step S1-3-5, when M>1, execution in step S1-3-6;
S1-3-5, the bit that described Interface status bitmap is set shines upon the corresponding interface of the described network equipment, the bit place value of described Interface status bitmap changes real-time update with the state of network equipment the corresponding interface, after promptly the Interface status bitmap is finished in setting, can in this Interface status bitmap, whether there be message by the arbitrary interface of the real time record network equipment, particularly, when message enters an interface, and when making its Interface status become non-NULL, the corresponding bits place value is that interface exists message in the described Interface status bitmap of mark, when message goes out team from an interface, and when making its Interface status become sky, the corresponding bits place value is not for existing message in the described Interface status bitmap of mark; In the present embodiment, 0 does not exist message for interface, and 1 exists message for interface.Therefore so-called real-time update is meant when message to enter an interface, and when making its Interface status become non-NULL, the corresponding bits position is updated to " 1 " in the described Interface status bitmap; When message goes out team from an interface, and when making its Interface status become sky, the corresponding bits position is updated to " 0 " in the described Interface status bitmap.
Those of ordinary skills can understand, and the setting of bit place value only is for example and not limitation in the present embodiment, do not have message such as being provided with 1 for interface, and 0 for there is message in interface, is equally applicable to technical scheme provided by the present invention.
In addition, because the foundation of concrete in the present embodiment mapping is the identical realization of interface index by bit subscript and the network equipment, the corresponding interface that is designated as the described network equipment under the bit of promptly described Interface status bitmap is numbered.
S1-3-6, the bit that minimum one-level Interface status bitmap is set shines upon the corresponding interface of the described network equipment, the bit place value of described minimum one-level Interface status bitmap changes real-time update with the state of network equipment the corresponding interface, 0 does not exist message for interface, 1 exists message for interface, after promptly the Interface status bitmap is finished in setting, the Interface status bitmap of low one-level is by the corresponding bits position index of the Interface status bitmap of higher one-level in this Interface status bitmap, the corresponding bits place value of higher one-level Interface status bitmap identifies in the low one-level Interface status bitmap of its index whether have message, 0 is that hanging down in the one-level Interface status bitmap of institute's index do not exist message, and 1 is that hanging down in the one-level Interface status bitmap of institute's index exists message.
With 64<n≤4096 is example, needs
Figure B2007101208651D00061
Promptly therefore 1<c≤64 DoubleWord needs to use the secondary bitmap to represent the system interface state.
Wherein the one-level bitmap is a DoubleWord, and the secondary bitmap is c DoubleWord; For the bit of " 1 " representative in the one-level bitmap is in the secondary bitmap of its index the interface that has message to be arranged; Identical with described in the step S1-3-5 of the corresponding actual interface of the bit of secondary bitmap, the rule of its real-time update.
Described with secondary bitmap shown in Figure 5, as follows:
Second secondary bitmap of second bit (being designated as 1 under it) index in the one-level bitmap; Second bit (being designated as 1 under it, then actual mapping 64*1+1=65) is the interface index of the network equipment in second secondary bitmap, and its bit place value is " 1 ", shows that there is message in this interface.
As can be seen, on 64 bit CPUs, the one-level bitmap is 64 interfaces of storage at most, and the secondary bitmap is storage 64 at most 2=4096 interfaces, M level bitmap is storage 64 at most MIndividual interface; On 32 bit CPUs, the one-level bitmap is 32 interfaces of storage at most, and the secondary bitmap is storage 32 at most 2=1024 interfaces, n level bitmap is storage 32 at most MIndividual interface.
When the bitmap of realizing network device interface by step S1-3 is preserved, and the defining interface state is after whether binary " 0 " and " 1 " can obtain dispatching with the expression interface, scheduling process between interface in fact just is converted into the process for " 1 " of bit in the bitmap of searching, promptly after step S1-3, execution in step:
S3-3, the described network equipment are searched described Interface status bitmap by the hardware bitmap instructions, directly dispatch an interface that has a message; Its concrete scheduling process can comprise by index Interface status bitmap realization from high to low:
The network equipment is by the hardware bitmap instructions, in higher one-level Interface status bitmap is 1 bit according to the ascending order value of searching of bit, exists then this bit execution next step, do not exist and then returns the instruction that interface does not have message;
For the bit of the low one-level Interface status bitmap of index, it is rapid that the low one-level bitmap of its index is re-executed previous step; Dispatch the interface of described bit mapping for the bit of the low one-level Interface status bitmap of index not.
As can be seen, have only when the Interface status bitmap under the situation of one-level, when the value of indexing is 1 bit, need not continues index and can realize scheduling; For the situation that has multistage Interface status bitmap, then need constantly approach subordinate's bitmap and realize index.Below by a specific embodiment this process is described, as shown in Figure 6:
S3-3-1, the described network equipment are by the hardware bitmap instructions, it in Interface status bitmap at the highest level is 1 bit according to the ascending order value of searching of bit, exist then to this bit execution in step S3-3-2, do not exist and then return the instruction that interface does not have message, the dispatch command next time of waiting for CPU processor;
As can be seen, what the hardware bitmap instructions was returned is the subscript minimum bit position that satisfies condition, and this is because the intrinsic property of hardware bitmap instructions determines.
Whether index hangs down the Interface status bitmap of one-level for S3-3-2, the described bit of identification, be to illustrate that then this value is that 1 bit only identifies in the interval and has message, therefore also needing to proceed the interval approaches the interface that has message with the location, is execution in step S3-3-3 in the present embodiment; Otherwise illustrate this value be 1 bit identified is to have message in the interface of its subscript mapping, can dispatch, so execution in step S3-3-4;
S3-3-3, the described network equipment are by the hardware bitmap instructions, it in the Interface status bitmap of described low one-level is 1 bit according to ascending order value of searching, and find first value be 1 bit after to its execution in step S3-3-2, rejudge and whether will carry out the interval and approach;
The interface of S3-3-4, the described bit mapping of scheduling.
Embodiment illustrated in fig. 6 having provided by judging step by step whether identification exists subordinate's bitmap, and then realize the scheme of interface scheduling.But it may be noted that, to whether having the judgement of subordinate's bitmap only is an exemplary flexible execution mode, in the ordinary course of things, the progression of Interface status bitmap is understood by system itself, therefore step S3-3-2 only exists from the flexible design angle, in a lot of actual implementation procedures, needs carrying out from high to low is index step by step, until the Interface status bitmap that arrives minimum one-level.
Generally speaking, because the existence of hardware instruction dclz, dclo etc., it is very fast to search bitmap speed, be illustrated with a concrete condition: be example still with secondary bitmap shown in Figure 5, first the bit subscript x that at first utilizes hardware instruction dclz to return first order DoubleWord for " 1 ", x=1 in the present embodiment; Navigate on the DoubleWord of secondary bitmap according to this subscript then, for this secondary DoubleWord, utilize once more hardware instruction dclz return its first be the subscript y of the bit of " 1 ", y=1 in the present embodiment; Just can calculate interface index according to formula x*64+y.
For further speed up processing, the step of calculating interface index herein can also use displacement to realize, promptly according to formula x<<6+y obtains interface index, wherein 6 is that the power of bit wide 64 relative 2 of DoubleWord is inferior.
First is the subscript of the bit of " 1 " among the DoubleWord but because instruction dclz can only return at every turn, and preferentially return the relatively little subscript of subscript value, so the interface that interface index is little always can be by priority scheduling, the interface that interface index is big must all be that sky just has an opportunity to be scheduled afterwards than its little interface by the time, and this has just caused interface to dispatch inequitable situation.In order to address this problem, interface dispatching method embodiment 4 of the present invention introduced with embodiment 3 in the Interface status bitmap interface mask bitmap of symmetry fully, as shown in Figure 7, may further comprise the steps:
S1-4, whether the arbitrary interface of the real time record network equipment exists message in default Interface status bitmap;
S2-4, at default and Interface status bitmap fully in the interface mask bitmap of symmetry, by each bit place value real time record in the symmetrical Interface status bitmap corresponding bits position whether dispatch;
In this step S2-4, interface masked bits figure stores whether the corresponding bits position was scheduled in some Interface status bitmaps, and bit " 0 " and " 1 " represent that respectively certain bit has been scheduled and has not been scheduled.Therefore, when the initialization of interface mask bitmap, whole bit place values of the described interface mask of mark bitmap are " 1 ", represent that all corresponding interface state bitmap bits all also were not scheduled.
S3-4, the described network equipment by the hardware bitmap instructions directly scheduling one not only had message but also the interface that is not scheduled; Concrete scheduling process can be by carrying out Interface status bitmap and interface mask bitmap and operation from high to low, and to operation after bitmap carry out index and realize, comprising:
Higher one-level Interface status bitmap and corresponding interface mask bitmap are carried out step-by-step and operation, and wherein, its whole bits are labeled as 1 during described interface mask bitmap initialization;
The network equipment is by the hardware bitmap instructions, with operation after bitmap in be 1 bit according to the ascending order value of searching of bit, exist then this bit is carried out next step, do not exist then whole bits in the corresponding interface mask bitmap are labeled as 1, and it is rapid to re-execute previous step;
Bit place value described in the interface mask bitmap is labeled as 0, and bit for the low one-level bitmap of index, behind described Interface status bitmap and execution step-by-step of interface mask bitmap and operation than low one-level than low one-level, it is rapid that it is re-executed previous step; For the bit of the low one-level bitmap of index not, dispatch the interface of described bit mapping, finish.
Referring to Fig. 8, be one to judge the embodiment whether identification exists subordinate's bitmap to dispatch step by step, comprising:
S3-4-1, described Interface status bitmap at the highest level and interface mask bitmap at the highest level are carried out step-by-step and operation;
S3-4-2, the described network equipment are by the hardware bitmap instructions, with operation after bitmap at the highest level in be 1 bit according to the ascending order value of searching of bit, exist then to this bit execution in step S3-4-3, do not have then execution in step S3-4-9;
Whether S3-4-3, the described bit of identification the bitmap of the low one-level of index, is execution in step S3-4-4 then, otherwise execution in step S3-4-7; Can understand, this step only is a step on the flexible design, for the system of known bitmap progression, in practical operation, does not often need through this step;
S3-4-4, bit place value described in the interface mask bitmap is labeled as 0; As can be seen, during next operation dispatching, after Interface status bitmap and interface mask bitmap were carried out step-by-step and operation, this bit will be left in the basket, even just also there is message in the interval of this bit institute index, also can be skipped.
S3-4-5, the Interface status bitmap of described low one-level and the interface mask bitmap of low one-level are carried out step-by-step and operation;
S3-4-6, the described network equipment be by the hardware bitmap instructions, in the bitmap after described and the operation is 1 bit according to the ascending order value of searching of bit, and or not there then execution in step S3-4-10 in existence then to this bit execution in step S3-4-3;
S3-4-7, bit described in the interface mask bitmap is labeled as 0; As can be seen, during next operation dispatching, after Interface status bitmap and interface mask bitmap were carried out step-by-step and operation, the interface of this bit mapping will be left in the basket.
The interface of S3-4-8, the described bit mapping of scheduling;
S3-4-9, with in the interface mask bitmap of described highest level all bits be labeled as 1, and execution in step S3-4-1 again;
S3-4-10, with in the described interface mask bitmap all bits be labeled as 1, and execution in step S3-4-5 again;
As can be seen, if one-level interface mask bitmap, after then it all exists the interface of message all to be scheduled once, when dispatching next time with operation after bitmap in will the value of can not find be 1 bit, so all be labeled as 1, begin new once scheduling; If multistage interface mask bitmap, then for all to exist the interval of message all to be scheduled once, when dispatching next time these intervals of index with operation after bitmap in will the value of can not find be 1 bit, therefore this grade interface mask bitmap all is labeled as 1, beginning is in these interval new once scheduling.
It should be noted that between the low one-level interface mask bitmap of high one-level interface mask bitmap and its index, do not have influencing each other of bit mark.For instance, when in the low one-level interface mask bitmap during corresponding two interfaces that have a message, scheduling for the first time, then the one correspondence exists the bit of message interface to be marked as 0, and its bit of high one-level interface mask bitmap of index also can be marked as 0; Another exists the interface of message can not be scheduled in the then low one-level interface mask bitmap, and its bit still keeps 1 value; After all being labeled as the new scheduling once of 1 beginning to the bit of high one-level interface mask bitmap, another exists the interface of message will obtain scheduling in the low one-level interface mask bitmap.
Obviously, utilize the circulation clear 0 of interface mask bitmap and reset, be actually and shielded modulated non-null interface of spending, can give non-NULL interface time once, reached the purpose of fair repeating query between non-null interface dispatcher.
In sum,, realized that the network equipment only dispatches non-null interface, improved the dispatching efficiency of the whole network equipment by interface dispatching method embodiment 1~4 of the present invention.Further, by interface dispatching method embodiment 2 and 4 of the present invention, the mode of using Interface status table and interface mask table, particularly Interface status bitmap and interface mask bitmap to combine has guaranteed the interface scheduling fairness.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of program command, described program can be stored in the computer read/write memory medium, this program comprises the steps: when carrying out
Step 1, whether the arbitrary interface of the real time record network equipment exists message in a default Interface status table;
Step 2, the described network equipment be by searching described Interface status table, directly dispatches an interface that has a message.
Described storage medium comprises: ROM/RAM, magnetic disc or CD etc.
Embodiments of the invention also provide a kind of interface dispatching device 200, are applicable to the network equipment 100 that comprises a plurality of interfaces 101, can be installed in the network equipment 100 inside, also can be by realizing the interface scheduling controlling with being connected of the network equipment 100.
As shown in Figure 9, be the block diagram of interface dispatching device embodiment 1 of the present invention, being installed in the network equipment 100 inside with interface dispatching device 200 is example.
At first, one of ordinary skill in the art will appreciate that, the concrete scheduling of network equipment docking port, all undertaken by central processing unit 102, interface dispatching device provided by the present invention is responsible for feeding back the interface 101 of being located to central processing unit 102, carries out follow-up scheduling operation by central processing unit 102.
In present embodiment 1, this interface dispatching device 200 comprises:
Interface status table module 202 is connected with described a plurality of interfaces 101 respectively, is used for the saving interface state table, is preferably the Interface status bitmap, and this Interface status table is used to write down each interface 101 of the network equipment and whether has message; When message enters an interface, and when making its Interface status become non-NULL, the list item value of the corresponding interface is for existing message in the described Interface status table of mark; When message goes out team from an interface, and when making its Interface status become sky, the list item value of the corresponding interface is not for existing message in the described Interface status table of mark.Preferable, whether each interface 101 of 202 pairs of network equipments of Interface status table module exists the record of message to carry out in real time.
Interface locating module 201, be connected with the central processing unit 102 and the Interface status table module 202 of the described network equipment 100, be used for interface dispatch command according to described central processing unit 102, the interface 101 that has message by the direct location one of described Interface status table, and return corresponding interface and number to described central processing unit 102, dispatched by described central processing unit 102.Promptly when central processing unit 102 has the ability an interface dispatched, will notification interface locating module 203; Under the situation that is preferably the Interface status bitmap, interface locating module 203 is by the hardware bitmap instructions, be labeled as the interface 101 of " 1 " rapidly in the locating interface state table module 202, dispatched by described central processing unit 102, thereby avoid poll of the prior art, realize the interface fast dispatch.
In the present embodiment, can also comprise interface mappings module 203, be connected with Interface status table module 202 with a plurality of interfaces 101 of the described network equipment 100 respectively, be used to set up the mapping relations of interface 101 to the Interface status table, such as being under the situation of Interface status bitmap at the Interface status table, come to be interface 101 codings by interface mappings module 203.
Further, in order to guarantee the interface scheduling fairness, the present invention also provides the embodiment 2 of interface dispatching device, as shown in figure 10.On the basis of interface dispatching device embodiment 1, further comprise interface mask table module 204, be connected with described interface locating module 201 with described Interface status table module 202 respectively, be used to preserve the interface mask table that has the same-interface entry with the Interface status table, be preferably the interface mask bitmap symmetrical fully with the Interface status bitmap; Whether this interface mask table module 204 dispatches according to the arbitrary interface 101 of the positioning result record network equipment of interface locating module 201: when the initialization of interface mask table, whole interfaces of the described interface mask table of mark are the interface that is not scheduled; When an interface was scheduled, the described interface of mark was modulated degree interface in described interface mask table; When not existing when not only having message but also not being scheduled interface, whole interfaces of the described interface mask table that resets are the interface that is not scheduled.Preferable, the record whether arbitrary interface 101 of 204 pairs of network equipments of interface mask table module has been dispatched carries out in real time.
When being provided with interface mask table module 204, corresponding, described interface locating module 201 is used for the record of Complex interface state table module 202 and interface mask table module 204, directly locatees one and has not only had message but also the interface that is not scheduled.
On the basis of embodiment 1 or 2, the Interface status table can be preferably the Interface status bitmap.Referring to Figure 11, be the embodiment 3 of interface dispatching device provided by the invention, wherein, Interface status table module 202 comprises:
The interface bitmap is preserved unit 2021, is connected with interface mappings module 203, is used to preserve M level Interface status bitmap;
This M is a positive integer, comprises 1 and greater than 1 integer; Specifically, the relation of the value of M and network device interface quantity n satisfies B (M-1)<n≤B M, wherein B is the memory capacity of an Interface status bitmap, and can not be greater than the processing bit wide of network equipment central processing unit.
In M level Interface status bitmap, the bit of minimum one-level Interface status bitmap shines upon the corresponding interface of the described network equipment, and the Interface status bitmap of low one-level is by the corresponding bits position index of the Interface status bitmap of higher one-level.
Interface bitmap set unit 2022, preserving unit 2021, interface mappings module 203 and each interface 101 with the interface bitmap is connected, whether the bit place value that is used for the described minimum one-level Interface status bitmap of real time modifying exists message with record the corresponding interface, 0 does not exist message for interface, and 1 exists message for interface; Whether the corresponding bits place value that also is used for the higher one-level Interface status of real time modifying bitmap exists message with the low one-level Interface status bitmap that writes down its index, 0 is that hanging down in the one-level Interface status bitmap of institute's index do not exist message, and 1 is that hanging down in the one-level Interface status bitmap of institute's index exists message.
Under the situation that adopts the Interface status bitmap, interface locating module 201 is to search by the hardware bitmap instructions according to the Interface status bitmap, is 1 bit thereby directly locate and have target value under the minimum bit position, and then the interface of dispatching office mapping.
Be preferably at the Interface status table on the basis of Interface status bitmap, the interface mask table also can be preferably interface mask bitmap, each bit place value real time record of described interface mask bitmap in the symmetrical Interface status bitmap corresponding bits position whether dispatch, 0 is modulated degree bit, and 1 for not dispatching bit; Then described interface locating module 201 comprises:
Bitmap and processing unit 2011 are preserved unit 2021 with the interface bitmap respectively and are connected with mask bitmap preservation unit 2041, are used for docking port state bitmap and interface mask bitmap and carry out step-by-step and operation;
Bitmap location unit 2012 is connected with processing unit 2011 with described bitmap, be used for by the hardware bitmap instructions, with operation after bitmap in be 1 bit according to the ascending order value of searching of bit;
Under the situation for this device known interface state bitmap progression, can directly navigate to the corresponding interface by bitmap location unit 2012, the central processing unit 102 of the instruction network equipment is dispatched.Install under the situation of unknown Interface status bitmap progression for this, then may further include bitmap recognition unit 2013, as shown in figure 11, be connected with described bitmap location unit 2012, be used for discre value and be the whether bitmap of the low one-level of index of 1 bit, call bitmap and processing unit 2011 low one-level bitmap of its index is handled, perhaps, the interface 101 of the described bit mapping of central processing unit 102 scheduling of the direct instruction network equipment;
Described interface mask table module 204 comprises:
The mask bitmap is preserved unit 2041, preserves unit 2021 with described Interface status bitmap and is connected, and is used to preserve the interface mask bitmap with described Interface status bitmap symmetry;
Mask bitmap reset unit 2042, preserving unit 2041 with described bitmap location unit 2012 and described mask bitmap is connected, being used for not having value at bitmap positioning unit 2012 feedback current bitmaps is under the situation of 1 bit, and the whole bits of the corresponding interface mask bitmap are labeled as 1;
Mask bitmap set unit 2043 is preserved unit 2041 with described bitmap location unit 2012 and described mask bitmap and is connected, is used for after current bitmap is located a bit, and the bit of the corresponding interface mask bitmap is labeled as 0.
It should be noted last that, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not break away from the spirit and scope of technical solution of the present invention.

Claims (13)

1. an interface dispatching method is applicable to the network equipment of supporting many interfaces, it is characterized in that, may further comprise the steps:
Whether step 1, whether the record network equipment arbitrary interface exists message in a default Interface status table, have in the interface mask table of same-interface entry the arbitrary interface of the record network equipment at default and an Interface status table and dispatch;
Step 2, the described network equipment are directly dispatched an interface that not only has message but also be not scheduled by searching described Interface status table and described interface mask table.
2. interface dispatching method according to claim 1 is characterized in that, whether described step 1 writes down the arbitrary interface of the network equipment and exist message to comprise in the Interface status table:
When message enters an interface, and when making its Interface status become non-NULL, the list item value of the corresponding interface is for existing message in the described Interface status table of real-time mark;
When message goes out team from an interface, and when making its Interface status become sky, the list item value of the corresponding interface is not for existing message in the described Interface status table of real-time mark.
3. interface dispatching method according to claim 1 is characterized in that, described in described interface mask table the record network equipment arbitrary interface whether dispatched and comprised:
When the initialization of interface mask table, whole interfaces of the described interface mask table of mark are the interface that is not scheduled;
When an interface was scheduled, the described interface of real-time mark was modulated degree interface;
When not existing when not only having message but also not being scheduled interface, whole interfaces of the described interface mask table that resets are the interface that is not scheduled.
4. according to the arbitrary described interface dispatching method of claim 1-3, it is characterized in that described Interface status table is the Interface status bitmap, wherein,
The memory capacity B of described Interface status bitmap is provided with according to the processing bit wide of network equipment CPU, and it is not more than the processing bit wide of described CPU;
Described Interface status bitmap is set to the M level according to described network device interface quantity n, satisfies B (M-1)<n≤B MWherein, the value of described M is a positive integer;
The bit of minimum one-level Interface status bitmap shines upon the corresponding interface of the described network equipment, whether the arbitrary interface of the bit place value real time record network equipment of described minimum one-level Interface status bitmap exists message, 0 does not exist message for interface, and 1 exists message for interface; The Interface status bitmap of low one-level is by the corresponding bits position index of the Interface status bitmap of higher one-level, and the corresponding bits place value of higher one-level Interface status bitmap identifies in the low one-level Interface status bitmap of its index whether have message, 0 is that hanging down in the one-level Interface status bitmap of institute's index do not exist message, and 1 is that hanging down in the one-level Interface status bitmap of institute's index exists message.
5. interface dispatching method according to claim 4 is characterized in that, described step 2 comprises:
2-1, the described network equipment be by the hardware bitmap instructions, in higher one-level Interface status bitmap is 1 bit according to the ascending order value of searching of bit, and existence or not and then returns the instruction that interface does not have message then to this bit execution in step 2-2;
2-2, for the bit of the low one-level Interface status bitmap of index, the low one-level bitmap of its index is re-executed step 2-1; Dispatch the interface of described bit mapping for the bit of the low one-level Interface status bitmap of index not.
6. interface dispatching method according to claim 4 is characterized in that, described in the interface mask table record network equipment arbitrary interface whether dispatched and comprised:
Interface mask bitmap with described Interface status bitmap symmetry is set, and each bit place value real time record of described interface mask bitmap in the symmetrical Interface status bitmap corresponding bits position whether dispatch, 0 is modulated degree bit, 1 for not dispatching bit.
7. interface dispatching method according to claim 6 is characterized in that, described step 2 comprises:
2-1 ', higher one-level Interface status bitmap and corresponding interface mask bitmap are carried out step-by-step and operation, wherein, its whole bits are labeled as 1 during described interface mask bitmap initialization;
2-2 ', the described network equipment be by the hardware bitmap instructions, with operation after bitmap in be 1 bit according to the ascending order value of searching of bit, or not there then execution in step 2-5 ' in existence then to this bit execution in step 2-3 ';
2-3 ', bit place value described in the interface mask bitmap is labeled as 0;
2-4 ', for the bit of the low one-level bitmap of index, the interface mask bitmap of the Interface status bitmap of described low one-level and low one-level carried out step-by-step and operation after, it is re-executed step 2-2 '; For the bit of the low one-level bitmap of index not, dispatch the interface of described bit mapping, finish;
2-5 ', with in the described interface mask bitmap all bits be labeled as 1, and execution in step 2-1 ' again.
8. an interface dispatching device is applicable to the network equipment that comprises a plurality of interfaces, it is characterized in that, comprises Interface status table module, interface locating module and interface mask table module:
Described Interface status table module is connected with described a plurality of interfaces respectively, is used for the saving interface state table, and described Interface status table is used to write down each interface of the network equipment and whether has message;
Described interface locating module, be connected with the central processing unit and the Interface status table module of the described network equipment, be used for according to the interface dispatch command, and the record of comprehensive described Interface status table module and interface mask table module, directly location one interface that not only has message but also be not scheduled is dispatched by the described network equipment;
Described interface mask table module, be connected with the interface locating module with described Interface status table module respectively, be used to preserve the interface mask table that has the same-interface entry with the Interface status table, and whether dispatch according to the arbitrary interface of the positioning result record network equipment of interface locating module.
9. interface dispatching device according to claim 8, it is characterized in that, whether described Interface status table module exists the record of message to carry out in real time to each interface of the network equipment, and the record whether described interface mask table module has dispatched to the arbitrary interface of the network equipment carries out in real time.
10. interface dispatching device according to claim 8, it is characterized in that, also comprise the interface mappings module, be connected with a plurality of interfaces and the Interface status table module of the described network equipment respectively, be used to set up the mapping relations of described Interface status table to described interface.
11. interface dispatching device according to claim 10 is characterized in that, described Interface status table is the Interface status bitmap, and then Interface status table module comprises:
The interface bitmap is preserved the unit, is connected with described interface mappings module, is used to preserve M level Interface status bitmap; Described M is a positive integer, and the relation of M level Interface status bitmap and network device interface quantity n satisfies B (M-1)<n≤B M, wherein B is the memory capacity of Interface status bitmap and the processing bit wide that is not more than network equipment central processing unit; In the described M level Interface status bitmap, the bit of minimum one-level Interface status bitmap shines upon the corresponding interface of the described network equipment, and the Interface status bitmap of low one-level is by the corresponding bits position index of the Interface status bitmap of higher one-level;
Interface bitmap set unit, preserving unit, interface mappings module and interface with described interface bitmap is connected, whether the bit place value that is used for the described minimum one-level Interface status bitmap of real time modifying exists message with record the corresponding interface, and 0 does not exist message for interface, and 1 exists message for interface; Whether the corresponding bits place value that also is used for the higher one-level Interface status of real time modifying bitmap exists message with the low one-level Interface status bitmap that writes down its index, 0 is that hanging down in the one-level Interface status bitmap of institute's index do not exist message, and 1 is that hanging down in the one-level Interface status bitmap of institute's index exists message.
12. interface dispatching device according to claim 11, it is characterized in that, described interface mask table is an interface mask bitmap, each bit place value real time record of described interface mask bitmap in the symmetrical Interface status bitmap corresponding bits position whether dispatch, 0 is modulated degree bit, and 1 for not dispatching bit; Then described interface locating module comprises:
Bitmap and processing unit are used for docking port state bitmap and interface mask bitmap and carry out step-by-step and operation;
The bitmap location unit is connected with processing unit with described bitmap, be used for by the hardware bitmap instructions, with operation after bitmap in be 1 bit according to the ascending order value of searching of bit;
Described interface mask table module comprises:
The mask bitmap is preserved the unit, preserves the unit with described Interface status bitmap and is connected, and is used to preserve the interface mask bitmap with described Interface status bitmap symmetry;
Mask bitmap reset unit is preserved the unit with described bitmap location unit and described mask bitmap and is connected, and being used for not having value at bitmap positioning unit feedback current bitmap is under the situation of 1 bit, and the whole bits of the corresponding interface mask bitmap are labeled as 1;
Mask bitmap set unit is preserved the unit with described bitmap location unit and described mask bitmap and is connected, is used for after current bitmap is located a bit, and the bit of the corresponding interface mask bitmap is labeled as 0.
13. interface dispatching device according to claim 12, it is characterized in that, described interface locating module also comprises the bitmap recognition unit, be connected with described bitmap location unit, be used for discre value and be the whether bitmap of the low one-level of index of 1 bit, call bitmap and processing unit the low one-level bitmap of its index is handled, perhaps, the direct instruction network equipment is dispatched the interface of described bit mapping.
CN2007101208651A 2007-08-28 2007-08-28 Interface scheduling method and interface scheduling device Active CN101159663B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101208651A CN101159663B (en) 2007-08-28 2007-08-28 Interface scheduling method and interface scheduling device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101208651A CN101159663B (en) 2007-08-28 2007-08-28 Interface scheduling method and interface scheduling device

Publications (2)

Publication Number Publication Date
CN101159663A CN101159663A (en) 2008-04-09
CN101159663B true CN101159663B (en) 2010-09-29

Family

ID=39307588

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101208651A Active CN101159663B (en) 2007-08-28 2007-08-28 Interface scheduling method and interface scheduling device

Country Status (1)

Country Link
CN (1) CN101159663B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523164B (en) * 2011-12-19 2015-09-23 曙光信息产业(北京)有限公司 A kind of system realizing the shunting of complex homologous chummage in network interface card
CN108304302B (en) * 2017-12-22 2021-08-24 努比亚技术有限公司 Interface merging method, equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1322091A (en) * 2000-03-02 2001-11-14 阿尔卡塔尔互联网运行公司 Qualifid priority queue dispatcher
CN1466318A (en) * 2002-07-05 2004-01-07 深圳市中兴通讯股份有限公司 Multi-channel weiighted polling method and device
CN1812371A (en) * 2005-01-30 2006-08-02 华为技术有限公司 Organizational scheduling method for multi-mode COS queue and apparatus thereof
US7245616B1 (en) * 2002-03-20 2007-07-17 Applied Micro Circuits Corporation Dynamic allocation of packets to tasks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1322091A (en) * 2000-03-02 2001-11-14 阿尔卡塔尔互联网运行公司 Qualifid priority queue dispatcher
US7245616B1 (en) * 2002-03-20 2007-07-17 Applied Micro Circuits Corporation Dynamic allocation of packets to tasks
CN1466318A (en) * 2002-07-05 2004-01-07 深圳市中兴通讯股份有限公司 Multi-channel weiighted polling method and device
CN1812371A (en) * 2005-01-30 2006-08-02 华为技术有限公司 Organizational scheduling method for multi-mode COS queue and apparatus thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CN 1466318 A,全文.

Also Published As

Publication number Publication date
CN101159663A (en) 2008-04-09

Similar Documents

Publication Publication Date Title
US8381230B2 (en) Message passing with queues and channels
CN104750690A (en) Query processing method, device and system
CN105512179A (en) Data sorting device, method and data processing chip achieved by hardware
CN115277566B (en) Load balancing method and device for data access, computer equipment and medium
CN105786619A (en) Virtual machine distribution method and device
WO2018126771A1 (en) Storage controller and io request processing method
CN104363282A (en) Cloud computing resource scheduling method and device
CN102301664A (en) Method and device for dispatching streams of multicore processor
CN115408100A (en) Container cluster scheduling method, device, equipment and storage medium
CN104615684A (en) Mass data communication concurrent processing method and system
CN111813517A (en) Task queue allocation method and device, computer equipment and medium
CN111083189B (en) System and method for processing data skew at runtime
US8543722B2 (en) Message passing with queues and channels
CN106202307A (en) A kind of batch log preservation method and device
CN101159663B (en) Interface scheduling method and interface scheduling device
CN111813515A (en) Multi-process-based task scheduling method and device, computer equipment and medium
CN106990913B (en) A kind of distributed approach of extensive streaming collective data
CN102761617B (en) Workflow queue server and workflow scheduling system and method
CN107346342A (en) A kind of file call method calculated based on storage and system
CN103747043A (en) CDN server dispatching method, CDN control center and system
CN111339064A (en) Data tilt correction method, device and computer readable storage medium
CN111144495B (en) Service distribution method, device and medium
CN103870313A (en) Virtual machine task scheduling method and system
CN103078926A (en) Method and device as well as system for file accessing of distributed storage system
CN111045959A (en) Complex algorithm variable mapping method based on storage optimization

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Patentee after: Xinhua three Technology Co., Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: Huasan Communication Technology Co., Ltd.