[go: up one dir, main page]

CN106506370A - List item sweep-out method and device - Google Patents

List item sweep-out method and device Download PDF

Info

Publication number
CN106506370A
CN106506370A CN201610987096.4A CN201610987096A CN106506370A CN 106506370 A CN106506370 A CN 106506370A CN 201610987096 A CN201610987096 A CN 201610987096A CN 106506370 A CN106506370 A CN 106506370A
Authority
CN
China
Prior art keywords
forwarding
item
interface
target
table item
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.)
Pending
Application number
CN201610987096.4A
Other languages
Chinese (zh)
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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech 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 DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201610987096.4A priority Critical patent/CN106506370A/en
Publication of CN106506370A publication Critical patent/CN106506370A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a kind of list item sweep-out method and device, and methods described includes:When receive issue for target outgoing interface forwarding-table item when, dress method equipment the value of interface indicator variable corresponding with the target outgoing interface is assigned to list item indicator variable corresponding with the forwarding-table item;When detecting the target outgoing interface and being abnormal, the value of interface indicator variable corresponding with the target outgoing interface is changed;To remove as invalid list item from the list item indicator variable forwarding-table item different with the value of the interface indicator variable of the target outgoing interface in the corresponding chained list of the target outgoing interface.The list item sweep-out method provided using the application, can be effectively reduced the system loading of forwarding unit.

Description

List item sweep-out method and device
Technical field
The application is related to computer communication field, more particularly to list item sweep-out method and device.
Background technology
Switch, router etc. play vital effect as important forwarding unit, in the Internet.When such When the outgoing interface of forwarding unit is abnormal, it usually needs remove the corresponding forwarding-table item of the outgoing interface, learn forwarding unit new Forwarding-table item, find new outgoing interface, the flow for receiving forwarded.
However, removing the forwarding-table item of abnormal outgoing interface, may generally increase the system loading of forwarding unit.Therefore, System loading when how to reduce forwarding-table item corresponding for the abnormal outgoing interface of removing just becomes problem demanding prompt solution.
Content of the invention
In view of this, the application provides a kind of list item sweep-out method and device, in order to reduce the system loading of forwarding unit.
Specifically, the application is achieved by the following technical solution:
According to the first aspect of the embodiment of the present application, there is provided a kind of list item sweep-out method, methods described are applied to forwarding and set Standby, the forwarding unit includes several outgoing interfaces, pre-configured right respectively in the corresponding structure of described several outgoing interfaces The interface indicator variable that answers;Outgoing interface identical forwarding-table item in the forward table of the forwarding unit is organized into corresponding respectively Chained list;The pre-configured corresponding list item indicator variable of forwarding-table item difference in the chained list;Methods described includes:
When receive issue for target outgoing interface forwarding-table item when, will interface corresponding with the target outgoing interface The value of indicator variable is assigned to list item indicator variable corresponding with the forwarding-table item;
When detecting the target outgoing interface and being abnormal, interface indicator variable corresponding with the target outgoing interface is changed Value;
Interface of the list item indicator variable in chained list corresponding with the target outgoing interface with the target outgoing interface is indicated The forwarding-table item that the value of variable is different is removed as invalid list item.
According to the second aspect of the embodiment of the present application, there is provided a kind of list item remove device, described device are applied to forwarding and set Standby, the forwarding unit includes several outgoing interfaces, pre-configured right respectively in the corresponding structure of described several outgoing interfaces The interface indicator variable that answers;Outgoing interface identical forwarding-table item in the forward table of the forwarding unit is organized into corresponding respectively Chained list;The pre-configured corresponding list item indicator variable of forwarding-table item difference in the chained list;Described device includes:
Assignment unit, for when receive issue for target outgoing interface forwarding-table item when, will go out with the target The value of the corresponding interface indicator variable of interface is assigned to list item indicator variable corresponding with the forwarding-table item;
Modification unit, for when detecting the target outgoing interface and being abnormal, changing corresponding with the target outgoing interface The value of interface indicator variable;
Clearing cell, for list item indicator variable going out to connect with the target in chained list corresponding with the target outgoing interface The forwarding-table item that the value of the interface indicator variable of mouth is different is removed as invalid list item.
The application provides a kind of method that list item is removed, when receiving the forwarding-table item for target outgoing interface that issues When, the value of interface indicator variable corresponding with the target outgoing interface can be assigned to and the forwarding-table item by forwarding unit Corresponding list item indicator variable.When detecting the target outgoing interface and being abnormal, forwarding unit can be changed and be gone out with the target The value of the corresponding interface indicator variable of interface.And can be by list item indicator variable in chained list corresponding with the target outgoing interface The forwarding-table items different from the value of the interface indicator variable of the target outgoing interface are removed as invalid list item.
As forwarding unit is no longer repeatedly traveled through repeatedly with the forward table of Hash table organization, the forward table for needing to remove is searched Item is deleted;But forwarding-table item can quickly be found according to chained list, and based on the interface structure body of target outgoing interface in Interface indicator variable and forwarding-table item in list item indicator variable, by corresponding for the target outgoing interface need remove forward table It is invalid that item collective is placed in, it is possible to deletes invalid forwarding-table item, such that it is able to significantly reduce the load of CPU, improves The resource utilization of CPU.
Description of the drawings
Fig. 1 is a kind of flow chart of the list item sweep-out method shown in one exemplary embodiment of the application;
Fig. 2 is a kind of hardware structure diagram of the list item remove device place equipment shown in one exemplary embodiment of the application;
Fig. 3 is a kind of block diagram of the list item remove device shown in one exemplary embodiment of the application.
Specific embodiment
Here in detail exemplary embodiment will be illustrated, its example is illustrated in the accompanying drawings.Explained below is related to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the application.Conversely, they be only with as appended by The example of consistent apparatus and method in terms of some that described in detail in claims, the application.
It is the purpose only merely for description specific embodiment in term used in this application, and is not intended to be limiting the application. " one kind ", " described " and " being somebody's turn to do " of singulative used in the application and appended claims is also intended to include majority Form, unless context clearly shows that other implications.It is also understood that term "and/or" used herein is referred to and is wrapped Containing one or more associated any or all possible combination for listing project.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the application A little information should not necessarily be limited by these terms.These terms are only used for same type of information is distinguished from each other out.For example, without departing from In the case of the application scope, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as One information.Depend on linguistic context, word as used in this " if " can be construed to " ... when " or " when ... When " or " in response to determining ".
Switch, router etc. play vital effect as important forwarding unit, in the Internet.When such When the outgoing interface of forwarding unit is abnormal, it usually needs remove the corresponding forwarding-table item of the outgoing interface.For example, in three-layer network In, the outgoing interface Down of forwarding unit falls, at this time, it may be necessary to forwarding unit removes ARP/ND list items, so that equipment can be again Study ARP/ND list items.Again for example, in the double layer network that is built using Spanning-Tree Protocol, if network topology changes, Forwarding unit as bridge needs to remove the MAC address entries on outgoing interface, so that forwarding unit relearns new network topology MAC address entries.
In the related, when certain outgoing interface of forwarding unit is abnormal, need to enter the forwarding-table item of the outgoing interface Row is removed.But, it is generally the case that forwarding-table item is constituted with the structure of Hash table, forms forward table.In forward table Contain the corresponding forwarding-table item of outgoing interface and outgoing interface on forwarding unit.When deleting to above-mentioned forwarding-table item, turn The equipment of sending out can travel through forward table with the interface ID of abnormal outgoing interface as index, search the corresponding forward table of abnormal outgoing interface , then the forwarding-table item is deleted.
Additionally, when forwarding unit is frame forwarding unit, in the reset procedure of abnormal outgoing interface forwarding-table item, frame The master control borad of forwarding unit needs for the forwarding-table item for needing to remove to be handed down to business board by inner passage, is searched by business board Corresponding forwarding-table item is purged.
However, in the related, on the one hand, when forwarding unit has multiple outgoing interfaces to need to remove forwarding-table item, When searching the corresponding forwarding-table item of the outgoing interface, repeatedly traversal forward table is needed.As forward table is tied with the data by Hash table Structure tissue, forward table is traveled through repeatedly, the occupancy of cpu resource can be greatly increased, so as to increase the load of CPU.
On the other hand, when there are multiple forwarding-table items to need to remove, removing is needed as master control borad is issued to business board Forwarding-table item, can take substantial amounts of channel resource, be likely to result in inner passage congestion, or even the generation of packet loss.
In sum, the method that is removed using the list item of correlation technique, considerably increases the system loading of forwarding unit.
In view of this, the application provides a kind of method that list item is removed, when receive issue for target outgoing interface During forwarding-table item, forwarding unit can by the value of interface indicator variable corresponding with the target outgoing interface be assigned to described The corresponding list item indicator variable of forwarding-table item.When detecting the target outgoing interface and being abnormal, forwarding unit can be changed and institute State the value of the corresponding interface indicator variable of target outgoing interface.And can be by list item in chained list corresponding with the target outgoing interface The indicator variable forwarding-table item different from the value of the interface indicator variable of the target outgoing interface is removed as invalid list item.
Additionally, when forwarding unit is frame forwarding unit, during list item is removed, the master control borad of frame type equipment is not The list item for needing to delete is handed down to business board again, but the interface ID of abnormal outgoing interface is sent to business board by master control borad, by Business board uses the method that the list item that the application provides is removed to turn corresponding for abnormal outgoing interface forwarding-table item as invalid Forwarding list item is deleted.
On the one hand, as forwarding unit no longer repeatedly travels through Hash table repeatedly, searching needs the forwarding-table item that removes to carry out Delete;But forwarding-table item can quickly be found according to chained list, and based on the interface in the interface structure body of target outgoing interface List item indicator variable in indicator variable and forwarding-table item, by corresponding for the target outgoing interface forwarding-table item collective for needing and removing It is invalid to be placed in, it is possible to delete invalid forwarding-table item, such that it is able to significantly reduce the load of CPU, improves the money of CPU Source utilization rate.
On the other hand, when forwarding unit is frame forwarding unit, as the master control borad of frame type equipment is no longer needed to industry Business plate sends the forwarding-table item for needing to delete, but the interface ID of abnormal outgoing interface is sent to business board, is based on by business board Interface ID completes the removing work of abnormal outgoing interface list item, such that it is able to be effectively saved the resource of inner passage.
In sum, the method that is removed using the list item that the embodiment of the present application is provided, can be effectively reduced forwarding unit System loading.
Referring to Fig. 1, Fig. 1 is a kind of flow chart of the list item sweep-out method shown in one exemplary embodiment of the application, described Method is applied to forwarding unit, and the forwarding unit includes several outgoing interfaces.The corresponding structure of described several outgoing interfaces The pre-configured corresponding interface indicator variable of middle difference.Outgoing interface identical forwarding-table item quilt in the forward table of the forwarding unit Corresponding chained list is organized into respectively.The pre-configured corresponding list item indicator variable of forwarding-table item difference in the chained list.Described Method specifically includes step as described below:
Step 101:When receive issue for target outgoing interface forwarding-table item when, will be with the target outgoing interface pair The value of the interface indicator variable that answers is assigned to list item indicator variable corresponding with the forwarding-table item.
Step 102:When detecting the target outgoing interface and being abnormal, change interface corresponding with the target outgoing interface and refer to Show the value of variable.
Step 103:By list item indicator variable in chained list corresponding with the target outgoing interface and the target outgoing interface The forwarding-table item that the value of interface indicator variable is different is removed as invalid list item.
Above-mentioned forwarding unit, refers to the equipment in the Internet with forwarding capability, it is generally the case that such forwarding unit Including some outgoing interfaces, each outgoing interface is to there is some forwarding-table items being stored in the forwarding unit.When study is to new During forwarding-table item, forwarding unit can update existing forwarding-table item.When the outgoing interface exception on forwarding unit or network are opened up Flutter when changing, forwarding unit can remove the forwarding-table item on the outgoing interface, to relearn new forwarding-table item etc..On It can be three layers of forwarding unit, such as router, or two layers of forwarding unit to state forwarding unit, such as switch, here only Exemplary explanation is carried out to which, forwarding unit is not specifically limited.
Above-mentioned forwarding-table item, it is generally the case that forwarding-table item can be organized the formation of forward table in the form of Hash table.? In the embodiment of the present application, developer is constituted to above-mentioned forwarding-table item also in the form of chained list.For double layer network comes Say, the forwarding-table item can be MAC address entries, for three-layer network, the forwarding-table item can be ARP/ND list items.
Above-mentioned interface indicator variable, is arrange in the structure of the outgoing interface of forwarding unit one change of developer Amount, in the embodiment of the present application, acts primarily as mark action, by the collective effect with above-mentioned list item indicator variable, identifies this and go out Whether the corresponding forwarding-table item of interface is effective.
Above-mentioned list item indicator variable, is variable that developer adds in the forwarding-table item of chained list, implements in the application In example, mark action is acted primarily as, by the collective effect with above-mentioned interface indicator variable, whether effective the forwarding-table item is identified. Under normal circumstances, when newly study is to the forwarding-table item for target outgoing interface, list item instruction can be added in forwarding-table item Variable, it is possible to which above-mentioned interface indicator variable is assigned to list item indicator variable.
In the embodiment of the present application, by the improvement to list item purge mechanism, i.e., by the existing machine for directly removing list item System to be advanced through and be placed in list item invalid, then is purged the removing that the two steps complete list item to invalid list item.Turn The equipment of sending out no longer repeatedly travels through Hash table repeatedly, and searching needs the forwarding-table item that removes to be deleted, but can according to chained list, Quickly find forwarding-table item, and based on the interface indicator variable and forwarding-table item in the interface structure body of target outgoing interface in List item indicator variable, it is invalid that corresponding for the target outgoing interface forwarding-table item collective for needing to remove is placed in, it is possible to will be invalid Forwarding-table item delete from forward table, such that it is able to significantly reduce the load of CPU, improve the resource utilization of CPU.
Configuration to carrying out for completing the list item sweep-out method of the application proposition, is described in detail below.
For the configuration for forwarding-table item, in the embodiment of the present application, developer can be organized in the form of chained list Above-mentioned forwarding-table item.By the organizational form of chain table organization forwarding-table item, corresponding for same outgoing interface forwarding-table item can be entered Row " link " so that forwarding unit no longer repeatedly can be traveled through with the forward table of Hash table organization, and can be by chained list The pointer of the sensing forwarding-table item of preservation rapidly finds invalid forwarding-table item, and which is deleted from internal memory.
For the organizational form of chained list, it is generally the case that developer can be in the interface structure body of target outgoing interface Configuration chained list node, is stored the pointer for pointing to the outgoing interface certain forwarding-table item corresponding, is referred to by this in the chained list node Pin, can quickly support and find the forwarding-table item.Meanwhile, also store in the forwarding-table item for finding and forwardly and rearwardly refer to Pin, in order to be respectively directed to upper one and next forwarding-table item of forwarding-table item association so that forwarding unit can pass through to Front and pointer backward, finds the corresponding all forwarding-table items of the outgoing interface.
Wherein, if two forwarding-table items have incidence relation, show that the two forwarding-table items are same outgoing interfaces pair The forwarding-table item that answers.What the application was provided is organized to forwarding-table item in the form of chained list, is to same outgoing interface pair in fact The all forwarding-table items that answers are organized.In other words, be exactly each outgoing interface to having chained list, contain in the chained list The corresponding all forwarding-table items of the outgoing interface.
Merely just to a kind of exemplary illustration of chain sheet form tissue forwarding-table item, not carrying out to which in this application Specifically limit.
In addition it is also necessary to illustrate, when being organized to above-mentioned forwarding-table item using chained list, typically it is readily apparent that Method is the pointer for only storing the address for pointing to next forwarding-table item in the method using single-track link table, i.e. chained list.In order to The corresponding whole forwarding-table item of the outgoing interface can be found, what this required in interface structure body storage is the outgoing interface pair The first node of chained list is answered, additionally, using single-track link table, forwarding-table item may only be accessed downwards, and be unable to two-way access forwarding List item, is therefore to cause greatly inconvenience using chain table search forwarding-table item.
And in the embodiment of the present application, developer is organized to above-mentioned forwarding-table item using doubly linked list, on the one hand, Using doubly linked list, can cause arbitrary node that chained list is stored in the structure of outgoing interface, facilitate the original place of chained list node to add Enter and delete;On the other hand, using doubly linked list, it is possible to achieve the pointer of two-way traversal forwarding-table item, accelerate to forwarding-table item Ground access speed.
Additionally, for the configuration of forwarding-table item, also include, forwarding-table item is stored in forwarding-table item in Hash table Node, and developer's pre-configured list item indicator variable in forwarding-table item.
For the configuration of interface indicator variable, interface indicator variable can be configured the knot in outgoing interface by developer in advance In structure body.The initial value of the indicator variable is the random value that the system of the forwarding unit is generated.
For the configuration of list item indicator variable, developer can configure list item indicator variable in each forwarding-table item.
Here, it should be noted that the interface indicator variable in the structure of above-mentioned outgoing interface is corresponding with the outgoing interface Forwarding-table item in list item indicator variable, act primarily as mark action, whether effective in order to distinguish forwarding-table item.Come in other words Say, if interface indicator variable is identical with list item indicator variable, show that the forwarding-table item is effective;If the interface indicator variable When differing with list item indicator variable, then show that the forwarding-table item is invalid.
Method to removing list item, is introduced in detail below.
In the embodiment of the present application, when receive issue for target outgoing interface forwarding-table item when, will be with the mesh The value for marking the corresponding interface indicator variable of interface is assigned to list item indicator variable corresponding with the forwarding-table item.
When realizing, when receive issue for target outgoing interface forwarding-table item when, forwarding unit can be by the mesh The value for marking the interface indicator variable in the interface structure body of interface is assigned to list item instruction change corresponding with the forwarding-table item Amount so that the value of the list item indicator variable in the forwarding-table item is identical with the value of interface indicator variable.
It should be noted that the newly study of the forwarding-table item for issuing, generally forwarding unit arrive for target outgoing interface Forwarding-table item, the value of the interface indicator variable in target outgoing interface corresponding with the forwarding-table item is assigned to and the forward table Corresponding list item indicator variable, mainly identify the new study to forwarding-table item be effective.
In addition it is also necessary to illustrate, when receive issue for target outgoing interface forwarding-table item when, forwarding unit The value of the interface indicator variable in the interface structure body of the target outgoing interface can be assigned to the list item indicator variable.So Do and be advantageous in that, after corresponding for target outgoing interface invalid forwarding-table item is removed by forwarding unit, it is not necessary to go out to connect by this Interface indicator variable in mouthful reverts to initial value, but in the target outgoing interface study to after new forwarding-table item, will modification The value of rear port indicator variable is assigned to list item indicator variable corresponding with new forwarding-table item.Due to reducing interface The step of indicator variable reverts to initial value, therefore can effectively improve the efficiency of list item removing.
In the embodiment of the present application, when detecting the target outgoing interface and being abnormal, change and the target outgoing interface pair The value of the interface indicator variable that answers.
When realizing, forwarding unit can be detected to target outgoing interface, if detecting the target outgoing interface exception, It is invalid that the corresponding forwarding-table item of target outgoing interface can be set to by forwarding unit.By the corresponding forward table of target outgoing interface During invalid, forwarding unit can change pre-configured interface indicator variable in the interface structure body of target outgoing interface Value so that the value of the list item indicator variable in the value of interface indicator variable forwarding-table item corresponding with the target outgoing interface Difference, by different values, it is invalid that the corresponding forwarding-table item of target outgoing interface is labeled as.Become for above-mentioned instruction is changed The value of amount, can not carried out to which here by modifying to the value of interface indicator variable is added first-class method Especially limit.
Here, it should be noted that outgoing interface exception described herein, refers to the corresponding forwarding-table item of the outgoing interface Need to remove, then show the outgoing interface exception.There is the abnormal situation of outgoing interface, Ke Yishi, outgoing interface failure or network Situations such as topology etc. changes.Here, simply exemplary explanation is carried out to there is the abnormal situation of outgoing interface, do not carry out Especially limit.
In addition it is also necessary to illustrate, invalid for forwarding-table item, the method being typically readily apparent that is by abnormal mesh Marking the corresponding forwarding-table item of interface carries out invalidation one by one.And in the embodiment of the present application, forwarding unit can lead to The method for crossing the interface indicator variable stored in the interface structure body of the abnormal target outgoing interface of modification, the abnormal target is gone out The corresponding forwarding-table item Collective Reference of interface is invalid.As the method that the embodiment of the present application is provided can go out to abnormal target The corresponding all forwarding-table items of interface carry out invalidation simultaneously, it is possible to effectively accelerate the invalid speed of list item, improve table The efficiency that item is removed.
In the embodiment of the present application, will list item indicator variable and the target in chained list corresponding with the target outgoing interface The forwarding-table item that the value of the interface indicator variable of outgoing interface is different is removed as invalid list item.
For by the interface of list item indicator variable in chained list corresponding with the target outgoing interface and the target outgoing interface The forwarding-table item that the value of indicator variable is different is removed as invalid list item, and forwarding unit can both be adopted and actively delete forward table The method of item, it would however also be possible to employ the cycle travels through each chained list, and respectively forwarding-table item is deleted.
The method for actively deleting forwarding-table item is as follows:
In the embodiment of the present application, when message is received, mate target corresponding with the message in forward table and turn Forwarding list item;When target forwarding-table item corresponding with the message is matched in forward table, the comparison target forwarding-table item In corresponding with the target forwarding-table item outgoing interface of list item indicator variable in interface indicator variable value whether identical;Such as Interface in list item indicator variable in really described target forwarding-table item outgoing interface corresponding with the target forwarding-table item indicates to become The value of amount is different, and the target forwarding-table item is neutralized chain corresponding with the target forwarding-table item as invalid list item from forward table Remove in table.
The above-mentioned method for actively deleting forwarding-table item, realizes mainly during forwarding unit E-Packets.? When realizing, when message is received, forwarding unit can mate target corresponding with the message that this receives in forward table and turn Forwarding list item.If mate target forwarding-table item corresponding with the message, forwarding unit can be obtained in the target forwarding-table item List item indicator variable, it is possible to based in the target forwarding-table item carry outgoing interface information, obtain the interface of the outgoing interface Interface indicator variable in structure.
Forwarding unit can compare the list item indicator variable and the value in interface indicator variable.If stating target forward table List item indicator variable in is different from the value of the interface indicator variable in the corresponding outgoing interface of target forwarding-table item, forwards Equipment can the target forwarding-table item be invalid with labelling.Now, forwarding unit can by this be labeled as invalid forwarding-table item from turn Deliver and remove in neutralization chained list corresponding with the target forwarding-table item.Meanwhile, forwarding unit can also remove the target forward table Chained list node in the interface structure body of the corresponding outgoing interface of item.
In the embodiment of the present application, if the list item indicator variable in the target forwarding-table item and the target forwarding-table item The value of the interface indicator variable in corresponding outgoing interface is identical, based on the target forwarding-table item, forwards the message.
When realizing, if the list item indicator variable in the target forwarding-table item corresponding with the target forwarding-table item go out The value of the interface indicator variable in interface is identical, and forwarding unit can determine the target forwarding-table item effectively, then forwarding unit The target forwarding-table item can be based on, the message is forwarded.
Interface chained list is traveled through using the cycle, the mode deleted by forwarding-table item is as follows:
In the present embodiment, forwarding unit can periodically travel through the forwarding-table item in each chained list, and it is invalid to inquire about respectively Forwarding-table item.And can be corresponding from forward table and forwarding-table item invalid with this by the described invalid forwarding-table item for inquiring Chained list in remove.
When realizing, developer can pre-configured timing in the interface structure body of each outgoing interface of forwarding unit Device, the cycle that traversal chained list is set by intervalometer.
Forwarding unit can be searched the node and referred to based on the interface chained list node stored in the interface structure body of the outgoing interface To forwarding-table item, it is possible to compare whether list item indicator variable in the forwarding-table item indicates to become with the interface in the outgoing interface Amount identical, if the list item indicator variable is different from the interface indicator variable, forwarding unit can determine the forwarding-table item without Effect, it is possible to which the forwarding-table item is deleted.Now, the chained list node can also be deleted from the interface structure body by forwarding unit Remove.
Before above-mentioned forwarding-table item is deleted, forwarding unit can obtain the finger forwardly and rearwardly stored in the forwarding-table item Pin, the forwarding-table item that the two-way search pointer forwardly and rearwardly is pointed to, and continue above-mentioned judgement invalid operation, work as forwarding-table item When invalid, forwarding-table item is deleted from forward table and the chained list.
Simultaneously using the method for actively deleting forwarding-table item and regular travel through chained list, forwarding-table item is deleted this two The method of kind, due to having no all to delete corresponding for target outgoing interface forwarding-table item with omitting, therefore effectively can carry The speed that high forwarding-table item is deleted.
In the embodiment of the present application, when the forwarding unit is frame forwarding unit;The frame type equipment includes master control borad And business board;The value of the indicator variable in the interface structure body for changing the target outgoing interface, including:Business board is received The forwarding-table item removing message that master control borad sends, and obtain the target outgoing interface of the forwarding-table item removing message carrying Interface ID;Business board searches the interface structure body of the target outgoing interface based on the interface ID;Modification goes out to connect with the target The value of the corresponding interface indicator variable of mouth.
When realizing, when the forwarding unit is frame forwarding unit, the master control borad of frame type equipment can enter to outgoing interface Row detection, when detecting target outgoing interface and being abnormal, master control borad can will remove the corresponding forwarding-table item of target outgoing interface Forwarding-table item removes message, is handed down to business board.
For the value of the indicator variable in the interface structure body for changing the target outgoing interface, business board can be received After the list item removes message, it is possible to obtain the interface ID of the target outgoing interface carried in the message.Business board can be based on should Interface ID, finds target outgoing interface, then the value of the interface indicator variable in the interface structure body of modification target outgoing interface.
It should be noted that in the list item sweep-out method that the application is proposed, frame forwarding unit is only for modification institute State the indicator variable in the interface structure body of target outgoing interface value the step of on be slightly different, remaining the step of with above-mentioned The step of list item sweep-out method, is identical, here, repeats no more.
In the embodiment of the present application, the forwarding unit includes two layers of forwarding unit and three layers of forwarding unit;The forwarding List item includes MAC address entries and ARP/ND list items.
It should be noted that when the list item sweep-out method that the application is proposed is applied in double layer network, the application turns The equipment of sending out can include two layers of forwarding unit, such as switch etc., and now, forwarding-table item can be MAC address entries etc..Work as the application When the list item sweep-out method of proposition is applied in three-layer network, the forwarding unit of the application can include three layers of forwarding unit, example Such as router etc..Now, forwarding-table item can be ARP/ND list items etc..
Furthermore, it is necessary to illustrate, all outgoing interfaces on forwarding unit can use above-mentioned list item sweep-out method pair The list item that removes is needed to be purged.The target outgoing interface can be with arbitrary outgoing interface on acute pyogenic infection of finger tip forwarding unit.
The application provides a kind of list item sweep-out method, when receive issue for target outgoing interface forwarding-table item when, The value of interface indicator variable corresponding with the target outgoing interface can be assigned to and the forwarding-table item pair by forwarding unit The list item indicator variable that answers.When detecting the target outgoing interface and being abnormal, forwarding unit can be changed and be gone out to connect with the target The value of the corresponding interface indicator variable of mouth.And can by list item indicator variable in chained list corresponding with the target outgoing interface with The forwarding-table item that the value of the interface indicator variable of the target outgoing interface is different is removed as invalid list item.
Additionally, when forwarding unit is frame forwarding unit, during list item is removed, the master control borad of frame type equipment is not The list item for needing to delete is handed down to business board again, but the interface ID of abnormal outgoing interface is sent to business board by master control borad, by Business board uses the method that the list item that the application provides is removed to turn corresponding for abnormal outgoing interface forwarding-table item as invalid Forwarding list item is deleted.
On the one hand, as forwarding unit no longer repeatedly travels through Hash table repeatedly, searching needs the forwarding-table item that removes to carry out Delete;But forwarding-table item can quickly be found according to chained list, and based on the interface in the interface structure body of target outgoing interface List item indicator variable in indicator variable and forwarding-table item, by corresponding for the target outgoing interface forwarding-table item collective for needing and removing It is invalid to be placed in, it is possible to delete invalid forwarding-table item, such that it is able to significantly reduce the load of CPU, improves the money of CPU Source utilization rate.
On the other hand, when forwarding unit is frame forwarding unit, as the master control borad of frame type equipment is no longer needed to industry Business plate sends the forwarding-table item for needing to delete, but the interface ID of abnormal outgoing interface is sent to business board, is based on by business board Interface ID completes the removing work of abnormal outgoing interface list item, such that it is able to be effectively saved the resource of inner passage.
In sum, the list item sweep-out method for being provided using the embodiment of the present application, can be effectively reduced forwarding unit System loading.
Corresponding with the embodiment of the method that aforementioned list item is removed, present invention also provides the enforcement of the device of list item removing Example.
The embodiment of the application list item remove device can be applied on forwarding unit.Device embodiment can pass through software Realize, it is also possible to realized by way of hardware or software and hardware combining.As a example by implemented in software, as on a logical meaning Device, be corresponding computer program instructions in nonvolatile memory to be read by the processor of its place forwarding unit To in internal memory, operation is formed.From for hardware view, as shown in Fig. 2 being the application list item remove device place forwarding unit A kind of hardware structure diagram, in addition to the processor shown in Fig. 2, internal memory, network outgoing interface and nonvolatile memory, The actual functional capability that the forwarding unit that device is located in embodiment is removed generally according to the list item, can also include other hardware, right This repeats no more.
Fig. 3 is refer to, Fig. 3 is a kind of block diagram of the list item remove device shown in one exemplary embodiment of the application.Described Device is applied to forwarding unit, and the forwarding unit includes several outgoing interfaces, the corresponding structure of described several outgoing interfaces The pre-configured corresponding interface indicator variable of middle difference;Outgoing interface identical forwarding-table item in the forward table of the forwarding unit Corresponding chained list is organized into respectively;The pre-configured corresponding list item indicator variable of forwarding-table item difference in the chained list;Institute Stating device includes:Assignment unit 310, modification unit 320 and clearing cell 330.
Wherein, assignment unit 310, for when receive issue for target outgoing interface forwarding-table item when, will be with institute The value for stating the corresponding interface indicator variable of target outgoing interface is assigned to list item indicator variable corresponding with the forwarding-table item;
Modification unit 320, for when detecting the target outgoing interface and being abnormal, changing corresponding with the target outgoing interface Interface indicator variable value;
Clearing cell 330, for will list item indicator variable and the target in chained list corresponding with the target outgoing interface The forwarding-table item that the value of the interface indicator variable of outgoing interface is different is removed as invalid list item.
In another kind of optional implementation, the clearing cell 330, specifically for when message is received, turning Deliver middle coupling target forwarding-table item corresponding with the message;When matching target corresponding with the message in forward table During forwarding-table item, in list item indicator variable in comparison target forwarding-table item outgoing interface corresponding with the target forwarding-table item Interface indicator variable value whether identical;If the list item indicator variable in the target forwarding-table item is forwarded with the target The value of the interface indicator variable in the corresponding outgoing interface of list item is different, using the target forwarding-table item as invalid list item from forwarding Table is neutralized in chained list corresponding with the target forwarding-table item and is removed.
In another kind of optional implementation, the clearing cell 330, specifically for periodically traveling through in each chained list Forwarding-table item, inquire about invalid forwarding-table item respectively;By the described invalid forwarding-table item for inquiring from forward table and with this Remove in the corresponding chained list of invalid forwarding-table item.
In another kind of optional implementation, described device also includes:Retransmission unit 340, if for the target The value phase of the interface indicator variable in the outgoing interface corresponding with the target forwarding-table item of the list item indicator variable in forwarding-table item With based on the target forwarding-table item, the forwarding message.
In said apparatus, the function of unit and effect realizes that process specifically refers in said method corresponding step Process is realized, be will not be described here.
For device embodiment, as which corresponds essentially to embodiment of the method, so related part is referring to method reality Apply the part explanation of example.Device embodiment described above is only schematically, wherein described as separating component The unit of explanation can be or may not be physically separate, as the part that unit shows can be or can also It is not physical location, you can be located at a place, or can also be distributed on multiple NEs.Can be according to reality Need to select some or all of module therein to realize the purpose of application scheme.Those of ordinary skill in the art are not paying In the case of going out creative work, you can to understand and implement.
The preferred embodiment of the application is the foregoing is only, not in order to limiting the application, all essences in the application Within god and principle, any modification, equivalent substitution and improvements that is done etc. are should be included within the scope of the application protection.

Claims (10)

1. a kind of list item sweep-out method, it is characterised in that methods described is applied to forwarding unit, and the forwarding unit includes some Individual outgoing interface, pre-configured respectively corresponding interface indicator variable in the corresponding structure of described several outgoing interfaces;Described turn Outgoing interface identical forwarding-table item in the forward table of the equipment of sending out is organized into corresponding chained list respectively;Forwarding in the chained list The pre-configured corresponding list item indicator variable of list item difference;Methods described includes:
When receive issue for target outgoing interface forwarding-table item when, corresponding with target outgoing interface interface is indicated The value of variable is assigned to list item indicator variable corresponding with the forwarding-table item;
When detecting the target outgoing interface and being abnormal, modification is taken with the corresponding interface indicator variable of target outgoing interface Value;
Interface indicator variable by list item indicator variable in chained list corresponding with the target outgoing interface and the target outgoing interface The different forwarding-table item of value remove as invalid list item.
2. method according to claim 1, it is characterised in that described will table in chained list corresponding with the target outgoing interface The item indicator variable forwarding-table item different from the value of the interface indicator variable of the target outgoing interface is removed as invalid list item, Including:
When message is received, mate target forwarding-table item corresponding with the message in forward table;
When target forwarding-table item corresponding with the message is matched in forward table, in the comparison target forwarding-table item Whether the value of the interface indicator variable in list item indicator variable outgoing interface corresponding with the target forwarding-table item is identical;
If the interface in the outgoing interface corresponding with the target forwarding-table item of the list item indicator variable in the target forwarding-table item The value of indicator variable is different, using the target forwarding-table item as invalid list item from forward table neutralization and the target forwarding-table item pair Remove in the chained list that answers.
3. method according to claim 1, it is characterised in that described will table in chained list corresponding with the target outgoing interface The item indicator variable forwarding-table item different from the value of the interface indicator variable of the target outgoing interface is removed as invalid list item, Including:
The forwarding-table item in each chained list is periodically traveled through, invalid forwarding-table item is inquired about respectively;
The described invalid forwarding-table item for inquiring is removed from forward table and the corresponding chained list of forwarding-table item invalid with this.
4. method according to claim 2, it is characterised in that methods described also includes:
If the interface in the outgoing interface corresponding with the target forwarding-table item of the list item indicator variable in the target forwarding-table item The value of indicator variable is identical, based on the target forwarding-table item, forwards the message.
5. method according to claim 1, it is characterised in that the forwarding unit is frame forwarding unit;The frame Equipment includes master control borad and business board;
The value for changing interface indicator variable corresponding with the target outgoing interface, including:
Business board receives the forwarding-table item removing message that master control borad sends, and obtains the institute that the forwarding-table item removes message carrying State the interface ID of target outgoing interface;
Business board searches the target outgoing interface based on the interface ID;
The value of modification interface indicator variable corresponding with the target outgoing interface.
6. method according to claim 1, it is characterised in that the forwarding unit include two layers of forwarding unit and three layers turn The equipment of sending out;The forwarding-table item includes MAC address entries and ARP/ND list items.
7. a kind of list item remove device, it is characterised in that described device is applied to forwarding unit, and the forwarding unit includes some Individual outgoing interface, pre-configured respectively corresponding interface indicator variable in the corresponding structure of described several outgoing interfaces;Described turn Outgoing interface identical forwarding-table item in the forward table of the equipment of sending out is organized into corresponding chained list respectively;Forwarding in the chained list The pre-configured corresponding list item indicator variable of list item difference;Described device includes:
Assignment unit, for when receive issue for target outgoing interface forwarding-table item when, will be with the target outgoing interface The value of corresponding interface indicator variable is assigned to list item indicator variable corresponding with the forwarding-table item;
Modification unit, for when detecting the target outgoing interface and being abnormal, changing interface corresponding with the target outgoing interface The value of indicator variable;
Clearing cell, for by list item indicator variable in chained list corresponding with the target outgoing interface and the target outgoing interface The forwarding-table item that the value of interface indicator variable is different is removed as invalid list item.
8. device according to claim 7, it is characterised in that the clearing cell, specifically for when message is received, Mate target forwarding-table item corresponding with the message in forward table;Corresponding with the message when matching in forward table During target forwarding-table item, list item indicator variable in the comparison target forwarding-table item is corresponding with the target forwarding-table item to be gone out to connect Whether the value of the interface indicator variable in mouthful is identical;If the list item indicator variable in the target forwarding-table item and the target The value of the interface indicator variable in the corresponding outgoing interface of forwarding-table item is different, using the target forwarding-table item as invalid list item from Forward table is neutralized in chained list corresponding with the target forwarding-table item and is removed.
9. device according to claim 7, it is characterised in that the clearing cell, each specifically for periodically traveling through Forwarding-table item in chained list, inquires about invalid forwarding-table item respectively;By the described invalid forwarding-table item for inquiring from forward table And remove in the corresponding chained list of forwarding-table item invalid with this.
10. device according to claim 8, it is characterised in that described device also includes retransmission unit, if for described Interface indicator variable in list item indicator variable in target forwarding-table item outgoing interface corresponding with the target forwarding-table item takes Value is identical, based on the target forwarding-table item, forwards the message.
CN201610987096.4A 2016-11-09 2016-11-09 List item sweep-out method and device Pending CN106506370A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610987096.4A CN106506370A (en) 2016-11-09 2016-11-09 List item sweep-out method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610987096.4A CN106506370A (en) 2016-11-09 2016-11-09 List item sweep-out method and device

Publications (1)

Publication Number Publication Date
CN106506370A true CN106506370A (en) 2017-03-15

Family

ID=58323792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610987096.4A Pending CN106506370A (en) 2016-11-09 2016-11-09 List item sweep-out method and device

Country Status (1)

Country Link
CN (1) CN106506370A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547405A (en) * 2017-08-08 2018-01-05 杭州迪普科技股份有限公司 Route agent's method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101155123A (en) * 2006-09-26 2008-04-02 华为技术有限公司 A method and device for ensuring the reliability of forwarding entries, and a forwarding device
US20150381482A1 (en) * 2002-08-22 2015-12-31 International Business Machines Corporation Splitting and sharing routing information among several routers acting as a single border router
CN105337873A (en) * 2014-05-30 2016-02-17 杭州迪普科技有限公司 MSTP networking service distribution method and apparatus
CN105450517A (en) * 2014-07-24 2016-03-30 杭州迪普科技有限公司 Forwarding item removing method and device
CN105939270A (en) * 2016-01-26 2016-09-14 杭州迪普科技有限公司 Method and device for updating MSTP neighbor table
CN105959226A (en) * 2016-06-17 2016-09-21 杭州迪普科技有限公司 Method and device for establishing forwarding table item

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150381482A1 (en) * 2002-08-22 2015-12-31 International Business Machines Corporation Splitting and sharing routing information among several routers acting as a single border router
CN101155123A (en) * 2006-09-26 2008-04-02 华为技术有限公司 A method and device for ensuring the reliability of forwarding entries, and a forwarding device
CN105337873A (en) * 2014-05-30 2016-02-17 杭州迪普科技有限公司 MSTP networking service distribution method and apparatus
CN105450517A (en) * 2014-07-24 2016-03-30 杭州迪普科技有限公司 Forwarding item removing method and device
CN105939270A (en) * 2016-01-26 2016-09-14 杭州迪普科技有限公司 Method and device for updating MSTP neighbor table
CN105959226A (en) * 2016-06-17 2016-09-21 杭州迪普科技有限公司 Method and device for establishing forwarding table item

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547405A (en) * 2017-08-08 2018-01-05 杭州迪普科技股份有限公司 Route agent's method and device
CN107547405B (en) * 2017-08-08 2019-12-06 杭州迪普科技股份有限公司 Routing agent method and device

Similar Documents

Publication Publication Date Title
CN104104604B (en) The method and device of accurate match Hash lookup database in network switch device
CN105224692B (en) Support the system and method for the SDN multilevel flow table parallel searchs of multi-core processor
US9344328B1 (en) Fast port failover in a network switch
US7096277B2 (en) Distributed lookup based on packet contents
CN101043428B (en) Method and system for route forwarding
US7509674B2 (en) Access control listing mechanism for routers
CN106470158B (en) Message forwarding method and device
US10333845B2 (en) Forwarding data packets
Banerjee et al. Tag-in-tag: Efficient flow table management in sdn switches
CN111937360B (en) Longest prefix matching
US9282031B2 (en) Network system and routing method
CN106664251A (en) Bi-directional flow stickiness in a network environment
CN108134748A (en) A kind of packet discarding method and device based on fast-forwarding list item
CN106534287A (en) Session table item management method and device
CN106453091B (en) The equivalent route management method and device of router Forwarding plane
CN106341338A (en) Message forwarding method and apparatus thereof
CN106209689A (en) From the multicast data packet forwarding method and apparatus of VXLAN to VLAN
US11775342B2 (en) System and method for processing information hierarchy management
CN106803809A (en) A kind of method and apparatus of message forwarding
US9258229B2 (en) Systems and methods for accessing a multi-bank SRAM
CN106506370A (en) List item sweep-out method and device
CN107493245B (en) Board card of switch and data stream forwarding method
CN101335737B (en) Network processor and data processing method thereof
Borokhovich et al. The show must go on: Fundamental data plane connectivity services for dependable SDNs
CN103957131B (en) Deep massage detection method based on finite automata

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170315

RJ01 Rejection of invention patent application after publication