• Aucun résultat trouvé

8 Thread control block

8.1 Finite state machine

An event which is "scheduled" by an action in an FSM must be passed immediately after the completion of the action.

The following variables are used in the FSM:

o Ni: number of unstalled incoming links o Hmax: largest incoming hop count

o Hout: hop count of the outgoing link for the current next hop o Hrec: hop count of the received thread

In the FSM, if Hmax=unknown, the value for (Hmax+1) becomes the value reserved for unknown hop count plus 1. For example, if

Hmax=unknown=255, the value (Hmax+1) becomes 256.

A TCB has three states; Null, Colored, and Transparent. When a TCB is in state Null, there is no outgoing link and Ni=0. The state Colored means that the node is extending a colored thread on the outgoing link for the current next hop. The state Transparent means that the node is the egress node or the outgoing link is transparent.

The flag value "1" represents the flag is set, "0" represents the flag is not set, and "*" means the flag value is either 1 or 0.

The FSM allows to have one transparent outgoing link on the old next hop and one colored outgoing link on the current next hop. However, it is not allowed to have a colored outgoing link on the old next hop.

State Null:

Event Action New state Recv thread

Flags CL LP NL

0 * * Do nothing. No change 1 0 * If the node is egress, start thread rewinding Transparent and change the color of the receiving link to

transparent.

Otherwise, extend the received thread without Colored changing color.

1 1 * Stall the received thread; if Hrec<unknown, No change schedule "Reset to unknown" event for the

detecting TCB.

Next hop If eligible-leaf, create a colored thread and Colored acquisition extend it.

Others Silently ignore the event. No change State Colored:

Event Action New state Recv thread

Flags CL LP NL

0 * * If Hmax+1<Hout<unknown, create a colored No change thread and extend it. Otherwise, do nothing.

1 0 * If Hmax<Hout, merge the received thread. No change Otherwise, extend the thread with (if NL=1)

or without (if NL=0) changing color.

1 1 * Stall the received thread.

If Ni=0 and the node is not an eligible leaf, Null initiate thread withdrawing.

If Ni>0 and Hrec<unknown, schedule "Reset to No change unknown" event for the detecting TCB.

Otherwise, do nothing. No change

Rewound Propagate thread rewinding to previous hops Transparent that are extending a colored thread; change

the colors stored in all incoming and outgoing links to transparent; if Hmax+1<Hout, extend transparent thread. Withdraw the thread on the outgoing link for which C-flag=0.

Withdrawn Remove the corresponding incoming link.

If Ni=0 and the node is not an eligible leaf, Null propagate thread withdrawing to all next hops.

Otherwise, if Hmax+1<Hout<unknown, create No change a colored thread and extend it.

Otherwise, do nothing. No change Next hop If there is already an outgoing link for the Transparent acquisition next hop, do nothing. (This case happens only

when the node retains the old path.)

Otherwise, create a colored thread and extend No change it.

Next hop If the outgoing link is transparent and the No change loss node is allowed to retain the link and the

next hop is alive, do nothing.

Otherwise, take the following actions.

Initiate thread withdrawing for the next hop;

if the node becomes a new egress, schedule "Rewound" event for this TCB.

If Ni=0, move to Null. Null Otherwise, do nothing. No change Reset to Create a colored thread of hop count unknown No change unknown and extend it.

Others Silently ignore the event. No change State Transparent:

Event Action New state Recv thread

Flags CL LP NL

0 * * If Hmax+1<Hout, extend a transparent thread. No change 1 0 * If the node is egress or if Hmax<Hout, change No change the color of the receiving link to transparent

and start thread rewinding.

Otherwise, extend the thread with (if NL=1) Colored or without (if NL=0) changing color.

Withdrawn Remove the corresponding incoming link.

If Ni=0 and the node is not an eligible leaf, Null propagate thread withdrawing to next hops.

Otherwise, if Hmax+1<Hout, create No change a transparent thread and extend it.

Otherwise, do nothing. No change Next hop Create a colored thread and extend it. Colored acquisition

Next hop If the node is allowed to retain the outgoing No change loss link and the next hop is alive, do nothing.

Otherwise, take the following actions.

Initiate thread withdrawing.

If Ni=0, move to Null. Null Otherwise, do nothing. No change Others Silently ignore the event. No change 9. Comparison with path-vector/diffusion method

o Whereas the size of the path-vector increases with the length of the LSP, the sizes of the threads are constant. Thus the size of messages used by the thread algorithm are unaffected by the network size or topology. In addition, the thread merging capability reduces the number of outstanding messages. These lead to improved scalability.

o In the thread algorithm, a node which is changing its next hop for a particular LSP must interact only with nodes that are between it and the LSP egress on the new path. In the

path-vector algorithm, however, it is necessary for the node to initiate a diffusion computation that involves nodes which do not lie between it and the LSP egress.

This characteristic makes the thread algorithm more robust. If a diffusion computation is used, misbehaving nodes which aren’t even in the path can delay the path setup. In the thread

algorithm, the only nodes which can delay the path setup are those nodes which are actually in the path.

o The thread algorithm is well suited for use with both the ordered downstream-on-demand allocation and ordered downstream allocation. The path-vector/diffusion algorithm, however, is tightly coupled with the ordered downstream allocation.

o The thread algorithm is retry-free, achieving quick path

(re)configuration. The diffusion algorithm tends to delay the path reconfiguration time, since a node at the route change point must to consult all its upstream nodes.

o In the thread algorithm, the node can continue to use the old path if there is an L3 loop on the new path, as in the

path-vector algorithm.

10. Security Considerations

The use of the procedures specified in this document does not have any security impact other than that which may generally be present in the use of any MPLS procedures.

11. Intellectual Property Considerations

Toshiba and/or Cisco may seek patent or other intellectual property protection for some of the technologies disclosed in this document.

If any standards arising from this document are or become protected by one or more patents assigned to Toshiba and/or Cisco, Toshiba and/or Cisco intend to disclose those patents and license them on reasonable and non-discriminatory terms.

12. Acknowledgments

We would like to thank Hiroshi Esaki, Bob Thomas, Eric Gray, and Joel Halpern for their comments.

13. Authors’ Addresses Yoshihiro Ohba

Toshiba Corporation

1, Komukai-Toshiba-cho, Saiwai-ku Kawasaki 210-8582, Japan

EMail: yoshihiro.ohba@toshiba.co.jp

Yasuhiro Katsube Toshiba Corporation

1, Toshiba-cho, Fuchu-shi, Tokyo, 183-8511, Japan

EMail: yasuhiro.katsube@toshiba.co.jp

Eric Rosen

Cisco Systems, Inc.

250 Apollo Drive Chelmsford, MA, 01824 EMail: erosen@cisco.com

Paul Doolan

Ennovate Networks 330 Codman Hill Rd Marlborough MA 01719

EMail: pdoolan@ennovatenetworks.com 14. References

[1] Callon, R., et al., "A Framework for Multiprotocol Label Switching", Work in Progress.

[2] Davie, B., Lawrence, J., McCloghrie, K., Rosen, E., Swallow, G., Rekhter, Y. and P. Doolan, "MPLS using LDP and ATM VC Switching", RFC 3035, January 2001.

[3] Rosen, E., et al., "A Proposed Architecture for MPLS", Work in Progress.

[4] Andersson, L., Doolan, P., Feldman, N., Fredette, A. and B.

Thomas, "LDP Specification", RFC 3036, January 2001.

Appendix A - Further discussion of the algorithm

The purpose of this appendix is to give a more informal and tutorial presentation of the algorithm, and to provide some of the motivation for it. For the precise specification of the algorithm, the FSM should be taken as authoritative.

As in the body of the document, we speak as if there is only one LSP;

otherwise we would always be saying "... of the same LSP". We also consider only the case where the algorithm is used for loop

prevention, rather than loop detection.

A.1. Loop Prevention the Brute Force Way

As a starting point, let’s consider an algorithm which we might call "loop prevention by brute force". In this algorithm, every path setup attempt must go all the way to the egress and back in order for the path to be setup. This algorithm is obviously loop-free, by virtue of the fact that the setup messages actually made it to the egress and back.

Consider, for example, an existing LSP B-C-D-E to egress node E. Now node A attempts to join the LSP. In this algorithm, A must send a message to B, B to C, C to D, D to E. Then messages are sent from E back to A. The final message, from B to A, contains a label binding, and A can now join the LSP, knowing that the path is loop-free.

Using our terminology, we say that A created a thread and extended it downstream. The thread reached the egress, and then rewound.

We needn’t assume, in the above example, that A is an ingress node.

It can be any node which acquires or changes its next hop for the LSP in question, and there may be nodes upstream of it which are also trying to join the LSP.

It is clear that if there is a loop, the thread never reaches the egress, so it does not rewind. What does happen? The path setup messages just keep traveling around the loop. If one keeps a hop count in them, one can ensure that they stop traveling around the loop when the hop count reaches a certain maximum value. That is, when one receives a path setup message with that the maximum hop count value, one doesn’t send a path setup message downstream.

How does one recover from this situation of a looping thread? In order for L3 routing to break the loop, some node in the loop MUST experience a next hop change. This node will withdraw the thread

from its old next hop, and extend a thread down its new next hop. If there is no longer a loop, this thread now reaches the egress, and gets rewound.

A.2. What’s Wrong with the Brute Force Method?

Consider this example:

A |

B--D--E |

C

If A and C both attempt to join the established B-D-E path, then B and D must keep state for both path setup attempts, the one from A and the one from C. That is, D must keep track of two threads, the A-thread and the C-thread. In general, there may be many more nodes upstream of B who are attempting to join the established path, and D would need to keep track of them all.

If VC merge is not being used, this isn’t actually so bad. Without VC merge, D really must support one LSP for each upstream node anyway. If VC merge is being used, however, supporting an LSP requires only that one keep state for each upstream link. It would be advantageous if the loop prevention technique also required that the amount of state kept by a node be proportional to the number of upstream links which thenode has, rather than to the number of nodes which are upstream in the LSP.

Another problem is that if there is a loop, the setup messages keep looping. Even though a thread has traversed some node twice, the node has no way to tell that a setup message it is currently receiving is part of the same thread as some setup message it received in the past.

Can we modify this brute force scheme to eliminate these two

problems? We can. To show how to do this, we introduce two notions:

thread hop count, and thread color.

A.3. Thread Hop Count

Suppose every link in an LSP tree is labeled with the number of hops you would traverse if you were to travel backwards (upstream) from that link to the leaf node which is furthest upstream of the link.

For example, the following tree would have its links labeled as follows:

1 2

A---B---C K | | |3 |1 | |

| 4 5 | 6 7 D---G---H---I---J |

|2 1 | E---F

Call these the "link hop counts".

Links AB, EF, KH are labeled one, because you can go only one hop upstream from these links. Links BC, and FD are labeled 2, because you can go 2 hops upstream from these links. Link DG is labeled 4, because it is possible to travel 4 hops upstream from this link, etc.

Note that at any node, the hop count associated with the downstream link is one more than the largest of the hop counts associated with the upstream links.

Let’s look at a way to maintain these hop counts.

In order to maintain the link hop counts, we need to carry hop counts in the path setup messages. For instance, a node which has no

upstream links would assign a hop count of 1 to its downstream link, and would store that value into the path setup messages it sends downstream. Once the value is stored in a path setup message, we may refer to it has a "thread hop count".

When a path setup message is received, the thread hop count is stored as the link hop count of the upstream link over which the message was received.

When a path setup message is sent downstream, the downstream link’s hop count (and the thread hop count) is set to be one more than the largest of the incoming link hop counts.

Suppose a node N has some incoming links and an outgoing link, with hop counts all set properly, and N now acquires a new incoming link.

If, and only if, the link hop count of the new incoming link is greater than that of all of the existing incoming links, the downstream link hop count must be changed. In this case, control messages must be sent downstream carrying the new, larger thread hop count.

If, on the other hand, N acquires a new incoming link with a link hop count that is less than or equal to the link hop count of all

existing incoming links, the downstream link hop count remains unchanged, and no messages need be sent downstream.

Suppose N loses the incoming link whose hop count was the largest of any of the incoming links. In this case, the downstream link hop count must be made smaller, and messages need to be sent downstream to indicate this.

Suppose we were not concerned with loop prevention, but only with the maintenance of the hop counts. Then we would adopt the following rules to be used by merge points:

A.3.1 When a new incoming thread is received, extend it downstream if and only if its hop count is the largest of all incoming threads.

A.3.2 Otherwise, rewind the thread.

A.3.3 An egress node would, of course, always rewind the thread.

A.4. Thread Color

Nodes create new threads as a result of next hop changes or next hop acquisitions. Let’s suppose that every time a thread is created by a node, the node assigns a unique "color" to it. This color is to be unique in both time and space: its encoding consists of an IP address of the node concatenated with a unique event identifier from a

numbering space maintained by the node. The path setup messages that the node sends downstream will contain this color. Also, when the node sends such a message downstream, it will remember the color, and this color becomes the color of the downstream link.

When a colored message is received, its color becomes the color of the incoming link. The thread which consists of messages of a certain color will be known as a thread of that color.

When a thread is rewound (and a path set up), the color is removed.

The links become transparent, and we will sometimes speak of an established LSP as being a "transparent thread".

Note that packets cannot be forwarded on a colored link, but only on a transparent link.

Note that if a thread loops, some node will see a message, over a particular incoming link, with a color that the node has already seen before. Either the node will have originated the thread of that color, or it will have a different incoming link which already has

that color. This fact can be used to prevent control messages from looping. However, the node would be required to remember the colors of all the threads passing through it which have not been rewound or withdrawn. (I.e., it would have to remember a color for each path setup in progress.)

A.5. The Relation between Color and Hop Count

By combining the color mechanism and the hop count mechanism, we can prevent loops without requiring any node to remember more than one color and one hop count per link for each LSP.

We have already stated that in order to maintain the hop counts, a node needs to extend only the thread which has the largest hop count of any incoming thread. Now we add the following rule:

A.5.1 When extending an incoming thread downstream, that thread’s color is also passed downstream (I.e., the downstream link’s color will be the same as the color of the upstream link with largest hop count.)

Note that at a given node, the downstream link is either transparent or it has one and only one color.

A.5.2 If a link changes color, there is no need to remember the old color.

We now define the concept of "thread merging":

A.5.2 Suppose a colored thread arrives at a node over an incoming link, the node already has an incoming thread with the same or larger hop count, and the node has an outgoing colored thread. In this case, we may say that the new incoming thread is "merged" into the outgoing thread.

Note that when an incoming thread is merged into an outgoing thread, no messages are sent downstream.

A.6. Detecting Thread Loops

It can now be shown that if there is a loop, there will always either be some node which gets two incoming threads of the same color, or the colored thread will return to its initiator. In this section, we give several examples that may provide an intuitive understanding of how the thread loops are detected.

1 2

A---B---C K | | |3 |1 | |

| 4 5 | 6 7 D---G---H---I---J |

|2 1 | E---F

Returning to our previous example, let’s set what would happen if H changed its next hop from I to E. H now creates a new thread, and assigns it a new color, say, red. Since H has two incoming link, with hop counts 1 and 5 respectively, it assigns hop count 6 to its new downstream link, and attempts a path setup through E.

E now has an incoming red thread with hop count 6. Since E’s downstream link hop count is now only 1, it must extend the red thread to F, with hop count 7. F then extends the red thread to D with hop count 8, D to G with hop count 9, and G to H with hop count

E now has an incoming red thread with hop count 6. Since E’s downstream link hop count is now only 1, it must extend the red thread to F, with hop count 7. F then extends the red thread to D with hop count 8, D to G with hop count 9, and G to H with hop count

Documents relatifs