CN101299726B - Method for calculating forwarding shortest path - Google Patents

Method for calculating forwarding shortest path Download PDF

Info

Publication number
CN101299726B
CN101299726B CN2008101291297A CN200810129129A CN101299726B CN 101299726 B CN101299726 B CN 101299726B CN 2008101291297 A CN2008101291297 A CN 2008101291297A CN 200810129129 A CN200810129129 A CN 200810129129A CN 101299726 B CN101299726 B CN 101299726B
Authority
CN
China
Prior art keywords
switch
weight
weight array
src
current
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
CN2008101291297A
Other languages
Chinese (zh)
Other versions
CN101299726A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN2008101291297A priority Critical patent/CN101299726B/en
Publication of CN101299726A publication Critical patent/CN101299726A/en
Application granted granted Critical
Publication of CN101299726B publication Critical patent/CN101299726B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method for computing the transmit shortest path, including the steps of: building the weighting array; initializing the built array according to the presupposed port attribute, to obtain the weighting array of the exchanger to the neighbor exchanger; recurrently traversing and computing the weighting array of the current exchanger to the other exchanger; comparing and acquiring the minimum in the weighting array of current exchanger to the other exchanger, to obtain the shortest path from the current exchanger to the other exchanger in the exchanger stacking system. The invention realizes the shortest path transmit in the exchanger stacking system to lift the transmitting efficiency of the message, reduce the wide band occupancy, cause the wide band use more reasonable on the link.

Description

A kind of method of calculating forwarding shortest path
Technical field
The present invention relates to the technology of calculating forwarding shortest path, relate in particular to a kind of method of switchboard stacked system calculating forwarding shortest path.
Background technology
When the switch in the switchboard stacked system was many, the selection of message forwarding path can have influence on the load and the transfer capability of whole switchboard stacked system.For instance, by the pile system that six switches are formed, 6 adopt daisy chain type successively from switch 1 to switch, promptly adopt ring topology to connect between the switch.When message is come in from the port of switch 1, in the time of need being forwarded to the port of switch 6,, understand very occupied bandwidth, and make the bandwidth on the link use unreasonable if transmit one by one by way of six switches from switch 1 beginning.For the fastest pass-through mode of this situation is exactly that message directly is forwarded to the port that switch 6 links to each other with switch 1 from the port of switch 1, that is to say the shortest path of selecting a forwarding, and message directly is forwarded to switch 6 from switch 1.
At present, because when adopting prior art to carry out the message forwarding, normally directly carrying out message according to the forward-path between each switch in the switchboard stacked system that sets in advance transmits, rather than carry out according to the forwarding shortest path that calculates and judge that message transmits, therefore, the shortcoming that adopts prior art to exist is: message forwarding efficient is low; The bandwidth usage height, and the bandwidth on the link is used unreasonable.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of method of calculating forwarding shortest path, can realize the shortest path forwarding of message at switchboard stacked system, and message forwarding efficient is got a promotion; Reduce bandwidth usage, and make the bandwidth use on the link more reasonable.
For achieving the above object, technical scheme of the present invention is achieved in that
A kind of method of calculating forwarding shortest path, this method may further comprise the steps:
A, establishment weight array; According to the weight array of the described establishment of port attribute initialization that sets in advance, to obtain the weight array of switch to its neighbor switch; Described weight array is the array that is used for identifying the distance of message forwarding path between each switch of switchboard stacked system; Described port attribute is the attribute that is used for writing down the port annexation between each switch of switchboard stacked system;
B, recurrence traversal are also calculated the weight array of current switch to the purpose switch; Relatively and obtain the minimum value of described current switch in the weight array of purpose switch, get access in the switchboard stacked system current switch to the shortest path of purpose switch; Wherein,
The current switch of described calculating to the weight array of purpose switch is: arrive under the forward-path unknown condition of purpose switch at described current switch; Perhaps current switch is known to the forward-path of purpose switch, and current switch to the weight array>current switch of purpose switch to reference to the weight array of switch+described with reference to switch under the weight array condition of purpose switch, calculate current switch and be: weight[src to the formula of the weight array of purpose switch] [dst]=weight[src] [mid]+weight[mid] [dst]; Wherein, src is the numbering of described current switch, and mid is described numbering with reference to switch, and dst is the numbering of described purpose switch; Weight[src] [dst] be current switch to the weight array of purpose switch, weight[src] [mid] be that current switch is to the weight array with reference to switch, weight[mid] [dst] be the weight array that arrives the purpose switch with reference to switch.
Wherein, also comprise in the steps A: according to the port attribute initialization sending metrix that sets in advance; Described sending metrix is the matrix that is used to identify the transmit path of message;
Also comprise among the step B and calculate described sending metrix, to finish of the message transmission of described current switch to the purpose switch; The computing formula of calculating described sending metrix employing is: sending metrix [src] [dst]=sending metrix [src] [mid].
Wherein, also comprise after the step B:
C, continue execution in step B,, get access in the described switchboard stacked system each switch to the shortest path of purpose switch until intact all switches of searching loop; Get access to the sending metrix of described each switch to the purpose switch;
D, according to the sending metrix of each switch to the shortest path of purpose switch, each switch to the purpose switch, finish the message of shortest path and transmit.
Recurrence traversal of the present invention is also calculated the weight array of current switch to the purpose switch; Relatively and obtain the minimum value of current switch in the weight array of purpose switch, get access in the switchboard stacked system current switch to the shortest path of purpose switch.
Adopt the present invention, can realize the shortest path forwarding of message at switchboard stacked system, promote the forwarding performance of message, message forwarding efficient is got a promotion at switchboard stacked system, and the reduction bandwidth usage, and make the bandwidth use on the link more reasonable.
Description of drawings
Fig. 1 is the realization flow schematic diagram of the inventive method;
Fig. 2 is the composition structural representation of a switchboard stacked system.
Embodiment
Core concept of the present invention is: the recurrence traversal is also calculated the weight array of current switch to the purpose switch; Relatively and obtain the minimum value of current switch in the weight array of purpose switch, get access in the switchboard stacked system current switch to the shortest path of purpose switch.
Be described in further detail below in conjunction with the enforcement of accompanying drawing technical scheme.
As shown in Figure 1, a kind of method of calculating forwarding shortest path, this method may further comprise the steps:
Step 101, establishment weight array; According to the weight array of the described establishment of port attribute initialization that sets in advance, to obtain the weight array of switch to its neighbor switch.
Here it is pointed out that the weight array, be used for identifying the distance of message forwarding path between each switch of switchboard stacked system.At neighbor switch, two adjacent switches are neighbor switch each other.Port attribute is used for writing down the port annexation between each switch of switchboard stacked system.
Here, at creating the weight array, the number that switch in the switchboard stacked system is set is n, according to order from small to large for each switch number 0,1 ...., (n-1), then create two-dimensional array weight[n] [n] for the weight array, this weight array is used for writing down the path weight value between any two switches.Usually, the path weight value between two switches of neighbor switch each other, promptly switch is 1 to the weight array of its neighbor switch, can be understood as switch is a jumping to the path of its neighbor switch.
Here, also comprise in the step 101: according to the port attribute initialization sending metrix that sets in advance, i.e. the transmit path of message is so that follow-uply send to the message of purpose switch by the calculating of sending metrix being finished current switch.Current switch refers to the source switch, and the purpose switch refers to need purpose switch that message is sent to by the source switch.The expression mode of sending metrix is a sending metrix [source] [purpose].Sending metrix [source] [purpose] is used for the stack port on the identification sources switch, and the message that the source switch mails to any port of purpose switch all sends by this stack port.
Wherein, further comprise in the step 101: according to the port attribute initialization receiving matrix that sets in advance, i.e. the RX path of message is so that follow-uply receive from the message of current switch by the calculating of receiving matrix being finished the purpose switch.Current switch refers to the source switch, and the purpose switch refers to need purpose switch that message is sent to by the source switch.The expression mode of receiving matrix is a receiving matrix [purpose] [source].Receiving matrix [source] [purpose], be used for the stack port on the recognition purpose switch,, then be sent to this stack port if the source switch need send message to the purpose switch, that is to say that the purpose switch all receives by this stack port from the message that switch any port in source receives.
Below, at weight array according to the described establishment of port attribute initialization that sets in advance, and sending metrix and receiving matrix, the elaboration of giving an example.
When port i is that the port attribute of this port i is tx_cpu_key and tx_stk_idx, and the switch of tx_cpu_key correspondence is numbered dst when being numbered the stack port of switch of src.Thereby with switch src as the source switch, with switch dst as the purpose switch.Switch src can send message to switch dst by this port i so, then initialization and the weight array is set is: weight[src] [dst]=1; Initialization also is provided with sending metrix and is: sending metrix [src] [dst]=i; Initialization also is provided with receiving matrix and is: [dst] [src]=tx_stk_idx.In this way, all stack ports of all switches in the traversal switchboard stacked system are finished initialization to weight array, sending metrix and receiving matrix according to the port attribute of all stack ports in the switchboard stacked system.In addition, when this stack port was full duplex, promptly this stack port not only can be used as the port that sends message, but also can be as the port that receives message.So, equally can initialization and the weight array is set is: weight[dst] [src]=1; Initialization also is provided with sending metrix and is: sending metrix [dst] [src]=i; Initialization also is provided with receiving matrix and is: receiving matrix [src] [dst]=tx_stk_idx.In this way, all stack ports of all switches in the traversal switchboard stacked system are finished initialization to weight array, sending metrix and receiving matrix according to the port attribute of all stack ports in the switchboard stacked system equally.
Step 102, recurrence traversal are also calculated the weight array of current switch to the purpose switch; Relatively and obtain the minimum value of current switch in the weight array of purpose switch, get access in the switchboard stacked system current switch to the shortest path of purpose switch.
Wherein, also comprise in the step 102: calculate sending metrix to finish of the message transmission of current switch to the purpose switch.Also further comprise in the step 102: calculate receiving matrix to finish of the message reception of purpose switch from current switch.
Here, calculating current switch is specially to the weight array of purpose switch: at current switch under the forward-path unknown condition of purpose switch; Perhaps current switch is known to the forward-path of purpose switch, and current switch to the weight array>current switch of purpose switch to reference to the weight array of switch+with reference to switch under the weight array condition of purpose switch, calculating current switch is formula (1) as follows to the formula of the weight array of purpose switch:
weight[src][dst]=weight[src][mid]+weight[mid][dst] (1)
Wherein, src is the numbering of current switch, and mid is the numbering with reference to switch, and dst is the numbering of purpose switch; Weight[src] [dst] be current switch to the weight array of purpose switch, weight[src] [mid] be that current switch is to the weight array with reference to switch, weight[mid] [dst] be the weight array that arrives the purpose switch with reference to switch.And, current switch src and with reference to switch mid, with reference to all communicating between switch mid and the purpose switch dst.
Here, the computing formula of calculating sending metrix is a formula (2) as follows:
Sending metrix [src] [dst]=sending metrix [src] [mid] (2)
Here, the computing formula of calculating receiving matrix is a formula (3) as follows:
Receiving matrix [dst] [src]=receiving matrix [dst] [mid] (3)
Here it may be noted that to be, owing to when obtaining shortest path, travel through all switches in the switchboard stacked system, but switch can not be identical by calculating and comparison weight array.Such as three switches are arranged in the switchboard stacked system, numbering is respectively src, mid and dst, the three can not the identical meaning refer to: switch src, switch mid and switch dst can not refer to same switch, and promptly switch src, switch mid and switch dst refer to three different switches in the switchboard stacked system.
Step 103, the execution in step 102 that continues, all switches in the intact switchboard stacked system of searching loop get access in the switchboard stacked system each switch to the shortest path of purpose switch; Get access to the sending metrix of each switch to the purpose switch.
Wherein, in the step 102, further comprise step: get access to the receiving matrix of each switch to the purpose switch.
Step 104, with the sending metrix of each switch to the shortest path of purpose switch, each switch to the purpose switch be set to packet route transmit in and be issued to chip, finish the message of shortest path according to the value of setting in the chip and transmit.
Wherein, in the step 104, further comprise step: with each switch to the receiving matrix of purpose switch also be set to packet route transmit in and be issued to chip, so, the message of finishing shortest path according to the value of setting in the chip is transmitted and to be: according to each switch to the shortest path of purpose switch, each switch to the purpose switch sending metrix and each switch to the receiving matrix of purpose switch, finish the message of shortest path and transmit.
Below set forth specific implementation process with an example with traversal mode calculating forwarding shortest path.
With four exchange pilings among Fig. 2 is example, and numbering is respectively A, B, C and D from top to bottom, and promptly as shown in Figure 2, switchboard stacked system comprises in this example: switch A, switch b, switch C and switch D.Wherein, switch A links to each other with switch D with switch b; Switch b links to each other with C with the switch A switch; Switch C links to each other with switch D with switch b; Switch D links to each other with switch A with switch C.The stack port of every switch all is x mouth and y mouth, does not show among the figure.
Is example to carry out recurrence traversal at switch A and to calculate current switch to the weight array of purpose switch.Specifically, at first the weight array and the sending metrix of each switch of initialization.Weight[A] [B]=1, sending metrix [A] [B]=x, weight[A] [D]=1, transmit path [A] [D]=y.So when calculating shortest path, travel through all switches of this switchboard stacked system, that is to say, involved calculating parameter in above-mentioned formula (1) and the formula (2): source switch src, all to traverse all switches with reference to computer mid and purpose switch dst, and source switch src, can not be identical with reference to switch mid and purpose switch dst.Then at first begin to carry out the recurrence traversal and calculate current switch from A to the process of the weight array of purpose switch be:
A, be source switch src with the switch A, because source switch src, can not be identical with reference to switch mid and purpose switch dst, then with reference to switch mid from switch b, promptly this moment, to get with reference to switch mid be switch b, this moment, purpose switch dst was from switch C.
Here, weight[A] [C] the unknown, then weight[A] [C]=weight[A] [B]+weight[B] [C]=2, sending metrix [A] [C]=sending metrix [A] [B]=x.Next, purpose switch dst will elect switch D as, still, weight[B] [D] the unknown, purpose switch dst continues down traversal.Because switch D is last, stops the traversal to purpose switch dst.
B, next will down travel through with reference to switch mid, and get switch mid this moment is switch C, restarts the traversal from A, and then this moment, purpose switch dst can be taken as switch b and switch D.
Here, weight[A] [B] known and weight[A] [B]<weight[A] [C]+weight[C] [B], and so weight[A] [B] remain unchanged, and in like manner, sending metrix [A] [B] also remains unchanged.
Next, purpose switch dst will elect switch D as, weight[A] [D] known, and weight[A] [D]<weight[A] [C]+weight[C] [D], so weight[A] [D] remain unchanged, in like manner, sending metrix [A] [D] also remains unchanged, and purpose switch dst has been last when being switch D.Because switch D is last, stops the traversal to purpose switch dst.
C, next, continue down traversal with reference to switch mid, get with reference to switch mid this moment is switch D, and purpose switch dst can be taken as switch b and switch C, calculate according to the method described above respectively, switch A has just all been determined to the shortest path of other each switches like this.
Be implemented as with the switch A be the recurrence traversal of source switch src after, next switch src in source down travels through, begin to carry out recurrence traversal and calculate current switch and carry out the calculating of weight array and sending metrix from A according to above-mentioned to a~principle of c process of the weight array of purpose switch, all switches in the intact switchboard stacked system of searching loop, thus finally get access to each switch in the switchboard stacked system to the shortest path of purpose switch with get access to the sending metrix that each switch arrives the purpose switch.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.

Claims (3)

1. the method for a calculating forwarding shortest path is characterized in that, this method may further comprise the steps:
A, establishment weight array; According to the weight array of the described establishment of port attribute initialization that sets in advance, to obtain the weight array of switch to its neighbor switch; Described weight array is the array that is used for identifying the distance of message forwarding path between each switch of switchboard stacked system; Described port attribute is the attribute that is used for writing down the port annexation between each switch of switchboard stacked system;
B, recurrence traversal are also calculated the weight array of current switch to the purpose switch; Relatively and obtain the minimum value of described current switch in the weight array of purpose switch, get access in the switchboard stacked system current switch to the shortest path of purpose switch; Wherein,
The current switch of described calculating to the weight array of purpose switch is: arrive under the forward-path unknown condition of purpose switch at described current switch; Perhaps current switch is known to the forward-path of purpose switch, and current switch to the weight array>current switch of purpose switch to reference to the weight array of switch+described with reference to switch under the weight array condition of purpose switch, calculate current switch and be: weight[src to the formula of the weight array of purpose switch] [dst]=weight[src] [mid]+weight[mid] [dst]; Wherein, src is the numbering of described current switch, and mid is described numbering with reference to switch, and dst is the numbering of described purpose switch; Weight[src] [dst] be current switch to the weight array of purpose switch, weight[src] [mid] be that current switch is to the weight array with reference to switch, weight[mid] [dst] be the weight array that arrives the purpose switch with reference to switch.
2. method according to claim 1 is characterized in that, also comprises in the steps A: according to the port attribute initialization sending metrix that sets in advance; Described sending metrix is the matrix that is used to identify the transmit path of message;
Also comprise among the step B and calculate described sending metrix, to finish of the message transmission of described current switch to the purpose switch; The computing formula of calculating described sending metrix employing is: sending metrix [src] [dst]=sending metrix [src] [mid].
3. method according to claim 2 is characterized in that, also comprises after the step B:
C, continue execution in step B,, get access in the described switchboard stacked system each switch to the shortest path of purpose switch until intact all switches of searching loop; Get access to the sending metrix of described each switch to the purpose switch;
D, according to the sending metrix of each switch to the shortest path of purpose switch, each switch to the purpose switch, finish the message of shortest path and transmit.
CN2008101291297A 2008-06-30 2008-06-30 Method for calculating forwarding shortest path Active CN101299726B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101291297A CN101299726B (en) 2008-06-30 2008-06-30 Method for calculating forwarding shortest path

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101291297A CN101299726B (en) 2008-06-30 2008-06-30 Method for calculating forwarding shortest path

Publications (2)

Publication Number Publication Date
CN101299726A CN101299726A (en) 2008-11-05
CN101299726B true CN101299726B (en) 2011-04-20

Family

ID=40079418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101291297A Active CN101299726B (en) 2008-06-30 2008-06-30 Method for calculating forwarding shortest path

Country Status (1)

Country Link
CN (1) CN101299726B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101488893B (en) * 2009-03-04 2011-04-27 北京星网锐捷网络技术有限公司 Stack system test method, apparatus and system
CN101645850B (en) * 2009-09-25 2013-01-30 杭州华三通信技术有限公司 Forwarding route determining method and equipment
CN103546390B (en) * 2012-07-17 2018-05-18 中兴通讯股份有限公司 A kind of fixed length bag Weighted Fair Queuing dispatching method and device
WO2017108119A1 (en) * 2015-12-23 2017-06-29 Huawei Technologies Co., Ltd. Rack awareness

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1764146A (en) * 2004-10-21 2006-04-26 华为技术有限公司 Optimization route choosing method
US7123615B2 (en) * 2002-02-02 2006-10-17 3Com Corporation Stacked network routers
CN1852266A (en) * 2006-06-01 2006-10-25 杭州华为三康技术有限公司 Method and apparatus for optimizing load-sharing route of network business flow
CN101018180A (en) * 2007-03-12 2007-08-15 中兴通讯股份有限公司 A method for implementing the forward table in the stack system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7123615B2 (en) * 2002-02-02 2006-10-17 3Com Corporation Stacked network routers
CN1764146A (en) * 2004-10-21 2006-04-26 华为技术有限公司 Optimization route choosing method
CN1852266A (en) * 2006-06-01 2006-10-25 杭州华为三康技术有限公司 Method and apparatus for optimizing load-sharing route of network business flow
CN101018180A (en) * 2007-03-12 2007-08-15 中兴通讯股份有限公司 A method for implementing the forward table in the stack system

Also Published As

Publication number Publication date
CN101299726A (en) 2008-11-05

Similar Documents

Publication Publication Date Title
CN102594664B (en) Flow forwarding method and device
KR100585327B1 (en) Method for adaptively reassigning addresses of nodes according to changes in volumn of wireless network
CN102347867A (en) Processing method and equipment for stacking splitting detection
CN101299726B (en) Method for calculating forwarding shortest path
CN102271100A (en) Gateway device between EtherCAT industrial Ethernet and wireless Zigbee and protocol conversion method of gateway device
CN103179178B (en) The method and apparatus of aggregation group member port between extension cluster
CN103166874A (en) Message forwarding method and device
CN102938922A (en) Wireless network system applied on plant control system
CN103401774A (en) Message forwarding method and equipment based on stacking system
CN102238072A (en) Method for dynamically selecting routing and CLOS (Charles Clos) switching network system
CN101317476A (en) Topological structure scanning method and scanning system
CN102196458A (en) Networking method and devices of wireless broadband sensor network
CN102857989B (en) Self-adaptive routing method oriented to mobile sensor network
CN101895952B (en) Multi-route establishment method and parallel data transmission method of wireless sensor network
CN102158419A (en) Method for realizing expedited forwarding of data packets in home gateway
CN102594650B (en) Method for processing multicast message and exchange access apparatus
CN103067294A (en) Method for order-maintaining data flow equilibrium processing in multi-next-hop transmitting router based on flow
CN104935509A (en) Method and apparatus of avoiding loop generation in vertical stack system
Naeimi et al. Directional multi–hop clustering routing protocol for wireless sensor networks
CN100401721C (en) Method for building intelligent virtual switching link
CN102685011B (en) Route computing method in a kind of TRILL network and equipment
CN102263632A (en) Time synchronization method in switchboard stacking system and stacking controller
CN202535552U (en) 6LoWPAN gateway device
CN100454907C (en) Method and device for realizing elastic sectionalization ring guiding protective inverting
CN102780640A (en) Method and device for realizing multilayer LM (loss measurement) in switching chip

Legal Events

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