<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2328 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2328.xml">
<!ENTITY RFC5340 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5340.xml">
<!ENTITY RFC6987 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6987.xml">
<!ENTITY RFC4203 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4203.xml">
<!ENTITY RFC4915 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4915.xml">
<!ENTITY RFC7684 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7684.xml">
<!ENTITY RFC8042 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8042.xml">
<!ENTITY RFC7752 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7752.xml">
<!ENTITY RFC6845 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6845.xml">
<!ENTITY RFC4577 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4577.xml">
<!ENTITY RFC5817 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5817.xml">
<!ENTITY RFC5329 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5329.xml">
<!ENTITY RFC4552 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4552.xml">
<!ENTITY RFC3630 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3630.xml">
]>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-ospf-link-overload-15" ipr="trust200902">
<front>
<title abbrev="OSPF graceful link shutdown"> OSPF Graceful Link shutdown</title>
<author initials="S." surname="Hegde" fullname="Shraddha Hegde">
<organization>Juniper Networks, Inc.</organization>
<address>
<postal>
<street>Embassy Business Park</street>
<city>Bangalore</city>
<region>KA</region>
<code>560093</code>
<country>India</country>
</postal>
<email>shraddha@juniper.net</email>
</address>
</author>
<author initials="P." surname="Sarkar" fullname="Pushpasis Sarkar">
<organization>Arrcus, Inc.</organization>
<address>
<postal>
<street></street>
<city></city>
<region></region>
<code></code>
<country></country>
</postal>
<email>pushpasis.ietf@gmail.com</email>
</address>
</author>
<author fullname="Hannes Gredler" initials="H." surname="Gredler">
<organization>Individual</organization>
<address>
<postal>
<street></street>
<city></city>
<region></region>
<code></code>
<country></country>
</postal>
<email>hannes@gredler.at</email>
</address>
</author>
<author fullname="Mohan Nanduri" initials="M." surname="Nanduri">
<organization>ebay Corporation</organization>
<address>
<postal>
<street>2025 Hamilton Avenue</street>
<city>San Jose</city>
<region>CA</region>
<code>98052</code>
<country>US</country>
</postal>
<email>mnanduri@ebay.com</email>
</address>
</author>
<author fullname="Luay Jalil" initials="L." surname="Jalil">
<organization>Verizon</organization>
<address>
<postal>
<street></street>
<city></city>
<region></region>
<code></code>
<country></country>
</postal>
<email>luay.jalil@verizon.com</email>
</address>
</author>
<date year="2018"/>
<area>Routing</area>
<workgroup>Open Shortest Path First IGP</workgroup>
<keyword>MPLS</keyword>
<keyword>IGP</keyword>
<keyword>OSPF</keyword>
<abstract>
<t> When a link is being prepared to be taken out of service, the traffic needs to be diverted from both ends of the link.
 Increasing the metric to the highest value on one side of the link
is not sufficient to divert the traffic flowing in the other direction.</t> 

<t>It is useful for the routers in an OSPFv2 or OSPFv3 routing domain to be able to
advertise a  link as being in a graceful-shutdown state to indicate impending maintenance activity on the link.
This information can be used by the network devices to re-route the traffic effectively.
 </t>
<t>This document describes the protocol extensions to disseminate
graceful-link-shutdown information in OSPFv2 and OSPFv3.</t>
</abstract>
<note title="Requirements Language">
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in <xref target="RFC2119">RFC 2119</xref>.</t>
</note>
</front>
<middle>

<section title="Introduction" anchor='intro'>

<t>When a node is being prepared for a planned maintenance or upgrade, 
<xref target="RFC6987"/> provides mechanisms to advertise the 
node being in a graceful-shutdown state by setting all outgoing link costs to MaxLinkMetric (0xffff). These procedures
are specific to the maintenance activity on a node and cannot be used when a single  link on a node
requires maintenance. </t>

<t>  In traffic-engineering deployments, 
LSPs need to be diverted from the link without disrupting the services.
<xref target="RFC5817"/> describes requirements and procedures for graceful shutdown of MPLS links.
It is useful to be able to advertise the impending maintenance
activity on the link and to have LSP re-routing policies at the ingress to route the LSPs away from the link. </t>

<t>Many OSPFv2 or OSPFv3 deployments run on overlay networks provisioned by means of pseudo-wires or L2-circuits.
Prior to devices in the underlying network going offline for maintenance, it is useful to
divert the traffic away from the node before the maintenance is actually performed. Since the nodes in the underlying network are not visible to OSPF,
the existing stub router mechanism described in <xref target="RFC6987"/> cannot be used. In a service provider's network, there may be many
CE-to-CE connections that run over a single PE. It is cumbersome to change the metric on every CE-to-CE connection in both directions. This document provides a mechanism
to change the metric  of the link on remote side and also use the link as a last-resort-link if no alternate paths are available.
 An application specific to this use case is described in detail in <xref target="Pseudowire_services"/>.</t>
 
 <t> The procedures described in this draft may be used to divert the traffic away from the link in scenarios other than 
link-shutdown or link-replacement activity.</t> 

 <t>
This document provides mechanisms to advertise graceful-link-shutdown state in the flexible encodings provided by
OSPFv2 Prefix/Link Attribute Advertisement <xref target="RFC7684"/> and E-Router-LSA <xref target="I-D.ietf-ospf-ospfv3-lsa-extend"/> fr OSPFv3.
Throughout this document, OSPF is used when the text applies to both
OSPFv2 and OSPFv3.  OSPFv2 or OSPFv3 is used when the text is
specific to one version of the OSPF protocol.
</t>
</section>

<section title="Motivation" anchor='Motivation'>

<t>The motivation of this document is to reduce manual intervention during maintenance activities.
The following objectives help to accomplish this in a range of deployment scenarios.</t>
<t>
<list style="numbers">
<t> Advertise impending maintenance activity so that traffic from both directions 
can be diverted away from the link.</t>
<t> Allow the solution to be backward compatible so that nodes that do not understand the new advertisement, do not
    cause routing loops.</t>
<t> Advertise the maintenance activity to other nodes in the network so that LSP ingress routers/controllers can learn about the impending
    maintenance activity and apply specific policies to re-route the LSPs for traffic-engineering based deployments.</t>
<t> Allow the link to be used as a last resort link to prevent traffic disruption when alternate paths are not available.</t>

</list>
</t>
</section>

<section title='Flooding Scope'>
<t>The graceful-link-shutdown information is flooded in area-scoped Extended Link Opaque LSA <xref target='RFC7684'/> for OSPFv2 and E-Router-LSA for OSPFv3
  <xref target="I-D.ietf-ospf-ospfv3-lsa-extend"/>.
   The Graceful-Link-Shutdown sub-TLV MAY be processed by the head-end nodes or the controller as described in the
 <xref target="applications"/>. The procedures for processing the Graceful-Link-Shutdown sub-TLV are described in <xref target="procedures"/>.
 </t>

</section>

<section title='Protocol Extensions' anchor='protocol-sub-tlvs'>

<section title='OSPFv2 graceful-link-shutdown sub-TLV'>
<t> The Graceful-Link-Shutdown sub-TLV  identifies the link as being gracefully shutdown. It is advertised in extended Link TLV  of the Extended Link Opaque LSA as defined in 
<xref target='RFC7684'/>.

<vspace blankLines="2" />
<figure anchor="OSPFv2-graceful-link-shutdown-sub-TLV" title="Graceful-Link-Shutdown sub-TLV for OSPFv2">
<artwork>
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              Type             |             Length            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     

</artwork>
</figure>
<vspace blankLines="1" />

Type : TBA (suggested value 7)
<vspace blankLines="1" />
Length: 0
<vspace blankLines="1" />

<vspace blankLines="1" />
</t>
</section>

<section title='Remote IPv4 Address Sub-TLV' anchor='remote-ipv4-addr'>


<t>This sub-TLV specifies the IPv4 address of remote endpoint on the link. It is advertised in the Extended Link TLV as defined in 
<xref target='RFC7684'/>. This sub-TLV is optional and MAY be advertised in an area-scoped Extended Link Opaque LSA
to identify the link when there are multiple parallel links between two nodes. 

<vspace blankLines="2" />
<figure anchor="remote-ipv4-addr-sub-tlv" title="Remote IPv4 Address Sub-TLV">
<artwork>
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              Type             |             Length            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                     Remote IPv4 address                       |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

</artwork>
</figure>
<vspace blankLines="1" />

Type : TBA (suggested value 8)
<vspace blankLines="1" />
Length: 4
<vspace blankLines="1" />
Value: Remote IPv4 address. The remote IPv4 address is used to identify the particular link on remote side when there are
       multiple parallel links between two nodes.
<vspace blankLines="1" />
</t>
</section>

<section title='Local/Remote Interface ID Sub-TLV' anchor='local-remote-interface-id'>


<t>This sub-TLV specifies local and remote interface identifiers. It is advertised in the Extended Link TLV as defined in 
<xref target='RFC7684'/>. This sub-TLV is optional and MAY be advertised in an area-scoped Extended Link Opaque LSA
to identify the link when there are multiple parallel unnumbered links between two nodes. 
The local interface-id is generally readily available.
One of the mechanisms to obtain remote interface-id is described in <xref target='RFC4203'/>.

<vspace blankLines="2" />
<figure anchor="local-remote-interface-id-sub-tlv" title="Local/Remote Interface ID Sub-TLV">
<artwork>
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              Type             |             Length            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                     Local Interface ID                        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                     Remote Interface ID                       |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

</artwork>
</figure>
<vspace blankLines="1" />

Type : TBA (suggested value 9)
<vspace blankLines="1" />
Length: 8
<vspace blankLines="1" />
Value: 4 octets of Local Interface ID followed by 4 octets of Remote interface ID.
<vspace blankLines="1" />
</t>
</section>

<section title='OSPFv3 Graceful-Link-Shutdown sub-TLV'>
<t> 
The Graceful-Link-Shutdown sub-TLV is carried in the Router-Link TLV as defined in the <xref target="I-D.ietf-ospf-ospfv3-lsa-extend"/> for OSPFv3.
The Router-Link TLV contains the neighbour interface-id and can uniquely identify the link on the remote node.

<vspace blankLines="2" />
<figure anchor="OSPFv3-graceful-link-shutdown-TLV" title="Graceful-Link-Shutdown sub-TLV for OSPFv3">
<artwork>
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              Type             |             Length            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
</artwork>
</figure>
<vspace blankLines="1" />
Type : TBA (Suggested value 7)
<vspace blankLines="1" />
Length: 0
</t>
</section>


<section title='BGP-LS Graceful-Link-Shutdown TLV'>
<t>BGP-LS as defined in <xref target="RFC7752"/> is a mechanism to distribute network information to the
external entities using BGP routing protocol. Graceful-link-shutdown is an imporatant link information that the external entities 
can use for various use cases as defined in <xref target="applications"/>. BGP Link NLRI is used to carry the link information.
A new TLV called Graceful-Link-Shutdown is defined to describe the link attribute corresponding to graceful-link-shutdown state.
The TLV format is as described in <xref target="RFC7752"/> sec 3.1. There is no value field and length field is set to zero for this TLV.

<vspace blankLines="2" />
<figure anchor="BGPLS-graceful-link-shutdown-TLV" title="Graceful-Link-Shutdown TLV for BGP-LS">
<artwork>
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              Type             |             Length            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
</artwork>
</figure>
<vspace blankLines="1" />
Type : TBA (Suggested value 1121)
<vspace blankLines="1" />
Length: 0
</t>

</section>

<section title='Distinguishing parallel links'>
<t> 
<vspace blankLines="2" />
<figure anchor="parallel_links" title="Parallel Linkls">
<artwork>
    
    ++++++++++I.w            I.y +++++++++
    |Router A|------------------|Router B | 
    |        |------------------|         |
    ++++++++++I.x             I.z++++++++++
</artwork>
</figure>

Consider two routers A and B connected with two parallel point-to-point interfaces. I.w and I.x represent the Interface address on Router A's side
and I.y and I.z represent Interface addresses on Router B's side. The extended link opaque LSA as described in <xref target="RFC7684"/>
describes links using link-type, Link-ID and Link-data. For ex. Link with address I.w is described as below on Router A.
<list>
<t>Link-type = Point-to-point</t>
<t>Link-ID: Router-ID of B</t>
<t>Link-Data = I.w</t>
</list>

A third node (controller or head-end) in the network cannot distinguish the Interface on router B which is connected to this particular Interface with the above information. 
Interface with address  I.y or I.z could be chosen due to this ambiguity.
In such cases Remote-IPv4 Address sub-TLV should be originated and added to the Extended Link TLV. The use cases as described in  <xref target="applications"/>
require controller or head-end nodes to interpret the graceful-link-shutdown information and hence the need for the Remote IPv4 address sub-TLV.
I.y is carried in the Extended Link TLV which unambiguously identifies the interface on the remote side.
OSPFv3 Router-link-TLV as described in <xref target="I-D.ietf-ospf-ospfv3-lsa-extend"/> contains Interface ID and neighbor's Interface-ID 
which can uniquely identify connecting interface on the remote side and hence OSPFv3 does not require seperate Remote-IPv6 address to be advertised
along with the OSPFv3-Graceful-Link-Shutdown sub-TLV.
</t>
</section>
</section>
<section title='Elements of procedure' anchor='procedures'>
<t>As defined in  <xref target="RFC7684"/> every link on the node will have a separate Extended Link Opaque LSA.
 The node that has the link to be taken out of service 
MUST advertise the Graceful-Link-Shutdown sub-TLV in the Extended Link TLV of the
Extended Link Opaque LSA as defined in  <xref target="RFC7684"/> for OSPFv2 and Router-Link TLV of E-Router-LSA for OSPFv3.
The Graceful-Link-Shutdown sub-TLV indicates that the link identified by the
 sub-TLV is subjected to maintenance.</t>
 
<t>For the purposes of changing the metric OSPFv2 and OSPFv3 Router-LSAs need to be re-orignated and for Traffic Engineering metric,
 TE Opaque LSAs <xref target="RFC3630"/> in OSPFv2 and
Intra-area-TE-LSA <xref target="RFC5329"/>in OSPFv3 need to be re-originated.</t>


<t>The Graceful-Link-Shutdown information is advertised 
as a property of the link and is flooded across the area. This information can be used by ingress routers or controllers to take
special  actions. An application specific to this use case is described in  <xref target="controller_TE"/>.</t>


<t>The precise action taken by the remote node at the other end of the link identified for graceful-shutdown depends on the link type.</t>

<t> When a link is ready to carry traffic, the Graceful-Lnk-Shutdown sub-TLV should be removed from the Extended Link TLV/Router-Link TLV and the corresponding
LSAs MUST be readvertised.</t>

<section title='Point-to-point links'>
<t>The node that has the link to be taken
   out of service MUST set metric of the link to MaxLinkMetric (0xffff) and re-originate its router-LSA. 
   The Traffic Engineering metric of the link SHOULD be set to 
   (0xffffffff) and the node SHOULD re-originate the corresponding TE Link Opaque LSAs.
When a Graceful-Link-Shutdown sub-TLV is received for a point-to-point link, the remote node MUST identify the local link which corresponds to the
graceful-shutdown link and set its metric to MaxLinkMetric (0xffff) and the remote node MUST re-originate  its router-LSA with the changed metric. 
When TE is enabled, the Traffic Engineering metric of the link SHOULD be set to (0xffffffff) and the TE opaque LSA for the link
 SHOULD be re-originated with new value.Similarly,  
 the remote node SHOULD set the  Traffic Engineering metric of the link to 0xffffffff
 and SHOULD re-originate the TE Link Opaque LSA for the link with the new value.</t>
 
 <t> The Extended link opaque LSAs and the Extended link TLV are not scoped for multi-topology <xref target="RFC4915"/>.
 In multi-topology deployments <xref target="RFC4915"/>, the Graceful-Link-Shutdown sub-TLV advertised in an Extended Link opaque LSA corresponds to all the topologies which include the link.
 
 The receiver node SHOULD change the metric in the reverse direction for all the topologies which include the remote link  and
 re-originate the router-LSA as defined in <xref target="RFC4915"/>.</t>
 
 <t>When the originator of the Graceful-Link-Shutdown sub-TLV purges the Extended Link Opaque LSA or re-originates it without the Graceful-Link-Shutdown sub-TLV,
 the remote node must re-originate the appropriate LSAs with the metric and TE metric values set to their original values.</t>
 
</section>

<section title='Broadcast/NBMA links'>
<t>Broadcast or NBMA networks in OSPF are represented by a star topology where the Designated Router (DR) is the central point to
which all other routers on the broadcast or NBMA network logically connect.  As a result, routers on the broadcast or NBMA network advertise only 
their adjacency to the DR.  Routers that do not act as DR do not form or advertise adjacencies with each other. 
 For the Broadcast links, the MaxLinkMetric on the remote link cannot be changed since all the neighbors are on same link. 
Setting the link cost to MaxLinkMetric would impact paths going via all neighbors. 
<vspace blankLines="1" />
The node that has the link to be taken out of service MUST set metric of the link to MaxLinkMetric (0xffff) and re-originate the Router-LSA.  
The Traffic Engineering metric of the link SHOULD be set to ( 0xffffffff) and the node SHOULD re-originate the corresponding TE Link Opaque LSAs.
For a broadcast link, the two part metric as described in <xref target="RFC8042"/> is used. The node originating the Graceful-Link-Shutdown
sub-TLV MUST set the metric in the Network-to-Router Metric sub-TLV to MaxLinkMetric (0xffff) for OSPFv2 and OSPFv3
and re-originate the corresponding LSAs.
The nodes that receive the two-part metric should follow the procedures described in <xref target="RFC8042"/>.
The backward compatibility procedures described in <xref target="RFC8042"/> should be followed to ensure 
loop free routing. 
</t>
</section>

<section anchor='point_to_pont' title='Point-to-multipoint links'>
   <t> Operation for the point-to-multipoint links is similar to the point-to-point links.
    When a Graceful-Link-Shutdown sub-TLV is received for a point-to-multipoint link the remote node MUST identify the neighbour which corresponds to the
    graceful-shutdown link and set its metric to MaxLinkMetric (0xffff). The remote node MUST re-originate the router-LSA with the changed metric for the correponding neighbor.</t>
</section>

<section title='Unnumbered interfaces'>
   <t> Unnumbered interface do not have a unique IP address and borrow their address from other interfaces.  
   <xref target="RFC2328"/> describes procedures to handle unnumbered interfaces in the context of the router-LSA. 
   We apply a similar procedure to the Extended Link TLV advertising the Graceful-Link-Shutdown sub-TLV in order to handle 
   unnumbered interfaces.
 
   The link-data field in the Extended Link TLV includes the Local interface-id instead of the IP address. 
   The Local/Remote Interface ID sub-TLV MUST be advertised when there are multiple parallel unnumbered interfaces between two nodes.
   One of the mechanisms to obtain the interface-id of the remote side are defined in  <xref target="RFC4203"/>. </t>
</section>

<section title='Hybrid Broadcast and P2MP interfaces'>
   <t> Hybrid Broadcast and P2MP interfaces  represent a broadcast network modeled as P2MP interfaces.
   <xref target="RFC6845"/> describes procedures to handle these interfaces. Operation for the Hybrid
   interfaces is similar to the P2MP interfaces.
    When a Graceful-Link-Shutdown sub-TLV is received for a hybrid link, the remote node MUST identify the neighbor which corresponds to the
    graceful-shutdown link and set its metric to MaxLinkMetric (0xffff). All the remote nodes connected to originator
    MUST re-originate the router-LSA with the changed metric for the neighbor.</t>
</section>    
</section>


    
<section title='Backward compatibility'>
   <t> The mechanisms described in the document are fully backward compatible.
    It is required that the node adverting the Graceful-Link-Shutdown sub-TLV as
    well as the node at the remote end of the graceful-shutdown link support the
    extensions described herein for the traffic to diverted from the 
    graceful-shutdown link. If the remote node doesn't support the capability, 
    it will still use the graceful-shutdown link but there are no other adverse 
    effects.  In the case of broadcast links using two-part metrics, the 
    backward compatibility procedures as described in <xref target="RFC8042"/> are 
    applicable.</t>

</section>

<section title='Applications' anchor='applications'>
<section anchor="Pseudowire_services" title='Pseudowire Services'> 


 <t>Many service providers offer pseudo-wire services to customers using L2 circuits. The IGP protocol that
runs in the customer network would also run over the pseudo-wire to create a seamless private network for the customer. 
Service providers want to offer graceful-shutdown functionality when the PE device is taken-out for maintenance.
The provider should guarantee that the PE is taken out for maintenance, only after the service is successfully diverted
on an alternate path. There can be large number of customers attached to a PE node and the remote end-points for these pseudo-wires 
are spread across the service provider's network. It is a tedious and error-prone process to change the metric for all
pseudo-wires in both directions. The graceful-link-shutdown feature 
simplifies the process by increasing the metric on the link in the reverse direction as well so that traffic
in both directions is diverted away from the PE undergoing maintenance.
 The Graceful-Link-Shutdown feature allows the link to be used as a last resort link so that traffic is not disrupted when alternate
paths are not available.</t>

<figure anchor="Pseudo_wire_services" title="Pseudowire Services">
<artwork>
                overlay network
        =======================================
       |                                       |
       |                                       |
       |     ------PE3---------------PE4------CE3
       |   /                             \          
       | /                                 \       
     CE1---------PE1----------PE2---------CE2
       |                       \                 
       |                        \                
       |                         ------CE4
       |                                 |
       |                                 |
       |                                 |
        =================================   
                overlay network

</artwork>
</figure>

<t> In the example shown in <xref target="Pseudo_wire_services"/>, when the PE1 node is going out of service for maintenance, service providers set the PE1 to stub-router state. 
The PE1 going in to maintenance state
triggers all the CEs connected to the PE (CE1 in this case) to set their pseudowire links passing via PE1 to graceful-link-shutdown state. The mechanisms used
to communicate between PE1 and CE1 is outside the scope of this document. CE1 sets the graceful-link-shutdown state on its links connecting CE3, CE2 and CE4 and changes the metric to
MaxLinkMetric and re-originates the corresponding LSA.
The remote end of the link at CE3, CE2, and CE4 also set the metric on the link to MaxLinkMetric and the traffic from
 both directions gets diverted away from the pseudowires.</t>
</section>

<section anchor="controller_TE" title='Controller based Traffic Engineering Deployments'>  


 <t>In controller-based deployments where the controller participates in the IGP protocol, 
 the controller can also receive the graceful-link-shutdown information as a warning that link maintenance is imminent.
 Using this information, the controller can find alternate paths for traffic which uses the affected link.  
 The controller can apply various policies and re-route the LSPs away from the link undergoing maintenance. 
 If there are no alternate paths satisfying the traffic engineering constraints, the controller might
 temporarily relax those constraints and put the service on a different path. Increasing the link metric alone does not specify
 the maintenance activity as the metric could increase in events such as LDP-IGP synchronisation. An explicit indication
from the router using the graceful-link-shutdown sub-TLV is needed to inform the Controller or head-end routers. </t>
 <figure anchor="TE_deployments" title="Controller based Traffic Engineering">
<artwork>
                      _____________
                     |             |
        -------------| Controller  |--------------
       |             |____________ |             |
       |                                         |
       |--------- Primary Path ------------------|
       PE1---------P1----------------P2---------PE2
                   |                  |
                   |                  |
                   |________P3________|      
                   
                      Alternate Path

</artwork>
</figure>
 <t>In the above example, PE1->PE2 LSP
 is set-up to satisfy a constraint of 10 Gbps bandwidth on each link. The links P1->P3 and P3->P2 have only 1 Gbps capacity 
 and there is no alternate path satisfying the bandwidth constraint of 10Gbps.
  When P1->P2 link is being prepared for maintenance, 
 the controller receives the graceful-link-shutdown information, as there is no alternate path available which satisfies the constraints,
 the controller chooses a path that is less optimal and temporarily sets up an alternate path via P1->P3->P2.
 Once the traffic is diverted, the P1->P2 link can be taken out of service for maintenance/upgrade.</t>
</section>
<section anchor="L3VPN" title='L3VPN Services and sham-links'> 


 <t>Many service providers offer L3VPN services to customers and CE-PE links run OSPF <xref target="RFC4577"/>.
  When PE is taken out of service for maintenance, all the links on the PE can be set to graceful-link-shutdown state which will gurantee
  that the traffic to/from dual-homed CEs gets diverted.
 The interaction between OSPF and BGP is outside the scope of this document.
 <xref target="RFC6987"/> based mechanism with summaries and externals advertised with high metrics could also be used to achieve the same functionality
 when implementations support high metrics advertisement for summaries and externals.</t>

<t> Another useful usecase is when ISPs provide sham-link services to customers <xref target="RFC4577"/>. When PE goes out of service for maintenance, all sham-links 
 on the PE can be set to graceful-link-shutdown state and traffic can be divered from both ends without having to touch the configurations on the remote end of the sham-links.</t>
</section>

<section anchor="Hub_and_spoke" title='Hub and spoke deployment'> 


 <t>OSPF is largely deployed in Hub and Spoke deployments with a large number of spokes connecting to the Hub. It is a general practice to deploy
 multiple Hubs with all spokes connecting to these  Hubs to achieve redundancy. The <xref target="RFC6987"/>  mechanism can be used to divert the spoke-to-spoke traffic from the 
 overloaded hub router. The traffic that flows from spokes via the hub into an external network may not be diverted in certain scenarios.When a Hub node goes down for maintenance,
 all links on the Hub can be set to graceful-link-shutdown state and traffic 
 gets divered from the spoke sites as well without having to make configuration changes on the spokes.</t>

</section>
</section>
<!-- HG: FIXME: add traffic-engineering reference -->
<section title='Security Considerations' anchor='sec-con'>
<t> This document utilizes the OSPF packets and LSAs described in 
<xref target="RFC2328"/> , <xref target="RFC5340"/> , <xref target="RFC3630"/> and <xref target="RFC5329"/>.
The authentication procedures described in <xref target="RFC2328"/> for OSPFv2 and <xref target="RFC4552"/>
for OSPFv3 are applicable to this document as well.
This document does not introduce any further security issues other
than those discussed in <xref target="RFC2328"/> and <xref target="RFC5340"/>.
</t>
</section>
<section anchor="IANA" title="IANA Considerations">

<t>This specification updates one OSPF registry:</t>
<t><vspace blankLines="1"/>
OSPFv2 Extended Link TLV Sub-TLVs</t>
<t><vspace blankLines="1"/>
  i)   Graceful-Link-Shutdown Sub-TLV  - Suggested value 7</t>
  <t><vspace blankLines="1"/>
  ii)  Remote IPv4 Address Sub-TLV - Suggested value 8 </t>
  <t><vspace blankLines="1"/>
  iii) Local/Remote Interface ID Sub-TLV - Suggested Value 9</t>
 

  <t> OSPFv3 Extended-LSA sub-TLV Registry</t>
 <t><vspace blankLines="1"/>
   i) Graceful-Link-Shutdown sub-TLV - suggested value 7</t>
  
     
   <t>BGP-LS Node Descriptor, Link Descriptor, Prefix Descriptor, and Attribute TLVs <xref target="RFC7752"/></t>
   <t><vspace blankLines="1"/>
   i)Graceful-Link-Shutdown TLV - Suggested 1121 </t>

</section>
<section title='Acknowledgements'>
<t>Thanks to Chris Bowers for valuable inputs and edits to the document.
 Thanks to Jeffrey Zhang, Acee Lindem and Ketan Talaulikar for inputs.
 Thanks to Karsten Thomann for careful review and inputs on the applications where graceful-link-shutdown
 is useful.</t>
 <t> Thanks to Alia atlas, Deborah Brungard, Alvaro Retana and Tim Chown for valuable inputs.</t>
</section>


</middle>
<back>

<references title='Normative References'>

&RFC7684;
&RFC8042;
&RFC7752;
&RFC6845;
&RFC2119;
&RFC6987;
&RFC2328;
&RFC5340;
&RFC5329;
&RFC3630;

<?rfc include="http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-ospf-ospfv3-lsa-extend-23.xml"?>
</references>
<references title='Informative References'>

&RFC4203;
&RFC4915;
&RFC4577;
&RFC5817;
&RFC4552;

</references>

</back>
</rfc>