]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ofed/management/opensm/doc/current-routing.txt
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ofed / management / opensm / doc / current-routing.txt
1 Current OpenSM Routing
2 7/9/07
3
4 OpenSM offers five routing engines:
5
6 1.  Min Hop Algorithm - based on the minimum hops to each node where the
7 path length is optimized.
8
9 2.  UPDN Unicast routing algorithm - also based on the minimum hops to each
10 node, but it is constrained to ranking rules. This algorithm should be chosen
11 if the subnet is not a pure Fat Tree, and deadlock may occur due to a
12 loop in the subnet.
13
14 3.  Fat-tree Unicast routing algorithm - this algorithm optimizes routing
15 of fat-trees for congestion-free "shift" communication pattern.
16 It should be chosen if a subnet is a symmetrical fat-tree.
17 Similar to UPDN routing, Fat-tree routing is credit-loop-free.
18
19 4. LASH unicast routing algorithm - uses Infiniband virtual layers
20 (SL) to provide deadlock-free shortest-path routing while also
21 distributing the paths between layers. LASH is an alternative
22 deadlock-free topology-agnostic routing algorithm to the non-minimal
23 UPDN algorithm avoiding the use of a potentially congested root node.
24
25 5. DOR Unicast routing algorithm - based on the Min Hop algorithm, but
26 avoids port equalization except for redundant links between the same
27 two switches.  This provides deadlock free routes for hypercubes when
28 the fabric is cabled as a hypercube and for meshes when cabled as a
29 mesh (see details below).
30
31 OpenSM provides an optional unicast routing cache (enabled by -A or
32 --ucast_cache options). When enabled, unicast routing cache prevents
33 routing recalculation (which is a heavy task in a large cluster) when
34 there was no topology change detected during the heavy sweep, or when
35 the topology change does not require new routing calculation, e.g. when
36 one or more CAs/RTRs/leaf switches going down, or one or more of these
37 nodes coming back after being down.
38 A very common case that is handled by the unicast routing cache is host
39 reboot, which otherwise would cause two full routing recalculations: one
40 when the host goes down, and the other when the host comes back online.
41
42 OpenSM also supports a file method which can load routes from a table. See
43 modular-routing.txt for more information on this.
44
45 The basic routing algorithm is comprised of two stages:
46 1. MinHop matrix calculation
47    How many hops are required to get from each port to each LID ?
48    The algorithm to fill these tables is different if you run standard
49 (min hop) or Up/Down.
50    For standard routing, a "relaxation" algorithm is used to propagate
51 min hop from every destination LID through neighbor switches
52    For Up/Down routing, a BFS from every target is used. The BFS tracks link
53 direction (up or down) and avoid steps that will perform up after a down
54 step was used.
55
56 2. Once MinHop matrices exist, each switch is visited and for each target LID,
57 a decision is made as to what port should be used to get to that LID.
58    This step is common to standard and Up/Down routing. Each port has a
59 counter counting the number of target LIDs going through it.
60    When there are multiple alternative ports with same MinHop to a LID,
61 the one with less previously assigned ports is selected.
62    If LMC > 0, more checks are added: Within each group of LIDs assigned to
63 same target port,
64    a. use only ports which have same MinHop
65    b. first prefer the ones that go to different systemImageGuid (then
66 the previous LID of the same LMC group)
67    c. if none - prefer those which go through another NodeGuid
68    d. fall back to the number of paths method (if all go to same node).
69
70
71 Effect of Topology Changes
72
73 OpenSM will preserve existing routing in any case where there is no change in
74 the fabric switches unless the -r (--reassign_lids) option is specified.
75
76 -r
77 --reassign_lids
78           This option causes OpenSM to reassign LIDs to all
79           end nodes. Specifying -r on a running subnet
80           may disrupt subnet traffic.
81           Without -r, OpenSM attempts to preserve existing
82           LID assignments resolving multiple use of same LID.
83
84 If a link is added or removed, OpenSM does not recalculate
85 the routes that do not have to change. A route has to change
86 if the port is no longer UP or no longer the MinHop. When routing changes
87 are performed, the same algorithm for balancing the routes is invoked.
88
89 In the case of using the file based routing, any topology changes are
90 currently ignored The 'file' routing engine just loads the LFTs from the file
91 specified, with no reaction to real topology. Obviously, this will not be able
92 to recheck LIDs (by GUID) for disconnected nodes, and LFTs for non-existent
93 switches will be skipped. Multicast is not affected by 'file' routing engine
94 (this uses min hop tables).
95
96
97 Min Hop Algorithm
98 -----------------
99
100 The Min Hop algorithm is invoked by default if no routing algorithm is
101 specified.  It can also be invoked by specifying '-R minhop'.
102
103 The Min Hop algorithm is divided into two stages: computation of
104 min-hop tables on every switch and LFT output port assignment. Link
105 subscription is also equalized with the ability to override based on
106 port GUID. The latter is supplied by:
107
108 -i <equalize-ignore-guids-file>
109 -ignore-guids <equalize-ignore-guids-file>
110           This option provides the means to define a set of ports
111           (by guids) that will be ignored by the link load
112           equalization algorithm.
113
114 LMC awareness routes based on (remote) system or switch basis.
115
116
117 UPDN Routing Algorithm
118 ----------------------
119
120 Purpose of UPDN Algorithm
121
122 The UPDN algorithm is designed to prevent deadlocks from occurring in loops
123 of the subnet. A loop-deadlock is a situation in which it is no longer
124 possible to send data between any two hosts connected through the loop. As
125 such, the UPDN routing algorithm should be used if the subnet is not a pure
126 Fat Tree, and one of its loops may experience a deadlock (due, for example,
127 to high pressure).
128
129 The UPDN algorithm is based on the following main stages:
130
131 1.  Auto-detect root nodes - based on the CA hop length from any switch in
132 the subnet, a statistical histogram is built for each switch (hop num vs
133 number of occurrences). If the histogram reflects a specific column (higher
134 than others) for a certain node, then it is marked as a root node. Since
135 the algorithm is statistical, it may not find any root nodes. The list of
136 the root nodes found by this auto-detect stage is used by the ranking
137 process stage.
138
139     Note 1: The user can override the node list manually.
140     Note 2: If this stage cannot find any root nodes, and the user did not
141             specify a guid list file, OpenSM defaults back to the Min Hop
142             routing algorithm.
143
144 2.  Ranking process - All root switch nodes (found in stage 1) are assigned
145 a rank of 0. Using the BFS algorithm, the rest of the switch nodes in the
146 subnet are ranked incrementally. This ranking aids in the process of enforcing
147 rules that ensure loop-free paths.
148
149 3.  Min Hop Table setting - after ranking is done, a BFS algorithm is run from
150 each (CA or switch) node in the subnet. During the BFS process, the FDB table
151 of each switch node traversed by BFS is updated, in reference to the starting
152 node, based on the ranking rules and guid values.
153
154 At the end of the process, the updated FDB tables ensure loop-free paths
155 through the subnet.
156
157 Note: Up/Down routing does not allow LID routing communication between
158 switches that are located inside spine "switch systems".
159 The reason is that there is no way to allow a LID route between them
160 that does not break the Up/Down rule.
161 One ramification of this is that you cannot run SM on switches other
162 than the leaf switches of the fabric.
163
164
165 UPDN Algorithm Usage
166
167 Activation through OpenSM
168
169 Use '-R updn' option (instead of old '-u') to activate the UPDN algorithm.
170 Use `-a <guid_list_file>' for adding an UPDN guid file that contains the
171 root nodes for ranking.
172 If the `-a' option is not used, OpenSM uses its auto-detect root nodes
173 algorithm.
174
175 Notes on the guid list file:
176 1.   A valid guid file specifies one guid in each line. Lines with an invalid
177 format will be discarded.
178 2.   The user should specify the root switch guids. However, it is also
179 possible to specify CA guids; OpenSM will use the guid of the switch (if
180 it exists) that connects the CA to the subnet as a root node.
181
182
183 To learn more about deadlock-free routing, see the article
184 "Deadlock Free Message Routing in Multiprocessor Interconnection Networks"
185 by William J Dally and Charles L Seitz (1985).
186
187
188 Fat-tree Routing Algorithm
189 --------------------------
190
191 Purpose:
192
193 The fat-tree algorithm optimizes routing for "shift" communication pattern.
194 It should be chosen if a subnet is a symmetrical or almost symmetrical
195 fat-tree of various types.
196 It supports not just K-ary-N-Trees, by handling for non-constant K,
197 cases where not all leafs (CAs) are present, any Constant
198 Bisectional Ratio (CBB) ratio.  As in UPDN, fat-tree also prevents
199 credit-loop-deadlocks.
200
201 If the root guid file is not provided ('-a' or '--root_guid_file' options),
202 the topology has to be pure fat-tree that complies with the following rules:
203   - Tree rank should be between two and eight (inclusively)
204   - Switches of the same rank should have the same number
205     of UP-going port groups*, unless they are root switches,
206     in which case the shouldn't have UP-going ports at all.
207   - Switches of the same rank should have the same number
208     of DOWN-going port groups, unless they are leaf switches.
209   - Switches of the same rank should have the same number
210     of ports in each UP-going port group.
211   - Switches of the same rank should have the same number
212     of ports in each DOWN-going port group.
213   - All the CAs have to be at the same tree level (rank).
214
215 If the root guid file is provided, the topology doesn't have to be pure
216 fat-tree, and it should only comply with the following rules:
217   - Tree rank should be between two and eight (inclusively)
218   - All the Compute Nodes** have to be at the same tree level (rank).
219     Note that non-compute node CAs are allowed here to be at different
220     tree ranks.
221
222 * ports that are connected to the same remote switch are referenced as
223 'port group'.
224 ** list of compute nodes (CNs) can be specified by '-u' or '--cn_guid_file'
225 OpenSM options.
226
227 Note that although fat-tree algorithm supports trees with non-integer CBB
228 ratio, the routing will not be as balanced as in case of integer CBB ratio.
229 In addition to this, although the algorithm allows leaf switches to have any
230 number of CAs, the closer the tree is to be fully populated, the more effective
231 the "shift" communication pattern will be.
232 In general, even if the root list is provided, the closer the topology to a
233 pure and symmetrical fat-tree, the more optimal the routing will be.
234
235 The algorithm also dumps compute node ordering file (opensm-ftree-ca-order.dump)
236 in the same directory where the OpenSM log resides. This ordering file provides
237 the CN order that may be used to create efficient communication pattern, that
238 will match the routing tables.
239
240
241 Usage:
242
243 Activation through OpenSM
244
245 Use '-R ftree' option to activate the fat-tree algorithm.
246
247 Note: LMC > 0 is not supported by fat-tree routing. If this is
248 specified, the default routing algorithm is invoked instead.
249
250
251 LASH Routing Algorithm
252 ----------------------
253
254 LASH is an acronym for LAyered SHortest Path Routing. It is a
255 deterministic shortest path routing algorithm that enables topology
256 agnostic deadlock-free routing within communication networks.
257
258 When computing the routing function, LASH analyzes the network
259 topology for the shortest-path routes between all pairs of sources /
260 destinations and groups these paths into virtual layers in such a way
261 as to avoid deadlock.
262
263 Note LASH analyzes routes and ensures deadlock freedom between switch
264 pairs. The link from HCA between and switch does not need virtual
265 layers as deadlock will not arise between switch and HCA.
266
267 In more detail, the algorithm works as follows:
268
269 1) LASH determines the shortest-path between all pairs of source /
270 destination switches. Note, LASH ensures the same SL is used for all
271 SRC/DST - DST/SRC pairs and there is no guarantee that the return
272 path for a given DST/SRC will be the reverse of the route SRC/DST.
273
274 2) LASH then begins an SL assignment process where a route is assigned
275 to a layer (SL) if the addition of that route does not cause deadlock
276 within that layer. This is achieved by maintaining and analysing a
277 channel dependency graph for each layer. Once the potential addition
278 of a path could lead to deadlock, LASH opens a new layer and continues
279 the process.
280
281 3) Once this stage has been completed, it is highly likely that the
282 first layers processed will contain more paths than the latter ones.
283 To better balance the use of layers, LASH moves paths from one layer
284 to another so that the number of paths in each layer averages out.
285
286 Note, the implementation of LASH in opensm attempts to use as few layers
287 as possible. This number can be less than the number of actual layers
288 available.
289
290 In general LASH is a very flexible algorithm. It can, for example,
291 reduce to Dimension Order Routing in certain topologies, it is topology
292 agnostic and fares well in the face of faults.
293
294 It has been shown that for both regular and irregular topologies, LASH
295 outperforms Up/Down. The reason for this is that LASH distributes the
296 traffic more evenly through a network, avoiding the bottleneck issues
297 related to a root node and always routes shortest-path.
298
299 The algorithm was developed by Simula Research Laboratory.
300
301 To learn more about LASH and the flexibility behind it, the requirement
302 for layers, performance comparisons to other algorithms, see the
303 following articles:
304
305 "Layered Routing in Irregular Networks", Lysne et al, IEEE
306 Transactions on Parallel and Distributed Systems, VOL.16, No12,
307 December 2005.
308
309 "Routing for the ASI Fabric Manager", Solheim et al. IEEE
310 Communications Magazine, Vol.44, No.7, July 2006.
311
312 "Layered Shortest Path (LASH) Routing in Irregular System Area
313 Networks", Skeie et al. IEEE Computer Society Communication
314 Architecture for Clusters 2002.
315
316
317 Use '-R lash -Q ' option to activate the LASH algorithm.
318
319 Note: QoS support has to be turned on in order that SL/VL mappings are
320 used.
321
322 Note: LMC > 0 is not supported by the LASH routing. If this is
323 specified, the default routing algorithm is invoked instead.
324
325
326 DOR Routing Algorithm
327 ---------------------
328
329 The Dimension Order Routing algorithm is based on the Min Hop
330 algorithm and so uses shortest paths.  Instead of spreading traffic
331 out across different paths with the same shortest distance, it chooses
332 among the available shortest paths based on an ordering of dimensions.
333 Each port must be consistently cabled to represent a hypercube
334 dimension or a mesh dimension.  Paths are grown from a destination
335 back to a source using the lowest dimension (port) of available paths
336 at each step.  This provides the ordering necessary to avoid deadlock.
337 When there are multiple links between any two switches, they still
338 represent only one dimension and traffic is balanced across them
339 unless port equalization is turned off.  In the case of hypercubes,
340 the same port must be used throughout the fabric to represent the
341 hypercube dimension and match on both ends of the cable.  In the case
342 of meshes, the dimension should consistently use the same pair of
343 ports, one port on one end of the cable, and the other port on the
344 other end, continuing along the mesh dimension.
345
346 Use '-R dor' option to activate the DOR algorithm.