CN104243334B - The method and apparatus for preventing link congestion - Google Patents

The method and apparatus for preventing link congestion Download PDF

Info

Publication number
CN104243334B
CN104243334B CN201410502641.7A CN201410502641A CN104243334B CN 104243334 B CN104243334 B CN 104243334B CN 201410502641 A CN201410502641 A CN 201410502641A CN 104243334 B CN104243334 B CN 104243334B
Authority
CN
China
Prior art keywords
port
equipment
message
occasional passage
root
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
CN201410502641.7A
Other languages
Chinese (zh)
Other versions
CN104243334A (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
New 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 New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201410502641.7A priority Critical patent/CN104243334B/en
Publication of CN104243334A publication Critical patent/CN104243334A/en
Application granted granted Critical
Publication of CN104243334B publication Critical patent/CN104243334B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

This application provides the method and apparatus for preventing link congestion.In this application, one interim occasional passage passed through in loop network is consulted by each leaf node device in annular link and root bridge device, so as to the link bandwidth in loop network it is nervous when, enable occasional passage and help the nervous link load traffic of bandwidth, this can solve the problem that because the temporary link congestion that link bandwidth is nervous and is likely to occur.

Description

The method and apparatus for preventing link congestion
Technical field
The application is related to the network communications technology, the method and apparatus for more particularly to preventing link congestion.
Background technology
Spanning-Tree Protocol (STP:Spanning Tree Protocol), it is a kind of two layer-managements agreement, it passes through selection Property redundant link in clogging networks eliminate double-layer loop, while being also equipped with the function of link backup.STP is by IEEE 802.1D standards are defined, the agreement for eliminating data link layer physics loop in a local network.The equipment for running the agreement is led to The loop crossed in INFORMATION DISCOVERY network interactively with each other, and selectively blocking to certain port, most loop network knot at last Structure is trimmed to the tree network structure of loop free, so as to prevent message continuous hyperplasia and Infinite Cyclic in loop network, it is to avoid Equipment is due to repeating the problem of message processing capability that reception identical message is caused declines.
RSTP (RSTP:Rapid Spanning Tree Protocol), determined by IEEE 802.1w standards Justice, it is improved on the basis of STP, realizes the Fast Convergent of network topology.Its " quick " is embodied in, and works as a port It is chosen as after root port and designated port, its delay for entering forwarding state will be greatly shortened, and finally be reached so as to shorten network To the time required for topological robust.
Either STP or RSTP, it can not all find and solve the provisional congestion of link in network appearance.Such as Fig. 1 It is shown, after network topology is in stable condition, if Device A connect upstream plant access internet, Device B as root bridging Under be used in conjunction family PC main frames, Device C block the port Port C2 that it connects Device B, and PC passes through Device B to Device A link-access internet, but when the link of the Device B to Device A is because data traffic is excessive and gathers around During plug, STP or RSTP are to have no idea to avoid congestion.
The content of the invention
This application provides the method and apparatus for preventing link congestion, to avoid because link bandwidth is nervous and is likely to occur Link congestion.
The technical scheme that the application is provided includes:
A kind of method for preventing link congestion, this method is applied to the network equipment in loop network, the network equipment For leaf node device or be root bridge device, this method includes:
When the network equipment is leaf node device,
If there is port blocked in this equipment, initiate to consult the notice of occasional passage in the loop network, connect Root bridge device and when allowing the notice for setting up occasional passage of other leaf node devices transmission in the loop network are received, will The port blocked present on this equipment is added to the occasional passage, and the port blocked is allowed to turn in occasional passage Send out data message;If port blocked is not present in this equipment, the notice is received, and judge whether this equipment allows foundation Occasional passage, if it is, the root port and designated port in this equipment are added to occasional passage together, and will allow foundation to face Shi Tongdao notice is to the leaf node device for initiating the notice;
After occasional passage negotiation is completed, message flow monitoring is carried out to the root port in this equipment, butt is being monitored When mouth meets port congestion condition, enable occasional passage and root port and share the message forwarded originally via the root port together, To avoid root port from congestion occur;
When the network equipment is root bridge device,
Receive and there is the notice for consulting occasional passage that the leaf node device of port blocked is initiated in the loop network, Judge whether this equipment allows to set up occasional passage, if it is, all designated ports in this equipment are added to occasional passage, And will allow to set up occasional passage and notify to the leaf node device for initiating the notice;
After occasional passage negotiation is completed, message flow monitoring is carried out to each designated port in this equipment;Monitoring When designated port meets port congestion condition, enable occasional passage and the designated port is shared originally via the designated port together The message of forwarding, to avoid the designated port from congestion occur.
A kind of equipment for preventing link congestion, the network equipment of the equipment application in loop network, when the network is set During for being leaf node device, including:First negotiation element, the first monitoring unit, first share processing unit;
First negotiation element, during for there is port blocked in this equipment, initiation negotiation is faced in the loop network What root bridge device and other leaf node devices were sent in Shi Tongdao notice, the reception loop network allows to set up interim During the notice of passage, the port blocked present on this equipment is added to the occasional passage, the port blocked is facing Forwarding data packets are allowed in Shi Tongdao;And
During for port blocked to be not present in this equipment, the notice is received, and judge whether this equipment allows foundation Occasional passage, if it is, the root port and designated port in this equipment are added to occasional passage together, and will allow foundation to face Shi Tongdao notice is to the leaf node device for initiating the notice;
First monitoring unit, for after occasional passage negotiation is completed, message flow to be carried out to the root port in this equipment Monitoring;
First shares processing unit, and port congestion condition is met for monitoring root port in first monitoring unit When, enable occasional passage and root port and share the message forwarded originally via the root port together, to avoid root port from gathering around Plug;
When the network equipment is root bridge device, including:Second negotiation element, the second monitoring unit, second share place Manage unit;
, there is the association that the leaf node device of port blocked is initiated in the loop network for receiving in the second negotiation element The notice of business's occasional passage, judges whether this equipment allows to set up occasional passage, if it is, by all designated ends in this equipment Mouthful add to occasional passage, and will allow to set up occasional passage and notify to the leaf node device for initiating the notice;
Second monitoring unit, for after occasional passage negotiation is completed, message to be carried out to each designated port in this equipment Traffic monitoring;
Second shares processing unit, and port congestion condition is met for monitoring designated port in second monitoring unit When, enable occasional passage and the designated port shares the message forwarded originally via the designated port together, to avoid this from specifying There is congestion in port.
As can be seen from the above technical solutions, in the present invention, set by each leaf node device in annular link and root bridge It is standby to consult an interim occasional passage passed through in loop network, so as to the link bandwidth in loop network it is nervous when, open Help the nervous link load traffic of bandwidth with occasional passage, this can solve the problem that because link bandwidth is nervous and be likely to occur it is temporary When property link congestion.
Brief description of the drawings
Fig. 1 is existing network networking schematic diagram;
Fig. 2 is networking schematic diagram provided in an embodiment of the present invention;
The method flow diagram that Fig. 3 provides for the present invention;
The another method flow chart that Fig. 4 provides for the present invention;
Fig. 5 is Hash operation schematic diagram provided in an embodiment of the present invention;
Fig. 6 is example networking schematic diagram provided in an embodiment of the present invention;
The equipment structure chart that Fig. 7 provides for the present invention;
Another equipment structure chart that Fig. 8 provides for the present invention.
Embodiment
In order that the object, technical solutions and advantages of the present invention are clearer, below in conjunction with the accompanying drawings with specific embodiment pair The present invention is described in detail.
To be readily appreciated that the application, first the technical term that the application is related to is described below:
Root bridge device:Tree-like network structure must have tree root, in being the introduction of the general of root bridge device (Root Bridge) Read.Root bridge device has and only one of which in the whole network, and miscellaneous equipment is then referred to as leaf node.Root bridge can be according to the change of network topology Change and change, therefore root bridge is not fixed.
Root port:The port nearest from root bridge device in leaf node device.Root port in leaf node device is responsible for Communicated with root bridge device.Root port is responsible for communicating with root bridge device, has in a leaf node device and only one of which root There is no root port in port, root bridge device, its port for connecting loop network is decided to be designated port.
Designated port, port blocked:For leaf node device, it is it is determined that a port of connection loop network is root Behind port, it can determine to connect another port of loop network by some calculating for designated port or port blocked, hereafter Describe how that it is designated port or port blocked to determine that it connects another port of loop network, wouldn't repeat here.
The technical term that the application is related to is described above.
The loop network that the present invention restrains and (also referred to as stablized) applied to topology status.Describe to be based on only by taking STP as an example below The topology status convergence process of STP loop network, RSTP principles are similar.
Original state:
The port of loop network is connected on each network equipment can generate and send using this equipment as root bridge device when initial Bridge protocol data unit (BPDU:Bridge Protocol Data Unit), root bridge ID is the equipment of itself in the BPDU ID, root path cost is 0, and it is the device id of itself to specify bridge ID, and designated port is the port.
Select root bridge:
When network is initial, each network equipment all thinks it oneself is " root bridge " equipment, afterwards by being handed over other network equipments It is root bridge device to change BPDU and select the minimum equipment of root bridge ID.
Select root port:
Leaf node device selects the port nearest from root bridge device to be root port.
Select designated port and port blocked:
Leaf node device handles the end for connecting loop network in this equipment in addition to root port by following substitute mode The BPDU of mouth (being referred to as role port undetermined) generation, is set to designated port BPDU by the BPDU after processing:
Root bridge ID replaces with the BPDU of root port root bridge ID;
The root path cost that root path cost is replaced with root port BPDU adds the corresponding path cost of root port;
Bridge ID is specified to replace with the ID of equipment of itself;
Designated port ID replaces with itself port id.
The BPDU that the designated port BPDU that leaf node device calculates this equipment is generated with role port undetermined oneself Compared as follows:If the BPDU calculated is more excellent, the port is confirmed as designated port, what its BPDU was also calculated BPDU is replaced, and is periodically sent out;If the BPDU of the port oneself is more excellent, the BPDU of the port is not updated and is incited somebody to action The state of the port is set to block (Discarding), and the state is set to the port referred to as port blocked of obstruction, will no longer Data are forwarded, and only receives and does not send BPDU.
After each above-mentioned process, entirely the topology status of the loop network based on STP is also just settled out.Fig. 2 Show the state for the port that loop network is connected in root bridge device and each leaf node device.
It is port blocked by setting the port of connection loop network in a leaf node device, can solve the problem that ring network The loop problem often occurred in network, still, this can not find and solve loop network link congestion.
In network application, link congestion is temporary transient, based on this, and the present invention is when there is link bandwidth nervous, temporarily Bandwidth is expanded, to solve because the temporary link congestion that link bandwidth is nervous and is likely to occur.The present invention simultaneously need not be extra Increase hardware or equipment, it is not required that great change is carried out in itself to the software forms and Spanning-Tree Protocol of existing ethernet device Become, so Networking Solutions & provisioned implementation cost will not be increased.
The method that the present invention is provided is described below:
Referring to Fig. 3, Fig. 3 is method flow diagram provided in an embodiment of the present invention.This method is applied to annular as described above Loop network of the network such as based on STP or RSTP.When the topology status of loop network is stable such as based on STP's or RSTP The topology status of loop network is stable (substantially also referring to spanning-tree state stable), then performs flow as shown in Figure 3.
As shown in figure 3, the flow may include following steps:
Step 301, the leaf node device that there is port blocked is initiated to consult the notice of occasional passage in loop network.
Step 302, the leaf node device in the absence of port blocked receives the notice, and judges whether this equipment allows Occasional passage is set up, if it is, the root port and designated port in this equipment are added to occasional passage together, and will allow to build The notice of vertical occasional passage is to the leaf node device for initiating the notice;Root bridge device receives the notice, and judges originally to set It is standby whether to allow to set up occasional passage, if it is, all designated ports in this equipment are added to occasional passage together, and will Allow the notice for setting up occasional passage to the leaf node device for initiating the notice.
In the present invention, the root port in this equipment and designated port are added occasional passage by leaf node device, and it is Mean that the root port and designated port possess the function of E-Packeting, but have no effect on the butt when using occasional passage The original message forwarding such as in loop network of mouth and the original function of designated port.Equally, root bridge device is by this equipment The principle that adds to occasional passage of all designated ports it is similar.
Step 303, exist port blocked leaf node device receive in the loop network root bridge device and other Leaf node device send when allowing the notice for setting up occasional passage, by the port blocked present on this equipment add to The occasional passage.
So far, the negotiation of occasional passage is just completed.Here, the occasional passage of negotiation is that link in loop network will When there is congestion, the link load traffic for helping this to will appear from congestion, to avoid the link congestion, is specifically shown in step 304 institute State.
Step 304, leaf node device carries out message flow after occasional passage negotiation is completed to the root port in this equipment Amount monitoring, when monitoring root port and meeting port congestion condition, enable occasional passage and root port share together originally via The message of root port forwarding, to avoid root port from congestion occur;Root bridge device is after occasional passage negotiation is completed, to this equipment Upper each designated port carries out message flow monitoring;When monitoring designated port and meeting port congestion condition, enable interim logical Road and the designated port share the message forwarded originally via the designated port together, to avoid the designated port from congestion occur.
This step 304 implement can be found in flow shown in Fig. 4 406 to step 415.Here it wouldn't repeat.
So far, flow shown in Fig. 3 is completed.
It is interim in ring by each network equipment negotiation one in annular link that the present invention is can be seen that from flow shown in Fig. 3 The occasional passage passed through in l network, so as to the link bandwidth in loop network it is nervous when, enable occasional passage and help bandwidth Nervous link load traffic, this can solve the problem that because the temporary link congestion that link bandwidth is nervous and is likely to occur.
Flow shown in above-mentioned Fig. 3 is described in detail below by Fig. 4.
Referring to Fig. 4, Fig. 4 is embodiment flow chart provided in an embodiment of the present invention.As shown in figure 4, the flow may include with Lower step:
Step 401, the leaf node device that there is port blocked in loop network takes the lead in initiating to consult in loop network The notice of occasional passage.
As shown in Fig. 2 leaf node device Device C, its port Port C2 port status are set to obstruction, i.e., Port C2 are port blocked, that is, leaf node device Device C are the leaf node device that there is port blocked, in this way, Based on step 401, Device C can initiate to consult the notice of occasional passage in the whole loop network shown in Fig. 2.Here, Device C can initiate to consult the logical of occasional passage by broadcast or multicast mode in the whole loop network shown in Fig. 2 Accuse.
In the present invention, carry this equipment to face in the notice that the Device C in leaf node device such as Fig. 2 are sent VLAN (VLAN) mark (ID) of Shi Tongdao generations.Preferably, the Device C in leaf node device such as Fig. 2 can It is in the following manner occasional passage generation VLAN ID:
Device C in leaf node device such as Fig. 2 are calculated by pseudo-random algorithm obtains one between 2 to 4094 Between random number, the random number that this is obtained is used as VLAN ID.
It should be noted that above-mentioned generation VLAN ID mode is citing, and the non-limiting present invention.
Further, for ease of understanding the port blocked in loop network, obstruction is also further carried in the notice The configuration informations such as the mark of the information of port, such as port blocked.
Step 402, the leaf node device that the notice is received in loop network judges whether this equipment allows foundation Occasional passage, and when judging that this equipment allows to set up occasional passage, by the root port and designated port in this equipment together Add to occasional passage, and will allow to set up occasional passage and notify to the leaf node device for initiating the notice.
Still by taking Fig. 2 as an example, the Device C in Fig. 2 initiate to consult the notice of occasional passage, when the leaf node in Fig. 2 is set Standby Device B are received after the notice, are judged whether this equipment allows to set up occasional passage, here, are judged whether this equipment allows The operation for setting up occasional passage is had been described in detail in step 403, and this step 402 wouldn't be described.
It is Port B1 by the root port in this equipment when Device B judge that this equipment allows to set up occasional passage It is that Port B2 are added to occasional passage together with designated port.That is, now occasional passage just contains Device B butt Mouth Port B1 and designated port Port B2.Here, occasional passage contains Device B root port Port B1 and designated ends Mouth Port B2, it is meant that when using occasional passage, root port Port B1 and designated port Port B2 can carry out message and turn Hair, but this has no effect on the original message forwardings in loop network of root port Port B1 and designated port Port B2.Afterwards, Device B will allow to set up occasional passage and notify to the leaf node device i.e. Device C for initiating the notice.
In this step 402, when Device B judge that this equipment does not allow to set up occasional passage, then it would not allow for setting up Occasional passage is notified to the leaf node device i.e. Device C for initiating the notice.
Step 403, the root bridge device that the notice is received in loop network judges whether this equipment allows to set up interim Passage, and when judging that this equipment allows to set up occasional passage, all designated ports in this equipment are added to facing together Shi Tongdao, and will allow to set up occasional passage and notify to the leaf node device for initiating the notice.
Still by taking Fig. 2 as an example, the Device C in Fig. 2 initiate to consult the notice of occasional passage, when the root bridge device in Fig. 2 Device A are received after the notice, judge whether this equipment allows to set up occasional passage, when Device A judge that this equipment permits It is that Port A1 and Port A2 are added to interim logical together by all designated ports in this equipment when being permitted to set up occasional passage Road.That is, now occasional passage also contains Device A designated port Port A1 and Port A2.Here, occasional passage Contain Device A designated port Port A1 and Port A2, it is meant that when using occasional passage, designated port Port A1 and Port A2 can carry out message forwarding, but this to have no effect on designated port Port A1 and Port A2 original in ring network Message forwarding in network.Afterwards, Device A will allow to set up occasional passage and notify to set to the leaf node for initiating the notice Standby i.e. Device C.
In this step 403, when Device A judge that this equipment does not allow to set up occasional passage, then it would not allow for setting up Occasional passage is notified to the leaf node device i.e. Device C for initiating the notice.
It should be noted that above-mentioned steps 402 and step 403 have no regular time sequencing, the application is to be It is easy to description, the numbering marked to it, and the non-limiting order that it is performed.
In above-mentioned steps 402, step 403, it can determine whether to set up occasional passage by following steps:
Judge that the VLAN that the notice received is carried identifies whether to conflict with this equipment already present VLAN marks, if it is, Then judge that this equipment does not allow to set up occasional passage, if it is not, then judging that this equipment allows to set up occasional passage.
Step 404, there are the leaf node device of port blocked other leaf nodes in the loop network is received Equipment and when allowing the notice for setting up occasional passage of root bridge device transmission, port blocked present on this equipment is added to institute State occasional passage.
That is, when going to this step 404, occasional passage also contains port blocked, when port blocked is added to described Occasional passage, it is meant that port blocked possesses data message forwarding function in occasional passage, it can allow forwarding data packets, But, for the data message forwarded without occasional passage, the port blocked still blocks this and forwarded without occasional passage Data message, otherwise stp state can be caused to switch repeatedly, agreement concussion.
It should be noted that in the description based on step 402, step 403, the present invention, there is the leaf section of port blocked Foundation is not allowed to face if point device receives root bridge device in loop network and/or at least one leaf node device is sent Shi Tongdao notice, then further perform the step of:
Again initiate to consult the notice of occasional passage in the loop network, the notice initiated again is carried as institute State the VLAN marks that occasional passage is regenerated.Afterwards, return to step 402 is to step 404.
When the leaf node device that there is port blocked adds port blocked to occasional passage, the leaf that there is port blocked Sub-node equipment will judge that the negotiation of occasional passage has been completed.Afterwards, it can regularly send heartbeat message (Heart Message), to safeguard the occasional passage, here, heartbeat message can be sent by broadcast or multicast mode.Still using Fig. 2 as , then Device C regularly pass through broadcast as the leaf node device that there is port blocked after occasional passage negotiation is completed Or multicast mode sends heartbeat message in the loop network.
And when receiving heartbeat message first in the absence of the leaf node device of port blocked in loop network, it thinks interim The negotiation of passage has been completed.Afterwards, it can detect whether to receive the leaf that there is port blocked within such as 30 seconds every setting time The heartbeat message that node device is sent, if it is not, then will have been added in this equipment to the root port of occasional passage and designated port Exited from occasional passage.Still by taking Fig. 2 as an example, Device C make as the leaf node device that there is port blocked, Device B For the leaf node device in the absence of port blocked, then Device B, can be every setting time after heartbeat message is received first Detect whether within such as 30 seconds to receive the heartbeat message that Device C are sent, if received, return every setting time ratio As detected whether within 30 seconds to receive the operation for the heartbeat message that Device C are sent, whereas if being not received by, then will originally it set Standby upper root port Port B1 and designated port Port B2 are exited from occasional passage, now, and occasional passage no longer includes Port B1 and Port B2, i.e. Port B1 and Port B2 no longer forward the message via occasional passage, but this has no effect on Port B1 With the original message forwardings in loop network of Port B2.
Equally, when the root bridge device in loop network receives heartbeat message first, the negotiation of occasional passage has also been will be considered that Complete.Afterwards, it can detect whether within such as 30 seconds that receiving the leaf node device that there is port blocked sends every setting time Heartbeat message, if it is not, then two designated ports added in this equipment to occasional passage are exited from occasional passage.Still By taking Fig. 2 as an example, Device C are as the leaf node device that there is port blocked, and Device A are as root bridge device, then, Device A can detect whether that receiving Device C sends for such as 30 seconds after heartbeat message is received first every setting time Heartbeat message, if received, ignore the heartbeat message, whereas if be not received by, then will be in this equipment specify Port Port A1 and Port A2 is exited from occasional passage, now, and occasional passage no longer includes Port A1 and Port A2, i.e., Port A1 and Port A2 no longer forward the message via occasional passage, but this have no effect on Port A1 and Port A2 it is original Message forwarding in loop network.
As can be seen that the negotiation of occasional passage can be completed by above-mentioned steps 401 to step 404.By taking Fig. 2 as an example, then The occasional passage finally negotiated by above-mentioned steps 401 to step 404 just by Device A Port A1, Port A2, Device B Port B1, Port B2, Device C Port C1, Port C2 compositions.
Step 405, after occasional passage negotiation is completed, leaf node device performs following step 406 to step 410, root Bridge device performs following step 411 to step 415.
Here leaf node device can be the leaf node device that there is port blocked, or in the absence of port blocked Leaf node device.
It should be noted that in the present invention, step 406 to step 410, and step 411 are not fixed to step 415 Time order and function order, it is for ease of describing marked numbering, and the non-limiting present invention.
Step 406, the message flow forwarded via root port in this equipment is recorded every the unit interval.
Here, the unit interval can be 1 second, or be other values, and the present invention is not specific to be limited.
Step 407, the report of the current one time T2 message flow C2 recorded and upper unit interval T1 records is utilized Literary flow C1 calculates the speed of the root port under the current one time.
Preferably, this step 407 can calculate the speed of root port by below equation:
(C2-C1)/(T2-T1)。
It should be noted that the mode of the computation rate is a kind of citing, and the non-limiting present invention.
Step 408, judge whether the speed is more than the first given threshold, if it is, by root port pair in this equipment The counter answered plus 1, if not, when the speed is less than the second given threshold, by the corresponding counting of root port in this equipment Device subtracts 1.
Here, first given threshold is more than or equal to the second given threshold.
Step 409, the current corresponding counter of monitoring root port, if the counter value is more than the first setting value, Confirm that root port meets port congestion condition, enable occasional passage and root port and share what is forwarded originally via the root port together Message.
In the present invention, the first given threshold, the second given threshold can be set according to real network situation.In fact, this hair In bright, when the speed of root port is more than the first given threshold, it is meant that butt port band width is nervous, that is, will appear from flow congestion, It is accomplished by enabling occasional passage and root port and shares the message forwarded originally via the root port together, avoids root port from occurring Congestion, and the present invention enables occasional passage and root port why not when the speed of root port is more than the first given threshold The message forwarded originally via the root port is shared together, but counter is handled, and reason is:Real network application In, network burst flow is relatively more, and speed change is frequent, to avoid frequently enabling occasional passage, increases counter, the meter The span of number device can be set previously according to network condition, such as span is [- 5,5], the only value in counter When reaching the first setting value, it can just enable occasional passage and root port and share the message forwarded originally via the root port together, This can be avoided occasional passage from being frequently activated.
Preferably, in this step 409, can be enabled according to following principle occasional passage and root port share together originally via The message of root port forwarding:
1, broadcasting packet, multicast message and unknown unicast message do not allow access into occasional passage, prevent message from winding occur;
2, to other kinds of message, perform following handle:
Hash operation is carried out to the message characteristic parameter that message is carried, Hash result is obtained, here, the message characteristic ginseng Number can be the source MAC of message carrying, target MAC (Media Access Control) address, source IP address, purpose IP address, transport layer protocol number, port numbers At least one in;
If according to Hash result it is determined that being forwarded by occasional passage, the equipment that this equipment is carried on the message The VLAN marks of mark and occasional passage, and forwarded by occasional passage, if according to Hash result it is determined that passing through root Port is forwarded, then forwards the message by the root port.
Here, according to Hash result it is determined that still specifically can be by following by root port forwarding by occasional passage Mode 1 or mode 2 are realized:
Mode 1:
Preassign and be designated odd number or even number by what occasional passage was forwarded, here by taking even number as an example, then pass through root The mark of port forwarding just mutually should be odd number;
Based on this, if the Hash result calculated is even number, mean that forwarded by occasional passage, and if meter The Hash result calculated is odd number, then mean that is forwarded by root port.
So that Hash result is message digest as an example, such as, it is assumed that message characteristic parameter is the source MAC that message is carried, Then for the message that source MAC is 2C41-38A1-4D5F, leaf node device is according to HASH algorithms to source MAC 2C41-38A1-4D5F is carried out after multiple XOR calculating as shown in Figure 5, and obtaining Hash result, (Hash result is plucked for message here Will) 8, Hash result 8 is even number, then source MAC should finally be forwarded for 2C41-38A1-4D5F message by occasional passage.
Mode 2:
M Hash bucket is set, shares ratio for depositing Hash result, and preassigning the message of root port and occasional passage Example.Because root port has smaller COST values in STP protocol convergence process before, in the premise of the non-congestion of message Under, message is forwarded from root port, is forwarded better than from occasional passage, and then the amortization ratio that is forwarded from root port of message should be greater than from Occasional passage is forwarded.
Such as, pre-set 10 Hash bucket, the Hash results of this 10 Hash bucket storages is followed successively by 0,1,2,3,4,5, 6、7、8、9;It is 8 that the message of specified root port and occasional passage, which shares ratio,:2, i.e., preceding 8 Hash bucket (the 1st to the 8th Hash Bucket) it is used for root port forwarding, latter two Hash bucket (the 9th to the 10th Hash bucket) is used for occasional passage forwarding;Then assume message Characteristic parameter is the source MAC that message is carried, and for the message that source MAC is 2C41-38A1-4D5F, leaf node is set It is standby source MAC 2C41-38A1-4D5F to be carried out according to HASH algorithms after multiple XOR calculating as shown in Figure 5, obtain Hash As a result (here Hash result be message digest) 8, Hash result 8 is just stored in the 9th Hash bucket, and the 9th Hash bucket Just it is specified for occasional passage forwarding, then source MAC finally should be by leading to temporarily for 2C41-38A1-4D5F message Road is forwarded.
It should be noted that aforesaid way 1, mode 2 are it is determined that according to Hash result by occasional passage still The embodiment forwarded by root port, and the non-limiting present invention.
Further, in the present invention, the report that script is forwarded via the root port is shared together when enabling occasional passage and root port The situation of bandwidth-rich may also occur in Wen Hou, follow-up root port, here, and the present invention sets the speed of root port less than second The situation for determining threshold value is set to the situation of root port bandwidth-rich.In root port bandwidth-rich, if current also enable temporarily Passage helps root port converting flow, then can cause bandwidth waste, based on this, of the invention in root port bandwidth-rich, if The current occasional passage that also enables helps root port converting flow, then withdraws occasional passage, the report that will be forwarded via occasional passage Text switches to root port forwarding.As mentioned previously, network burst flow is relatively more, and speed change is frequent, to avoid frequently Enable, withdraw occasional passage, the present invention nor withdrawing occasional passage once monitoring root port bandwidth-rich, but monitor root The current corresponding counter in port, if the counter value is less than the second setting value, confirms that root port meets port idle Condition;First setting value is more than the second setting value, such as the first setting value is 3, and the second setting value is -3.When root port is full During sufficient port idle condition, if the current occasional passage that enabled shares what is forwarded originally via the root port together with the root port Message, then switch to root port forwarding by the message forwarded via occasional passage.
Step 410, when receiving Portable device mark and occasional passage identification message, if the equipment mark that the message is carried Know the device identification for this equipment itself, then abandon the message received, if the device identification that the message is carried not is this The device identification of equipment itself, then judge this learning equipment to the port of the message target MAC (Media Access Control) address whether be divided by lower port Outside other ports:Root port and port blocked on root port and designated port, or this equipment in this equipment, if it is, Device identification and the occasional passage mark of message carrying are then peelled off, by learning to the port of the message target MAC (Media Access Control) address to forward The message, if not, when this equipment receives the message by root port, the report is forwarded by the designated port in this equipment Text, when this equipment receives the message by designated port, the message is forwarded by the root port in this equipment.
In this step 410, leaf node device is in the equipment that the device identification that the message received is carried is this equipment itself The message received is abandoned during mark, and in the port for the target MAC (Media Access Control) address for judging the message that this learning equipment is received to this When the root port in this equipment and the port in addition to designated port, to peel off device identification and the occasional passage mark of message carrying Know, the message is forwarded to the port of the message target MAC (Media Access Control) address by study, can prevent message forwarding from winding occur.
Step 411, root bridge device every the unit interval to the message flow via each designated port forwarding in this equipment Recorded.
Step 412, root bridge device is directed to each designated port, the message flow and upper one recorded using the current one time The message flow of individual unit interval record calculates the speed of the designated port under the current one time.
This step 412 is similar with above-mentioned steps 407, and only step 407 is that, to root port, this step 411 is for referring to Fixed end mouthful.
Step 413, root bridge device judges whether the speed is more than the 3rd given threshold, if it is, by the designated ends The corresponding counter of mouth adds 1, if not, when the speed is less than four given thresholds, by the corresponding counting of the designated port Device subtracts 1.
Here, the 3rd given threshold is more than or equal to the 4th given threshold.
In this step 413, the 3rd given threshold is unrelated with the first given threshold in above-mentioned steps 408.Equally, the 4th set Determine threshold value and the second given threshold in above-mentioned steps 408 is also unrelated.In addition, this step 413 sets the 3rd given threshold, the 4th The purpose of given threshold is similar with the given threshold of setting first described in above-mentioned steps 409, the purpose of the second given threshold, this In repeat no more.
Step 414, the current corresponding counter of root bridge device monitoring designated port, if the counter value is more than the 3rd Setting value, confirms that designated port meets port congestion condition, enable occasional passage and the designated port share together originally via The message of designated port forwarding.
In this step 414, the 3rd setting value is unrelated with the first setting value in above-mentioned steps 409, the second setting value.
Occasional passage is enabled in this step 414 and the designated port shares the report forwarded originally via the designated port together Text shares the mode of the message forwarded originally via the root port together with enabling occasional passage and root port in above-mentioned steps 409 It is similar, the root port in step 409 is only replaced with into the designated port in this step 414, repeated no more here.
Further, in the present invention, shared together originally via designated port forwarding when enabling occasional passage and designated port Message after, the situation of bandwidth-rich may also occur in the follow-up designated port, here, and the present invention is small by the speed of designated port It is set to the situation of designated port bandwidth-rich in the situation of the 4th given threshold.In designated port bandwidth-rich, if currently Also enable occasional passage and help the designated port converting flow, then can cause bandwidth waste, based on this, the present invention is in designated ends When port band width is rich, if currently also enabling occasional passage helps the designated port converting flow, occasional passage is withdrawn, will The message forwarded via occasional passage switches to designated port forwarding.As mentioned previously, network burst flow is relatively more, speed Rate change is frequent, to avoid frequently enabling, withdraws occasional passage, of the invention nor once monitoring designated port bandwidth-rich Occasional passage is withdrawn, but monitors the current corresponding counter of designated port, if the counter value is less than the 4th setting value, Then confirm that designated port meets port idle condition;4th setting value and the first above-mentioned setting value, the second setting value without Close, but less than the 3rd above-mentioned setting value, such as the 3rd setting value is 3, and the 4th setting value is -3.When designated port meets port During idle condition, if the current occasional passage that enabled shares the report forwarded originally via the designated port together with the designated port Text, then switch to designated port forwarding by the message forwarded via occasional passage.
Step 415, root bridge device receives the report that Portable device mark and occasional passage are identified by a designated port Wen Shi, if the device identification that the message is carried is the device identification of this equipment itself, abandons the message received, if The device identification that the message is carried is not the device identification of this equipment itself, then judges that this learning equipment arrives message purpose MAC Whether the port of address is port in addition to designated port in this equipment, if it is, peelling off the device identification of message carrying With occasional passage mark, the message is forwarded to the port of the message target MAC (Media Access Control) address by study, if not, passing through this equipment Other upper designated ports forward the message.
In this step 415, root bridge device is in the device identification that the device identification that the message received is carried is this equipment itself When abandon the message received, and judge the port of the target MAC (Media Access Control) address for the message that this learning equipment is received to this for except In this equipment during port outside two designated ports, device identification and the occasional passage mark of message carrying are peelled off, passes through and learns The port for practising the message target MAC (Media Access Control) address forwards the message, can prevent message forwarding from winding occur.
So far, the flow shown in Fig. 4 is completed.
Flow shown in Fig. 4 is described below by a specific embodiment:
Referring to Fig. 6, Fig. 6 is network example figure provided in an embodiment of the present invention.In figure 6,5 Ethernet switches are set up One loop network as shown in Figure 6, in the loop network, by Spanning-Tree Protocol computing, is obtained:Device A are root bridge Equipment, Device A Port A1, Port A2 are designated port, and Device B to Device E are leaf node device, Device B Port B1 are that root port, Port B2 are designated port, and Device C Port C2 are port blocked, Port C1 is root port, and Device D Port D1 are that root port, Port D2 are designated port, and Device E Port E1 are root Port, Port E2 are designated port.Multiple pc (being referred to as PC B crowds) is connected under Device B a large amount of between Server A Data forwarding.
Then based on the network shown in Fig. 6, then,
Device C start the notice for initiating to consult occasional passage, and it is that occasional passage is random that Device C are carried in the notice The VLAN marks of generation are such as 100;
Device A are received after notice, judge to allow to set up occasional passage, then by two designated ports with Port A1, Port A2 add occasional passage, and the notice for allowing to set up occasional passage is sent to Device C;
Device B are received after notice, judge to allow to set up occasional passage, then by from root port PortB1 and Designated port Port B2 add occasional passage, and the notice for allowing to set up occasional passage is sent to Device C;
Device D are received after notice, judge to allow to set up occasional passage, then by from root port PortD1 and Designated port Port D2 add occasional passage, and the notice for allowing to set up occasional passage is sent to Device C;
Device E are received after notice, judge to allow to set up occasional passage, then by from root port PortE1 and Designated port Port E2 add occasional passage, and the notice for allowing to set up occasional passage is sent to Device C;
Device C receive Device A, Device B, Device D, Device E send allow set up occasional passage Notice after, the port blocked Port C2 in this equipment are added into occasional passage, and port blocked Port C2 are opened interim Data message forwarding function in passage.Now, Device C think that occasional passage is consulted to have completed, then can be regularly in the ring Heartbeat message is sent in l network;
When Device A, Device B, Device D, Device E receive first Device C transmission heartbeat message, Then think that occasional passage consults completion, afterwards, detect whether to receive the leaf node that there is port blocked every setting time The heartbeat message that equipment is sent, if it is not, then will have been added in this equipment to the root port of occasional passage and designated port from facing Shi Tongdao is exited, if it is, ignoring the heartbeat message.Meanwhile, Device B, C, D, E start to the root port in this equipment Carry out traffic monitoring;And Device A start to carry out traffic monitoring to each designated port in this equipment.
As PC, B groups have mass data forwarding between Server A, and Device D have found root port by traffic monitoring Port D1 meet port congestion condition, it is necessary to enable occasional passage and root port Port D1 share originally via the butt together The message of mouth Port D1 forwardings:
Device D classify to PC B crowds message, part of message is forwarded to from root port Port D1 Server A are reached after Device E, Device A, emphasis is not described here.
Device D carry another part message VLAN marks 100 and the device identification of this equipment of occasional passage Device D, are forwarded to Device C by occasional passage afterwards.Emphasis description is hereafter carried out:
Device C receive carry VLAN mark 100 message after, judge message target MAC (Media Access Control) address (i.e. Server A's MAC Address) learn in root port Port C1, only E-Packet;
The processing mode that Device B receive the message for carrying VLAN marks 100 is identical with Device C;
Device A are received after the message for carrying VLAN marks 100, and inspection message target MAC (Media Access Control) address be (i.e. Server A's MAC Address) study this Device A connection Server A port Port0, be two designated ends on this Device A Other ports beyond mouthful, then peel VLAN marks 100 and the device identification of message carrying off, then by message according to normal flow It is transmitted to Server A;
The message that Server A are responded is forwarded according to the MAC Address of learning equipment, is returned to from Device A designated port PC B crowds.If Device A have found designated port congestion, it would however also be possible to employ the mode pair of similar step 411 to step 415 The message that Server A respond PC B crowds carries out classification transmission, repeats no more here.
So far, the method description that the present invention is provided is completed.
The equipment that the present invention is provided is described below:
Referring to Fig. 7, the equipment structure chart that Fig. 7 provides for the present invention.The network equipment of the equipment application in loop network.
As shown in fig. 7, when the equipment is leaf node device, including:First negotiation element, the first monitoring unit, One shares processing unit;
First negotiation element, during for there is port blocked in this equipment, initiation negotiation is faced in the loop network What root bridge device and other leaf node devices were sent in Shi Tongdao notice, the reception loop network allows to set up interim During the notice of passage, the port blocked present on this equipment is added to the occasional passage, the port blocked is facing Forwarding data packets are allowed in Shi Tongdao;And
During for port blocked to be not present in this equipment, the notice is received, and judge whether this equipment allows foundation Occasional passage, if it is, the root port and designated port in this equipment are added to occasional passage together, and will allow foundation to face Shi Tongdao notice is to the leaf node device for initiating the notice;
First monitoring unit, for after occasional passage negotiation is completed, message flow to be carried out to the root port in this equipment Monitoring;
First shares processing unit, and port congestion condition is met for monitoring root port in first monitoring unit When, enable occasional passage and root port and share the message forwarded originally via the root port together, to avoid root port from gathering around Plug;
When the network equipment is root bridge device, including:Second negotiation element, the second monitoring unit, second share place Manage unit;
, there is the association that the leaf node device of port blocked is initiated in the loop network for receiving in the second negotiation element The notice of business's occasional passage, judges whether this equipment allows to set up occasional passage, if it is, by all designated ends in this equipment Mouthful add to occasional passage, and will allow to set up occasional passage and notify to the leaf node device for initiating the notice;
Second monitoring unit, for after occasional passage negotiation is completed, message to be carried out to each designated port in this equipment Traffic monitoring;
Second shares processing unit, and port congestion condition is met for monitoring designated port in second monitoring unit When, enable occasional passage and the designated port shares the message forwarded originally via the designated port together, to avoid this from specifying There is congestion in port.
Preferably, in the present invention, when the network equipment is leaf node device, described first, which shares processing unit, enters One step when first monitoring unit monitors root port and meets port idle condition, if it is current enabled occasional passage with The root port shares the message forwarded originally via the root port together, then the message forwarded via occasional passage is switched into this Root port is forwarded;
When the network equipment is root bridge device, described second shares processing unit further in the described second monitoring list When member monitors designated port and meets port idle condition, occasional passage is enabled if current and shares original together with the designated port This message forwarded via the designated port, then switch to designated port forwarding by the message forwarded via occasional passage.
Preferably, in the present invention, when the network equipment is there is port blocked in leaf node device, and this equipment When, the notice of initiation carries the virtual LAN VLAN mark that this equipment generates for the occasional passage;
When the network equipment is that port blocked is not present in leaf node device, and this equipment, or, when the net When network equipment is root bridge device, judging whether this equipment allows to set up occasional passage includes:
Judge that the VLAN that the notice received is carried identifies whether to conflict with this equipment already present VLAN marks, if it is, Then judge that this equipment does not allow to set up occasional passage, if it is not, then judging that this equipment allows to set up occasional passage.
Preferably, in the present invention, when the network equipment is that port blocked is not present in leaf node device, and this equipment When, first negotiation element further would not allow for setting up interim if it is judged that this equipment does not allow to set up occasional passage Passage is notified to the leaf node device for initiating the notice;
When the network equipment is root bridge device, second negotiation element is not if it is judged that this equipment allows to set up Occasional passage, further would not allow for setting up occasional passage and notifies to the leaf node device for initiating the notice;
When the network equipment is there is port blocked in leaf node device, and this equipment, described first consults single It is first further to receive the notice for not allowing to set up occasional passage, initiate to consult the logical of occasional passage in the loop network again Accuse, the notice initiated again carries the VLAN marks regenerated for the occasional passage.
Preferably, in the present invention, first monitoring unit carries out message flow monitoring to the root port in this equipment and wrapped Include:The message flow forwarded via root port in this equipment is recorded every the unit interval;Remembered using the current one time The message flow of the message flow of record and record of the upper unit interval calculates the speed of the root port under the current one time; Judge whether the speed is more than the first given threshold, if it is, adding 1 by the corresponding counter of root port in this equipment, such as It is really no, when the speed is less than the second given threshold, then the corresponding counter of root port in this equipment is subtracted 1;Described first Given threshold is more than or equal to the second given threshold;
Monitoring root port and meeting port congestion condition includes:The current corresponding counter of root port is monitored, if the meter Number device value is more than the first setting value, then confirms that root port meets port congestion condition;
Monitoring root port and meeting port idle condition includes:The current corresponding counter of root port is monitored, if the meter Number device value is less than the second setting value, then confirms that root port meets port idle condition;First setting value is set more than second Definite value;
Second monitoring unit carries out message flow monitoring to each designated port in this equipment to be included:For this equipment Upper each designated port, the message flow forwarded via the designated port is recorded every the unit interval;Utilize the current one time Record via the designated port forward message flow and a upper unit interval record via the designated port forward Message flow calculates the speed of the designated port under the current one time;Judge whether the speed is more than the 3rd given threshold, If it is, adding 1 by the corresponding counter of the designated port, if not, being less than the 4th given threshold in the speed, then should The corresponding counter of designated port subtracts 1;3rd given threshold is more than or equal to the 4th given threshold;
It is described monitor designated port and meet port congestion condition include:The current corresponding counter of designated port is monitored, If the counter value is more than the 3rd setting value, confirm that designated port meets port congestion condition;
It is described monitor designated port and meet port idle condition include:The current corresponding counter of designated port is monitored, If the counter value is less than the 4th setting value, confirm that designated port meets port idle condition;3rd setting value More than or equal to the 4th setting value.
Preferably, the present invention in, described first share processing unit enable occasional passage and root port share together originally The message forwarded via root port includes:
Broadcasting packet, multicast message and the unknown unicast message forwarded to script via root port, passes through the root port Forwarding;To other kinds of message, following handle is performed:Hash operation is carried out to the message characteristic parameter that message is carried to be breathed out Uncommon result, if according to Hash result it is determined that being forwarded by occasional passage, the equipment that this equipment is carried on the message Mark and the mark of occasional passage are simultaneously forwarded by occasional passage, if according to Hash result it is determined that being turned by root port Hair, then forward the message by the root port.
Described second share processing unit enable occasional passage and designated port share together originally via designated port turn The message of hair includes:
Broadcasting packet, multicast message and the unknown unicast message forwarded to script via the designated port, is referred to by this Fixed end mouthful forwarding;
To other kinds of message, following handle is performed:Hash operation is carried out to the message attribute parameter that message is carried to obtain To Hash result, the message attribute parameter is at least one in the five-tuple that message is carried;If true according to Hash result Making is forwarded by occasional passage, then the device identification of this equipment and the mark of occasional passage are carried on the message and is led to Occasional passage forwarding is crossed, if forwarded according to Hash result by the designated port it is determined that forwarded by designated port The message.
Preferably, in the present invention, as shown in fig. 7, when the network equipment is leaf node device, further comprising: First forward processing unit;
First forward processing unit, for receiving when Portable device mark and occasional passage identification message,
If the device identification that the message is carried is the device identification of this equipment itself, the message received is abandoned, If the device identification that the message is carried is not the device identification of this equipment itself, judge that this learning equipment arrives the message purpose The port of MAC Address whether be divided by lower port outside other ports:
Root port and port blocked on root port and designated port, or this equipment in this equipment;
If it is, peelling off device identification and the occasional passage mark of message carrying, message purpose MAC is arrived by study The port of address forwards the message, if not, when this equipment receives the message by root port, passing through specifying in this equipment Port forwards the message, and when this equipment receives the message by designated port, the report is forwarded by the root port in this equipment Text;
When the network equipment is root bridge device, further comprise:Second forward processing unit;
Second forward processing unit, for receiving Portable device mark and occasional passage mark by a designated port Message when,
If the device identification that the message is carried is the device identification of this equipment itself, the message received is abandoned;
If the device identification that the message is carried is not the device identification of this equipment itself, judges that this learning equipment is arrived and be somebody's turn to do Whether the port of message target MAC (Media Access Control) address is port in addition to designated port in this equipment, if it is, peelling off message carrying Device identification and occasional passage mark, the message to the port of the message target MAC (Media Access Control) address is forwarded by study, if not, The message is forwarded by other designated ports in this equipment.
Preferably, in the present invention, when the network equipment is there is port blocked in leaf node device, and this equipment When, the first negotiation element, which adds port blocked present on this equipment to the occasional passage, is determined as that occasional passage has been consulted Into;
When the network equipment is there is port blocked in leaf node device, and this equipment, the first negotiation element enters One step regularly sends heartbeat message, to safeguard the occasional passage after occasional passage negotiation is completed in the loop network;
When the network equipment is that port blocked is not present in leaf node device, and this equipment, the first negotiation element The heartbeat message for receiving the leaf node device transmission that there is port blocked first is determined as that occasional passage consults completion;
When the network equipment is root bridge device, the second negotiation element will receive the leaf section that there is port blocked first The heartbeat message that point device is sent is determined as that occasional passage consults completion;
When the network equipment is that port blocked is not present in leaf node device, and this equipment, the first negotiation element Further detect whether to receive the heartbeat message that the leaf node device that there is port blocked is sent every setting time, if It is no, then it will add to the root port of occasional passage and designated port and exited from occasional passage in this equipment;
When the network equipment is root bridge device, the second negotiation element further detects whether to receive every setting time The heartbeat message sent to the leaf node device that there is port blocked, if it is not, then will have been added in this equipment to interim logical The root port and designated port in road are exited from occasional passage.
So far, the device structure description shown in Fig. 7 is completed.
Present invention also offers the description of the hardware configuration of the network equipment shown in corresponding diagram 7.
Referring to Fig. 8, Fig. 8 is the hardware structure diagram of the network equipment provided in an embodiment of the present invention.As shown in figure 8, the network Equipment may include:
Memory, for when the network equipment is leaf node device, the first negotiation element of storage, the first monitoring to be single Member, first share processing unit;And, for when the network equipment is root bridge device, depositing the second negotiation element, second Monitoring unit, second share processing unit;
CPU, for when the network equipment be leaf node device when, storage the first negotiation element, the first monitoring unit, First shares the program of processing unit operation;And, for when the network equipment is root bridge device, storage second to be consulted single Member, the second monitoring unit, second share the program that processing unit is run.
Wherein, the first negotiation element, the first monitoring unit, first share the program of processing unit operation each as described above The first negotiation element, the first monitoring unit, first share processing unit execution operation described in, repeat no more here;
Second negotiation element, the second monitoring unit, second share the of the program of processing unit operation each as described above Two negotiation elements, the second monitoring unit, second are shared described in the operation of processing unit execution, are repeated no more here.
So far, the device hardware structure description shown in Fig. 8 is completed.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention God is with principle, and any modification, equivalent substitution and improvements done etc. should be included within the scope of protection of the invention.

Claims (16)

1. a kind of method for preventing link congestion, it is characterised in that this method is applied to the network equipment in loop network, described The network equipment is leaf node device or is root bridge device, and this method includes:
When the network equipment is leaf node device,
If there is port blocked in this equipment, initiate to consult the notice of occasional passage in the loop network, receive institute Root bridge device and when allowing the notice for setting up occasional passage of other leaf node devices transmission in loop network are stated, will originally be set The port blocked present on standby is added to the occasional passage, and the port blocked is allowed to forward number in occasional passage According to message;If port blocked is not present in this equipment, the notice is received, and judge whether this equipment allows to set up interim Passage, if it is, the root port and designated port in this equipment are added to occasional passage together, and will allow to set up interim logical The notice in road is to the leaf node device for initiating the notice;
After occasional passage negotiation is completed, message flow monitoring is carried out to the root port in this equipment, expired monitoring root port During sufficient port congestion condition, enable occasional passage and root port and share the message forwarded originally via the root port together, to keep away Exempt from root port and congestion occur;
When the network equipment is root bridge device,
Receive and there is the notice for consulting occasional passage that the leaf node device of port blocked is initiated in the loop network, judge Whether this equipment allows to set up occasional passage, if it is, all designated ports in this equipment are added to occasional passage, and will Allow to set up occasional passage to notify to the leaf node device for initiating the notice;
After occasional passage negotiation is completed, message flow monitoring is carried out to each designated port in this equipment;It is specified monitoring When port meets port congestion condition, enable occasional passage and the designated port is shared being forwarded originally via the designated port together Message, to avoid the designated port from congestion occur.
2. according to the method described in claim 1, it is characterised in that when the network equipment is leaf node device, the party Method further comprises:
When monitoring root port and meeting port idle condition, occasional passage is enabled if current and has been shared together with the root port Originally the message forwarded via the root port, then switch to root port forwarding by the message forwarded via occasional passage;
When the network equipment is root bridge device, this method further comprises:
When monitoring designated port and meeting port idle condition, occasional passage is enabled if current and has divided together with the designated port The message that load is forwarded via the designated port originally, then switch to the designated port by the message forwarded via occasional passage and turn Hair.
3. according to the method described in claim 1, it is characterised in that when the network equipment is leaf node device, and originally set When there is port blocked on standby, it is the VLAN that the occasional passage is generated that the notice that this equipment is initiated, which carries this equipment, VLAN is identified;
When the network equipment is that port blocked is not present in leaf node device, and this equipment, or, when the network is set Standby when being root bridge device, judging whether this equipment allows to set up occasional passage includes:
Judge that the VLAN that the notice received is carried identifies whether to conflict with this equipment already present VLAN marks, if it is, sentencing Break and this equipment and do not allow to set up occasional passage, if it is not, then judging that this equipment allows to set up occasional passage.
4. according to the method described in claim 1, it is characterised in that when the network equipment is leaf node device, and originally set It is standby upper when port blocked is not present, or, when the network equipment is root bridge device, if it is judged that this equipment does not allow to build Vertical occasional passage, this method further comprises:It would not allow for setting up occasional passage to notify to the leaf node for initiating the notice Equipment;
When the network equipment is there is port blocked in leaf node device, and this equipment, this method further comprises:Connect The notice for not allowing to set up occasional passage is received, initiates to consult the notice of occasional passage in the loop network again, this is again The notice of initiation carries the VLAN marks regenerated for the occasional passage.
5. method according to claim 2, it is characterised in that described when the network equipment is leaf node device Message flow monitoring is carried out to the root port in this equipment to be included:Every the unit interval to via root port forwarding in this equipment Message flow is recorded;The message flow of the message flow recorded using the current one time and record of the upper unit interval Calculate the speed of the root port under the current one time;Judge whether the speed is more than the first given threshold, if it is, The corresponding counter of root port in this equipment is added 1, if not, when the speed is less than the second given threshold, then will originally set The standby corresponding counter of upper root port subtracts 1;First given threshold is more than or equal to the second given threshold;
Monitoring root port and meeting port congestion condition includes:The current corresponding counter of root port is monitored, if the counter Value is more than the first setting value, then confirms that root port meets port congestion condition;
Monitoring root port and meeting port idle condition includes:The current corresponding counter of root port is monitored, if the counter Value is less than the second setting value, then confirms that root port meets port idle condition;First setting value is more than the second setting value;
It is described that message flow monitoring bag is carried out to each designated port in this equipment when the network equipment is root bridge device Include:For each designated port in this equipment, the message flow forwarded via the designated port is recorded every the unit interval;Utilize The message flow forwarded via the designated port of current one time record and referring to via this for record of the upper unit interval The message flow of fixed end mouthful forwarding calculates the speed of the designated port under the current one time;Judge whether the speed is more than the Three given thresholds, if it is, adding 1 by the corresponding counter of the designated port, if not, being less than the 4th setting in the speed Threshold value, then subtract 1 by the corresponding counter of the designated port;3rd given threshold is more than or equal to the 4th given threshold;
It is described monitor designated port and meet port congestion condition include:The current corresponding counter of designated port is monitored, if The counter value is more than the 3rd setting value, confirms that designated port meets port congestion condition;
It is described monitor designated port and meet port idle condition include:The current corresponding counter of designated port is monitored, if The counter value is less than the 4th setting value, then confirms that designated port meets port idle condition;3rd setting value is more than Or equal to the 4th setting value.
6. according to the method described in claim 1, it is characterised in that described when the network equipment is leaf node device Enabling occasional passage and root port and sharing the message that is forwarded via root port originally together includes:
Broadcasting packet, multicast message and the unknown unicast message forwarded to script via root port, is turned by the root port Hair;To other kinds of message, following handle is performed:Hash operation is carried out to the message characteristic parameter that message is carried and obtains Hash As a result, if according to Hash result it is determined that forwarded by occasional passage, the equipment mark of this equipment is carried on the message The mark of knowledge and occasional passage is simultaneously forwarded by occasional passage, if turned according to Hash result it is determined that passing through root port Hair, then forward the message by the root port;
When the network equipment is root bridge device, occasional passage and the designated port of enabling is shared originally via specified together The message of port forwarding includes:
Broadcasting packet, multicast message and the unknown unicast message forwarded to script via the designated port, passes through the designated ends Mouth forwarding;
To other kinds of message, following handle is performed:Hash operation is carried out to the message attribute parameter that message is carried to be breathed out Uncommon result, the message attribute parameter is at least one in the five-tuple that message is carried;If determined according to Hash result It is to be forwarded by occasional passage, then the device identification of this equipment and the mark of occasional passage is carried on the message and by facing Shi Tongdao is forwarded, if forwarding the report by the designated port it is determined that forwarded by designated port according to Hash result Text.
7. method according to claim 6, it is characterised in that when the network equipment is leaf node device, the party Method further comprises:
When receiving Portable device mark and occasional passage identification message,
If the device identification that the message is carried is the device identification of this equipment itself, the message received is abandoned, if The device identification that the message is carried is not the device identification of this equipment itself, then judges that this learning equipment arrives message purpose MAC The port of address whether be divided by lower port outside other ports:
Root port and port blocked on root port and designated port, or this equipment in this equipment;
If it is, peelling off device identification and the occasional passage mark of message carrying, the message target MAC (Media Access Control) address is arrived by study Port forward the message, if not, when this equipment receives the message by root port, passing through the designated port in this equipment The message is forwarded, when this equipment receives the message by designated port, the message is forwarded by the root port in this equipment;
When the network equipment is root bridge device, this method further comprises:
When receiving the message that Portable device mark and occasional passage are identified by a designated port,
If the device identification that the message is carried is the device identification of this equipment itself, the message received is abandoned;
If the device identification that the message is carried is not the device identification of this equipment itself, judge that this learning equipment arrives the message Whether the port of target MAC (Media Access Control) address is port in addition to designated port in this equipment, if it is, peelling off setting for message carrying Standby mark and occasional passage mark, forward the message, if not, passing through by study to the port of the message target MAC (Media Access Control) address Other designated ports forward the message in this equipment.
8. according to the method described in claim 1, it is characterised in that when the network equipment is leaf node device, and originally set When there is port blocked on standby, port blocked present on this equipment is added to the occasional passage and is determined as that occasional passage is assisted Business completes;
When the network equipment is there is port blocked in leaf node device, and this equipment, this method further comprises: Complete after occasional passage negotiation, regularly heartbeat message is sent in the loop network, to safeguard the occasional passage;
When the network equipment is that port blocked is not present in leaf node device, and this equipment, or, when the network is set During for being root bridge device, the heartbeat message that the leaf node device transmission that there is port blocked is received first is determined as interim logical Consult to complete in road;
When the network equipment is that port blocked is not present in leaf node device, and this equipment, or, when the network is set During for being root bridge device, this method further comprises:Detect whether to receive the leaf that there is port blocked every setting time The heartbeat message that node device is sent, if it is not, then will have been added in this equipment to the root port of occasional passage and designated port Exited from occasional passage.
9. a kind of equipment for preventing link congestion, it is characterised in that the network equipment of the equipment application in loop network, works as institute When stating the network equipment for leaf node device, including:First negotiation element, the first monitoring unit, first share processing unit;
First negotiation element, during for there is port blocked in this equipment, initiates to consult interim logical in the loop network What root bridge device and other leaf node devices were sent in the notice in road, the reception loop network allows to set up occasional passage Notice when, the port blocked present on this equipment is added to the occasional passage, the port blocked leads to temporarily Forwarding data packets are allowed in road;And
During for port blocked to be not present in this equipment, the notice is received, and judge whether this equipment allows to set up interim Passage, if it is, the root port and designated port in this equipment are added to occasional passage together, and will allow to set up interim logical The notice in road is to the leaf node device for initiating the notice;
First monitoring unit, for after occasional passage negotiation is completed, message flow monitoring to be carried out to the root port in this equipment;
First shares processing unit, for when first monitoring unit monitors root port and meets port congestion condition, opening The message forwarded originally via the root port is shared together with occasional passage and root port, to avoid root port from congestion occur;
When the network equipment is root bridge device, including:Second negotiation element, the second monitoring unit, second share processing list Member;
Second negotiation element, the negotiation that there is the leaf node device initiation of port blocked in the loop network for receiving is faced Shi Tongdao notice, judges whether this equipment allows to set up occasional passage, if it is, all designated ports in this equipment are added Enter to occasional passage, and will allow to set up occasional passage to notify to the leaf node device for initiating the notice;
Second monitoring unit, for after occasional passage negotiation is completed, message flow to be carried out to each designated port in this equipment Monitoring;
Second shares processing unit, for when second monitoring unit monitors designated port and meets port congestion condition, Enable occasional passage and the designated port shares the message forwarded originally via the designated port together, to avoid the designated port There is congestion.
10. equipment according to claim 9, it is characterised in that described when the network equipment is leaf node device First shares processing unit further when first monitoring unit monitors root port and meets port idle condition, if worked as The preceding occasional passage that enabled shares the message forwarded originally via the root port together with the root port, then will be via occasional passage The message of forwarding switches to root port forwarding;
When the network equipment is root bridge device, described second shares processing unit further supervises in second monitoring unit When controlling designated port and meeting port idle condition, if it is current enabled occasional passage and shared together with the designated port pass through originally The message forwarded by the designated port, then switch to designated port forwarding by the message forwarded via occasional passage.
11. equipment according to claim 9, it is characterised in that when the network equipment is leaf node device, and originally set When there is port blocked on standby, it is the virtual LAN VLAN mark that the occasional passage is generated that the notice of initiation, which carries this equipment, Know;
When the network equipment is that port blocked is not present in leaf node device, and this equipment, or, when the network is set Standby when being root bridge device, judging whether this equipment allows to set up occasional passage includes:
Judge that the VLAN that the notice received is carried identifies whether to conflict with this equipment already present VLAN marks, if it is, sentencing Break and this equipment and do not allow to set up occasional passage, if it is not, then judging that this equipment allows to set up occasional passage.
12. equipment according to claim 9, it is characterised in that when the network equipment is leaf node device, and originally set Standby upper when port blocked is not present, first negotiation element enters one if it is judged that this equipment does not allow to set up occasional passage Step would not allow for setting up occasional passage and notify to the leaf node device for initiating the notice;
When the network equipment is root bridge device, second negotiation element is not if it is judged that this equipment allows to set up interim Passage, further would not allow for setting up occasional passage and notifies to the leaf node device for initiating the notice;
When the network equipment is there is port blocked in leaf node device, and this equipment, first negotiation element enters One step receives the notice for not allowing to set up occasional passage, initiates to consult the notice of occasional passage in the loop network again, Again the notice initiated carries the VLAN marks regenerated for the occasional passage.
13. equipment according to claim 10, it is characterised in that first monitoring unit is to the root port in this equipment Carrying out message flow monitoring includes:The message flow forwarded via root port in this equipment is recorded every the unit interval; The message flow of the message flow recorded using the current one time and record of the upper unit interval calculates the current one time Under the root port speed;Judge whether the speed is more than the first given threshold, if it is, by root port in this equipment Corresponding counter adds 1, if not, when the speed is less than the second given threshold, then it is root port in this equipment is corresponding Counter subtracts 1;First given threshold is more than or equal to the second given threshold;
Monitoring root port and meeting port congestion condition includes:The current corresponding counter of root port is monitored, if the counter Value is more than the first setting value, then confirms that root port meets port congestion condition;
Monitoring root port and meeting port idle condition includes:The current corresponding counter of root port is monitored, if the counter Value is less than the second setting value, then confirms that root port meets port idle condition;First setting value is more than the second setting value;
Second monitoring unit carries out message flow monitoring to each designated port in this equipment to be included:For every in this equipment One designated port, the message flow forwarded via the designated port is recorded every the unit interval;Recorded using the current one time Via the designated port forward message flow and a upper unit interval record via the designated port forward message The speed of the designated port under the flow rate calculation current one time;Judge whether the speed is more than the 3rd given threshold, if It is then the corresponding counter of the designated port to be added 1, if not, being less than the 4th given threshold in the speed, then specifies this The corresponding counter in port subtracts 1;3rd given threshold is more than or equal to the 4th given threshold;
It is described monitor designated port and meet port congestion condition include:The current corresponding counter of designated port is monitored, if The counter value is more than the 3rd setting value, confirms that designated port meets port congestion condition;
It is described monitor designated port and meet port idle condition include:The current corresponding counter of designated port is monitored, if The counter value is less than the 4th setting value, then confirms that designated port meets port idle condition;3rd setting value is more than Or equal to the 4th setting value.
14. equipment according to claim 9, it is characterised in that described first share processing unit enable occasional passage and Root port shares the message forwarded originally via root port together to be included:
Broadcasting packet, multicast message and the unknown unicast message forwarded to script via root port, is turned by the root port Hair;To other kinds of message, following handle is performed:Hash operation is carried out to the message characteristic parameter that message is carried and obtains Hash As a result, if according to Hash result it is determined that forwarded by occasional passage, the equipment mark of this equipment is carried on the message The mark of knowledge and occasional passage is simultaneously forwarded by occasional passage, if turned according to Hash result it is determined that passing through root port Hair, then forward the message by the root port;
Described second, which shares processing unit, enables occasional passage and designated port and shares together and forwarded originally via designated port Message includes:
Broadcasting packet, multicast message and the unknown unicast message forwarded to script via the designated port, passes through the designated ends Mouth forwarding;
To other kinds of message, following handle is performed:Hash operation is carried out to the message attribute parameter that message is carried to be breathed out Uncommon result, the message attribute parameter is at least one in the five-tuple that message is carried;If determined according to Hash result It is to be forwarded by occasional passage, then the device identification of this equipment and the mark of occasional passage is carried on the message and by facing Shi Tongdao is forwarded, if forwarding the report by the designated port it is determined that forwarded by designated port according to Hash result Text.
15. equipment according to claim 13, it is characterised in that when the network equipment is leaf node device, enter One step includes:First forward processing unit;
First forward processing unit, for receiving when Portable device mark and occasional passage identification message,
If the device identification that the message is carried is the device identification of this equipment itself, the message received is abandoned, if The device identification that the message is carried is not the device identification of this equipment itself, then judges that this learning equipment arrives message purpose MAC The port of address whether be divided by lower port outside other ports:
Root port and port blocked on root port and designated port, or this equipment in this equipment;
If it is, peelling off device identification and the occasional passage mark of message carrying, the message target MAC (Media Access Control) address is arrived by study Port forward the message, if not, when this equipment receives the message by root port, passing through the designated port in this equipment The message is forwarded, when this equipment receives the message by designated port, the message is forwarded by the root port in this equipment;
When the network equipment is root bridge device, further comprise:Second forward processing unit;
Second forward processing unit, for receiving the report that Portable device mark and occasional passage are identified by a designated port Wen Shi,
If the device identification that the message is carried is the device identification of this equipment itself, the message received is abandoned;
If the device identification that the message is carried is not the device identification of this equipment itself, judge that this learning equipment arrives the message Whether the port of target MAC (Media Access Control) address is port in addition to designated port in this equipment, if it is, peelling off setting for message carrying Standby mark and occasional passage mark, forward the message, if not, passing through by study to the port of the message target MAC (Media Access Control) address Other designated ports forward the message in this equipment.
16. equipment according to claim 9, it is characterised in that when the network equipment is leaf node device, and originally set When there is port blocked on standby, the first negotiation element, which adds port blocked present on this equipment to the occasional passage, to be judged Consult to complete for occasional passage;
When the network equipment is there is port blocked in leaf node device, and this equipment, the first negotiation element is further After occasional passage negotiation is completed, heartbeat message regularly is sent in the loop network, to safeguard the occasional passage;
When the network equipment is that port blocked is not present in leaf node device, and this equipment, the first negotiation element is by head The secondary heartbeat message for receiving the leaf node device transmission that there is port blocked is determined as that occasional passage consults completion;
When the network equipment is root bridge device, the second negotiation element will receive the leaf node that there is port blocked first and set The heartbeat message that preparation is sent is determined as that occasional passage consults completion;
When the network equipment is that port blocked is not present in leaf node device, and this equipment, the first negotiation element enters one Walk and detect whether to receive the heartbeat message that the leaf node device that there is port blocked is sent every setting time, if not, It will then add to the root port of occasional passage and designated port and exited from occasional passage in this equipment;
When the network equipment is root bridge device, the second negotiation element further is detected whether to receive and deposited every setting time The heartbeat message sent in the leaf node device of port blocked, if it is not, then will have been added in this equipment to occasional passage Root port and designated port are exited from occasional passage.
CN201410502641.7A 2014-09-26 2014-09-26 The method and apparatus for preventing link congestion Active CN104243334B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410502641.7A CN104243334B (en) 2014-09-26 2014-09-26 The method and apparatus for preventing link congestion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410502641.7A CN104243334B (en) 2014-09-26 2014-09-26 The method and apparatus for preventing link congestion

Publications (2)

Publication Number Publication Date
CN104243334A CN104243334A (en) 2014-12-24
CN104243334B true CN104243334B (en) 2017-08-11

Family

ID=52230714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410502641.7A Active CN104243334B (en) 2014-09-26 2014-09-26 The method and apparatus for preventing link congestion

Country Status (1)

Country Link
CN (1) CN104243334B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105991470B (en) * 2015-02-10 2019-12-06 新华三技术有限公司 method and device for caching message by Ethernet equipment
CN106789889B (en) * 2016-11-22 2020-05-05 广州市诚毅科技软件开发有限公司 Network monitoring method and device based on mesh structure
CN106850853B (en) * 2017-03-24 2019-06-11 国网江苏省电力公司电力科学研究院 A kind of information channel intelligent selecting method based on load balancing
US11477122B2 (en) * 2017-09-27 2022-10-18 Intel Corporation Technologies for selecting non-minimal paths and throttling port speeds to increase throughput in a network
CN111464436B (en) * 2020-04-03 2022-02-01 中电科航空电子有限公司 Method for solving single-port loop of RSTP (remote station transfer protocol)
CN114531319A (en) * 2020-10-31 2022-05-24 华为技术有限公司 Message sending method, equipment and system
CN113225241B (en) * 2021-04-19 2022-09-06 中国科学院计算技术研究所 Data transmission congestion control method and system for ring-shaped data message network
CN116248583A (en) * 2023-01-03 2023-06-09 重庆长安汽车股份有限公司 Communication redundancy configuration method and device of vehicle-mounted controller, vehicle and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1976311A (en) * 2006-11-24 2007-06-06 中兴通讯股份有限公司 Multi-loop contact Ethernet loop network loop protection switchover method
CN101986615A (en) * 2010-11-09 2011-03-16 中兴通讯股份有限公司 Multiple-ring Ethernet and protection method thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3963728B2 (en) * 2002-01-22 2007-08-22 富士通株式会社 Spanning tree bypass method and apparatus
CN101309215B (en) * 2008-06-25 2010-12-15 北京星网锐捷网络技术有限公司 Ethernet ring network link restoring and detecting method and Ethernet ring network switch
CN101640644B (en) * 2009-09-01 2011-11-16 杭州华三通信技术有限公司 Method and equipment for flow equilibrium based on flexible link group

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1976311A (en) * 2006-11-24 2007-06-06 中兴通讯股份有限公司 Multi-loop contact Ethernet loop network loop protection switchover method
CN101986615A (en) * 2010-11-09 2011-03-16 中兴通讯股份有限公司 Multiple-ring Ethernet and protection method thereof

Also Published As

Publication number Publication date
CN104243334A (en) 2014-12-24

Similar Documents

Publication Publication Date Title
CN104243334B (en) The method and apparatus for preventing link congestion
US10812367B2 (en) Exploratory linktrace operations in a computer network
CN103414650B (en) A kind of avoid congested method for routing and device
WO2009036705A1 (en) Method for detecting interface failure and network node equipment
CN108259333A (en) A kind of BUM flow control methods, relevant apparatus and system
WO2017000802A1 (en) Service fault location method and device
CN104852855B (en) Jamming control method, device and equipment
WO2012119372A1 (en) Message processing method, device and system
US20170223103A1 (en) Automated Mirroring And Remote Switch Port Analyzer (RSPAN)/ Encapsulated Remote Switch Port Analyzer (ERSPAN) Functions Using Fabric Attach (FA) Signaling
CN102158422B (en) Message forwarding method and equipment for layer 2 ring network
CN104580002B (en) The big balanced retransmission method of current load and device
CN106888105B (en) A kind of discovery method and device of three layers of virtual link end to end
CN107809381A (en) One kind, which is realized, is based on route loop active auditing algorithm and implementation method in SDN
Banchuen et al. An SDN framework for video conference in inter-domain network
CN102938737B (en) Two layers of looped network Proxy Method and equipment
CN105049345A (en) Method and system for fusing BGP route traffic data
CN108924065A (en) Interchanger, double layer network message forwarding method and network system
CN101540692B (en) Dynamic multicast configuration method and node equipment
CN106656788A (en) Chip implementation method for optimizing broadcast traffic of MLAG isolated port
Ren et al. A reactive traffic flow estimation in software defined networks
Zheng et al. Comparing the complexity of two network architectures
WO2018205728A1 (en) Method for processing stack split, computer device and computer readable storage medium
Gobjuka Topology discovery for virtual local area networks
Patil et al. Scalable and Adaptive Software Defined Network Management for Cloud-hosted Group Communication Applications
Santos et al. Improving carrier ethernet recovery time using a fast reroute mechanism

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

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

Applicant after: Xinhua three Technology Co., Ltd.

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

Applicant before: Huasan Communication Technology Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant