[go: up one dir, main page]

CN103095588B - Based on the adaptive routing method without dead of multiple spanning tree - Google Patents

Based on the adaptive routing method without dead of multiple spanning tree Download PDF

Info

Publication number
CN103095588B
CN103095588B CN201310017506.9A CN201310017506A CN103095588B CN 103095588 B CN103095588 B CN 103095588B CN 201310017506 A CN201310017506 A CN 201310017506A CN 103095588 B CN103095588 B CN 103095588B
Authority
CN
China
Prior art keywords
node
router
spanning tree
port
nodes
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.)
Expired - Fee Related
Application number
CN201310017506.9A
Other languages
Chinese (zh)
Other versions
CN103095588A (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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN201310017506.9A priority Critical patent/CN103095588B/en
Publication of CN103095588A publication Critical patent/CN103095588A/en
Application granted granted Critical
Publication of CN103095588B publication Critical patent/CN103095588B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种基于多生成树的无死锁自适应路由方法,涉及网络通信技术领域。该方法具体包括:确定多生成树的各个根节点,并构造多生成树;将不同的源/目的网络通信节点对分配给不同的生成树,使不同的源/目的网络通信节点对通过不同的生成树传递数据;打破通信网络拓扑图中的资源循环依赖,避免潜在的死锁;在路由器中,使用路由和仲裁单元来代替路由表;对所述路由器采用动态缓冲区分配策略。本发明方法有效减轻了各个生成树中根节点和气泡节点的拥堵情况,提高了不规则网络的通信性能,当网络规模增大时,本发明方法具有较好的可扩展性。

The invention discloses a deadlock-free adaptive routing method based on multiple spanning trees, and relates to the technical field of network communication. The method specifically includes: determining each root node of a multiple spanning tree, and constructing a multiple spanning tree; assigning different source/destination network communication node pairs to different spanning trees, so that different source/destination network communication node pairs pass through different Spanning tree transfers data; breaks resource cycle dependence in communication network topology graph, avoids potential deadlock; uses routing and arbitration unit to replace routing table in router; adopts dynamic buffer allocation strategy for said router. The method of the invention effectively reduces the congestion of root nodes and bubble nodes in each spanning tree, and improves the communication performance of the irregular network. When the network scale increases, the method of the invention has good scalability.

Description

基于多生成树的无死锁自适应路由方法Deadlock-free Adaptive Routing Method Based on Multiple Spanning Trees

技术领域technical field

本发明涉及网络通信技术领域,具体涉及一种基于多生成树的无死锁自适应路由方法。The invention relates to the technical field of network communication, in particular to a deadlock-free adaptive routing method based on multiple spanning trees.

背景技术Background technique

传统的应用于不规则网络通信中的上/下路由方法是在网络中建立一棵生成树并且只选择一个节点作为根节点。它是一个在不规则网络中有一定自适应性的分布式无死锁路由方法。总的来说,上/下路由方法就是在一棵生成树中为各个节点间的通信数据进行路由。从源节点出发的数据包首先沿着这棵生成树向根节点运动,然后再沿着生成树向目标节点运动。通常,我们在离其他所有节点距离最短的一些节点中随机选择一个作为生成树的根节点。这样所有网络拓扑图中节点间的链路就可以根据它们所连接的节点与根节点的位置关系被标记为上或者下。例如,网络中的两个相邻节点u,v,如果u到根节点的距离比v到根节点的距离远,那么链路(u,v)的状态为上,反之为下。如果u和v到根节点的距离相等,那么它们之间链路的方向就为拥有小ID号的节点指向拥有大ID号的节点。例如,如果节点u比节点v的ID号小,那么链路(u,v)的状态就为上。图1(a)展示了一个八个节点的不规则网络拓扑,图1(b)展示了以节点1为根节点的上/下路由方法中的生成树,可以看出图中不存在环。The traditional up/down routing method applied to irregular network communication is to build a spanning tree in the network and select only one node as the root node. It is a distributed deadlock-free routing method with certain adaptability in irregular networks. In general, the up/down routing method is to route the communication data between nodes in a spanning tree. The data packet starting from the source node first moves along the spanning tree to the root node, and then moves along the spanning tree to the target node. Usually, we randomly select one of the nodes with the shortest distance from all other nodes as the root node of the spanning tree. In this way, the links between nodes in all network topology graphs can be marked as up or down according to the positional relationship between the nodes they connect and the root node. For example, for two adjacent nodes u and v in the network, if the distance from u to the root node is farther than the distance from v to the root node, then the state of the link (u, v) is up, and vice versa. If u and v have the same distance from the root node, then the direction of the link between them is from the node with the small ID number to the node with the large ID number. For example, if node u has a smaller ID number than node v, then the state of link (u, v) is up. Figure 1(a) shows an irregular network topology with eight nodes, and Figure 1(b) shows the spanning tree in the up/down routing method with node 1 as the root node, and it can be seen that there is no cycle in the figure.

源节点与目标节点间的路由路线遵循以下规则:0个或者多个状态为上的链路需要在0个或者多个状态为下的链路之前。也就是说,数据包需要首先经过状态为上的链路然后再经过状态为下的链路。这样的路由路线就避免了数据包传递中可能的资源循环依赖。也就是说,上/下路由方法是一种无死锁的路由方法。而且在上/下路由方法所产生的生成树中,不同的源/目标节点对可能存在着多条符合规则的路由路线,这样就为上/下路由方法带来了一定的自适应性。The routing route between the source node and the target node follows the following rules: 0 or more links whose state is up need to be before 0 or more links whose state is down. That is, the packet needs to go through the link whose state is up first and then the link whose state is down. Such a routing route avoids possible resource circular dependencies in packet delivery. That is, the up/down routing method is a deadlock-free routing method. Moreover, in the spanning tree generated by the up/down routing method, there may be multiple routing routes conforming to the rules for different source/destination node pairs, which brings a certain degree of adaptability to the up/down routing method.

上/下路由方法的优点在于简单的路由器结构和一定的自适应性。它的缺点在于源/目标节点间的路由路线有可能不是两个节点间的最短路线,而且靠近根节点的物理链路有可能变得十分拥堵从而成为整个网络通信的瓶颈。The advantage of the up/down routing method lies in the simple router structure and certain adaptability. Its disadvantage is that the routing route between source/destination nodes may not be the shortest route between two nodes, and the physical link close to the root node may become very congested and become the bottleneck of the entire network communication.

避免死锁的传统方法是将一条物理链路分为多条虚拟链路,这样不同的数据包就可以在同一条物理链路不同的虚拟链路中传递。另外一种避免死锁的方法叫做气泡流量控制法,这种方法的原理是限制形成循环依赖的数据包的注入。这样,网络拓扑图中有可能形成循环依赖的环中的资源永远都不可能同时被占用,从而环中的数据包永远都可以继续向他们的目的节点前进。同时,气泡流量控制法很容易实现,事实上,本发明就是运用气泡流量控制法来避免死锁的。The traditional method to avoid deadlock is to divide a physical link into multiple virtual links, so that different data packets can be transmitted in different virtual links of the same physical link. Another method to avoid deadlock is called bubble flow control method. The principle of this method is to limit the injection of data packets that form circular dependencies. In this way, the resources in the rings that may form circular dependencies in the network topology diagram can never be occupied at the same time, so that the data packets in the rings can always continue to move forward to their destination nodes. At the same time, the bubble flow control method is easy to implement. In fact, the present invention uses the bubble flow control method to avoid deadlock.

在传统的上/下路由方法中,多数的数据包都会经过生成树的根节点进行传递。这样,这个根节点在很多情况下都有可能变成网络通信的瓶颈,特别是当网络的规模变大时。在多数情况下,根节点并不是数据包的目的节点,它仅仅扮演了数据包传递中中间节点的角色。In the traditional up/down routing method, most data packets are transmitted through the root node of the spanning tree. In this way, the root node may become the bottleneck of network communication in many cases, especially when the scale of the network becomes larger. In most cases, the root node is not the destination node of the data packet, it only plays the role of an intermediate node in the transmission of the data packet.

发明内容Contents of the invention

(一)要解决的技术问题(1) Technical problems to be solved

本发明主要解决现有上/下路由方法中生成树根节点附近的物理链路容易发生拥堵的技术问题,并在很大程度上提高路由的灵活性与网络规模的可扩展性。The invention mainly solves the technical problem that the physical link near the root node of the spanning tree is easily congested in the existing up/down routing method, and improves the flexibility of routing and the scalability of network scale to a large extent.

(二)技术方案(2) Technical solution

为解决上述问题,本发明提供了一种基于多生成树的无死锁自适应路由方法,包括以下步骤:In order to solve the above problems, the present invention provides a deadlock-free adaptive routing method based on multiple spanning trees, comprising the following steps:

S1、确定多生成树的各个根节点,并构造多生成树;S1. Determine each root node of the multiple spanning tree, and construct the multiple spanning tree;

S2、将不同的源/目的网络通信节点对分配给不同的生成树,使不同的源/目的网络通信节点对通过不同的生成树传递数据;S2. Assign different source/destination network communication node pairs to different spanning trees, so that different source/destination network communication node pairs transmit data through different spanning trees;

S3、打破通信网络拓扑图中的资源循环依赖,避免潜在的死锁;S3. Break the circular dependence of resources in the topology diagram of the communication network to avoid potential deadlocks;

S4、在路由器中,使用路由和仲裁单元来代替路由表;S4. In the router, use the routing and arbitration unit to replace the routing table;

S5、对所述路由器采用动态缓冲区分配策略。S5. Adopt a dynamic buffer allocation strategy for the router.

优选地,所述步骤S1进一步包括以下步骤:Preferably, the step S1 further includes the following steps:

S101、确定第一个根节点,使其余节点通过以其为根节点的生成树进行通信的平均距离最短,所述第一个根节点根据以下公式得到:S101. Determine the first root node, so that the average distance for other nodes to communicate through the spanning tree with it as the root node is the shortest, and the first root node is obtained according to the following formula:

FRFR == minmin rr {{ ΣΣ uu ,, vv distdist rr (( uu ,, vv )) }} ,,

其中,distr(u,v)表示u节点和v节点在常规上/下路由方法中的距离;Among them, dist r (u, v) represents the distance between u node and v node in the conventional up/down routing method;

S102、确定第二个根节点,使得通信网络拓扑中各个节点输入端口缓存区的循环依赖所涉及的节点数和所有节点间通信的距离之和都尽量最小,所述第二个根节点根据以下公式得到:S102. Determine the second root node so that the number of nodes involved in the cyclic dependency of the input port buffers of each node in the communication network topology and the sum of the communication distances between all nodes are as small as possible, and the second root node is based on the following The formula yields:

SRSR == ΣΣ uu ,, vv ΔdistΔdist (( uu ,, vv )) ΣΣ cc sizesize (( cc )) ,,

其中,size(c)表示循环依赖中的节点数,∑csize(c)表示识别出的所有循环依赖所涉及的所有节点总数,Σu,vΔdist(u,v)表示新增根节点所带来的所有节点间缩短的通信距离的总和;Among them, size(c) represents the number of nodes in the circular dependency, ∑ c size(c) represents the total number of all nodes involved in all identified circular dependencies, Σ u, v Δdist(u, v) represents the number of new root nodes The sum of the shortened communication distances between all nodes brought about;

S103、根据以下公式确定其余的根节点:S103. Determine the remaining root nodes according to the following formula:

hh == ΣΣ uu ,, vv ΔdistΔdist (( uu ,, vv )) ΔTΔT ,,

ΔTΔT == ΣΣ cc ∈∈ cc 22 sizesize (( cc )) -- ΣΣ cc ∈∈ cc 11 sizesize (( cc )) ,,

其中c1和c2是新生成树建立前和建立后网络中循环依赖所涉及的节点集合,Δdist(u,v)代表在新生成树建立后各个节点间减少的通信距离。Among them, c 1 and c 2 are the sets of nodes involved in the cyclic dependency in the network before and after the establishment of the new spanning tree, and Δdist(u,v) represents the reduced communication distance between each node after the establishment of the new spanning tree.

优选地,所述步骤S2进一步包括以下步骤:Preferably, said step S2 further includes the following steps:

S201、将一组源/目的网络通信节点对分配给与其通信距离最短的一个生成树;S201. Assign a group of source/destination network communication node pairs to a spanning tree with the shortest communication distance therewith;

S202、相同源节点、不同目的节点的网络通信节点对均衡分配给不同的生成树;S202. The network communication node pairs with the same source node and different destination nodes are allocated to different spanning trees in a balanced manner;

S203、当一组源/目的网络通信节点对在多个生成树中的通信距离都为最小且相等时,将这组源/目的网络通信节点对分配给任意一个生成树。S203. When the communication distances of a group of source/destination network communication node pairs in multiple spanning trees are the smallest and equal, assign the group of source/destination network communication node pairs to any spanning tree.

优选地,所述步骤S3进一步包括以下步骤:Preferably, said step S3 further includes the following steps:

S301、在通信网络拓扑图中找到可能发生资源循环依赖的环;S301. Find a ring in the communication network topology diagram where resource circular dependency may occur;

S302、在每个环中找到限制端口,当所述限制端口满足预定规则时,允许数据包通过其进行传递,当所述限制端口不满足预定规则时,不允许数据包通过其进行传递,其预定规则是下一跳端口有多余或者等于两个缓存区;S302. Find a restricted port in each ring. When the restricted port satisfies a predetermined rule, the data packet is allowed to pass through it. When the restricted port does not meet the predetermined rule, the data packet is not allowed to pass through it. The predetermined rule is that the next hop port is redundant or equal to two buffer areas;

根据以下的效益计量公式能够确定一个节点中的输入端口作为限制端口:The input port in a node can be determined as the limit port according to the following benefit measurement formula:

mm (( vv ii )) == ΣΣ vv ii ∈∈ CC sizesize (( CC )) ,,

其中,节点v的输入端口i是循环依赖C中的限制端口,size(C)是循环依赖C的大小,选择上述效益计量值大的输入端口作为限制端口;Wherein, the input port i of node v is the limiting port in the circular dependency C, size(C) is the size of the circular dependency C, and the input port with the above-mentioned benefit measurement value is selected as the limiting port;

S303、当两个输入端口的效益计量值相等时,选择度数小的节点中的输入端口作为限制端口;S303. When the benefit measurement values of the two input ports are equal, select the input port in the node with a small degree as the restricted port;

S304、在选择出每一个限制端口后,每一个节点的每一个端口的效益计量值都要进行更新,即在打破的循环依赖中所包含的节点和这些节点中的输入端口的循环计量值都要减去循环依赖的大小;S304. After selecting each restricted port, the benefit measurement value of each port of each node must be updated, that is, the nodes contained in the broken circular dependency and the cycle measurement values of the input ports in these nodes are all to subtract the size of the circular dependency;

S305、重复执行以上步骤,直到所有的循环依赖都被打破。S305. Repeat the above steps until all circular dependencies are broken.

优选地,所述步骤S4进一步包括以下步骤:Preferably, said step S4 further includes the following steps:

S401、将经过路由器某一个端口的数据包分成两类:其中一类是以该路由器为源节点的数据包;另一类是经过该路由器,以该路由器为中间节点的数据包;S401. Divide the data packets passing through a certain port of the router into two types: one type is the data packet with the router as the source node; the other type is the data packet with the router as the intermediate node through the router;

S402、将以该路由器为源节点的数据包根据其具体传递所在的生成树分类,所述情况在路由方程中的表达为:表示生成树的标志位乘以所述数据包在该生成树中的各个目的节点的标志位之和,如果该端口在该生成树中为限制端口,则还需乘以限制端口标志位;S402. Classify the data packet with the router as the source node according to the specific spanning tree where it is delivered, and the expression of the situation in the routing equation is: the flag bit representing the spanning tree multiplied by the data packet in the spanning tree If the port is a restricted port in the spanning tree, it needs to be multiplied by the restricted port flag;

S403、将以该路由器为中间节点的数据包根据到达该路由器的物理链路的状态分为两类:其中一类是经过状态为上的物理链路到达该路由器的数据包;另一类是经过状态为下的物理链路到达该路由器的数据包;S403. Divide the data packet with the router as an intermediate node into two types according to the state of the physical link arriving at the router: one of them is the data packet arriving at the router through the physical link whose state is up; the other is Data packets arriving at the router through the physical link in the state of Down;

S404、将以该路由器为中间节点并且经过状态为上的物理链路到达该路由器的数据包根据其具体传递所在的生成树分类,所述情况在路由方程中的表达为:表示生成树的标志位乘以所述数据包在该生成树中的各个目的节点的标志位之和,如果该端口在该生成树中为限制端口,则还需乘以限制端口标志位;S404. Classify the data packet that takes the router as an intermediate node and arrives at the router through a physical link in the upper state according to the spanning tree where it is specifically delivered, and the expression of the situation in the routing equation is: a sign representing the spanning tree The bit is multiplied by the sum of the flag bits of each destination node in the spanning tree of the data packet, if the port is a restricted port in the spanning tree, it is also required to be multiplied by the flag bit of the restricted port;

S405、将以该路由器为中间节点并且经过状态为下的物理链路到达该路由器的数据包根据其具体传递所在的生成树分类,所述情况在路由方程中的表达为:表示生成树的标志位乘以上一跳标志位再乘以所述数据包在该生成树中的各个目的节点的标志位之和,如果该端口在该生成树中为限制端口,则还需乘以限制端口标志位;S405. Classify the data packet that takes the router as an intermediate node and arrives at the router through a physical link in the lower state according to the spanning tree where it is specifically delivered, and the expression of the situation in the routing equation is: a sign representing the spanning tree multiplied by the previous hop flag bit and then multiplied by the sum of the flag bits of each destination node in the spanning tree of the data packet, if the port is a restricted port in the spanning tree, it needs to be multiplied by the restricted port flag bit ;

S406、将上述各个路由方程中的表达式相加再乘以下一跳空闲缓存区标志位,再乘以输出端口缓存区队列长度标志位取反。S406. Add the expressions in the above routing equations, multiply the flag bit of the next hop free buffer area, and multiply it by the output port buffer area queue length flag bit to invert.

优选地,所述步骤S5进一步包括以下步骤:Preferably, said step S5 further includes the following steps:

S501、将缓存区资源分为两类,一类是特定缓存区,另一类是中央缓存区;S501. Divide the cache area resources into two categories, one is a specific cache area, and the other is a central cache area;

S502、将特定缓存区与某一个特定的输入端口绑定,使得每一个输入端口都有一个足以装下一个数据包的特定缓存区;S502. Bind a specific buffer area to a specific input port, so that each input port has a specific buffer area sufficient to hold a data packet;

S503、中央缓存区能够分配给任何一个输入端口;S503, the central buffer area can be allocated to any input port;

S504、每一个缓存区都设有一个用来标记其状态的标志位、一个用来标记其是否被申请占用的标志位、以及一个标记其是否已经被占用的标志位;S504. Each buffer area is provided with a flag bit for marking its status, a flag bit for marking whether it is occupied by an application, and a flag bit for marking whether it is already occupied;

S505、为连接根节点和限制端口的输入端口分配更多的中央缓存区资源。S505. Allocate more resources of the central buffer area to the input port connected to the root node and the restricted port.

(三)有益效果(3) Beneficial effects

本发明方法有效减轻了各个生成树中根节点和气泡节点的拥堵情况,提高了不规则网络的通信性能,当网络规模增大时,本发明方法具有较好的可扩展性。The method of the invention effectively reduces the congestion of root nodes and bubble nodes in each spanning tree, and improves the communication performance of the irregular network. When the network scale increases, the method of the invention has good scalability.

附图说明Description of drawings

图1(a)是拥有八个网络节点的不规则网络示意图,(b)是传统上/下路由方法中的生成树示意图;Figure 1(a) is a schematic diagram of an irregular network with eight network nodes, and (b) is a schematic diagram of a spanning tree in the traditional up/down routing method;

图2是拥有两棵符合传统路由方法生成树的不规则网络示意图;Fig. 2 is a schematic diagram of an irregular network with two spanning trees conforming to the traditional routing method;

图3是本发明方法的流程图;Fig. 3 is the flowchart of the inventive method;

图4是VCT交换路由器的路由逻辑示意图;Fig. 4 is the routing logic diagram of VCT exchange router;

图5是拥有多棵生成树的不规则网络中的资源循环依赖示意图,其中(a)表示只有输入端口的不规则网络,(b)表示网络中的资源循环依赖,(c)表示在生成树8中2a被选为限制端口,(d)表示生成树1中的3a和生成树8中的7a、6b被选为限制端口。Figure 5 is a schematic diagram of the circular dependency of resources in an irregular network with multiple spanning trees, where (a) represents an irregular network with only input ports, (b) represents the circular dependency of resources in the network, and (c) represents the resource cycle in the spanning tree 2 a in 8 is selected as the restricted port, and (d) indicates that 3 a in spanning tree 1 and 7 a and 6 b in spanning tree 8 are selected as restricted ports.

具体实施方式Detailed ways

下面结合附图和实施例,对本发明的具体实施方式作进一步详细描述。以下实施例用于说明本发明,但不用来限制本发明的范围。The specific implementation manners of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

本发明提出了一种新的基于多生成树的无死锁自适应路由方法,该方法的核心思想是为一个不规则网络建立多棵生成树,使不同源/目的节点间的数据包在不同的生成树上传递。这个技术可以平均地将网络上的数据包分配给不同的生成树,使它们经过各自的根节点进行传递,从而直接改善单生成树根节点附近的拥堵情况。如图2所示,在网络中我们以节点1和节点8为根节点构造了两棵生成树。The present invention proposes a new deadlock-free adaptive routing method based on multiple spanning trees. The core idea of the method is to establish multiple spanning trees for an irregular network, so that data packets between different source/destination nodes are passed on the spanning tree. This technology can evenly distribute data packets on the network to different spanning trees, so that they can be transmitted through their respective root nodes, thereby directly improving the congestion near the root node of a single spanning tree. As shown in Figure 2, we have constructed two spanning trees with nodes 1 and 8 as root nodes in the network.

在某一棵生成树的拓扑图中不可能存在环,但是在多棵生成树之间有可能存在资源的循环依赖。本发明采用为每一个在拓扑图中存在的环选择一个气泡节点的方法来避免潜在循环依赖的发生。气泡节点相应的端口被限制而不是被完全禁止,被限制的端口只有当它能提供足够的缓存区时它才被允许用来传递数据包。本发明还提出了一个新的动态分配缓存区的方法来提高整个网络的性能和减轻各个生成树中根节点和气泡节点的拥堵情况。There cannot be a cycle in the topology graph of a certain spanning tree, but there may be a circular dependency of resources among multiple spanning trees. The present invention adopts a method of selecting a bubble node for each loop existing in the topological graph to avoid the occurrence of potential circular dependencies. The corresponding port of the bubble node is restricted rather than completely prohibited, and the restricted port is only allowed to transmit data packets if it can provide enough buffer area. The invention also proposes a new method for dynamically allocating buffer areas to improve the performance of the entire network and alleviate the congestion of root nodes and bubble nodes in each spanning tree.

图3是本发明方法的流程图,本发明提供一种基于多生成树的无死锁自适应路由方法,包括以下步骤:Fig. 3 is the flowchart of the method of the present invention, and the present invention provides a kind of non-deadlock self-adaptive routing method based on multiple spanning tree, comprises the following steps:

步骤S1:选择多生成树的各个根节点并构造生成树。各个生成树的根节点的选择对于所有基于生成树的路由方法都至关重要。不同于以前的多种方法所使用的生成树根节点选择方法,本发明需要使用两种不同的启发式算法来分别选择第一个根节点和其余的根节点。Step S1: Select each root node of the multiple spanning tree and construct the spanning tree. The selection of the root node of each spanning tree is crucial for all spanning tree based routing methods. Different from the spanning tree root node selection methods used in the previous methods, the present invention needs to use two different heuristic algorithms to select the first root node and the remaining root nodes respectively.

步骤S101:第一个根节点需要具备其余节点通过它进行通信的平均距离最短的特点。用公式:Step S101: The first root node needs to have the characteristic that the average distance through which other nodes communicate is the shortest. Use the formula:

FRFR == minmin rr {{ ΣΣ uu ,, vv distdist rr (( uu ,, vv )) }}

可以得到我们需要的根节点。其中distr(u,v)表示u节点和v节点在传统上/下路由方法中的距离。We can get the root node we need. where dist r (u,v) represents the distance between node u and node v in the traditional up/down routing method.

步骤S102:在选择第一个根节点后我们需要选择第二个根节点,尽管所根据的算法思想相同,对于第二个根节点和其余根结点的选择基于不同的公式。因为网络通信中涉及可能发生资源循环依赖的节点越多对网络性能的影响就越大,所以在选择其余的根节点时我们应该尽量使得网络拓扑中各个节点输入端口缓存区的循环依赖所涉及的节点数和所有节点间通信的距离之和都最小。对于第二个根节点,根据以下公式进行选择:Step S102: After selecting the first root node, we need to select the second root node. Although the algorithm is based on the same idea, the selection of the second root node and the remaining root nodes are based on different formulas. Because the more nodes involved in network communication that may have resource circular dependencies, the greater the impact on network performance, so when selecting the rest of the root nodes, we should try to make the circular dependencies of the input port buffers of each node in the network topology involved. The sum of the number of nodes and the communication distance between all nodes is the smallest. For the second root node, the selection is made according to the following formula:

SRSR == ΣΣ uu ,, vv ΔdistΔdist (( uu ,, vv )) ΣΣ cc sizesize (( cc )) ,,

其中size(c)表示循环依赖中的节点数,∑csize(c)表示识别出的所有循环依赖所涉及的所有节点总数,∑u,vΔdist(u,v)表示新增根节点所带来的所有节点间缩短的通信距离的总和。Where size(c) represents the number of nodes in the circular dependency, ∑ c size(c) represents the total number of nodes involved in all identified circular dependencies, ∑ u, v Δdist(u, v) represents the number of nodes brought by the newly added root node The sum of the shortened communication distances between all nodes coming from .

步骤S103:第三个节点和第四个节点可以根据以下公式进行选择:Step S103: the third node and the fourth node can be selected according to the following formula:

hh == ΣΣ uu ,, vv ΔdistΔdist (( uu ,, vv )) ΔTΔT ,,

ΔTΔT == ΣΣ cc ∈∈ cc 22 sizesize (( cc )) -- ΣΣ cc ∈∈ cc 11 sizesize (( cc )) ,,

其中c1和c2是新生成树建立前和建立后网络中循环依赖所涉及的节点集合,Δdist(u,v)代表在新生成树建立后各个节点间减少的通信距离。需要注意的是当ΔT=0时,需要将它从上述公式中移除。Among them, c 1 and c 2 are the sets of nodes involved in the cyclic dependency in the network before and after the establishment of the new spanning tree, and Δdist(u,v) represents the reduced communication distance between each node after the establishment of the new spanning tree. It should be noted that when ΔT=0, it needs to be removed from the above formula.

步骤S2:在本发明提出的方法中,一个网络拥有多棵生成树,这样不同的源/目的网络通信节点对就可以通过不同的生成树传递数据包。这样做的好处是可以使整个网络负载均衡的传递数据包,同时也避免了不同生成树使用不同虚拟通道传递数据包所带来的物理链路不能充分利用的问题。如何将不同的源/目的网络节点对分配给不同的生成树,对于不规则网络的负载均衡是至关重要的。Step S2: In the method proposed by the present invention, a network has multiple spanning trees, so that different source/destination network communication node pairs can transmit data packets through different spanning trees. The advantage of this is that the entire network load can be balanced to transmit data packets, and at the same time, it can avoid the problem that the physical link cannot be fully utilized caused by different spanning trees using different virtual channels to transmit data packets. How to assign different source/destination network node pairs to different spanning trees is crucial to the load balancing of irregular networks.

步骤S201:将一组源/目的网络通信节点对尽量分配给它们通信距离最短的一个生成树。Step S201: Allocate a group of source/destination network communication node pairs to a spanning tree whose communication distance is the shortest.

步骤S202:为了达到更好的负载均衡,相同源节点、不同目的节点的网络通信节点对应该均衡的分配给不同的生成树。Step S202: In order to achieve better load balancing, network communication nodes corresponding to the same source node and different destination nodes should be distributed to different spanning trees in a balanced manner.

步骤S203:当一组源/目的网络通信节点对在多个生成树中的通信距离都为最小且相等时,这组网络通信节点对就可以分配给任意一个生成树,这时就为数据包的分配提供了一些灵活性。Step S203: When the communication distances of a group of source/destination network communication node pairs in multiple spanning trees are the smallest and equal, this group of network communication node pairs can be assigned to any spanning tree. The assignment of provides some flexibility.

步骤S3:基于多生成树的无死锁自适应路由方法不仅仅为不同节点间提供了更短的通信路径还有效的提升了整个路由算法的自适应性。然而,这个算法同时也带来了在网络拓扑图中的一些可能发生的资源循环依赖。通过遵循以下步骤,可以打破这些循环依赖从而避免潜在的死锁:Step S3: The deadlock-free adaptive routing method based on multiple spanning trees not only provides shorter communication paths between different nodes, but also effectively improves the adaptability of the entire routing algorithm. However, this algorithm also brings some possible resource cycle dependencies in the network topology graph. These circular dependencies can be broken and potential deadlocks avoided by following these steps:

步骤S301:在网络拓扑图中找到可能发生资源循环依赖的环。Step S301: Find a cycle in which resource circular dependency may occur in the network topology graph.

步骤S302:然后在每个环中找到一些限制端口,当这些限制端口满足预定要求时,允许数据包经过它们进行传递,当它们不满足预定要求时,不允许数据包经过它们进行传递。在选择限制端口时,遵循以下规则:Step S302: Then find some restricted ports in each ring. When these restricted ports meet predetermined requirements, data packets are allowed to pass through them, and when they do not meet predetermined requirements, data packets are not allowed to pass through them. When selecting restricted ports, follow these rules:

1、每一个循环依赖中至少包含一个含有限制端口的节点;1. Each circular dependency contains at least one node with restricted ports;

2、含有限制端口节点的选择是根据相应的输入端口而不是整个节点;2. The selection of nodes containing restricted ports is based on the corresponding input ports rather than the entire node;

3、尽量避免选择根节点中的输入端口作为限制端口;3. Try to avoid selecting the input port in the root node as the restricted port;

4、网络中的所有节点所包含的限制端口的数量不能超过一个给定的阈值;4. The number of restricted ports contained in all nodes in the network cannot exceed a given threshold;

5、尽量选择度数较小的网络节点中的输入端口作为限制端口。5. Try to choose the input port in the network node with a small degree as the restricted port.

可以根据以下的效益计量公式来选择一个节点中的输入端口作为限制端口:An input port in a node can be selected as a limit port according to the following benefit metering formula:

mm (( vv ii )) == ΣΣ vv ii ∈∈ CC sizesize (( CC ))

其中,节点v的输入端口i是循环依赖C中的限制端口。size(C)是循环依赖C的大小。循环依赖所涉及的节点越多对整个网络的性能影响就越大。所以优先选择上述效益计量值大的输入端口作为限制端口。Among them, the input port i of node v is the restricted port in the circular dependency C. size(C) is the size of the circular dependency C. The more nodes involved in circular dependencies, the greater the impact on the performance of the entire network. Therefore, the input port with the above-mentioned large benefit measurement value is preferentially selected as the limiting port.

步骤S303:当两个输入端口的效益计量值相等时,选择度数小的节点中的输入端口,因为,度数大的节点在网络中会负责传递更多的流量。Step S303: When the benefit measurement values of the two input ports are equal, select the input port of the node with a small degree, because a node with a large degree will be responsible for transmitting more traffic in the network.

步骤S304:在选择出每一个限制端口后,每一个节点的每一个端口的效益计量都要进行相应的更新,也就是在打破的循环依赖中所包含的节点和这些节点中的输入端口的循环计量值都要减去循环依赖的大小。Step S304: After each restricted port is selected, the benefit measurement of each port of each node must be updated accordingly, that is, the cycle of the nodes contained in the broken circular dependency and the input ports of these nodes The metered values are all minus the size of the circular dependency.

步骤S305:重复执行以上步骤,直到所有的循环依赖都被打破。Step S305: Repeat the above steps until all circular dependencies are broken.

步骤S4:在路由器中,使用路由和仲裁单元来代替路由表。Step S4: In the router, a routing and arbitration unit is used to replace the routing table.

步骤S401:将经过路由器某一个端口的数据包分成两类:其中一类是以该路由器为源节点的数据包;另一类是经过该路由器,以该路由器为中间节点的数据包;Step S401: Divide the data packets passing through a certain port of the router into two types: one type is the data packet with the router as the source node; the other type is the data packet with the router as the intermediate node through the router;

步骤S402:将以该路由器为源节点的数据包根据其具体传递所在的生成树分类,所述情况在路由方程中的表达为:表示生成树的标志位乘以所述数据包在该生成树中的各个目的节点的标志位之和,如果该端口在该生成树中为限制端口,则还需乘以限制端口标志位;Step S402: Classify the data packet with the router as the source node according to the spanning tree where it is delivered. The sum of the flag bits of each destination node in , if the port is a restricted port in the spanning tree, it needs to be multiplied by the restricted port flag;

步骤S403:将以该路由器为中间节点的数据包根据到达该路由器的物理链路的状态分为两类:其中一类是经过状态为上的物理链路到达该路由器的数据包;另一类是经过状态为下的物理链路到达该路由器的数据包;Step S403: divide the data packet with the router as the intermediate node into two types according to the state of the physical link arriving at the router: one type is the data packet arriving at the router through the physical link whose state is up; the other type It is the data packet that arrives at the router through the physical link in the lower state;

步骤S404:将以该路由器为中间节点并且经过状态为上的物理链路到达该路由器的数据包根据其具体传递所在的生成树分类,所述情况在路由方程中的表达为:表示生成树的标志位乘以所述数据包在该生成树中的各个目的节点的标志位之和,如果该端口在该生成树中为限制端口,则还需乘以限制端口标志位;Step S404: Classify the data packets that take the router as an intermediate node and arrive at the router through a physical link in the upper state according to the spanning tree where they are delivered. The expression of the situation in the routing equation is: represents the spanning tree The flag bit is multiplied by the sum of the flag bits of each destination node of the data packet in the spanning tree, and if the port is a restricted port in the spanning tree, the flag bit of the restricted port needs to be multiplied;

步骤S405:将以该路由器为中间节点并且经过状态为下的物理链路到达该路由器的数据包根据其具体传递所在的生成树分类,所述情况在路由方程中的表达为:表示生成树的标志位乘以上一跳标志位再乘以所述数据包在该生成树中的各个目的节点的标志位之和,如果该端口在该生成树中为限制端口,则还需乘以限制端口标志位;Step S405: Classify the data packets that take the router as an intermediate node and arrive at the router through the physical link in the state according to the spanning tree where they are delivered. The expression of the situation in the routing equation is: represents the spanning tree The flag bit is multiplied by the last hop flag bit and then multiplied by the sum of the flag bits of each destination node in the spanning tree of the data packet. If the port is a restricted port in the spanning tree, it needs to be multiplied by the restricted port flag bit;

步骤S406:将上述各个路由方程中的表达式相加再乘以下一跳空闲缓存区标志位,再乘以输出端口缓存区队列长度标志位取反。Step S406: Add the expressions in the above routing equations, multiply the flag of the next hop free buffer area, and multiply by the output port buffer queue length flag to invert.

在步骤S4中,提出了一种包含k个输入和输出端口的新的路由器结构来满足基于多生成树的无死锁自适应路由方法在网络上应用的需求。In step S4, a new router structure including k input and output ports is proposed to meet the application requirements of the deadlock-free adaptive routing method based on multiple spanning trees on the network.

新的路由报头包含两位用来表示该报文所属生成树的标志位,一位用来表示上一跳是上还是下的标志位,还有一组用来表示目的地地址的标志位,例如:拥有16个节点的网络需要四位长度的标志位来代表目的地地址。The new routing header contains two flag bits used to indicate the spanning tree to which the message belongs, one flag bit used to indicate whether the previous hop is up or down, and a set of flag bits used to indicate the destination address, for example : A network with 16 nodes requires a four-bit flag to represent the destination address.

新的路由器结构包括:The new router structure includes:

k*n个表示输出端口状态的信号。n表示生成树的个数,k表示输出端口的个数。例如:Si,j=1第i个输出端口在第j个生成树上是上否则为下。这些信号在所有生成树建立之后即为固定不变的值。k*n signals representing the state of the output port. n represents the number of spanning trees, and k represents the number of output ports. For example: S i, j = 1 The i-th output port is up on the j-th spanning tree; otherwise, it is down. These signals are fixed values after all spanning trees have been established.

k个代表各个输出端口队列长度的信号。例如:qi=1表示第i个端口的输出队列长度至少为1,否则该队列为空。k signals representing the queue length of each output port. For example: q i =1 means that the output queue length of the i-th port is at least 1, otherwise the queue is empty.

k个代表各个输出端口是否为限制输出端口的信号。例如:Ci=1表示第i个输出端口及它所对应的物理链路是受限的。The k signals represent whether each output port is a limited output port. For example: C i =1 indicates that the i-th output port and its corresponding physical link are restricted.

2*k个代表各个输出端口所对应的下一跳节点输入端口的可用缓存去数量。例如:bi,1,bi,2=00,01,10,11就表示第i个输出端口所对应的下一跳节点输入端口的可用缓存去数量为0个,1个,2个,和3个。2*k represents the number of available buffers for the input port of the next hop node corresponding to each output port. For example: bi , 1 , bi , 2 = 00, 01, 10, 11 means that the number of available caches for the input port of the next hop node corresponding to the i-th output port is 0, 1, 2, and 3 more.

使用路由方程来实现路由表的功能,用于代替路由表的逻辑十分的简洁。The routing equation is used to realize the function of the routing table, and the logic used to replace the routing table is very simple.

如图2所示,节点5的b端口的路由方程为:As shown in Figure 2, the routing equation of port b of node 5 is:

RR bb == bb 1,11,1 ·&Center Dot; qq 22 ‾‾ ·&Center Dot; CC 22 ·&Center Dot; (( tt ‾‾ ·&Center Dot; (( dd 11 ‾‾ dd 22 dd 33 ‾‾ ++ dd 11 dd 22 dd 33 )) ++ tt ·· sthe s ·&Center Dot; (( dd 11 ‾‾ dd 22 dd 33 ‾‾ ++ dd 11 dd 22 dd 33 )) ++

tt ‾‾ ·· dd 11 ‾‾ dd 22 ‾‾ dd 33 ++ tt ·&Center Dot; (( dd 11 ‾‾ dd 22 dd 33 ‾‾ ++ dd 11 dd 22 dd 33 )) ))

== bb 1,11,1 ·&Center Dot; qq 22 ‾‾ ·&Center Dot; CC 22 ·&Center Dot; (( dd 11 ‾‾ dd 22 dd 33 ‾‾ ++ tt ‾‾ ·&Center Dot; dd 11 ‾‾ dd 22 ‾‾ dd 33 ++ dd 11 dd 22 dd 33 ))

q2=1表示输出端口的队列长度至少为1。代表在生成树8上面传递的以节点5作为中间节点的数据包,代表在生成树1上面传递的以节点5作为中间节点的数据包,代表在生成树1和生产树8上面以节点5作为源节点的数据包。q 2 =1 indicates that the queue length of the output port is at least 1. Represents the data packet passed on the spanning tree 8 with node 5 as the intermediate node, Represents the data packet passed on spanning tree 1 with node 5 as the intermediate node, and Represents data packets with node 5 as the source node on spanning tree 1 and spanning tree 8.

步骤S5:为了充分利用有限的缓存去存储资源,本发明提出了一种新的动态缓存区分配策略。Step S5: In order to make full use of the limited cache to store resources, the present invention proposes a new dynamic cache allocation strategy.

步骤S501:首先将缓存区资源分为两类,一类是特定缓存区,一类是中央缓存区。Step S501: Firstly, the cache resources are divided into two categories, one is a specific cache, and the other is a central cache.

步骤S502:将特定缓存区与某一个特定的输入端口绑定,满足每一个输入端口都有一个足以装下一个数据包的特定缓存区。Step S502: Bind a specific buffer area to a specific input port, so that each input port has a specific buffer area enough to hold a data packet.

步骤S503:中央缓存区可以分配给任何一个输入端口。如果需要的话一个输入端口可占有多个中央缓存区,并在数据包传递完成后释放它们。Step S503: The central buffer can be allocated to any input port. An input port can hold as many central buffers as needed and release them after the packet delivery is complete.

步骤S504:每一个缓存去都有一个用来标记它们状态的标志位,一个用来标记它们是否被申请占用的标志位,还有一个它们是否已经被占用的标志位。Step S504: Each buffer has a flag bit used to mark their status, a flag bit used to mark whether they are occupied by an application, and a flag bit used to mark whether they have been occupied.

步骤S505:为连接根节点和限制端口的输入端口分配更多的中央缓存去资源,进而避免这些位置成为网络通信的瓶颈。Step S505: Allocate more central cache resources to the input ports connected to the root node and the restricted ports, so as to prevent these locations from becoming a bottleneck of network communication.

本发明用Java语言实现了上述基于多生成树的无死锁自适应路由方法和动态缓存区分配策略,同时被实现的还有传统的上/下路由方法、基于Duato原则的路由方法、多层路由方法、区域排序基于标签的路由方法。其中基于Duato原则的路由方法和多层路由方法需要多条虚拟链路,所以需要为所有的路由器的端口都分配两个或两个以上的缓存区。用于测试的不规则网络拓扑是随机生成的,物理链路在满足每个节点的度不超过4的条件下被随机添加到网络节点之间。The present invention realizes above-mentioned non-deadlock self-adaptive routing method based on multiple spanning tree and dynamic cache allocation strategy with Java language, also has traditional up/down routing method, routing method based on Duato principle, multi-layer Routing method, area ordering Label-based routing method. Among them, the routing method based on the Duato principle and the multi-layer routing method need multiple virtual links, so it is necessary to allocate two or more buffer areas for all router ports. The irregular network topology used for testing is randomly generated, and physical links are randomly added between network nodes under the condition that the degree of each node does not exceed 4.

本发明实现了所有在网络拓扑中有三棵或者四个生成树的根节点选择情况。下表1展示了在节点数为16、32、64、128、256、512的网络中对第一个根节点进行选择的处理器时间和对剩余根节点进行选择的处理器平均时间。The invention realizes all root node selection situations with three or four spanning trees in the network topology. Table 1 below shows the processor time for selecting the first root node and the average processor time for selecting the remaining root nodes in networks with 16, 32, 64, 128, 256, and 512 nodes.

表1Table 1

节点的数量number of nodes 1616 3232 6464 128128 256256 512512 第一个根节点first root node 1.011.01 1.981.98 3.903.90 14.6814.68 248.5248.5 6542865428 其余根节点(3棵生成树)The remaining root nodes (3 spanning trees) 1.021.02 2.092.09 4.114.11 16.7916.79 260.4260.4 6609966099 其余根节点(4棵生成树)The remaining root nodes (4 spanning trees) 1.041.04 2.152.15 4.754.75 16.4316.43 260.0260.0 6604866048

通常以两个量来评估不同路由算法的性能:传递一个数据包的延迟和整个网络的最大负载。在拥有32个节点和116条物理链路的网络中。传统的上/下路由方法在网络负载稍大于0.1后就很快到达了饱和点。基于Duato原则的扩展路由方法在网络负载为0.24时到达了饱和点。多层路由方法的性能明显优于传统的上/下路由方法和基于Duato原则的扩展路由方法,当网络负载为0.18时它所能接受的流量略多与基于Duato原则的扩展路由方法。本发明提出的基于多生成树的无死锁自适应路由方法,无论是否应用本发明提出的动态缓存区分配策略,在任何情况下性能都明显优于区域排序基于标签的路由方法。The performance of different routing algorithms is usually evaluated by two quantities: the delay of delivering a data packet and the maximum load of the entire network. In a network with 32 nodes and 116 physical links. The traditional up/down routing method reaches the saturation point soon after the network load is slightly greater than 0.1. The extended routing method based on Duato's principle reaches the saturation point when the network load is 0.24. The performance of the multi-layer routing method is obviously better than the traditional up/down routing method and the extended routing method based on the Duato principle. When the network load is 0.18, it can accept slightly more traffic than the extended routing method based on the Duato principle. The deadlock-free self-adaptive routing method based on multiple spanning trees proposed by the present invention, no matter whether the dynamic cache area allocation strategy proposed by the present invention is applied or not, its performance is obviously better than the routing method based on area sorting labels in any case.

在64个网络节点232条物理链路的网络中,区域排序基于标签的路由方法的表现要好于基于多生成树的无死锁自适应路由方法,但它的表现在各种情况下都明显差于基于多生成树的无死锁自适应路由方法的动态缓存区分配版本。In a network of 64 network nodes and 232 physical links, the region ordering label-based routing method performed better than the multiple spanning tree-based deadlock-free adaptive routing method, but its performance was significantly worse in all cases A version of dynamic buffer allocation based on a deadlock-free adaptive routing method based on multiple spanning trees.

当网络的规模增大时,上述差异将更加明显。也就是说本发明提出的方法具有更好的可扩展性。在128个网络节点464条物理链路的网络中可以发现,当生成树的数目为3时,本发明方法的性能最佳。一个网络中最佳生成树的数目受网络中网络节点的个数、物理链路的条数和每一个输入端口的缓存区数量所影响。When the scale of the network increases, the above differences will be more obvious. That is to say, the method proposed by the present invention has better scalability. In a network with 128 network nodes and 464 physical links, it can be found that when the number of spanning trees is 3, the performance of the method of the present invention is the best. The number of optimal spanning trees in a network is affected by the number of network nodes in the network, the number of physical links and the number of buffer areas for each input port.

下面详述基于多生成树的无死锁自适应路由方法具体的路由器实施方法。假设路由器拥有k个输入或者输出端口,以VCT交换为基础。如图4所示,数据包的路由头部包含两位用来标识该数据包在哪棵生成树上传递的标识位t1t2。一组用来标识目的节点的标识位,例如拥有16个节点的网络需要4位标识位d1d2d3d4来代表目的节点。一位用来标识上一条状态的标识位s,当s=1时表明上一跳为下,反之上一跳为上。The specific router implementation method of the deadlock-free adaptive routing method based on multiple spanning trees will be described in detail below. Assume that the router has k input or output ports based on VCT switching. As shown in FIG. 4 , the routing header of the data packet contains two identification bits t 1 t 2 used to identify which spanning tree the data packet is transmitted on. A set of identification bits used to identify the destination node, for example, a network with 16 nodes requires 4 identification bits d 1 d 2 d 3 d 4 to represent the destination node. A flag s used to identify the last state, when s=1, indicates that the previous jump is down, and vice versa, the previous jump is up.

标识位s1,1,s1,2,s2,1,s2,2,…,sk,1,sk,2用来标识输出链路的状态。si,j=1表示第j棵生成树的第i条输出链路的状态为上,反之则为下。当网络中的生成树被建立之后,标识位s1,1,s1,2,s2,1,s2,2,…,sk,1,sk,2的值就是固定不变的了。在整个路由过程中对输出链路的选择必须遵循上/下路由算法的规则。也就是说当上一跳的状态为上时,所有的输出链路都是候选链路,而当上一跳的状态为下时,只可以选择状态为下的输出链路。The identification bits s 1,1 , s 1,2 , s 2,1 , s 2,2 , . . . , s k,1 , s k,2 are used to identify the state of the output link. s i,j = 1 means that the state of the i-th output link of the j-th spanning tree is up, otherwise it is down. After the spanning tree in the network is established, the values of the identification bits s 1 , 1, s 1 , 2, s 2 , 1, s 2, 2 , ..., s k, 1 , s k, 2 are fixed up. The selection of output links in the whole routing process must follow the rules of the up/down routing algorithm. That is to say, when the state of the previous hop is up, all output links are candidate links, and when the state of the previous hop is down, only the output link whose state is down can be selected.

标识位q1,q2,…,qk也是标识与输出链路对应的缓存区队列的状态,当qi=1时表示第i条输出链路所对应的缓存区队列的长度至少为1,否则队列为空。这里使用k个标识位C1,C2,…,Ck来标识路由器中的k个输出端口是否为限制端口。当Ci=1时,路由器的第i个端口以及与它相连的物理链路的状态为受限状态。当一条物理链路的状态为受限时,数据包只能在与它相连的下一跳端口的空闲缓存区的数量大于等于2时,选择这条物理链路进行传递。标识位b1,b2用来表示输出端口相应的下一跳输入端口的空闲缓存区数量,当b1,b2的值分别为00,01,10和11时,表示下一跳输入端口空闲缓存区的数量为0,1,2,3。The identification bits q 1 , q 2 ,...,q k also identify the state of the buffer queue corresponding to the output link, and when q i =1, it means that the length of the buffer queue corresponding to the i-th output link is at least 1 , otherwise the queue is empty. Here, k identification bits C 1 , C 2 , . . . , C k are used to identify whether the k output ports in the router are restricted ports. When C i =1, the state of the i-th port of the router and the physical link connected to it is a restricted state. When the state of a physical link is limited, the data packet can only be selected for transmission when the number of free buffer areas of the next-hop port connected to it is greater than or equal to 2. The identification bits b 1 and b 2 are used to indicate the number of free buffer areas of the corresponding next-hop input port of the output port. When the values of b 1 and b 2 are 00, 01, 10 and 11 respectively, it indicates the next-hop input port The number of free buffers is 0,1,2,3.

整个路由逻辑部分并不复杂,我们用路由和仲裁单元来实现路由表的功能。实现路由表功能的逻辑十分的简洁。如图5所示,以节点5为源节点的数据包可以被平均的分配给两棵生成树。具体的分配方式如下:5→1(8)(数据包以5为源节点在生成树8上进行传递),5→6(8),5→2(8),5→3(1),5→4(1),5→8(1),5→7(1)。我们的网络中,只有目的节点为3,2,8的数据包的传递可能会经过节点5的b端口。在生成树1中传递的数据包5→3和5→8经过了限制链路。The entire routing logic part is not complicated, we use the routing and arbitration unit to realize the function of the routing table. The logic to implement the routing table function is very simple. As shown in FIG. 5 , the data packets with node 5 as the source node can be evenly distributed to the two spanning trees. The specific allocation method is as follows: 5→1(8) (the data packet is transmitted on spanning tree 8 with 5 as the source node), 5→6(8), 5→2(8), 5→3(1), 5→4(1), 5→8(1), 5→7(1). In our network, only the data packets whose destination nodes are 3, 2, and 8 may pass through port b of node 5. Packets 5→3 and 5→8 passed in spanning tree 1 go through the restricted link.

现在考虑以节点5作为中转节点的数据包。通过状态为上的物理链路到达节点5的数据包可以被传递给节点3,8,2;通过状态为下的物理链路到达节点5的数据包可以被传递给节点3和节点8。这样,节点5的b端口的路由方程为:Now consider the packet with node 5 as the transit node. The data packet arriving at node 5 through the physical link whose state is up can be delivered to nodes 3, 8, 2; the data packet arriving at node 5 through the physical link whose state is down can be delivered to node 3 and node 8. In this way, the routing equation of port b of node 5 is:

RR bb == bb 1,11,1 ·· qq 22 ‾‾ ·&Center Dot; CC 22 ·· (( tt ‾‾ ·&Center Dot; (( dd 11 ‾‾ dd 22 dd 33 ‾‾ ++ dd 11 dd 22 dd 33 )) ++ tt ·&Center Dot; sthe s ·&Center Dot; (( dd 11 ‾‾ dd 22 dd 33 ‾‾ ++ dd 11 dd 22 dd 33 )) ++

tt ‾‾ ·&Center Dot; dd 11 ‾‾ dd 22 ‾‾ dd 33 ++ tt ·&Center Dot; (( dd 11 ‾‾ dd 22 dd 33 ‾‾ ++ dd 11 dd 22 dd 33 )) ))

== bb 1,11,1 ·&Center Dot; qq 22 ‾‾ ·· CC 22 ·· (( dd 11 ‾‾ dd 22 dd 33 ‾‾ ++ tt ‾‾ ·· dd 11 ‾‾ dd 22 ‾‾ dd 33 ++ dd 11 dd 22 dd 33 ))

q2=1表示输出端口的队列长度至少为1,代表在生成树8上面传递的以节点5作为中间节点的数据包,代表在生成树1上面传递的以节点5作为中间节点的数据包,代表在生成树1和生产树8上面以节点5作为源节点的数据包。q 2 =1 means that the queue length of the output port is at least 1, Represents the data packet passed on the spanning tree 8 with node 5 as the intermediate node, Represents the data packet passed on spanning tree 1 with node 5 as the intermediate node, and Represents data packets with node 5 as the source node on spanning tree 1 and spanning tree 8.

在路由单元提供的多个候选端口中,通常倾向选择非受限的端口,从而使得下一跳的端口拥有更多的缓存区数量。当有两个状态为非受限的端口时,通常选择端口所在节点度数较小的那个。因为选择度数较小的节点往往会带来更小的网络拥堵。当候选端口的数量仍多于1时,则在它们中间随机选择一个,因此本发明的选择逻辑也非常简单。Among the multiple candidate ports provided by the routing unit, it is generally preferred to select an unrestricted port, so that the next-hop port has more buffers. When there are two ports whose status is unrestricted, the one with the smaller degree of the node where the port is located is usually selected. Because choosing a node with a smaller degree tends to bring less network congestion. When the number of candidate ports is still more than 1, one of them is randomly selected, so the selection logic of the present invention is also very simple.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明技术原理的前提下,还可以做出若干改进和替换,这些改进和替换也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the technical principle of the present invention, some improvements and replacements can also be made, these improvements and replacements It should also be regarded as the protection scope of the present invention.

Claims (2)

1.一种基于多生成树的无死锁自适应路由方法,其特征在于,包括以下步骤:1. A deadlock-free adaptive routing method based on multiple spanning trees, characterized in that, comprising the following steps: S1、确定多生成树的各个根节点,并构造多生成树;S1. Determine each root node of the multiple spanning tree, and construct the multiple spanning tree; S2、将不同的源/目的网络通信节点对分配给不同的生成树,使不同的源/目的网络通信节点对通过不同的生成树传递数据;S2. Assign different source/destination network communication node pairs to different spanning trees, so that different source/destination network communication node pairs transmit data through different spanning trees; S3、打破通信网络拓扑图中的资源循环依赖,避免潜在的死锁;S3. Break the circular dependence of resources in the topology diagram of the communication network to avoid potential deadlocks; S4、在路由器中,使用路由和仲裁单元来代替路由表;S4. In the router, use the routing and arbitration unit to replace the routing table; S5、对所述路由器采用动态缓冲区分配策略;S5. Adopting a dynamic buffer allocation strategy for the router; 所述步骤S1进一步包括以下步骤:Said step S1 further comprises the following steps: S101、确定第一个根节点,使其余节点通过以其为根节点的生成树进行通信的平均距离最短,所述第一个根节点根据以下公式得到:S101. Determine the first root node, so that the average distance for other nodes to communicate through the spanning tree with it as the root node is the shortest, and the first root node is obtained according to the following formula: FRFR == minmin rr {{ ΣΣ uu ,, vv distdist rr (( uu ,, vv )) }} ,, 其中,distr(u,v)表示u节点和v节点在常规上/下路由方法中的距离;Among them, dist r (u, v) represents the distance between u node and v node in the conventional up/down routing method; S102、确定第二个根节点,使得通信网络拓扑中各个节点输入端口缓存区的循环依赖所涉及的节点数和所有节点间通信的距离之和都尽量最小,所述第二个根节点根据以下公式得到:S102. Determine the second root node so that the number of nodes involved in the cyclic dependency of the input port buffer of each node in the communication network topology and the sum of the communication distances between all nodes are as small as possible, and the second root node is based on the following The formula yields: SRSR == ΣΣ uu ,, vv ΔdistΔdist (( uu ,, vv )) ΣΣ cc sizesize (( cc )) ,, 其中,size(c)表示循环依赖中的节点数,∑csize(c)表示识别出的所有循环依赖所涉及的所有节点总数,∑u,vΔdist(u,v)表示新增根节点所带来的所有节点间缩短的通信距离的总和;Among them, size(c) indicates the number of nodes in the circular dependency, ∑ c size(c) indicates the total number of all nodes involved in all identified circular dependencies, ∑ u,v Δdist(u,v) indicates the number of new root nodes The sum of the shortened communication distances between all nodes brought about; S103、根据以下公式确定其余的根节点:S103. Determine the remaining root nodes according to the following formula: hh == ΣΣ uu ,, vv ΔdistΔdist (( uu ,, vv )) ΔTΔT ,, ΔTΔT == ΣΣ cc ∈∈ cc 22 sizesize (( cc )) -- ΣΣ cc ∈∈ cc 11 sizesize (( cc )) ,, 其中c1和c2是新生成树建立前和建立后网络中循环依赖所涉及的节点集合,Δdist(u,v)代表在新生成树建立后各个节点间减少的通信距离;Among them, c 1 and c 2 are the node sets involved in the cyclic dependency in the network before and after the establishment of the new spanning tree, and Δdist(u,v) represents the communication distance reduced between each node after the establishment of the new spanning tree; 所述步骤S3进一步包括以下步骤:Said step S3 further comprises the following steps: S301、在通信网络拓扑图中找到可能发生资源循环依赖的环;S301. Find a ring in the communication network topology diagram where resource circular dependency may occur; S302、在每个环中找到限制端口,当所述限制端口满足预定规则时,允许数据包通过其进行传递,当所述限制端口不满足预定规则时,不允许数据包通过其进行传递,其预定规则是下一跳端口有多余或者等于两个缓存区;S302. Find a restricted port in each ring. When the restricted port satisfies a predetermined rule, the data packet is allowed to pass through it. When the restricted port does not meet the predetermined rule, the data packet is not allowed to pass through it. The predetermined rule is that the next hop port is redundant or equal to two buffer areas; 根据以下的效益计量公式能够确定一个节点中的输入端口作为限制端口:The input port in a node can be determined as the limit port according to the following benefit measurement formula: mm (( vv ii )) == ΣΣ vv ii ∈∈ CC sizesize (( CC )) ,, 其中,节点v的输入端口i是循环依赖C中的限制端口,size(C)是循环依赖C的大小,选择上述效益计量值大的输入端口作为限制端口;Wherein, the input port i of node v is the limiting port in the circular dependency C, size(C) is the size of the circular dependency C, and the input port with the above-mentioned benefit measurement value is selected as the limiting port; S303、当两个输入端口的效益计量值相等时,选择度数小的节点中的输入端口作为限制端口;S303. When the benefit measurement values of the two input ports are equal, select the input port in the node with a small degree as the restricted port; S304、在选择出每一个限制端口后,每一个节点的每一个端口的效益计量值都要进行更新,即在打破的循环依赖中所包含的节点和这些节点中的输入端口的循环计量值都要减去循环依赖的大小;S304. After each restricted port is selected, the benefit measurement value of each port of each node must be updated, that is, the nodes contained in the broken circular dependency and the cycle measurement values of the input ports in these nodes are all to subtract the size of the circular dependency; S305、重复执行以上步骤,直到所有的循环依赖都被打破;S305. Repeat the above steps until all circular dependencies are broken; 所述步骤S4进一步包括以下步骤:Said step S4 further comprises the following steps: S401、将经过路由器某一个端口的数据包分成两类:其中一类是以该路由器为源节点的数据包;另一类是经过该路由器,以该路由器为中间节点的数据包;S401. Divide the data packets passing through a certain port of the router into two types: one type is the data packet with the router as the source node; the other type is the data packet with the router as the intermediate node through the router; S402、将以该路由器为源节点的数据包根据其具体传递所在的生成树分类,将以该路由器为源节点的数据包根据其具体传递所在的生成树分类的情况在路由方程中的表达为:表示生成树的标志位乘以所述数据包在该生成树中的各个目的节点的标志位之和,如果以该路由器为源节点的数据包经过该路由器的输出端口在该生成树中为限制端口,则还需乘以限制端口标志位;S402. Classify the data packet with the router as the source node according to the spanning tree where it is specifically delivered, and classify the data packet with the router as the source node according to the spanning tree where it is specifically delivered, expressed in the routing equation as: : Indicates that the flag bit of the spanning tree is multiplied by the sum of the flag bits of each destination node of the data packet in the spanning tree, if the data packet with the router as the source node passes through the output port of the router, the spanning tree If the port is restricted, it needs to be multiplied by the flag bit of the restricted port; S403、将以该路由器为中间节点的数据包根据到达该路由器的物理链路的状态分为两类:其中一类是经过状态为上的物理链路到达该路由器的数据包;另一类是经过状态为下的物理链路到达该路由器的数据包;S403. Divide the data packet with the router as an intermediate node into two types according to the state of the physical link arriving at the router: one of them is the data packet arriving at the router through the physical link whose state is up; the other is Data packets arriving at the router through the physical link in the state of Down; S404、将以该路由器为中间节点并且经过状态为上的物理链路到达该路由器的数据包根据其具体传递所在的生成树分类,将以该路由器为中间节点并且经过状态为上的物理链路到达该路由器的数据包根据其具体传递所在的生成树分类的情况在路由方程中的表达为:表示生成树的标志位乘以所述数据包在该生成树中的各个目的节点的标志位之和,如果以该路由器为中间节点并且经过状态为上的物理链路到达该路由器的数据包经过该路由器的输出端口在该生成树中为限制端口,则还需乘以限制端口标志位;S404. Classify the data packets that arrive at the router with the router as the intermediate node and through the physical link whose state is up according to the spanning tree where it is delivered, and classify the data packets that use the router as the intermediate node and pass through the physical link whose state is up The data packet arriving at the router is expressed in the routing equation according to the classification of the spanning tree where it is specifically delivered: the flag bit representing the spanning tree multiplied by the flag bit of each destination node of the data packet in the spanning tree And, if the data packet that takes the router as an intermediate node and arrives at the router through a physical link in the state is a restricted port in the spanning tree through the output port of the router, then it needs to be multiplied by the restricted port flag; S405、将以该路由器为中间节点并且经过状态为下的物理链路到达该路由器的数据包根据其具体传递所在的生成树分类,将以该路由器为中间节点并且经过状态为下的物理链路到达该路由器的数据包根据其具体传递所在的生成树分类的情况在路由方程中的表达为:表示生成树的标志位乘以上一跳标志位再乘以所述数据包在该生成树中的各个目的节点的标志位之和,如果以该路由器为中间节点并且经过状态为下的物理链路到达该路由器的数据包经过该路由器的输出端口在该生成树中为限制端口,则还需乘以限制端口标志位;S405. Classify the data packets that arrive at the router with the router as the intermediate node and through the physical link in the lower state according to the spanning tree where the specific delivery is located, and classify the data packets that use the router as the intermediate node and pass through the physical link in the lower state The data packet arriving at the router is expressed in the routing equation according to the classification of the spanning tree where it is specifically delivered: the flag bit representing the spanning tree is multiplied by the last hop flag bit and then multiplied by the data packet in the spanning tree. The sum of the flag bits of each destination node, if the data packet that takes the router as an intermediate node and reaches the router through the physical link in the lower state passes through the output port of the router and is a restricted port in the spanning tree, it needs to be multiplied by to limit the port flag; S406、将上述各个路由方程中的表达式相加再乘以下一跳空闲缓存区标志位,再乘以输出端口缓存区队列长度标志位取反;S406. Add the expressions in the above-mentioned routing equations, multiply the flag bit of the next hop free buffer area, and multiply by the output port buffer area queue length flag bit to invert; 所述步骤S5进一步包括以下步骤:Said step S5 further comprises the following steps: S501、将缓存区资源分为两类,一类是特定缓存区,另一类是中央缓存区;S501. Divide the cache area resources into two categories, one is a specific cache area, and the other is a central cache area; S502、将特定缓存区与某一个特定的输入端口绑定,使得每一个输入端口都有一个足以装下一个数据包的特定缓存区;S502. Bind a specific buffer area to a specific input port, so that each input port has a specific buffer area sufficient to hold a data packet; S503、中央缓存区能够分配给任何一个输入端口;S503, the central buffer area can be allocated to any input port; S504、每一个缓存区都设有一个用来标记其状态的标志位、一个用来标记其是否被申请占用的标志位、以及一个标记其是否已经被占用的标志位;S504. Each buffer area is provided with a flag bit for marking its status, a flag bit for marking whether it is occupied by an application, and a flag bit for marking whether it is already occupied; S505、为连接根节点和限制端口的输入端口分配更多的中央缓存区资源。S505. Allocate more resources of the central buffer area to the input port connected to the root node and the restricted port. 2.如权利要求1所述的方法,其特征在于,所述步骤S2进一步包括以下步骤:2. The method according to claim 1, wherein said step S2 further comprises the following steps: S201、将一组源/目的网络通信节点对分配给与其通信距离最短的一个生成树;S201. Assign a group of source/destination network communication node pairs to a spanning tree with the shortest communication distance therewith; S202、相同源节点、不同目的节点的网络通信节点对均衡分配给不同的生成树;S202. The network communication node pairs with the same source node and different destination nodes are allocated to different spanning trees in a balanced manner; S203、当一组源/目的网络通信节点对在多个生成树中的通信距离都为最小且相等时,将这组源/目的网络通信节点对分配给任意一个生成树。S203. When the communication distances of a group of source/destination network communication node pairs in multiple spanning trees are the smallest and equal, assign the group of source/destination network communication node pairs to any spanning tree.
CN201310017506.9A 2013-01-17 2013-01-17 Based on the adaptive routing method without dead of multiple spanning tree Expired - Fee Related CN103095588B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310017506.9A CN103095588B (en) 2013-01-17 2013-01-17 Based on the adaptive routing method without dead of multiple spanning tree

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310017506.9A CN103095588B (en) 2013-01-17 2013-01-17 Based on the adaptive routing method without dead of multiple spanning tree

Publications (2)

Publication Number Publication Date
CN103095588A CN103095588A (en) 2013-05-08
CN103095588B true CN103095588B (en) 2015-09-30

Family

ID=48207741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310017506.9A Expired - Fee Related CN103095588B (en) 2013-01-17 2013-01-17 Based on the adaptive routing method without dead of multiple spanning tree

Country Status (1)

Country Link
CN (1) CN103095588B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079490B (en) * 2014-06-27 2017-09-22 清华大学 Multi-level dragonfly interference networks and adaptive routing method
CN107870949B (en) * 2016-09-28 2021-09-07 腾讯科技(深圳)有限公司 Data analysis job dependency relationship generation method and system
CN109120537B (en) * 2017-06-23 2020-10-16 迈普通信技术股份有限公司 Multicast tree calculation method and device
CN116016330B (en) * 2023-01-03 2025-01-24 之江实验室 A data transmission method and device for non-direct connection topology network

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1754410A (en) * 2003-02-28 2006-03-29 思科技术公司 Industrial Ethernet switch
CN1820463A (en) * 2002-10-24 2006-08-16 思科技术公司 Large-scale layer 2 metropolitan area network
CN101247253A (en) * 2008-03-21 2008-08-20 清华大学 Multicast Transmission Method Based on Virtual Distribution Network in IP Network
CN101488922A (en) * 2009-01-08 2009-07-22 浙江大学 Network-on-chip router having adaptive routing capability and implementing method thereof
CN101834789A (en) * 2010-04-15 2010-09-15 南京大学 Fallback and Steering Routing Algorithm for Packet-Circuit-Switching On-Chip Router and the Router Used
CN102170402A (en) * 2011-05-31 2011-08-31 清华大学 A deadlock-free adaptive routing algorithm in a Torus network
EP1162788B1 (en) * 2000-06-09 2012-11-21 Broadcom Corporation Trunking and mirroring across stacked gigabit switches

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7830793B2 (en) * 2004-10-22 2010-11-09 Cisco Technology, Inc. Network device architecture for consolidating input/output and reducing latency

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1162788B1 (en) * 2000-06-09 2012-11-21 Broadcom Corporation Trunking and mirroring across stacked gigabit switches
CN1820463A (en) * 2002-10-24 2006-08-16 思科技术公司 Large-scale layer 2 metropolitan area network
CN1754410A (en) * 2003-02-28 2006-03-29 思科技术公司 Industrial Ethernet switch
CN101247253A (en) * 2008-03-21 2008-08-20 清华大学 Multicast Transmission Method Based on Virtual Distribution Network in IP Network
CN101488922A (en) * 2009-01-08 2009-07-22 浙江大学 Network-on-chip router having adaptive routing capability and implementing method thereof
CN101834789A (en) * 2010-04-15 2010-09-15 南京大学 Fallback and Steering Routing Algorithm for Packet-Circuit-Switching On-Chip Router and the Router Used
CN102170402A (en) * 2011-05-31 2011-08-31 清华大学 A deadlock-free adaptive routing algorithm in a Torus network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Adaptive bubble router: a design to improve performance in torus networks;Puente, V. 等;《Parallel Processing, 1999》;19990924;第58-67页 *
Multiple spanning tree construction for deadlock-free adaptive routing in irregular networks;D. Xiang and J. Han;《10th IEEE Int. Symp. On Parallel and Distributed Processing with Application》;20120713;第9-16页 *

Also Published As

Publication number Publication date
CN103095588A (en) 2013-05-08

Similar Documents

Publication Publication Date Title
JP6093867B2 (en) Non-uniform channel capacity in the interconnect
US9130856B2 (en) Creating multiple NoC layers for isolation or avoiding NoC traffic congestion
US8819616B2 (en) Asymmetric mesh NoC topologies
EP3186928B1 (en) Bandwidth-weighted equal cost multi-path routing
CN103095588B (en) Based on the adaptive routing method without dead of multiple spanning tree
US20140301241A1 (en) Multiple heterogeneous noc layers
CN102055675A (en) Multipath routing distribution method based on load equilibrium
CN107294852A (en) A kind of network route method using the scattered short path collection of topology
CN103036792A (en) Transmitting and scheduling method for maximizing minimal equity multiple data streams
CN101123576A (en) A Path Selection Method for Mobile Ad Hoc Networks Based on Bandwidth Constraint and Minimum Load
CN111245722A (en) SDN data center network flow forwarding method based on genetic algorithm
CN103825762B (en) A kind of Traffic grooming and differentiation importance degree guard method based on sub-clustering
CN105072032B (en) A kind of method and system of definite network-on-chip routed path
WO2014073188A1 (en) Semiconductor circuit bus system
TWI382715B (en) Traffic management method for performing traffic management in a mesh network, multi-radio node and computer readable medium
CN105072046B (en) A kind of delay-tolerant network congestion-preventing approach based on the forwarding of Token Control node concurrent data
WO2017101750A1 (en) Traffic engineering system and method for a communications network
CN103729332A (en) MoT (mesh-of-tree) structure based low-power-consumption NoC (network-on-chip) routing method
WO2016078071A1 (en) Communication system, control node and communication method
CN106804053A (en) Unicast routing method based on the selection of self adaptation attractor in a kind of mobile ad-hoc network
JP5212503B2 (en) COMMUNICATION CONTROL DEVICE, COMMUNICATION CONTROL METHOD, AND COMMUNICATION CONTROL PROGRAM
Raszhivin et al. Deterministic scheduling of SpaceWire data streams
US20180198682A1 (en) Strategies for NoC Construction Using Machine Learning
CN104243263B (en) A kind of on-line mixing mapping method of virtual network
CN114448873A (en) Traffic distribution method, system, device and medium based on link pricing strategy

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150930