Internet Draft MPLS Working Group Liwen Wu Internet Draft Pierrick Cheval Expiration Date: March 1999 Christophe Boscher Alcatel USA October 1998 LDP State Machine draft-wu-mpls-ldp-state-00.txt 0. Status of this Memo This document is an Internet-Draft. Internet-Drafts are working docu- ments of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working doc- uments as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress". To learn the current status of any Internet-Draft, please check the "1id- abstracts.txt" listing contained in the Internet-Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au (Pacific Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu (US West Coast). 1. Abstract In the current LDP draft [Ref5], there is no state machine specified for processing the hop-by-hop routed LDP messages. We think that defining a common state machine is very important for interoperability between different ldp implementations. This draft provides state machine tables for ATM switch LSRs. We begin in section 2 by defining a list of terminologies. Then in section 3, we propose the state machine tables for ATM switch LSRs. Finally, in section 4, we outline the possible future working items. Even though the state machines in this document are specific for ATM-LSR, they can be easily adapted for other types of LSRs. 2. Terminologies - LDP-REQUEST: LDP Label Request message Wu, Cheval, Boscher [Page 1] INTERNET DRAFT LDP State Machines October 1998 - LDP-MAPPING: LDP Label Mapping message - LDP-WITHDRAW: LDP Label Withdraw message - LDP-RELEASE: LDP Label Release message - LDP-NAK: LDP notifications which related to Label mapping. 3. State Machine This draft focuses on the LDP state machines and the associated control blocks. It does not describe the "LDP controller" which is in charge of LDP session initialization, address mapping messages management, routing interface, etc. In this draft, we provide two sets of state machines: one for the ATM LSR which does not have VC-merge capability, and the other one for the ATM LSR which does have VC-merge capability. The state machines cover both independent LSP control and ordered LSP control. As of today, there are two proposals for handling loop detection and loop prevention, path vector[Ref5] and color scheme[Ref6], but there has been no decision made on which one will be adopted as the standard option. So the impact of loop detection and loop prevention messages on a state machine is left for further study. 3.0 An LSR's Behavior in the Case of a Next Hop Change When there is a topology change and an LSR detects a new better next hop for an LSP, it may behave in 3 different ways: 1) It tries to do a "local repair". This means that it extends the LSP through the new next hop, releases the old path from this LSR forward and then splices into this newly extended LSP. 2) If the LSP is created with the "pinned" option, the LSR ignores the new next hop change, and the LSP stays unchanged. The LSR may decide to send an LDP-MAPPING which contains the attribute about this New Next Hop (NH) change. 3) The LSR may also decide to tear down the whole LSP ("global repair") in the case of next hop change. It sends an LDP-WITHDRAW message upstream and an LDP-RELEASE message downstream. 3.1. ATM Switch LSR with NO VC-merge Wu, Cheval, Boscher [Page 2] INTERNET DRAFT LDP State Machines October 1998 In an MPLS domain where some ATM LSRs do not have VC-merge capability, downstream-on-demand mode is required for these ATM LSRs[Ref1]. Also, "conservative label retention mode" is required in this case[Ref1]. 3.1.1 LSP Control Block For each LSP, an LSP_Control_Block is defined which may contain the following information: - Upstream Label Request ID(assigned by the upstream LSR) - Downstream Label Request ID (assigned by this LSR itself) - Upstream LDP Session Identifier - Downstream LDP Session Identifier - State - FEC - Upstream Label(assigned by this LSR) - Downstream Label(assigned by the downstream LSR) - New Next Hop(NH) Behavior Flag, which can be: -- "local repair" or -- "pinned" or -- "global repair"(which means tear down the whole LSP) - New NH Downstream LDP Session Identifier(used while waiting for the new next hop label) - New NH Downstream Label Request ID(used while waiting for the new next hop label) The following index combinations can be used to locate a unique LSP_Control_Block: - Downstream Label and Downstream LDP Session Identifier, or - Upstream Label and Upstream LDP Session Identifier, or - Upstream Label Request ID and Upstream LDP Session Identifier, or Wu, Cheval, Boscher [Page 3] INTERNET DRAFT LDP State Machines October 1998 - Downstream Label Request ID and Downstream LDP Session Identifier - New NH Downstream LDP Session Identifier and New NH Downstream Label Request ID 3.1.2 States This section describes the various states that are used in the state machine for the ATM non VC-merge LSR. -- IDLE This is the initial LSP state, when the LSP_Control_Block is created. -- RESPONSE_AWAITED This state means that the LSR has received an LDP-REQUEST from an upstream LSR, has processed the LDP-REQUEST, and has sent a new LDP- REQUEST towards a downstream LSR. And the LSR is waiting for the LDP-MAPPING message from the downstream LSR. -- ESTABLISHED This state means that the LSR has received the LDP-MAPPING message from the downstream LSR and the LSP is up and operational. -- NEW_NH_RETRY This is the state where an LSR waits for a retry timer to expire and then tries to establish an LSP through a new next hop. -- NEW_NH_RESPONSE_AWAITED This is the state where an LSR is in the middle of establishing a new LSP through a new next hop. It has sent an LDP-REQUEST towards the new next hop and is waiting for the LDP-MAPPING message. 3.1.3 Events -- LDP Request The LSR receives an LDP-REQUEST from an upstream LSR. -- LDP Mapping The LSR receives an LDP-MAPPING from a downstream LSR. Wu, Cheval, Boscher [Page 4] INTERNET DRAFT LDP State Machines October 1998 -- LDP Release The LSR receives an LDP-RELEASE from an upstream LSR. -- LDP Withdraw The LSR receives an LDP-WITHDRAW from a downstream LSR. -- Internal New NH The LSR detects there is a new next hop for a FEC. -- LDP Upstream Nak The LSR receives an LDP-NAK from an upstream LSR. -- LDP Downstream Nak The LSR receives an LDP-NAK from a downstream LSR. -- Internal Retry Timeout The LSP retry timer expires. -- Upstream Lost The LSR loses its LDP session with an upstream LDP peer. -- Downstream Lost The LSR loses its LDP session with a downstream LDP peer. Wu, Cheval, Boscher [Page 5] INTERNET DRAFT LDP State Machines October 1998 3.1.4 State Transitions +-------------------+ | | +-------->| IDLE |<--------------+ | | | | | +-------------------+ |(LDP Release) |(LDP Upstream Nak) | |(LDP Withdraw) |(LDP DownstreamNak)|(LDP Request) |(LDP Upstream Nak?) |(Downstream Lost) | |(LDP Downstream | | | Nak?) |(Upstream Lost) v |(Upstream Lost) | +-------------------+ |(Downstream Lost) | | | | +---------| RESPONSE_AWAITED | | | | | +-------------------+ | | | |(LDP Mapping) | | | v | +-------------------+ | | | | | ESTABLISHED |------------>--+ | |<--------------|---+ +-------------------+ | | | | | |(Internal New NH) | | | | | v | | +-------------------+ | | | | | | |NEW_NH_RETRY | | | | | | | +-------------------+ | | | | | |(Internal retry timeout) | | | ^ | v | | +-------------------+ | | | |------------>--+ | |NEW_NH_RESPONSE |-------------------+ | _AWAITED | (LDP Mapping) +-------------------+ 3.1.5 State Machine Wu, Cheval, Boscher [Page 6] INTERNET DRAFT LDP State Machines October 1998 3.1.5.1 State -- "IDLE" State: IDLE Event: LDP Request New States: Depends upon the action routine Actions: If this LSR is the LSP Egress or Proxy Egress [Ref2] Then: Choose an upstream label, connect this upstream label to the local IP forwarding module, allocate the resources, send the LDP-MAPPING message upstream with the upstream label, and go to the new state `ESTABLISHED'. else Obtain a next hop (or interface) with the FEC specified in the LDP-REQUEST message, propagate the LDP-REQUEST message towards the obtained next hop, and go to the new state `RESPONSE_AWAITED'. If the LSR uses the independent control mode[Ref2], choose an upstream label, connect this upstream label to the local IP forwarding module, and send an LDP-MAPPING message upstream with the upstream label. If unable to process the request for any reason, issue an LDP-NAK message to the sender with the appropriate error code and delete the control block. State: IDLE Event: LDP Mapping New State: IDLE Actions: Ignore the event. State: IDLE Event: LDP Release New State: IDLE Wu, Cheval, Boscher [Page 7] INTERNET DRAFT LDP State Machines October 1998 Actions: Ignore the event. State: IDLE Event: LDP Withdraw New State: IDLE Actions: Ignore the event. State: IDLE Event: Internal New NH New State: IDLE Actions: Ignore the event. State: IDLE Event: LDP Upstream Nak New State: IDLE Actions: Ignore the event. State: IDLE Event: LDP Downstream Nak New State: IDLE Actions: Ignore the event. State: IDLE Event: Internal Retry Timeout Wu, Cheval, Boscher [Page 8] INTERNET DRAFT LDP State Machines October 1998 New State: IDLE Actions: Ignore the event. State: IDLE Event: Upstream Lost New State: IDLE Actions: Ignore the event. State: IDLE Event: Downstream Lost New State: IDLE Actions: Ignore the event. 3.1.5.2 State -- "RESPONSE_AWAITED" State: RESPONSE_AWAITED Event: LDP Request New State: RESPONSE_AWAITED Actions: Ignore the event. State: RESPONSE_AWAITED Event: LDP Mapping New State: ESTABLISHED Actions: If the LSR uses the ordered control mode, choose an upstream label. Wu, Cheval, Boscher [Page 9] INTERNET DRAFT LDP State Machines October 1998 Connect the upstream label to the downstream label. Allocate the resources. Propagate the LDP-MAPPING message upstream with the upstream label. If unable to process the message, disconnect the upstream label from the downstream label, free the upstream label, release the resources, send an LDP-RELEASE message downstream and an LDP-Nak upstream, and delete the LSP_Control_Block. State: RESPONSE_AWAITED Event: LDP Release New State: IDLE Actions: If the LSR uses the independent control mode, free the upstream label. Send an LDP-NAK message downstream and delete the LSP_Control_Block. State: RESPONSE_AWAITED Event: LDP Withdraw New State: RESPONSE_AWAITED Actions: Ignore the event. State: RESPONSE_AWAITED Event: Internal New Next Hop New State: Depends on the action routine Actions: If the LSP is "pinned", ignore the event. If a "local repair" is desired, send an LDP-REQUEST to the new next hop, send an LDP-NAK to the old next hop and stay in 'RESPONSE_AWAITED' state. Wu, Cheval, Boscher [Page 10] INTERNET DRAFT LDP State Machines October 1998 If a "global repair" is desired: If the LSR uses the independent mode, send an LDP-WITHDRAW message upstream. If the LSR uses the ordered control mode, send an LDP-NAK message upstream. Send an LDP-NAK message downstream. Delete the control block. State: RESPONSE_AWAITED Event: LDP Upstream Nak New State: IDLE Actions: If the LSR uses the independent control mode, free the upstream label. Send an LDP-NAK message downstream. Delete the LSP_Control_Block. State: RESPONSE_AWAITED Event: LDP Downstream Nak New State: IDLE Actions: If the LSR uses the independent control mode, free the upstream label and send an LDP-WITHDRAW message upstream. If the LSR uses the ordered control mode, send an LDP-NAK message upstream. Then, delete the LSP_Control_Block. State: RESPONSE_AWAITED Event: Internal Retry Timeout New State: RESPONSE_AWAITED Wu, Cheval, Boscher [Page 11] INTERNET DRAFT LDP State Machines October 1998 Actions: Ignore the event. State: RESPONSE_AWAITED Event: Upstream Lost New State: IDLE Actions: If the LSR uses the independent control mode, free the upstream label. Send an LDP-NAK downstream and delete the LSP_Control_Block. State: RESPONSE_AWAITED Event: Downstream Lost New State: IDLE Actions: If the LSR uses the independent control mode, free the upstream label and send an LDP-WITHDRAW upstream. If the LSR uses the ordered control mode, send an LDP-NAK upstream. Delete the LSP_Control_Block. 3.1.5.3 State --"ESTABLISHED" State: ESTABLISHED Event: LDP Request New State: ESTABLISHED Actions: Ignore the event. State: ESTABLISHED Event: LDP Mapping Wu, Cheval, Boscher [Page 12] INTERNET DRAFT LDP State Machines October 1998 New State: ESTABLISHED Actions: Process the LDP-MAPPING message, which may contain the new attributes of the label mapping and then propagate the LDP-MAPPING message upstream. State: ESTABLISHED Event: LDP Release New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate the LDP-RELEASE message downstream and delete the LSP_Control_Block. State: ESTABLISHED Event: LDP Withdraw New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate the LDP-WITHDRAW message upstream and delete the LSP_Control_Block. State: ESTABLISHED Event: Internal New NH New State: Depend on the action routine Wu, Cheval, Boscher [Page 13] INTERNET DRAFT LDP State Machines October 1998 Actions: If the LSP is "pinned", ignore the event. Start the LSP retry timer and go to the 'NEW_NH_RETRY' state. State: ESTABLISHED Event: LDP Upstream Nak New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Propagate an LDP-RELEASE message downstream and delete the LSP_Control_Block. State: ESTABLISHED Event: LDP Downstream Nak New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-WITHDRAW message upstream and delete the LSP_Control_Block. State: ESTABLISHED Event: Internal Retry Timeout New State: ESTABLISHED Actions: Ignore the event. Wu, Cheval, Boscher [Page 14] INTERNET DRAFT LDP State Machines October 1998 State: ESTABLISHED Event: Upstream Lost New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-RELEASE message downstream and delete the LSP_Control_Block. State: ESTABLISHED Event: Downstream Lost New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-WITHDRAW message upstream and delete the LSP_Control_Block. 3.1.5.4 State -- "NEW_NH_RETRY" State: NEW_NH_RETRY Event: LDP Request New State: NEW_NH_RETRY Actions: Ignore the event. State: NEW_NH_RETRY Wu, Cheval, Boscher [Page 15] INTERNET DRAFT LDP State Machines October 1998 Event: LDP Mapping New State: NEW_NH_RETRY Actions: Process the LDP-MAPPING message, which may contain the new attributes of the label binding and then propagate the LDP-MAPPING message upstream. State: NEW_NH_RETRY Event: LDP Release New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-RELEASE message to the old downstream next hop LSR. Delete the LSP_Control_Block. State: NEW_NH_RETRY Event: LDP Withdraw New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-WITHDRAW message upstream. Delete the LSP_Control_Block. State: NEW_NH_RETRY Wu, Cheval, Boscher [Page 16] INTERNET DRAFT LDP State Machines October 1998 Event: Internal New NH New State: NEW_NH_RETRY Actions: Restart the LSP retry timer. State: NEW_NH_RETRY Event: LDP Upstream Nak New State: NEW_NH_RETRY Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-RELEASE message to the old downstream next hop LSR. Delete the LSP_Control_Block. State: NEW_NH_RETRY Event: LDP Downstream Nak New State: NEW_NH_RETRY Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-WITHDRAW message upstream. Delete the LSP_Control_Block. State: NEW_NH_RETRY Event: Internal Retry Timeout Wu, Cheval, Boscher [Page 17] INTERNET DRAFT LDP State Machines October 1998 New State: Depends on the action routine Actions: If the new next hop is the same one as the old next hop, go to the state 'ESTABLISHED'. Otherwise, if the new next hop is different than the old next hop: If a "local repair" is desired, send an LDP-REQUEST to the new next hop and go to the state 'NEW_NH_RESPONSE_AWAITED'. If a "global repair" is desired, send an LDP-WITHDRAW upstream and an LDP-RELEASE downstream, then delete the control block. State: NEW_NH_RETRY Event: Upstream Lost New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-RELEASE message to the old downstream next hop LSR. Delete the LSP_Control_Block. State: NEW_NH_RETRY Event: Downstream Lost New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-WITHDRAW message upstream. Wu, Cheval, Boscher [Page 18] INTERNET DRAFT LDP State Machines October 1998 Delete the LSP_Control_Block. 3.1.5.4 State -- "NEW_NH_RESPONSE_AWAITED" State: NEW_NH_RESPONSE_AWAITED Event: LDP Request New State: NEW_NH_RESPONSE_AWAITED Actions: Ignore the event. State: NEW_NH_RESPONSE_AWAITED Event: LDP Mapping New State: Depends on the action routine Actions: If the LDP-MAPPING message comes from the new next hop LSR: Connect the upstream label to the new next hop downstream label. Propagate the new LDP-MAPPING message upstream. Send an LDP-RELEASE to the old next hop LSR and go to the state 'ESTABLISHED'. If unable to process the message, send an LDP-NAK downstream, restart the LSP retry timer,and go to the state 'NEW_NH_RETRY'. If the LDP-MAPPING comes from the old next hop LSR, Process the LDP-MAPPING message. Propagate the LDP-MAPPING message upstream. State: NEW_NH_RESPONSE_AWAITED Event: LDP Release New State: IDLE Actions: Wu, Cheval, Boscher [Page 19] INTERNET DRAFT LDP State Machines October 1998 Disconnect the upstream label from the downstream label. Free the upstream label. Release the resources. Propagate an LDP-RELEASE message to the old next hop downstream LSR. Send an LDP-NAK to the new next hop downstream LSR. Delete the LSP_Control_Block. State: NEW_NH_RESPONSE_AWAITED Event: LDP Withdraw New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Propagate an LDP-WITHDRAW message upstream. Send an LDP-NAK to the new next hop downstream LSR. Delete the LSP_Control_Block. State: NEW_NH_RESPONSE_AWAITED Event: Internal New Next Hop New State: NEW_NH_RETRY Actions: To avoid route flapping, send an LDP-NAK to the previous new next hop LSR, restart the LSP retry timer, and go to the state 'NEW_NH_RETRY'. State: NEW_NH_RESPONSE_AWAITED Event: LDP Upstream Nak New State: IDLE Actions: Wu, Cheval, Boscher [Page 20] INTERNET DRAFT LDP State Machines October 1998 Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-RELEASE message to the old next hop downstream LSR. Send an LDP-NAK to the new next hop downstream LSR. Delete the LSP_Control_Block. State: NEW_NH_RESPONSE_AWAITED Event: LDP Downstream Nak New State: Depends on the action routine Actions: If the LDP-NAK comes from the old next hop LSR: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-WITHDRAW message upstream. Send an LDP-NAK to the new next hop downstream LSR. Delete the LSP_Control_Block. If the LDP-NAK comes from the new next hop LSR: restart the LSP retry timer, and go to the state 'NEW_NH_RETRY'. State: NEW_NH_RESPONSE_AWAITED Event: Internal Retry Timeout New State: NEW_NH_RESPONSE_AWAITED Actions: Ignore the event. Wu, Cheval, Boscher [Page 21] INTERNET DRAFT LDP State Machines October 1998 State: NEW_NH_RESPONSE_AWAITED Event: Upstream Lost New State: IDLE Actions: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-RELEASE message to the old next hop downstream LSR. Send an LDP-NAK to the new next hop downstream LSR. Delete the LSP_Control_Block. State: NEW_NH_RESPONSE_AWAITED Event: Downstream Lost New State: Depends on the action routine Actions: If the old next hop downstream LSR is lost: Disconnect the upstream label from the downstream label. Free the upstream label. Free the resources. Propagate an LDP-WITHDRAW message upstream. Send an LDP-NAK to the new next hop downstream LSR. Delete the LSP_Control_Block. If the new next hop downstream LSR is lost: Restart the LSP retry timer, and go to the state 'NEW_NH_RETRY'. 3.1.6 LDP Related Message Handling Wu, Cheval, Boscher [Page 22] INTERNET DRAFT LDP State Machines October 1998 - If an LSR receives an LDP-REQUEST from an upstream LSR: a) Create a new LSP_Control_Block, store the relevant information from the message into the control block, then pass the event `LDP Request' to its state machine. - If an LSR receives an LDP-MAPPING from a downstream LSR: a) Extract the LDP Request ID value from the LDP-MAPPING message. b) Find an LSP_Control_Block with the same Downstream Label Request ID and the same Downstream LDP Session Identifier, or with the same New NH Downstream Label Request ID and the same New NH Downstream LDP Session Identifier. c) If an LSP_Control_Block is found, pass the event `LDP Mapping' to its state machine. d) Otherwise, ignore the LDP-MAPPING message. - If an LSR receives an LDP-RELEASE from an upstream LSR: a) Find an LSP_Control_Block which has the same Upstream Label and the same Upstream LDP Session Identifier. b) If an LSP_Control_Block is found, pass the event 'LDP Release' to its state machine. c) Otherwise, ignore the message. - If an LSR receives an LDP-WITHDRAW from a downstream LSR: a) Find an LSP_Control_Block which has the same Downstream Label and the same Downstream LDP Session Identifier, or the same New NH Downstream Label Request ID and the same New NH Downstream LDP Session Identifier. b) If an LSP_Control_Block is found, pass the event 'LDP Withdraw' to its state machine. c) Otherwise, ignore the LDP-WITHDRAW message. - If an upstream LDP peer is lost: a) Find all the LSP_Control_Blocks whose upstream LDP peer is that LSR. Wu, Cheval, Boscher [Page 23] INTERNET DRAFT LDP State Machines October 1998 b) Then pass the event 'Upstream Lost' to their state machines. - If a downstream LDP peer is lost: a) Find all the LSP_Control_Blocks whose downstream LDP peer is that LSR. b) Then pass the event 'Downstream Lost' to their state machines. - If the LSR detects a new next hop for an FEC: a) Find all the LSP_Control_Blocks which are affected by this next hop change. b) Pass the event `Internal New NH' to their state machines. - If an LSR receives an LDP-NAK from an upstream LSR: a) Extract the LDP Request ID value from the LDP-NAK message. b) Find an LSP_Control_Block which has the same Upstream Label Request ID and the same Upstream LDP Session Identifier. c) If an LSP_Control_Block is found, pass the event 'LDP Upstream Nak' to its state machine. d) Otherwise, ignore the message. - If the LSR receives an LDP-NAK from a downstream LSR: a) Extract the LDP Request ID value from the LDP-NAK. b) Find an LSP_Control_Block which has the same Downstream Label Request ID and the same Downstream LDP Session Identifier, or the same New NH Downstream Label Request ID and the same Downstream LDP Session Identifier. c) If an LSP_Control_Block is found, pass the event d) Otherwise, ignore the message. - If an LSP retry timer expires: a) Pass the event 'Internal Retry Timeout' to its corresponding LSP_Control_Block. Wu, Cheval, Boscher [Page 24] INTERNET DRAFT LDP State Machines October 1998 3.2. ATM Switch LSR with VC-merge 3.2.1 VC-merge A VC-merge capable LSR can map multiple incoming labels(VPI/VCI) into one outgoing label. It is possible that this LSR can only merge a limited number of incoming labels into a single outgoing label. As described in [Ref2], suppose, for example, that due to some hardware limitation a node is capable of merging four incoming labels into a single outgoing label. Suppose however, that this particular node has six incoming labels arriving at it for a particular FEC. In this case, this node may merge these into two outgoing labels. When an upstream LSR has a limited merging capability, it is difficult for a downstream LSR to know how many labels should be assigned to each FEC. In this case, downstream-on-demand is recommended. 3.2.2 Control Block There are 2 types of control blocks involved: Upstream_LSP_Control_Block, Downstream_LSP_Control_Block. There is one Upstream_LSP_Control_Block for each LDP-REQUEST received. There is one Downstream_LSP_Control_Block for each unique LDP- REQUEST sent to a downstream LSR. There can be multiple Downstream_LSP_Control_Blocks per FEC in an LSR. This can be the result of an upstream LSR asking for a label of an FEC. This LSR must assign a unique upstream label and it can not merge this upstream label into an existing downstream label of this FEC. A Downstream_LSP_Control_Block contains a list of pointers to Upstream_LSP_Control_Blocks. This means that this LSR has decided to map the multiple labels listed in the Upstream_LSP_Control_Blocks into a single label listed in the Downstream_LSP_Control_Block. An Upstream_LSP_Control_Block may contain the following information: - Upstream LDP Session Identifier - State - Upstream Label(assigned by this LSR) - Downstream_LSP_Control_Block pointer Wu, Cheval, Boscher [Page 25] INTERNET DRAFT LDP State Machines October 1998 - Upstream LDP Request ID (assigned by the Upstream LSR in downstream-on-demand mode) - New Next Hop Behavior Flag, which can be: -- "local repair" or, -- "pinned" or, -- "global repair" - New Next Hop Downstream_LSP_Control_Block pointer Upstream Label and Upstream LDP Session Identifier can be used to locate a unique Upstream_LSP_Control_Block. If an LSR is using downstream-on-demand mode, it can use the Upstream LDP Request ID and the Upstream LDP Session Identifier to locate a unique Upstream_LSP_Control_Block. A Downstream_LSP_Control_Block may contain the following information: - FEC - State - Downstream LDP Session Identifier - list of pointers to the Upstream_LSP_Control_Blocks which are merged at this LSR for this FEC - Downstream Label(assigned by the downstream LSR) - Downstream Label Request ID (assigned by the LSR itself if it is using downstream-on-demand mode) Downstream Label, Downstream LDP Session Identifier can be used to locate a unique Downstream_LSP_Control_Block. If an LSR is using downstream-on-demand mode, it can also use the Downstream Label Request ID and the Downstream LDP Session Identifier to locate a unique Downstream_LSP_Control_Block. The following diagram details the relationship between these 2 types of control blocks: For example, the LSR has decided to merge 3 LDP-REQUESTs of a FEC from upstream LSR1,LSR2,LSR3 into one LDP-REQUEST and sent it to a downstream LSR4. Wu, Cheval, Boscher [Page 26] INTERNET DRAFT LDP State Machines October 1998 +---------------------+ | | | Upstream_LSP_Control| | _Block for Upstream|-------+ | LSR1 | | +---------------------+ | | | | | | +---------------------+ | | | | | Upstream_LSP_Control| | (merged into) | _Block for Upstream |-------+ | LSR2 | | +---------------------+ | | | | | +------------------------------+ | | | +-->| Downstream_LSP_Control_Block | | | for Downstream LSR4 | | | | | +------------------------------+ | +---------------------+ | | | | | Upstream_LSP_Control| | |_Block for Upstream |-------+ | LSR3 | +---------------------+ 3.2.3 State Machines for Downstream-on-demand Mode The following sections describe the state machines used in downstream-on-demand mode. 3.2.3.1 State of the Upstream_LSP_Control_Block's State Machine for Downstream-on-demand Mode -- IDLE This is the initial LSP state. -- RESPONSE_AWAITED Wu, Cheval, Boscher [Page 27] INTERNET DRAFT LDP State Machines October 1998 This state means that the LSR has received an LDP-REQUEST from an upstream LSR, has processed the LDP-REQUEST, and has sent a new LDP- REQUEST towards a downstream LSR. The LSR is waiting for the LDP- MAPPING message from the downstream LSR. -- ESTABLISHED This state means that the LSR has received the LDP-MAPPING message from the downstream LSR and the LSP is up and operational. -- NEW_NH_RETRY This is the state where an LSR waits for a retry timer to expire and then tries to reestablish an LSP through a new next hop. -- NEW_NH_RESPONSE_AWAITED This is the state where an LSR is in middle of extending the LSP through a new next hop. It has sent an LDP-REQUEST towards the new next hop and is waiting for the LDP-MAPPING message. 3.2.3.2 Events of the Upstream_LSP_Control_Block's State Machine for Downstream-on-demand Mode -- LDP Request The LSR receives an LDP-REQUEST from an upstream LSR. -- Internal Downstream Mapping This event is sent by one Downstream_LSP_Control_Block's state machine. This Downstream_LSP_Control_Block is the merged Downstream_LSP_Control_Block of this Upstream_LSP_Control_Block. The event is the result of receiving an LDP-MAPPING message by the Downstream_LSP_Control_Block's state machine. -- LDP Release The LSR receives an LDP-RELEASE from an upstream LSR. -- Internal Downstream Withdraw This event is sent by one Downstream_LSP_Control_Block's state machine. This Downstream_LSP_Control_Block is the merged Downstream_LSP_Control_Block of this Upstream_LSP_Control_Block. The event is the result of receiving an LDP-WITHDRAW message by the Downstream_LSP_Control_Block's state machine. Wu, Cheval, Boscher [Page 28] INTERNET DRAFT LDP State Machines October 1998 -- Internal New NH The LSR detects there is a new next hop for a FEC. -- LDP Upstream Nak The LSR receives an LDP-NAK from an upstream LSR. -- Internal Retry Timeout The LSP retry timer expires. -- Internal Downstream Nak This event is sent by one Downstream_LSP_Control_Block's state machine. This Downstream_LSP_Control_Block is the merged Downstream_LSP_Control_Block of this Upstream_LSP_Control_Block. The event is the result of receiving an LDP-NAK message by the Downstream_LSP_Control_Block's state machine, or it detects an error. -- Upstream Lost The LSR loses the LDP session with its upstream LDP peer. Wu, Cheval, Boscher [Page 29] INTERNET DRAFT LDP State Machines October 1998 3.2.3.3 State Transitions of the Upstream_LSP_Control_Block's State Machine for Downstream-on-demand Mode +-------------------+ | | +-------->| IDLE |<------------+ | | | | | +-------------------+ | |(LDP Upstream Nak)| | |(Internal |(LDP Request) | | Downstream Nak) | | |(Upstream Lost) | | | v | | +-------------------+ | | | | | +---------| RESPONSE_AWAITED | | | | |(Upstream Lost) +-------------------+ |(Internal Downstream | | Nak ??) |(Internal Downstream | | mapping) |(LDP Release) | |(Internal Downstream v | Withdraw) +-------------------+ | | | |(LDP Upstream Nak?) | ESTABLISHED |------->-----^ | |<--------- | +-------------------+ | | | | | |(Internal New NH) | | | | | v | | +-------------------+ | | | | | | | NEW_NH_RETRY |----->---|---^ | | | | +-------------------+ | | | | | |(Internal Retry | | | Timeout) | | | | | v | | +-------------------+ | | | |----->---|---^ |NEW_NH_RESPONSE |---------+ | _AWAITED | (LDP mapping) Wu, Cheval, Boscher [Page 30] INTERNET DRAFT LDP State Machines October 1998 +-------------------+ 3.2.3.4 Upstream_LSP_Control_Block's State Machine for Downstream-on-demand Mode 3.2.3.4.1 State -- "IDLE" State: IDLE Event: LDP Request New State: Depends upon the action routine. Actions: If this LSR is the LSP Egress or Proxy Egress [Ref2], choose an upstream label, allocate the resources, connect this upstream label to the local IP forwarding module, send an LDP-MAPPING upstream with the upstream label and go to the state 'ESTABLISHED'. Otherwise, choose a next hop. Find a Downstream_LSP_Control_Block which has the same FEC and the same next hop and also is able to merge more input labels. If not found, create a new Downstream_LSP_Control_Block with the state 'IDLE'. If the state of the Downstream_LSP_Control_Block is `ESTABLISHED', choose an upstream label, connect the upstream label with the downstream label and send an LDP-MAPPING message upstream with the upstream label, and go to the state `ESTABLISHED'. If the state of Downstream_LSP_Control_Block is not `ESTABLISHED', set the state of the Upstream_LSP_Control_Block to 'RESPONSE_AWAITED'. If the LSR use the independent control mode[Ref2], choose an upstream label, and send an LDP-MAPPING message upstream. Pass the event `Internal AddUpstream' to the Downstream_LSP_Control_Block's state machine. If unable to process the request for any reason, issue an LDP-NAK message to the sender with the appropriate error code and delete the control block. State: IDLE Event: Internal Downstream Mapping Wu, Cheval, Boscher [Page 31] INTERNET DRAFT LDP State Machines October 1998 New State: IDLE Actions: Ignore the event. State: IDLE Event: LDP Release New State: IDLE Actions: Ignore the event. State: IDLE Event: Internal Downstream Withdraw New State: IDLE Actions: Ignore the event. State: IDLE Event: Internal New NH New State: IDLE Actions: Ignore the event. State: IDLE Event: LDP Upstream Nak New State: IDLE Actions: Ignore the event. State: IDLE Wu, Cheval, Boscher [Page 32] INTERNET DRAFT LDP State Machines October 1998 Event: Internal Retry Timeout New State: IDLE Actions: Ignore the event. State: IDLE Event: Internal Downstream Nak New State: IDLE Actions: Ignore the event State: IDLE Event: Upstream Lost New State: IDLE Actions: Ignore the event. 3.2.3.4.2 State -- "RESPONSE_AWAITED" State: RESPONSE_AWAITED Event: LDP Request New State: RESPONSE_AWAITED Actions: Ignore the event. State: RESPONSE_AWAITED Event: Internal Downstream Mapping New State: Depends on the action routine Wu, Cheval, Boscher [Page 33] INTERNET DRAFT LDP State Machines October 1998 Actions: If the LSR uses the ordered control mode, assign an upstream label. Connect the upstream label to the downstream label and allocate the resources. Send an LDP-MAPPING message upstream with the upstream label. Then go to the state 'ESTABLISHED'. If unable to process the message for any reason, issue an LDP-NAK message upstream and an LDP-RELEASE message downstream and delete the control block. State: RESPONSE_AWAITED Event: LDP Release New State: IDLE Actions If the LSR uses the independent control mode, release the upstream label and other resources. Send the event "DeleteUpstream" to the state machine of its Downstream_LSP_Control_Block. State: RESPONSE_AWAITED Event: Internal Downstream Withdraw New State: IDLE Actions Ignore the event. State: RESPONSE_AWAITED Event: Internal New NH New State: Depends on the action routine Actions Wu, Cheval, Boscher [Page 34] INTERNET DRAFT LDP State Machines October 1998 If the LSP is "pinned", ignore the event. If a "local repair" is desired, send an LDP-REQUEST to the new next hop, send an LDP-NAK to the old next hop and stay in 'RESPONSE_AWAITED' state. Otherwise, if a "global repair" is desired, send an LDP-RELEASE downstream. Pass the event `Internal DeleteUpstream' to the state machine of its Downstream_LSP_Control_Block. Then delete the control block. State: RESPONSE_AWAITED Event: LDP Upstream Nak New State: IDLE Actions If the LSR uses the independent control mode, free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to its Downstream_LSP_Control_Block's state machine. Delete the control block. State: RESPONSE_AWAITED Event: Internal Retry Timeout New State: RESPONSE_AWAITED Actions Ignore the event. State: RESPONSE_AWAITED Event: Internal Downstream Nak New State: IDLE Actions: If the LSR uses the independent control mode, free the upstream label and the resources. Then, send an LDP-WITHDRAW message upstream. Wu, Cheval, Boscher [Page 35] INTERNET DRAFT LDP State Machines October 1998 If the LSR uses the ordered control mode, propagate the LDP-NAK message upstream. Delete the control block. State: RESPONSE_AWAITED Event: Upstream Lost New State: IDLE Actions If the LSR uses the independent control mode, free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to its Downstream_LSP_Control_Block's state machine. Delete the control block. 3.2.3.4.3 State -- "ESTABLISHED" State: ESTABLISHED Event: LDP Request New State: ESTABLISHED Actions Ignore the event. State: ESTABLISHED Event: Internal Downstream Mapping New State: ESTABLISHED Actions Process the new attributes of the mapping and then propagate the LDP-MAPPING message upstream. State: ESTABLISHED Event: LDP Release Wu, Cheval, Boscher [Page 36] INTERNET DRAFT LDP State Machines October 1998 New State: IDLE Actions Disconnect the upstream label from the downstream label, free the upstream label and resources. Send the event 'Internal DeleteUpstream' to its Downstream_LSP_Control_Block's state machine. Delete the control block. State: ESTABLISHED Event: Internal Downstream Withdraw New State: IDLE Actions Disconnect the upstream label from the downstream label, free the upstream label and resources. Propagate the LDP-WITHDRAW upstream. Delete the control block. State: ESTABLISHED Event: Internal New NH New State: Depends on the action routine Actions If the LSP is "pinned", ignore the event. Otherwise, start the LSP retry timer and go to the state 'NEW_NH_RETRY'. State: ESTABLISHED Event: LDP Upstream Nak New State: IDLE Actions Wu, Cheval, Boscher [Page 37] INTERNET DRAFT LDP State Machines October 1998 Disconnect the upstream label from the downstream label, free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to its Downstream_LSP_Control_Block's state machine. Delete the control block. State: ESTABLISHED Event: Internal Retry Timeout New State: IDLE Actions Ignore the event. State: ESTABLISHED Event: Internal Downstream Nak New State: IDLE Actions: Disconnect the upstream label from the downstream label, free the upstream label and the resources. Send an LDP-WITHDRAW upstream. Delete the control block. State: ESTABLISHED Event: Upstream Lost New State: IDLE Actions: Disconnect the upstream label from the downstream label, free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to its Downstream_LSP_Control_Block's state machine. Delete the control block. Wu, Cheval, Boscher [Page 38] INTERNET DRAFT LDP State Machines October 1998 3.2.3.4.1 State -- "NEW_NH_RETRY" State: NEW_NH_RETRY Event: LDP Request New State: NEW_NH_RETRY Actions Ignore the event. State: NEW_NH_RETRY Event: Internal Downstream Mapping New State: NEW_NH_RETRY Actions Process the new attributes of the mapping and then propagate the LDP-MAPPING message upstream. State: NEW_NH_RETRY Event: LDP Release New State: IDLE Actions Disconnect the upstream label from the downstream label, free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to its old next hop's Downstream_LSP_Control_Block's state machine. Delete the control block. State: NEW_NH_RETRY Event: Internal Downstream Withdraw New State: IDLE Actions Wu, Cheval, Boscher [Page 39] INTERNET DRAFT LDP State Machines October 1998 Disconnect the upstream label from the downstream label, free the upstream label and the resources. Delete the control block. State: NEW_NH_RETRY Event: Internal New NH New State: NEW_NH_RETRY Actions Ignore the event. State: NEW_NH_RETRY Event: LDP Upstream NAK New State: IDLE Actions Disconnect the upstream label from the downstream label, free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to its old(actual) next hop's Downstream_LSP_Control_Block's state machine. Delete the control block. State: NEW_NH_RETRY Event: Internal Retry Timeout New State: NEW_NH_RESPONSE_AWAITED Actions If a "local repair" is desired: Choose a next hop. Find a Downstream_LSP_Control_Block which has the same FEC and the same next hop and which is able to merge more input labels. If not found, create a new Downstream_LSP_Control_Block and set its state to 'IDLE'. If the state of the Downstream_LSP_Control_Block is `ESTABLISHED', Wu, Cheval, Boscher [Page 40] INTERNET DRAFT LDP State Machines October 1998 connect the old upstream lable with the new downstream label, send an LDP-RELEASE message to the old next hop downstream LSR and go to the State `ESTABLISHED. Otherwise, go to the State 'NEW_NH_RESPONSE_AWAITED'. Pass the event `Internal AddUpstream' to the new next hop's Downstream_LSP_Control_Block's state machine. Set the new next hop Downstream_LSP_Control_Block pointer with the correct value. If a "global repair" is desired: Send an LDP-WITHDRAW message upstream and an LDP-RELEASE message downstream. Delete the control block. State: NEW_NH_RETRY Event: Internal Downstream Nak New State: IDLE Actions: Disconnect the upstream label from the downstream label, free the upstream label and the resources. Delete the control block. State: NEW_NH_RETRY Event: Upstream Lost New State: IDLE Actions Disconnect the upstream label from the downstream label, free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to its old next hop's Downstream_LSP_Control_Block's state machine. Delete the control block. Wu, Cheval, Boscher [Page 41] INTERNET DRAFT LDP State Machines October 1998 3.2.3.4.1 State -- "NEW_NH_RESPONSE_AWAITED" State: NEW_NH_RESPONSE_AWAITED Event: LDP Request New State: NEW_NH_RESPONSE_AWAITED Actions: Ignore the event. State: NEW_NH_RESPONSE_AWAITED Event: Internal Downstream Mapping New State: ESTABLISHED Actions: If the LDP-MAPPING comes from the new next hop LSR, then: Connect the old upstream label to the new downstream label. Send the LDP-MAPPING message upstream. Send the event 'Internal DeleteUpstream' to its old next hop's Downstream_LSP_Control_Block's state machine. Set the Downstream_LSP_Control_Block pointer to the new next hop's Downstream_LSP_Control_Block. else if the LDP-MAPPING message comes from the old next hop LSR: Process the new attributes of the LDP-MAPPING message. Propagate the LDP-MAPPING upstream State: NEW_NH_RESPONSE_AWAITED Event: LDP Release New State: IDLE Actions Wu, Cheval, Boscher [Page 42] INTERNET DRAFT LDP State Machines October 1998 Disconnect the upstream label from the downstream label and free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to both old and new next hop's Downstream_LSP_Control_Block's state machine. Delete the control block. State: NEW_NH_RESPONSE_AWAITED Event: Internal Downstream Withdraw New State: IDLE Actions If the LDP-WITHDRAW messages comes from the old next hop LSR: Disconnect the upstream label from the downstream label and free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to both the new next hop's Downstream_LSP_Control_Block's state machine Delete the control block. If the LDP-WITHDRAW messages comes from the new next hop LSR: Restart the LSP retry timer, and go to the state 'NEW_NH_RETRY'. State: NEW_NH_RESPONSE_AWAITED Event: Internal New NH New State: NEW_NH_RETRY Actions Send the event 'Internal DeleteUpstream' to its new next hop's Downstream_LSP_Control_Block's state machine. Retart the LSP retry timer and go to the state 'NEW_NH_RETRY' State: NEW_NH_RESPONSE_AWAITED Event: LDP Upstream Nak Wu, Cheval, Boscher [Page 43] INTERNET DRAFT LDP State Machines October 1998 New State: IDLE Actions Disconnect the upstream label from the downstream label and free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to both old and new next hop's Downstream_LSP_Control_Block's state machine. Delete the control block. State: NEW_NH_RESPONSE_AWAITED Event: Internal retry timeout New State: NEW_NH_RESPONSE_AWAITED Actions Ignore the event. State: NEW_NH_RESPONSE_AWAITED Event: Internal Downstream Nak New State: Depends on the action routine Actions: If the message is caused by the old next hop LSR: Disconnect the upstream label from the downstream label and free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to both old and new next hop's Downstream_LSP_Control_Block's state machine. Delete the control block. If the message is caused by the new next hop LSR: Restart the LSP retry timer, and go to the state 'NEW_NH_RETRY'. State: NEW_NH_RESPONSE_AWAITED Event: Upstream Lost Wu, Cheval, Boscher [Page 44] INTERNET DRAFT LDP State Machines October 1998 New State: IDLE Actions Disconnect the upstream label from the downstream label and free the upstream label and the resources. Send the event 'Internal DeleteUpstream' to both old and new next hop's Downstream_LSP_Control_Block's state machine. Delete the control block. 3.2.3.5 State of the Downstream_LSP_Control_Block's State Machine for Downstream-on-demand Mode -- IDLE This is the initial LSP state. -- RESPONSE_AWAITED This state means that the LSR has received an LDP-REQUEST from an upstream LSR, has processed the LDP-REQUEST, and has sent a new LDP- REQUEST towards a downstream LSR. The LSR is waiting for the LDP- MAPPING message from the downstream LSR. -- ESTABLISHED This state means that the LSR has received the LDP-MAPPING message from the downstream LSR and the LSP is up and operational. 3.2.3.6 Events of the Downstream_LSP_Control_Block's State Machine for Downstream-on-demand Mode -- Internal AddUpstream This event is sent by an Upstream_LSP_Control_Block's state machine when it is created. -- Internal DeleteUpstream This event is sent by an Upstream_LSP_Control_Block's state machine when it is deleted. -- LDP Mapping Wu, Cheval, Boscher [Page 45] INTERNET DRAFT LDP State Machines October 1998 The LSR receives an LDP-MAPPING message from a downstream LSR. -- LDP Withdraw The LSR receives an LDP-WITHDRAW message from a downstream LSR. -- LDP Downstream Nak The LSR receives an LDP-NAK from a downstream LSR. -- Downstream Lost The LSR loses the LDP session with its downstream LSR. Wu, Cheval, Boscher [Page 46] INTERNET DRAFT LDP State Machines October 1998 3.2.3.7 State Transitions of the Downstream_LSP_Control_Block'S State Machine for Downstream-on-demand mode +-------------------+ | | | IDLE |<--------------+ | | |(last Internal +-------------------+ | DeleteUpstream) | |(LDP Withdraw) |(1st Internal AddUpstream)| | |(LDP Downstream v | Nak) +-------------------+ |(Downstream | | | Lost) | RESPONSE_AWAITED |---------->----^ | | | +-------------------+ | | | |(LDP Mapping) | | | v | +-------------------+ | | | | | ESTABLISHED |-------->------^ | | +-------------------+ 3.2.3.8 Downstream_LSP_Control_Block'S State Machine for Downstream-on-demand Mode. 3.2.3.8.1 State -- "IDLE" State: IDLE Event: Internal AddUpstream New State: RESPONSE_AWAITED Actions Initialize the list of pointers in the Upstream_LSP_Control_Block to contain the newly added upstream pointer. Send a new LDP-REQUEST downstream and go to the state 'RESPONSE_AWAITED'. Wu, Cheval, Boscher [Page 47] INTERNET DRAFT LDP State Machines October 1998 State: IDLE Event: Internal DeleteUpstream New State: IDLE Actions Ignore the event. State: IDLE Event: LDP Mapping New State: IDLE Actions Ignore the event. State: IDLE Event: LDP Withdraw New State: IDLE Actions Ignore the event. State: IDLE Event: LDP Downstream Nak New State: IDLE Actions Ignore the event. State: IDLE Event: Downstream Lost New State: IDLE Actions Wu, Cheval, Boscher [Page 48] INTERNET DRAFT LDP State Machines October 1998 Ignore the event. 3.2.3.8.2 State -- "RESPONSE_AWAITED" State: RESPONSE_AWAITED Event: Internal AddUpstream New State: RESPONSE_AWAITED Actions Add the pointer to new Upstream_LSP_Control_Block to the Upstream_LSP_Control_Blocks pointer list. State: RESPONSE_AWAITED Event: Internal DeleteUpstream New State: Depend on the action routine Actions Delete the Upstream_LSP_Control_Block pointer from the Upstream_LSP_Control_Block pointers list. If the list becomes empty, release the resources, send an LDP-NAK downstream, and then delete the control block. State: RESPONSE_AWAITED Event: LDP Mapping New State: ESTABLISHED Actions For each Upstream_LSP_Control_Block in the Upstream_LSP_Control_Block pointers list, pass the event 'Internal Downstream Mapping' to its state machine. State: RESPONSE_AWAITED Event: LDP Withdraw New State: RESPONSE_AWAITED Actions Wu, Cheval, Boscher [Page 49] INTERNET DRAFT LDP State Machines October 1998 Ignore the event. State: RESPONSE_AWAITED Event: LDP Downstream Nak New State: IDLE Actions For each Upstream_LSP_Control_Block in the Upstream_LSP_Control_Block pointers list, pass the event 'Internal Downstream Nak' to its state machine. Release the resources, and delete the control block. State: RESPONSE_AWAITED Event: Downstream Lost New State: IDLE Actions For each Upstream_LSP_Control_Block in the Upstream_LSP_Control_Block pointers list, pass the event 'Internal Downstream Nak' to its state machine. Release the resources, and delete the control block. 3.2.3.8.3 State -- "ESTABLISHED" State: ESTABLISHED Event: Internal AddUpstream New State: ESTABLISHED Actions Add the pointer to new Upstream_LSP_Control_Block to the Upstream_LSP_Control_Block pointers list. State: ESTABLISHED Event: Internal DeleteUpstream New State: Depends on the action routine Wu, Cheval, Boscher [Page 50] INTERNET DRAFT LDP State Machines October 1998 Actions Delete the pointer of Upstream_LSP_Control_Block from its Upstream_LSP_Control_Block pointers list. If the list becomes empty, release the resources, send an LDP-RELEASE downstream, and then delete the control block. State: ESTABLISHED Event: LDP Mapping New State: ESTABLISHED Actions For each Upstream_LSP_Control_Block in the Upstream_LSP_Control_Block pointers list, pass the event 'Internal Downstream mapping' to its state machine. State: ESTABLISHED Event: LDP Withdraw New State: IDLE Actions For each Upstream_LSP_Control_Block in the Upstream_LSP_Control_Block pointers list, pass the event 'Internal Downstream withdraw' to its state machine. Release the resources, and delete the control block. State: ESTABLISHED Event: LDP Downstream Nak New State: IDLE Actions For each Upstream_LSP_Control_Block in the Upstream_LSP_Control_Block pointers list, pass the event 'Internal Downstream Nak' to its state machine. Release the resources, and delete the control block. Wu, Cheval, Boscher [Page 51] INTERNET DRAFT LDP State Machines October 1998 3.2.4 Downstream The following sections describe the state machines for the ATM-LSR which uses downstream mode. While both independent LSP control and ordered LSP control modes are possible, only the ordered mode is taken into account, because the independant LSP control mode uses the liberal label retention mode and so is considered burning too many ATM resources. 3.2.4.1 States of the Upstream_LSP_Control_Block's State Machine for Downstream Mode -- IDLE This is the initial LSP state. -- ESTABLISHED This state means that the LSR has received the LDP-MAPPING message from the downstream LSR and the LSP is up and operational. 3.2.4.2 Events of the Upstream_LSP_Control_Block's State Machine for Downstream Mode -- Internal Downstream Mapping This event is sent by one Downstream_LSP_Control_Block's state machine. This Downstream_LSP_Control_Block is the merged Downstream_LSP_Control_Block of this Upstream_LSP_Control_Block. The event is the result of receiving an LDP-MAPPING message by the Downstream_LSP_Control_Block's state machine. -- LDP Release The LSR receives an LDP-RELEASE from an upstream LSR. -- Internal Downstream Withdraw This event is sent by one Downstream_LSP_Control_Block's state machine. This Downstream_LSP_Control_Block is the merged Downstream_LSP_Control_Block of this Upstream_LSP_Control_Block. The event is the result of receiving an LDP-WITHDRAW message by the Downstream_LSP_Control_Block's state machine. Wu, Cheval, Boscher [Page 52] INTERNET DRAFT LDP State Machines October 1998 3.2.4.3 State Transitions of Upstream_LSP_Control_Block's State Machine for Downstream Mode +-------------------+ | | | IDLE |<--------------+ | | | +-------------------+ | | |(LDP Release) | |(LDP Downstream | | Withdraw) | | |(Internal Downstream | | Mapping) | | | v | +-------------------+ | | | | | ESTABLISHED |---------------+ | | +-------------------+ 3.2.4.4 Upstream_LSP_Control_Block's State Machine for Downstream Mode 3.2.4.4.1 : State -- "IDLE" State: IDLE Event: Internal Downstream mapping New State: ESTABLISHED Actions Choose an upstream label, connect the upstream label with the downstream label. Propagate the LDP-MAPPING upstream. State: IDLE Event: LDP Release New State: IDLE Wu, Cheval, Boscher [Page 53] INTERNET DRAFT LDP State Machines October 1998 Actions Ignore the event. State: IDLE Event: Internal Downstream Withdraw New State: IDLE Actions Ignore the event. 3.2.4.4.2 : State -- "ESTABLISHED" State: ESTABLISHED Event: Internal Downstream Mapping New State: ESTABLISHED Actions Process the new attributes of the new mapping msg. Propagate the LDP-MAPPING upstream. State: ESTABLISHED Event: LDP Release New State: IDLE Actions Disconnect upstream label from downstream label. Get Downstream_LSP_control_block from UPstream_LSP_control_block, pass the event `Internal DeleteUpstream' to its state machine. State: ESTABLISHED Event: Internal Downstream Withdraw New State: IDLE Actions Wu, Cheval, Boscher [Page 54] INTERNET DRAFT LDP State Machines October 1998 Disconnect upstream label from downstream label. Propagate the LDP-WITHDRAW upstream. Delete the control block. 3.2.4.5 State of the Downstream_LSP_Control_Block's State Machine for Downstream Mode -- IDLE This is the initial LSP state. -- ESTABLISHED This state means that the LSR has received the LDP-MAPPING msg from the downstream LSR and the LSP is up and operational. 3.2.4.6 Events of the Downstream_LSP_Control_Block's State Machine for Downstream Mode -- Internal DeleteUpstream This event is sent by an Upstream_LSP_Control_Block's state machine when it is created. -- LDP Mapping The LSR receives an LDP-MAPPING msg from a downstream LSR. -- LDP Withdraw The LSR receives an LDP-WITHDRAW msg from a downstream LSR. -- Internal New NH The LSR detects there is a new next hop for an FEC. Wu, Cheval, Boscher [Page 55] INTERNET DRAFT LDP State Machines October 1998 3.2.4.7 State Transitions of Downstream_LSP_Control_Block's State Machine for Downstream Mode +-------------------+ | | | IDLE |<--------------+ | | | +-------------------+ |(last Internal | | DeleteUpstream) | |(LDP Withdraw) | |(Internal New NH) | | | (LDP Mapping) | | | v | +-------------------+ | | | | | ESTABLISHED |---------------+ | | +-------------------+ 3.2.4.8 Downstream_LSP_Control_Block's State Machine for Downstream Mode 3.2.4.8.1 : State -- "IDLE" State: IDLE Event: Internal DeleteUpstream New State: IDLE Actions Ignore the event. State: IDLE Event: LDP mapping New State: ESTABLISHED Actions For all the LDP peers except the downstream LSR which assigned the label, create an Upstream_LSP_Control_Block, chain them together into the Upstream_LSP_Control_Block pointer list of the Wu, Cheval, Boscher [Page 56] INTERNET DRAFT LDP State Machines October 1998 Downstream_LSP_Control_Block and pass the event `Internal Downstream Mapping' to each of the Upstream_LSP_Control_Block's state machines. State: IDLE Event: LDP withdraw New State: IDLE Actions ignore the event. State: IDLE Event: Internal New NH New State: IDLE Actions ignore the event. 3.2.4.8.1 : State -- "ESTABLISHED" State: ESTABLISHED Event: Internal DeleteUpstream New State: depend on the action routine Actions Delete the Upstream LSP_control_block from the Upstream_LSP_control_block pointer list. If the list becomes empty, propagate LDP-RELEASE to downstream LSR and delete the control block. State: ESTABLISHED Event: LDP mapping New State: ESTABLISHED Actions For each Upstream_LSP_control_block in UPstream_LSP_control_block pointer list, pass event `Internal downstream mapping' to its state Wu, Cheval, Boscher [Page 57] INTERNET DRAFT LDP State Machines October 1998 machine. State: ESTABLISHED Event: LDP withdraw New State: IDLE Actions For each Upstream_LSP_control_block in UPstream_LSP_control_block pointer list, pass event `Internal downstream Withdraw' to its state machine. delete the control block. State: ESTABLISHED Event: Internal New NH New State: IDLE Actions For each Upstream_LSP_control_block in UPstream_LSP_control_block pointer list, pass event `Internal downstream Withdraw' to its state machine. Send LDP-REQUEST to downstream LSR (RequestWhenNeeded behavior). delete control block. 3.2.5 LDP Related Message Processing - If an LSR receives an LDP-REQUEST message: If the LSR uses the downstream mode, ignore the message. If the LSR uses the downstream-on-demand, create a new Upstream_LSP_Control_Block. Then pass the event `LDP Request' to this Upstream_LSP_Control_Block's state machine. - If an LSR receives an LDP-MAPPING message: Locate a Downstream_LSP_Control_Block which has the same FEC, the same Downstream LDP Session Identifier and the same Downstream Label. If a Downstream_LSP_Control_Block is found, pass the event `LDP Mapping' to its state table. This could mean that the attributes of Wu, Cheval, Boscher [Page 58] INTERNET DRAFT LDP State Machines October 1998 label binding have changed. Otherwise, if it is downstream mode, and if there is no matching Downstream_LSP_Control_Block found, and the downstream LSR is the next hop of the FEC listed in the LDP-MAPPING message (ordered mode), create a new Downstream_LSP_Control_Block and pass the event `LDP Mapping' to its state machine. If it is downstream-on-demand mode, use the Downstream LDP request ID and Downstream LDP Session Identifier to locate the Downstream_LSP_Control_Block and pass the event `LDP Mapping' to its state machine. If no Downstream_LSP_Control_Block is found, ignore the message. - If an LSR receives an LDP-RELEASE message: Locate an Upstream_LSP_Control_Block which has the same FEC, the same Upstream Label, the same Upstream LDP Session Identifier. If no Upstream_LSP_Control_Block is found, ignore the message. If an Upstream_LSP_Control_Block is found, send the event `LDP Release' to its state machine. - If an LSR receives an LDP-WITHDRAW message: Find a Downstream_LSP_Control_Block which has the same FEC, the same Downstream LDP Session Identifier and the same Downstream Label. Pass the event `LDP Withdraw' to its state machines. - If an Upstream LDP peer is lost: Pass the event `Upstream Lost' to the state machines of all the Upstream_LSP_Control_Blocks whose upstream LDP peer is that LSR. - If a Downstream LDP peer is lost: Pass the event `Downstream Lost' to the state machines of all the Downstream_LSP_Control_Blocks whose the downstream LDP peer is that LSR. - If a next hop of an FEC is changed: If it is downstream mode, find all the Downstream_LSP_Control_Blocks which has the same FEC and the same next hop and pass the event `Internal New NH' to their state machine If it is downstream-on-demand mode, find all the Upstream_LSP_Control_Blocks which are infected by this change, pass Wu, Cheval, Boscher [Page 59] INTERNET DRAFT LDP State Machines October 1998 the event 'Internal New NH' to their state machines. - If an LSR receives an LDP-NAK from an Upstream LSR: If it is downstream mode, ignore the msg. An LDP-NAK should never appear in the downstream-mode LSR If it is downstream-on-demand mode, use the Upstream LDP Request ID and Upstream LDP Session Identifier to locate the Upstream_LSP_Control_Block and pass the event `LDP Upstream Nak' to its state machine. - If an LSR receives an LDP-NAK from a downstream LSR: If it is using downstream mode, ignore the msg. If it is downstream-on-demand mode, use the Downstream LDP Request ID and Downstream Session Identifier to locate a Downstream_LSP_control_block and pass the event `LDP Downstream Nak' to its state machine. 4. The Possible Future Works The following is a list of items that might need to be worked on in the future: 1)Throughout the state machines in this document, the action 'ignore the event' needs to be further classified whether it is 1) a protocol error, or 2) an internal implementation error, or 3) other for interworking purpose. 2)In the Downstream-on-Demand and Ordered LSP Control mode, some timers may be needed to protect the lost of LDP messages. For example, if an LSR has sent an LDP-REQUEST downstream, but the LDP- MAPPING is lost (??is it possible) on its way back, in this case, the LSR may want to use a timer to recover from this situation. 3)Once the LSP is operational, whether the LSR can receive an LDP-NAK message is also debatable. 4)In this draft, for the VC-merge case, the LDP-REQUEST message only goes up to the merge point. Whether the LDP-REQUEST need to go all the way to the egress and back in order for the path to be setup (brute force way) is debatable. Wu, Cheval, Boscher [Page 60] INTERNET DRAFT LDP State Machines October 1998 5. Security Considerations Security considerations will be addressed in a future revision of this document. 6. Acknowledgements The authors would like to acknowledge the helpful comments and suggestions of the following people: Mary Sue Mangan, Steve Silverman, Gerard Gobillard. 7. Authors's Address Liwen Wu Alcatel 44983 Knoll Square Ashburn, VA. 20147 U.S.A Phone: 703-724-2619 Email:liwen.wu@adn.alcatel.com Pierrick Cheval Alcatel 44983 Knoll Square Ashburn, VA. 20147 U.S.A Phone: 703-724-2080 Email: pierrick.cheval@adn.alcatel.com Christophe Boscher Alcatel CIT Le Mail 44700 Nantes-Orvault France Phone: (33) 251781828 Email: christophe.boscher@or.cit.alcatel.fr 8. References 1."Use of Label Switching With ATM", Bruce Davie, Jeremy Lawrence, Keith McCloghrie, Yokov Rekhter, Eric Rosen, George Swallow, Paul Doolan, work in progress, Internet Draft, <draft-davie-mpls-atm-01.txt> 2."Multiprotocol Label Switching Architecture", Eric C Rosen, Arun Viswanathan, Ross Callon, work in progress, Internet Draft,3."Definition of Managed Objects for the Multiprotocol Label Switching, Label Distribution Protocol (LDP)", Joan Cucchiara, Hans Sjostrand, James V. Luciani, work in progress, Internet Draft, 4."Requirements for Traffic Engineering Over MPLS", Daniel O.Awduche, Joe Malcolm, Johnson Agogbua, Mike O'Dell, Jim McMaus, work in progress,Internet Draft, <draft-awduche-mpls-traffic-eng-00.txt> 5. "LDP Specification", Loa Andersson, Paul Doolan,Nancy Feldman, Andre Fredette, Bob Thomas, work in progress, Internet Draft, 6. "MPLS Loop Prevention Mechanism", Yoshihiro Ohba, Yasuhiro Katsube, Eric Rosen, Paul Doolan, work in progress, Internet Draft, Wu, Cheval, Boscher [Page 62]