<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;"><!ENTITY zwsp   "&#8203;"><!ENTITY nbhy   "&#8209;"><!ENTITY wj     "&#8288;">]>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<rfc category="info" docName="draft-menon-svr-07" ipr="trust200902" obsoletes="" submissionType="independent" tocInclude="true" updates="" version="3" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude">
  <!-- xml2rfc v2v3 conversion 3.14.2 -->
  <front>
    <title>Juniper's Secure Vector Routing (SVR)</title>
    <seriesInfo name="Internet-Draft" value="draft-menon-svr-07"/>
    <author fullname="Abilash Menon" initials="A." surname="Menon">
      <organization>Maia Tech</organization>
      <address>
        <postal>
          <street>100 Summit Drive</street>
          <city>Burlington</city>
          <region>MA</region>
          <code>01803</code>
          <country>US</country>
        </postal>
        <email>abilashmenon@maia-tech.com</email>
      </address>
    </author>
    <author fullname="Patrick MeLampy" initials="P." surname="MeLampy">
      <organization>Retired</organization>
      <address>
        <postal>
          <street>1024 Main St.</street>
          <city>Dustable</city>
          <region>MA</region>
          <code>01827</code>
          <country>US</country>
        </postal>
        <email>pmelampy@gmail.com</email>
      </address>
    </author>
    <author fullname="Michael Baj" initials="M." surname="Baj">
      <organization>Juniper Networks</organization>
      <address>
        <postal>
          <street>10 Technology Part Dr.</street>
          <city>Westford</city>
          <region>MA</region>
          <code>01886</code>
          <country>US</country>
        </postal>
        <email>mbaj@juniper.net</email>
      </address>
    </author>
    <author fullname="Patrick Timmons" initials="P." surname="Timmons">
      <organization>Maia Tech</organization>
      <address>
        <postal>
          <street>100 Summit Drive</street>
          <city>Burlington</city>
          <region>MA</region>
          <code>01803</code>
          <country>US</country>
        </postal>
        <email>ptimmons@gmail.com</email>
      </address>
    </author>
    <author fullname="Hadriel Kaplan" initials="H." surname="Kaplan">
      <organization>Juniper Networks</organization>
      <address>
        <postal>
          <street>10 Technology Park Dr.</street>
          <city>Westford</city>
          <region>MA</region>
          <code>01886</code>
          <country>US</country>
        </postal>
        <email>hkaplan@juniper.net</email>
      </address>
    </author>
    <date day="4" month="November" year="2024"/>
    <area>General</area>
    <abstract>
      <t>
This document describes Juniper's Secure Vector Routing (SVR). SVR is an
overlay inter-networking protocol that operates at the session layer.
SVR provides end-to-end communication of network requirements not
possible or practical using network headers. SVR uses application layer
cookies that eliminate the need to create and maintain non-overlapping
address spaces necessary to manage network routing requirements.
SVR is an overlay networking protocol that works through middleboxes
and address translators including those existing between private
networks, the IPv4 public internet, and the IPv6 public internet.
SVR enables SD-WAN and multi-cloud use cases and improves security at
the networking routing plane.
SVR eliminates the need for encapsulation and decapsulation often used
to create non-overlapping address spaces.
      </t>
    </abstract>
    <note>
      <t>
This draft provides information for the Internet community.
It does not specify an Internet standard that has IETF consensus, nor
is this part of a standards track of the IETF. This document is being
published for the purposes of interoperability. The authors request
suggestions for improvement.</t>
    </note>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
There exists a need to communicate network requirements between IP
routers in order to provide an end-to-end experience. Selection of
specific paths whose attributes meet or exceed the networking 
requirements are an objective of SVR. There is also a need for
applications to communicate their requirements to networks. This need is
increasing as workloads move to public clouds and the numbers of 
cloud locations increase. Standard practice today is to use an overlay 
network of tunnels to create a virtual network.
      </t>
      <t>
SVR is proposed as an alternative to using tunnels. SVR simplifies the 
network by virtue of having only one network layer. SVR securely 
transports traffic with authentication and adaptive encryption. The 
absence of tunneling overhead reduces bandwidth. Since SVR specifies 
requirements abstractly, it also has the capability to interwork 
policies between different networks and address spaces.
      </t>
      <t>
Many WAN networks are deployed with a virtual private network (VPN)
across IP backbone facilities. VPNs have the significant disadvantage of
carrying additional network layers, increasing packet size and leading 
to IP fragmentation as well as reduced bandwidth.
      </t>
      <section anchor="terminology" numbered="true" toc="default">
        <name>Terminology</name>
        <t>
The key words &quot;MUST&quot;, &quot;MUST NOT&quot;,
&quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;,
&quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,
&quot;NOT RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot;
in this document are to be interpreted as described in <xref
format="default" target="RFC2119">BCP 14</xref> <xref format="default"
target="RFC8174"/> when, and only when, they appear in all capitals, as
shown here.
        </t>
      </section> <!-- terminology -->

      <section anchor="overview" numbered="true" toc="default">
        <name>Overview</name>
        <t>
An SVR implementation describes a network requirement semantically and
shares this as SVR Metadata with a routing peer. The requirement to a
peer is conveyed by means of a cookie, often referred to as first packet
SVR Metadata, which is placed in the first packet of a session that is
targeted towards the SVR Peer. SVR requires session state on every
participating SVR router and sets up a bidirectional flow (matching 
forward and reverse flows) based on the requirement. Once the session is
established bidirectionally, the cookie is not sent in subsequent 
packets, resulting in elimination of additional overhead.
        </t>
        <t>Benefits from this approach include:</t>
        <ul spacing="normal">
          <li>
Tunnel Compression: The SVR Metadata contains information required to
eliminate tunnel header information for established sessions. This can
result in anywhere from 12% to 100% bandwidth savings when compared to
IPSEC based tunnels depending on the original packet size.
          </li>
          <li>
Elimination of overhead associated with Tunnels (Elephant Flow problem):
Tunnels are very long lived and often contain large aggregates of inner
flows. Tunnels are often fixed on a specific network ECMP path or
&quot;hash&quot; while each SVR session has a unique ECMP path.
          </li>
          <li>
QoS support is per flow, not per packet: Because each SVR flow has a
unique 5-tuple on the wire, standard MPLS routing and QoS techniques
work seamlessly.
Adding QoS to Tunnels requires QoS on entry to a tunnel, tunnel DSCP
markings, and policies to copy/map inner packet DSCP to Tunnel Packet
DSCP. In practice many core networks do not look at the DSCP markings
once fast path forwarding rules are established.
          </li>
          <li>
Avoid Re-encryption: Tunnels often encrypt all traffic. Much of the 
traffic in the tunnel is already encrypted, thus there is a
re-encryption penalty. SVR supports adaptive encryption which performs
encryption on only those sessions that require it.
          </li>
          <li>
Firewalls and security proxies can intercept TLS sessions and perform
decryption and encryption if they are passive to SVR Metadata. This is 
not possible with IPSEC tunnels by design.
          </li>
          <li>
Scaling of software-based encryption is much higher when session state
is available. Encryption performance is limited to what is possible in a
single processing core for a single session, and at the time of this
document being written, the limit is currently 1.5GigE for Tunnel
termination.
          </li>
        </ul>
      </section> <!-- overview -->

      <section anchor="doc_org" numbered="true" toc="default">
        <name>Document Organization</name>
        <t>
This document is structured into six major sections. Section 2 provides
a high-level theory of how SVR works. Section 3 presents an example of
SVR in action. Section 4 describes the SVR message handling in detail.
SVR Peer management is described in Section 5. Section 6 details some
additional SVR procedures that may be required. Finally, Section 7
describes individual protocol messages.
        </t>
      </section> <!-- doc_org -->

      <section anchor="definitions" numbered="true" toc="default">
        <name>Definitions</name>
        <t>The following terms are used throughout this document.</t>
        <dl newline="false" spacing="normal">
          <dt>Authority:</dt>
          <dd>
A textual definition of the owner of an SVR namespace. Each namespace
owner can allocate Tenant names (representing collections of network
endpoints sharing common network enforcement policy), and Service names
(representing accessible destinations and traffic treatment policy). 
Practically speaking, an Authority is used as a logical separation of an 
administrative domain. Authority namespaces should be unique if 
inter networking is desired. Claiming and resolving disputes about 
Authority naming are outside the scope of this document.
          </dd>
          <dt>Tenant:</dt>
          <dd>
This is a textual description defining network endpoints that share
common access policy (allow lists or block lists to network destinations
). These may be mapped using any known technique including source IP
address mask, a VLAN tag, ingress interface, provided by an
authentication system, or even client supplied, and this mapping is
outside the scope of this document. Often these are location specific
definitions, but the Tenant has an Authority wide scope. Tenant names
can conform to domain name syntax, and be expressed as hierarchical
structures (e.g., location.department.example).
          </dd>
          <dt>Session:</dt>
          <dd>
A session is the entire sequence of packets in both directions that
represents a single TCP or UDP communication. The initiator of the
sessions is always the client, and the answering side is always the
server.
          </dd>
          <dt>Service:</dt>
          <dd>
This is a textual description of what server(s) can be accessed with
this intent. Examples include Zoom, or Office365/Outlook. Although
outside the scope of this document, these could be defined with any 
known technique, including URLs, IP address(es) protocol(s) and port(s),
CIDR block(s), etc. Having a single text name to describe a network 
destination makes defining network requirements easier. Other Service 
specific network requirements including Quality Policies and Security 
Policies can be associated with Services in data models, but are not 
described in this document.</dd>
          <dt>Context:</dt>
          <dd>
This is the original &quot;5-tuple&quot; of an IP packet, including 
source IP, source port, destination IP, destination port, and protocol. 
Optionally, layer 2 information such as MAC Address or VLAN tags may be
included for certain use cases, if required.</dd>
          <dt>Signature:</dt>
          <dd>
SVR Metadata packets SHOULD be cryptographically signed using HMAC by 
the source router, and all packets traversing an SVR peer pathway SHOULD
have an HMAC signature so the next hop router can authenticate the 
sender of the data and verify its integrity. The portion of the packet 
that is signed must not include the IP header, as it may go through a 
NAT or IPv4 to IPv6 conversion.</dd>
          <dt>Direction:</dt>
          <dd>
This is inferred, and not a specific SVR Metadata attribute. The 
Direction represents the intended client to server direction. The 
initial network packet of a communication session indicates this 
direction. For example, a TCP SYN packet would travel from client to 
server, defining the direction of a service. Forward direction is always
client to server, and reverse is always server to the client. These 
directions have nothing to do with a network topology (for example, hub 
and spoke), and a single network path could have forward sessions going 
bidirectionally -- traffic going from node A to node B may represent 
the forward direction for some sessions and the reverse direction for 
other sessions.
          </dd>
          <dt>Peer:</dt>
          <dd>
An SVR Peer is a client, server, or router that supports the SVR 
protocol. The SVR Peer could be either directly adjacent, or reachable 
through an IP network. The SVR Peer should not be confused with BGP 
Peer. Since SVR Peers must be able to reach each other, and because SVR 
Peers are often deployed at network edges, SVR Peers can also be BGP 
Peers. In this document peer will always mean SVR Peer.
          </dd>
          <dt>Waypoint:</dt>
          <dd>
A Waypoint is a reachable IP Address associated with an SVR Router's 
interface. Some physical interfaces may have multiple IP Addresses, and
as such a single physical interface could represent multiple Waypoints. 
In some cases, routers use dynamically assigned addresses on interfaces.
In these cases, a Waypoint address may change dynamically.
          </dd>
          <dt>Peer Received IP Address:</dt>
          <dd>
This is the destination IP address to send packets to reach a Waypoint 
Address. Normally, this is the same IP Address as a Waypoint Address, 
unless there is a NAT present between Peers.
          </dd>
          <dt>SVR Metadata:</dt>
          <dd anchor="svr_metadata_def">
SVR Metadata is a block of TLVs that contain SVR attributes described in
<xref format="default" target="meta_format"/>. This block of data 
communicates network information between SVR routers.
          </dd>
          <dt>BFD Metadata:</dt>
          <dd anchor="bfd_metadata_def">
BFD Metadata refers to data added to BFD messages to extend standardized
support required for Peer relationships. See <xref format="default" 
target="std_bfd"/>.
          </dd>
          <dt>Peer Pathway:</dt>
          <dd anchor="svr_peer_paths">
An SVR Peer Pathway is a unique pair of Waypoint addresses that can 
reach each other. The path can be defined as either a pair of IP 
addresses or a pair of domain names that resolve to IP Addresses. Peer 
Pathways have attributes related to availability, performance (jitter, 
latency, packet loss) and cost. Techniques such as BFD <xref 
format="default" target="RFC5880"/> can ensure a Peer Pathway's state 
and readiness for packet transmission.
          </dd>
          <dt>Router Certificate:</dt>
          <dd anchor="router_certificate_definition">
A Certificate Signing Request (CSR) is created by every router that 
attaches to an SVR network that contains the routers UUID, Authority, 
and public key. The resulting certificate is used to authenticate SVR 
routers on Peer Pathways. The certificate is fairly long lived, and 
seldom used. Keying procedures use derived key functions based on the 
certificate.</dd>
          <dt>Peer Key:</dt>
          <dd anchor="peer_key_definition">
After authentication, every SVR router peer pathway creates a Peer Key 
used between respective peers. This key is solely used to encrypt 
certain BFD fields between two peers. The Peer Key is rekeyed by
calculating a new shared key as often as required. See <xref 
format="default" target="peer_key_procedure"/>.
          </dd>
          <dt>SVR Metadata Key:</dt>
          <dd anchor="metadata_key_definition">
Each peer will broadcast to all of its peers a key to use for metadata 
decryption. The key is delivered securely as an encrypted field in BFD 
Metadata. This permits a single key for each router to be used for 
metadata decryption for all Peer Paths. See <xref format="default" 
target="svr_metadata_key_procedure"/>.
          </dd>
          <dt>Payload Key:</dt>
          <dd anchor="payload_key">
Each peer will generate a key for a session that requires payload 
encryption. This key will be used only by this specific session. The key
is generated by the originating router and is included in metadata, 
which avoids race conditions by using the same key for reverse traffic.
Re-keying can be performed by generating a new key, and sending metadata
in the first packet encrypted with the new key.
          </dd>
          <dt>Session HMAC Key:</dt>
          <dd anchor="session_hmac_key_definition">
Timed Based HMAC signatures can be used to protect SVR pathways against
replay attacks. Upon start, every session creates a Session HMAC Key 
which is the Peer Key at the time the session was created. Session HMAC 
Keys must be saved for the life of a session, and do not change. Time 
based HMAC signatures effectively change the key every two seconds.
        </dd>
        </dl>
      </section> <!-- definitions -->

    </section> <!-- intro -->

    <section anchor="provisioning" numbered="true" toc="include">
      <name>Configuration and Management</name>
      <t>
While provisioning and orchestration is outside the scope of this 
document, it is worth noting which aspects must be provisioned through 
some means of coordinated orchestration.
      </t>
      <t>
This is not intended to be a comprehensive list, nor define the 
organization, nor define input constraints, but to highlight the minimal
attributes that would need to be provisioned in order to establish an
SVR peering relationship between two routers.
      </t>
      <figure anchor="pseudo_datamodel">
        <artwork align="left" alt="" name="" type="">
          <![CDATA[

            Adjacency[]
              port-range
              peer[]
              rekey-interval

            Tenant[]
              name
              source-ip[]

            SecurityPolicy[]
              name
              HMAC
                mode
                cipher
              payload-encryption-cipher
              adaptive-encryption
              rekey-interval

            Service[]
              name
              domain[]
              ip-address[]
              port[]
              protocol[]
              permit
                Tenant[]
              deny
                Tenant[]
              ServiceLevelAgreement
                max-jitter
                max-loss
                max-latency
              SecurityPolicy

          ]]>
        </artwork>
      </figure>
    </section> <!-- provisioning -->

    <section anchor="op_theory" numbered="true" toc="default">
      <name>Theory of operation of Secure Vector Routing</name>
      <t>
Secure Vector Routing is a session stateful routing protocol that
operates at the edges of networks where stateful NATing is normally 
performed. It is at these same locations where multi-path routing is 
being deployed. These locations include edge routers located at 
branches, data centers, and public clouds. SVR maps local network 
requirements into administratively defined text strings that have 
Authority wide meaning. These are communicated or signaled by insertion 
of a networking cookie called SVR Metadata directly into IP Packets in 
transit.
      </t>
      <figure anchor="net_diagram">
        <artwork align="left" alt="" name="" type="">
          <![CDATA[

                       +-----------+
                       | Network 2 |
   +-----------+       |           |        +-----------+
   |          SVR<---->+<--L3-IP-->+<----->SVR          |
   |           |       +-----------+        |           |
   | Network 1 |       +-----------+        | Network 4 |
   |          SVR<--->SVR         SVR<---->SVR          |
   +-----------+       |           |        +-----------+
                       | Network 3 |
   +-----------+       |           |
   | Client   SVR<--->SVR          |
   +-----------+       +-----------+

          ]]>
        </artwork>
      </figure>
      <t>
The above diagram shows typical places where SVR can be deployed. SVR
can be deployed between Network 1 and Network 4, traversing Network 3. 
This is typical of a connection between a corporate site and a data 
center through the public internet. SVR can be deployed directly between
Network 1 and Network 3, Network 3 and Network 4 to build a 
multi-network connectivity. Clients that support SVR are connected to 
Network 3, permitting full SVR based access to Networks 1, 3, and 4.
      </t>
      <t>
SVR Metadata is inserted into existing packets directly after the L4 
header (see <xref format="default" target="std_md_insertion"/>). The SVR
Metadata in the first packet of a new session (TCP or UDP bidirectional
flow) can be used for path selection and security. SVR Metadata can be
inserted in any subsequent packet to change/update the networking 
requirements. The SVR Metadata is inserted into the payload portion of a
packet to guarantee delivery between SVR routers.
      </t>
      <t>
Sessions supported by SVR include TCP, UDP, UDP Unicast, Multicast, 
MP-TCP, QUIC, point-to-point ethernet, and ICMP. Sessions are 
characterized by having an initial first packet that is unique to an SVR
router. Often this is described as a unique 5-tuples as seen by the 
router. Sessions start when the first packet is processed and end when 
either the L4 protocol indicates the session is completed (TCP 
FIN/FIN/RST ACK) or there has been no activity for a length of time 
(UDP, ICMP, UDP Unicast, point-to-point ethernet).
      </t>
      <section anchor="directionality" numbered="true" toc="include">
        <name>Directionality</name>
        <t>
SVR utilizes the concept of session direction. The direction of the
session is what creates a Secure Vector. Routing policies include a
Tenant (source) and Service (destination) pair that exactly match the
direction of sessions. When describing SVR Metadata in this document,
direction is either forward or reverse; it is not tied to network
topology, but rather the direction of session establishment. For TCP,
the forward direction is always the client side towards the server side.
For UDP, the forward direction is from the sender of the first packet; 
reverse is the opposite direction. On a given pathway, Secure Vector 
Routes could be traversing on the same pathways with opposite 
directions.
        </t>
        <t>
SVR Metadata formats described in this document will be labeled as 
&quot;forward&quot; or &quot;reverse&quot;. Forward SVR Metadata is 
inserted in packets going from client to server. Reverse SVR Metadata is
inserted in packets that travel from server to client.
        </t>
      </section> <!-- directionality -->

      <section anchor="order_of_operation" numbered="true" toc="default">
        <name>Order of Operations</name>
        <t>
The basic order of operations when processing a packet upon arrival at 
the first SVR Router includes:
        </t>
        <dl newline="false" spacing="normal">
          <dt>Receive First Packet of a new Flow:</dt>
          <dd>
SVR Routers have active flow tables. When a packet arrives, whose 
addresses are not in the flow table, the router considers this a first 
packet of a new flow.
          </dd>
          <dt>Parse and Route:</dt>
          <dd>
SVR Routers will parse all of the L2, and L3 information in the network 
headers. The SVR Router will perform longest prefix matches to determine
where to forward the packet.
          </dd>
          <dt>If Next Hop Router is an SVR Router:</dt>
          <dd>
If the next-hop router supports SVR, then SVR Procedures as described in
this document can be used. If not, the packet is forwarded in a 
traditional way.
          </dd>
          <dt>Insert SVR Metadata:</dt>
          <dd>
When the next-hop router supports SVR, SVR Metadata is inserted into the
very first packet. This provides valuable networking information to the 
next-hop router.
          </dd>
          <dt>Update Transport Addresses:</dt>
          <dd>
If SVR Metadata is inserted, the transport addresses are updated to 
steer the packet directly to the next-hop SVR router (think IPv6 Segment
Routing) with the from addresses being the initiating router. This new 
address pair reflects the chosen transport path between two routers 
bidirectionally.
          </dd>
          <dt>Forward Packet:</dt>
          <dd>
The SVR Packet with SVR metadata included is forwarded to the next-hop 
SVR router.
          </dd>
        </dl>
        <t>
The basic order of operations for a subsequent SVR Router includes:
        </t>
        <dl newline="false" spacing="normal">
          <dt>Receive First Packet of a new SVR Flow:</dt>
          <dd>
When a first packet arrives that is not in its flow table and it has a 
destination of the router's interface address, the packet must be from a 
known SVR Peer, and must contain SVR metadata.
          </dd>
          <dt>Parse and Remove Metadata:</dt>
          <dd>
SVR Metadata is decrypted and authenticated. The SVR information can be 
used in the routing of the packet. If the next-hop is not another SVR 
router, the SVR metadata is removed, and the packet addresses are 
restored to their original values.
          </dd>
          <dt>Parse and Route:</dt>
          <dd>
Subsequent SVR Routers will parse all of the L2, and L3 information in 
the network headers. The SVR Router will perform longest prefix matches 
to find possible next-hop routers for packet forwarding. The SVR 
Metadata contents can be used for route selection.
          </dd>
          <dt>If Next Hop Router is an SVR Router:</dt>
          <dd>
If the next-hop router supports SVR, then SVR Procedures as described in
this document can be used. If not, the packet is forwarded in a 
traditional way.
          </dd>
          <dt>Insert SVR Metadata:</dt>
          <dd>
When the next-hop router supports SVR, SVR Metadata is inserted into the
very first packet. This provides valuable networking information to the 
next-hop router.
          </dd>
          <dt>Update Transport Addresses:</dt>
          <dd>
If SVR Metadata is inserted, the transport addresses are updated to 
steer the packet directly to the next-hop SVR router (think IPv6 Segment
Routing) with the from addresses being the initiating router. This new 
address pair reflects the chosen transport path between two routers 
bidirectionally.
          </dd>
          <dt>Forward Packet:</dt>
          <dd>
The SVR Packet with SVR metadata included is forwarded to the next-hop 
SVR router.
          </dd>
        </dl>
      </section> <!-- order_of_operations -->

      <section anchor="mixedsvr" numbered="true" toc="include">
        <name>SVR with Other Traffic</name>
        <t>
SVR co-exists with traditional routing and alongside non-SVR traffic. In
fact, the router interface addresses known as Waypoints in this document 
MUST be reachable via traditional networking for every peer 
relationship. When packet routing is being decided in the router, should
the route resolve to an SVR capable router (i.e., the next hop address 
returned in the route equals a known Waypoint address of an SVR Peer) 
then SVR Metadata MAY be inserted and session stateful SVR is performed.
Otherwise, the packet is forwarded like any traditional IP router.
        </t>
      </section> <!-- mixedsvr -->

      <section anchor="handshake" numbered="true" toc="include">
        <name>SVR Metadata Handshake</name>
        <t>
To ensure the SVR Metadata is received and understood between peers, a 
handshake is performed for each session.
        </t>
        <t>
A sender of SVR Metadata acknowledges its receipt of forward Metadata by 
receiving a subsequent backward SVR metadata from its peer. Senders must
include metadata in every packet until they receive this confirmation. 
Once confirmed, the sender can stop sending metadata in subsequent 
packets.
        </t>
        <t>
A receiver of SVR metadata from a peer always responds by sending 
reverse SVR metadata in every subsequent packet of a session. This 
continues until a packet is received from the peer that no longer has 
metadata, signaling receipt.
        </t>
        <t>
These two comprise what is known as the &quot;SVR Metadata 
handshake&quot; -- that is, the initiating router includes SVR Metadata 
in all packets it sends to the recipient router until it receives a 
reverse packet with SVR Metadata from that recipient. Likewise, the 
recipient continues to send SVR Metadata to the initiating router until 
it receives a packet without SVR Metadata. This is how two routers 
acknowledge receipt of SVR Metadata from their counterparts: the absence
of SVR Metadata in a packet indicates that it has received SVR Metadata 
from its counterpart.
        </t>
      </section> <!-- handshake -->

      <section anchor="path_obstruct" numbered="true" toc="include">
        <name>Pathway Obstructions and Changes</name>
        <t>
Firewalls and other middleboxes that are deployed along a peer pathway 
may not propagate TCP SYN messages with data in the payload (despite 
being valid). Middleboxes may also verify sequence numbers in TCP 
streams - which would appear as invalid due to the inclusion of SVR 
Metadata (while not changing sequence numbers). The two devices that 
represent the peer pathway endpoints may determine, through testing, if 
there is a firewall, NAT, or other active middlebox between the two 
routers. The BFD protocol with BFD Metadata can be used to detect the 
presence of a NAT. See <xref format="default" 
target="bfd_nat_detection"/>. Additional procedures like STUN <xref 
format="default" target="RFC8489"/>, TURN <xref format="default" 
target="RFC6062"/>, and ICE <xref format="default" target="RFC8445"/> 
are well-known, and not included in this document.
        </t>
        <t>
If a NAT is detected on the Peer Pathway, the SVR Router that determines
its Waypoint address is being changed, saves this as an attribute of the 
pathway. The NAT will change the port address assignment, and require 
NAT keep-alives as exemplified in <xref format="default" 
target="nat_keep_alive"/>.
        </t>
        <t>
If a middlebox is detected, the packets can be UDP-transformed (i.e., 
the protocol octet can be changed from TCP to UDP) by the transmitting 
router and restored to TCP by the receiving router for packets flowing 
in both directions. See <xref format="default" 
target="std_udp_transform"/> and <xref format="default" 
target="std_udp_untransform"/> for more information.
        </t>
        <t>
When routers use IP addresses that are dynamic, such as DHCP served 
addresses or PPPoE network attachments, it is possible to be assigned a 
new address during the lifetime of any given session traversing the 
router. If this happens, all existing sessions using that Waypoint 
address must be updated to use the new address. For existing sessions 
this can be performed in real time by reviewing the sending address. If 
the address has changed, internal references to the old address can be 
updated. For idle circuits, BFD with SVR Metadata is used to detect 
address changes. See <xref format="default" 
target="bfd_router_address_change"/> for details.
        </t>
      </section> <!-- path_obstruct -->

      <section anchor="meta_remove" numbered="true" toc="include">
        <name>SVR Metadata removal</name>
        <t>
To prevent breaking any applications, there MUST be a 100% guarantee 
that SVR Metadata inserted by a participating SVR device is removed 
prior to the transmission of the data to the application. If the 
client and server support SVR Metadata, then SVR Metadata can be sent 
end-to-end. When a mid-stream packet router wants to insert SVR 
Metadata, it must guarantee that the packet is directed to a next hop 
device that will understand and remove the SVR Metadata.
        </t>
        <t>
A router can be certain an SVR capable router is on the path when the 
next-hop address returned from a FIB table exactly matches a known peer 
Waypoint address. Before sending the packet with SVR Metadata to the 
Waypoint address, the originating SVR router should determine the Peer 
reachability as exemplified in <xref format="default" 
target="SVR_example"/> and <xref format="default" target="std_bfd"/>.
        </t>
        <t>
If the next-hop is not a known reachable peer, SVR Metadata insertion 
MUST NOT be performed.
        </t>
      </section> <!-- meta_remove -->

      <section anchor="transport_addr_mod" numbered="true" toc="include">
        <name>Modification of transport addresses</name>
        <t>
To guarantee that the packet will go to a specific router, the 
destination address for the packet is changed to the Waypoint Address of
the chosen peer. The original addresses are stored in the forward 
context (see <xref format="default" target="fwd_ctx_v4"/>) and can be 
recovered when needed. This is similar to IPv6 segment routing (see 
<xref format="default" target="RFC8986"/>) or a LISP (see <xref 
format="default" target="RFC9300"/>) RLOC with the exception that the 
original addresses are stored in SVR Metadata within the payload portion
of the packet, and not the IP Network Header.
        </t>
        <t>
Selection of the Waypoint Address to direct sessions is implementation 
specific. In the general case, a standard FIB lookup returns one or more
IP Address(es) (Waypoints) of the next SVR peer. When more than one 
Waypoint address is returned from the FIB, additional logic can be 
applied to select the best Waypoint based on observed peer pathway 
quality or session layer load balancing. See <xref format="default" 
target="SVR_example"/> for exemplary details.
        </t>
        <t>
To provide a return path for the return flow, the source SVR peer 
changes the source address to be its own egress Waypoint address. This 
provides a guarantee of a symmetric flow. The state of the session MUST 
be held in both the source SVR router and the destination SVR peer.
        </t>
        <t>
The address translation rules for the session become state information 
that is processed on every packet after the SVR Metadata handshake. All 
5 tuples of addressing information are updated bidirectionally for the 
session. This action replaces tunnel encapsulation and decapsulation 
(tunnel compression), and is an order of magnitude simpler 
computationally.
        </t>
      </section> <!-- transport_addr_mod -->

      <section anchor="semantic_based_routing" numbered="true" toc="default">
        <name>Optional use of Tenants and Service names for Routing</name>
        <t>
SVR Metadata contains contextual IP Addresses (sources, destinations, 
and Waypoints) along with textual service names (i.e., Zoom, Office365, 
etc.). The SVR routers can apply policies and route sessions based on 
the textual names within SVR Metadata if they have a route information 
base that contains service names. When performing name-based routing, a 
destination NAT is often required when exiting the SVR network. The 
primary use case for this is networking between public clouds such as 
AWS and Azure.
        </t>
        <t>
With semantic based routing, the use of Dynamic DNS to locate a service 
can be eliminated if clients support SVR. Clients can simply request the
service by name, and the SVR router can resolve the route, and deliver
the session to the best location. The last SVR Router on egress performs
a destination NAT for the chosen best instance of a service.
        </t>
        <t>
A local DNS server resolving service addresses to a nearby SVR router 
can also provide semantic based routing. This can eliminate the need to 
use dynamic DNS for locating services inside data centers.
        </t>
      </section> <!-- semantic_based_routing -->

      <section anchor="unique_tuples" numbered="true" toc="include">
        <name>Unique 5-Tuples for Every Session</name>
        <t>
To make sessions completely independent on peer pathways, the source 
port and destination port can be assigned any values that are unique by 
the source router. When there are no NATs between the two router 
interfaces, this permits 2^32 (4,294,967,296) different unique sessions 
on a peer pathway. If there are source NATs, this will be reduced to 
2^16 (64,512 less 1024 reserved) different unique sessions. Ports can be
reassigned if not in active use. It is also possible that middle boxes 
will limit what destination ports are permissible, reducing the number 
of possibilities. Due to all these reasons, range of ports that can be 
used on a peer pathway are provisioned by an administrator.
        </t>
        <t>
The ingress SVR peer (client side) assigns both source and destination
ports, even ports for local (source port) and odd ports for remote 
(destination port). This provides uniqueness between any two peers, with
no negotiation or collision possibilities. This reduces the number of 
sessions originating by a router to half of the total sessions 
(or 2^30). Think of the two ports as a Session Identification Tag. Even 
if a session traveling in the opposite direction was allocated the same 
exact ports, because the source address and destination addresses would 
be swapped, the 5-tuples on the wire remain unique.
        </t>
        <t>
This unique tuple per TCP/UDP session also allows any DSCP or QoS scheme
to work properly. Those fields in the original packet were not modified 
and the underlay network routers will see those fields on a 
session-by-session basis.
        </t>
      </section> <!-- unique_tuples -->

      <section anchor="post_exchange" numbered="true" toc="include">
        <name>Session Packets Post SVR Metadata Exchange</name>
        <t>
After the SVR Metadata handshake has been completed, all subsequent 
packets are transformed (all 5-tuples, bidirectionally).  Compared to 
IPSec encapsulation, packet transformation is very efficient as it does 
not require memory copies, new header creation, new packet checksums, 
and mandatory encryption.
        </t>
      </section> <!-- post_exchange -->

      <section anchor="session_state_reqs" numbered="true" toc="include">
        <name>Session State Requirements</name>
        <t>
Each participant (peer) in secure vector routing must maintain state for 
every active session. This includes the full set of original addresses 
and translations required. This allows participants to stop sending SVR 
Metadata once it has been received by the peer as well as directing 
traffic through a network akin to segment routing. There are three 
possible scenarios for how state could be lost. Loss of state can result
in sessions that become stale.
          </t>
        <ul spacing="normal">
          <li>
SVR Ingress Router Loses State: The session state at a router that 
originated the SVR session loses state. This could happen during a 
redundancy or power failure.
          </li>
          <li>
SVR Peer Router Loses State: The session state is lost in an 
intermediate (2nd to nth) router processing an SVR session.
          </li>
          <li>
One or more middleboxes lose state between two SVR routers, breaking or 
modifying the session.
          </li>
        </ul>
        <dl newline="false" spacing="normal">
          <dt>Reacquiring State:</dt>
          <dd>
In all cases, securely reacquiring and/or reestablishing the state from 
an SVR peer for a session is necessary. If neither peer has session 
state, the session can be considered a new session and treated like any 
first packet. See <xref format="default" target="east_first_pkt_proc"/>.

Detection of potential loss of state is performed on every SVR router 
for every session at all times. Just prior to transmitting a packet from
an SVR router for a session, the elapsed time since a packet was 
received from an SVR peer is compared to an inactivity timeout. The 
inactivity timeout is provisioned, and has a recommended value of 5 
seconds. If the inactivity timeout is exceeded, then a loss of session 
state MAY be indicated. Note that this logic has no relationship with 
session timers guarding session state against no activity.
          </dd>
          <dt>Unicast Flows:</dt>
          <dd>
For unicast flows, or asynchronous sessions, consisting of packets in 
one direction, detection of potential loss of state will occur 
frequently. This will result in this inactivity timeout occurring on a 
routine basis for these types of sessions.
          </dd>
          <dt>Potential Loss of State:</dt>
          <dd>
If a potential loss of session state is indicated, then a Session Health
Check SVR Metadata is inserted in the packet being transmitted. When the
SVR Peer receives Session Health Check SVR Metadata, if the session is 
valid, and simply idle, a unicast flow, or an asynchronous session, the 
SVR peer will respond with a generated packet that includes Forced Drop 
SVR Metadata with a reason of 8 indicating the session health check is 
good. For unicast and asymmetric flows, this bi-directional exchange of 
SVR Metadata ensures the session is valid and any middleboxes between 
the SVR routers have valid session state. This exchange only occurs 
during normal packet transmittal, and as such does not replace session 
keep alive. (see <xref format="default" target="nats_and_keepalive"/>).
          </dd>
          <dt>State not present:</dt>
          <dd>
If an SVR peer receives a packet with Session Health Check SVR Metadata
and it has no session state for the session, a generated packet that 
includes Forced Drop SVR Metadata with reason 2 indicating that full 
session set SVR Metadata should be sent in the next packet. See <xref 
format="default" target="state_recovery_examples"/> for an example. In 
certain cases, where a middle box has lost state information, or 
arbitrarily modified some aspect of the session (e.g., CGNAT), packets 
with SVR Metadata may not transmit successfully. In cases where there is
no response to a Session Health Check, the next forward packet is 
treated as a new session and is processed as such. See <xref 
format="default" target="east_first_pkt_proc"/>.
          </dd>
        </dl>
      </section> <!-- session_state_reqs -->

      <section anchor="nats_and_keepalive" numbered="true" toc="include">
        <name>NATs and Session Keep Alive</name>
        <t>
Each SVR router (peer) must statefully remember the source address of a
session with SVR Metadata. This may not be the same address the router 
sent a packet from due to a NAT or firewall in the pathway. Routers use 
both provisioned and learned Waypoint Addresses. Routers MUST store the 
actual Waypoint Addresses received on the wire from a peer.
        </t>
        <t>
When a firewall or middlebox is detected, the SVR router behind such a 
device must send SVR Metadata packets periodically on idle sessions to 
keep any firewall pinhole translations from being removed. For every UDP
and TCP session that has seen no packets after a programmable length of
time (20 seconds is recommended), the SVR Peer should send an SVR 
Control Message on the peer path with the source and destination ports 
from the idle session's saved state. See <xref format="default" 
target="proto_msg"/> for more information and see <xref format="default"
target="nat_keep_alive"/> for an example.
        </t>
      </section> <!-- nats_and_keepalive -->

      <section anchor="opt_bfd_metadata" numbered="true" toc="include">
        <name>Use of BFD on Peer Pathways</name>
        <t>
BFD <xref format="default" target="RFC5880"/> is used to verify Peer
Pathways. BFD is used to determine reachability, presence of NATs, 
changes of Waypoint Addresses, determination of MTU size, current 
quality on idle circuits, authentication of peers, and maintenance of 
peer cryptographic keys. Alternative methods can be used for each of 
these if both peers agree. The use of BFD is included in this 
specification as a preferred technique for Peer Pathway management.
        </t>
        <t>
BFD Metadata is defined and required to measure quality, perform 
authentication, and maintain security keys because standard BFD 
authentication fields are insufficient. BFD Metadata is different than 
SVR Metadata because it is inserted at the very end of a BFD control 
packet, and not at the end of the layer 4 header. Some BFD Metadata is 
encrypted. To make processing easy, protobufs (Protocol Buffers) are 
used to transmit the BFD Metadata instead of TLVs. The specifics of BFD
Metadata can be found in <xref format="default" target="std_bfd"/>.
        </t>
      </section> <!-- opt_bfd_metadata -->

    </section> <!-- op_theory -->

    <section anchor="SVR_example" numbered="true" toc="include">
      <name>SVR Multi-path Routing Example</name>
      <t keepWithNext="true">
The example below shows two SVR capable routers, peering with each other
over multiple pathways.
      </t>
      <figure anchor="ex_setup">
        <artwork align="left" alt="" name="" type="">
          <![CDATA[

 Client
  LAN
10.x.x.x
   |
   |  +--------+                                  +---------+
   |  |        |                                  |         |
   |  |        |                                  |         |
   +->] East  [203.0.113.1<---MPLS---->203.0.113.89] West   |
      | SVR    |                                  |  SVR    |
      | Router[198.51.80.2<--Inet-+--->198.51.80.8]  Router |
      |        |                  |               |         |
      |       [192.0.2.1<-----LTE-+               |         [<--+
      |        |                                  |         |   |
      +--------+                                  +---------+   |
                <========= Peer Pathways ========>              |
                                                                |
                                                          172.15.11.x 
                                                              LAN
                                                             Servers

          ]]>
        </artwork>
      </figure>
      <t>
Note: The client, server, and MPLS network can support the private 
routes in 10.x.x.x and 172.15.11.x address spaces natively, but the 
internet and LTE networks do not. This is an example of using secure
vectors to join networks together.
      </t>

      <section anchor="establish_peer" numbered="true" toc="include">
        <name>Establishing SVR Peering</name>
        <t>
The first step in peering SVR routers is to apply any locally defined
static L3 routes and begin advertising and receiving routes using L3 
networking protocols (BGP, OSPF, etc.) in order to build a forward 
information base. This is required initially to ensure that the 
Waypoints are reachable bidirectionally allowing SVR Peer Paths to be 
established.
        </t>
        <t>
The second step is for both the East and West routers to establish the 
authenticated peer pathways that make up the SVR Peer relationship. It 
is recommended that each peer pathway must be authenticated 
bidirectionally before the SVR pathway is used.
        </t>
        
        <section anchor="peer_auth" numbered="true" toc="include">
          <name>Reachability and Peer Authentication</name>
          <t>
Authentication of peers is recommended. It is technically possible to 
send SVR Metadata and determine a key for peers without authentication,
but this is discouraged. Either peer could require authentication, and
declare the peer relationship invalid should authentication fail.
          </t>
          <t>
Authentication is based on a certificate signature request created by 
the router that contains its UUID and Authority that is signed by a 
trusted CA (The Router Certificate). A UUID is created and assigned to a
router by and administrator. The UUID is used for several reasons. 
UUID's can be permanently assigned to a router, and if the router name 
changes, the certificate is still valid. There is also a desire to 
prevent router names (typically set to the hostname) and thus network 
topology from being discovered in packet traces. The device 
registration, creation, signing, and the secure installation of this 
certificate are omitted from this specification. Please refer to 
<xref format="default" target="RFC4210"/>.
          </t>
          <t>
While RSA certificate cryptography can be used, Elliptical Curve 
encryption (see <xref format="default" target="RFC8422"/>) techniques 
are recommended for use in SVR. The NIST Curve that is to be used is 
defined by an administrator. It is recommended that NIST Curve P-256 be 
used for all SVR Metadata cryptography. All participating routers in an 
SVR network must use the same elliptic curve.
          </t>
          <t>
Each peer sends a BFD packet that contains BFD Metadata in clear text 
that contains an X.509 Router Certificate in PEM format (see <xref 
format="default" target="RFC5758"/>). See <xref format="default" 
target="peer_auth_procedure"/> for specifications. Upon receipt, this 
certificate is verified like any other X.509 certificate. The common 
name in the certificate provides the authenticated UUID of the peer 
router. The router must verify that the UUID identified in the 
certificate is a valid peer in its routing configuration. The 
certificate should have a locally verifiable chain to a trusted 
certificate authority (CA).
          </t>
          <t>
In the example above, there are three pathways. The BFD message with the
X.509 certificate is sent by each side (East and West) on each pathway.
Each side verifies the certificate, and then determines if the peer 
pathway is valid and should be used between peers. To communicate that 
the peer has received the certificate, and to stop sending it in 
subsequent BFD packets, a BFD packet without a certificate is sent. This
defines the handshake for the local and remote peer. If a certificate is
ever required (for example when a router reboots) a peer can request it
be transmitted by sending its certificate.
          </t>
          <t>
The public key of the router is stored and saved to verify signatures 
used in subsequent keying procedures (see <xref format="default" 
target="peer_key"/>). If the router's certificate is updated, this 
process must be repeated. Any outstanding valid keys remain operational,
preventing outages during recertification.
          </t>
        </section> <!-- peer_auth -->

        <section anchor="peer_key" numbered="true" toc="include">
          <name>Peer Cryptographic Key/Re-keying</name>
          <t>
In the above example <xref format="default" target="ex_setup"/> there is
one peer relationship (East and West) that share three Peer Pathways.
Assuming that all three pathways have been authenticated, the East West
peer relationship has three usable transport pathways.
          </t>
          <t>
To securely exchange BFD traffic between East and West peers, a Peer Key
is required. Because the Private Key/Public Key pair used by router is 
to be very long lived, a Key Derivative Function is used (ECDH-ES). The 
SVR protocol uses Concat KDF. See <xref format="default" 
target="NIST_SP_800-56A"/>.
          </t>
          <t>
The Concat KDF process uses a Salt value, one from each peer. The Salt 
values, private key, and the two public keys are inputs to create a key
that is derived from the certificate (essentially authenticated by the 
certificate). This prevents any man in the middle attacks. Encrypted 
fields in BFD Metadata are used to distribute keys for SVR Metadata 
encryption/decryption. Please see <xref format="default" 
target="svr_metadata_key_procedure"/>) for detailed description of how
this works.
          </t>
          <t>
To prevent replay of BFD packets, a nonce is added to BFD Metadata which
is then tracked to prevent reinjection of old BFD packets with 
out-of-date clock times. To avoid an unreasonably growing table size of 
nonces, the amount of BFD packets tracked with timestamps should be rate
limited. Once per minute results in roughly 1440 nonces per peer in one
day. 
          </t>
          <t>
To rekey, at any time, either party can initiate the same sequence, only
with new Salt values.
          </t>
          <t>
The same Peer Key is used for all pathways between peers. This is 
efficient when there are many parallel multi-path pathways.
          </t>
        </section> <!-- peer_key -->

        <section anchor="metadata_key" numbered="true" toc="include">
          <name>Metadata Cryptographic Key/Re-keying</name>
          <t>
SVR Routers can receive packets with SVR Metadata on any interface. 
Also, many remote Peers may share a single interface on an SVR Router. 
Because source addresses changes (NAT Updates) and packets will 
sometimes arrive on different interfaces due to network flaps, and 
routing changes, each SVR Router must know in advance what cryptographic
key to use for each SVR Peer.
          </t>
          <t>
Each SVR router creates a key (or obtains a quantum safe key) that it 
shares with its peers. Any SVR metadata sent from any peer must use 
this SVR Metadata Key. BFD Encrypted Metadata is used to broadcast the 
Key to all peers and its version. See <xref format="default" 
target="svr_metadata_key_procedure"/>.
          </t>
          <t>
The SVR router will share the same Key with all Peers, therefore all SVR
Metadata processed locally will have one key until it is rotated.
          </t>
        </section> <!-- metadata_key -->

        <section anchor="peer_service_state" numbered="true" toc="include">
          <name>Bring Peer into Service</name>
          <t>
When a peer has at least one working authenticated pathway, and has 
calculated an Elliptical Curve Peer Key (ECPK), the SVR Peer is declared
operational and in service and ready for transporting traffic 
bidirectionally.
          </t>
        </section> <!-- peer_service_state -->

        <section anchor="peer_in_service" numbered="true" toc="include">
          <name>Resulting Peer Relationship</name>
          <t>
When in service, East and West independently communicate using BFD to 
each other's interfaces to ensure operational status and measure path
characteristics such as jitter, latency, and packet loss. In our 
example, assuming 100 percent success, the resulting peer pathways would
be:
          </t>
          <figure anchor="ex_peer_config">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

PEER: East -> West Authenticated/In Service
  Name      Description                    Characteristics
  MPLS      203.0.113.1->203.0.113.89      20ms Lat, 0 Loss,  2 Jit
  Internet  198.51.80.2->198.51.80.8       30ms Lat, 0 Loss,  3 Jit
  LTE       192.0.2.1->198.51.80.8         50ms Lat, 0 Loss, 15 Jit

PEER: West -> East Authenticated/In Service
  Name      Description                    Characteristics
  MPLS      203.0.113.89->203.0.113.1      20ms Lat, 0 Loss,  2 Jit
  Internet  198.51.80.8->198.51.80.2       30ms Lat, 0 Loss,  3 Jit
  LTE       198.51.80.8->192.0.2.1         50ms Lat, 0 Loss, 15 Jit

              ]]>
            </artwork>
          </figure>
          <t>
BFD is also used on service Peer Pathways to determine MTU size and 
detect address changes, and monitor quality when session traffic is 
idle.
          </t>
        </section> <!-- peer_in_service -->

      </section> <!-- establish_peer -->

      <section anchor="svr_fib" numbered="true" toc="include">
        <name>CIDR based SVR Peer FIB Entries</name>
        <t>
To route packets and sessions of packets onto SVR Peer Pathways, a route
lookup must return an indication of either an SVR peer pathway, or an 
SVR peer.
        </t>
        <t>
In the example shown below, our assumption is that there are servers 
that are located inside 172.15.11.0/24 at the West location. West 
publishes or otherwise advertises this route to East on each path 
available to it. Subsequently East's FIB will look like this:
        </t>
        <figure anchor="ex_fib">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

  East's Forward Information Base (FIB)
     Route             Next-Hop IP Addr
     ----------------  -----------------
     172.15.11.0/24    203.0.113.89
     172.15.11.0/24    198.51.80.8
     ....
     [FIB Entries to reach Waypoints omitted]

            ]]>
          </artwork>
        </figure>
        <t>
Additionally, we will assume there exists a network policy created by 
the administrator of an Authority &quot;example&quot; that defines a 
Tenant &quot;engineering&quot; as 10.0.0.0/25 VLAN2, and 
&quot;github.example&quot; as 172.15.11.23 using TCP port 22. The 
provisioning and/or discovery of this policy is outside the scope of 
this protocol description.
        </t>
        <t>
A first packet from an engineering client with github as a destination
received at the East SVR Router will result in a search of the FIB and 
result in two possible next-hop IP Addresses. East will consult its SVR 
Peer Pathway list and recognize that three of its peer pathways have an 
exact match of this next-hop IP Address. These represent the three 
possible pathways that may be used for routing this session. The 
resulting potential routes are:
        </t>
        <figure anchor="ex_fib_results">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

  Possible Routes
    MPLS      20ms Latency, 0 Loss,  2 Jitter
    Internet  30ms Latency, 0 Loss,  3 Jitter
    LTE       50ms Latency, 0 Loss, 15 Jitter

            ]]>
          </artwork>
        </figure>
        <t>
The East router can now choose which Peer Pathway is desired for the 
specific session. If the East router has quality service levels to 
maintain, it can choose from any of the Peer Pathways based on their 
current quality metrics. If all things are equal, the East router could 
load balance using approaches like &quot;least busy&quot; or other 
techniques. Once a Peer Pathway is chosen, the first packet SVR Metadata
is constructed, inserted into the first packet, and sent down the chosen
pathway to the West peer router.
        </t>
        <t>
For this example, the private address space in the LAN supported by the
East Router is different. This is often the case with large networks. 
This is illustrative of a branch router performing network address 
translation (NAT) on a source address to solve overlapping address 
problems.
        </t>
        <t>
In this specific case, assuming MPLS was chosen, East would perform 
first packet processing resulting in the insertion of SVR Metadata in 
the first packet (see <xref format="default" 
target="east_first_pkt_proc"/>) and send it out East's interface with a 
source address of 203.0.113.1 and a destination address of 203.0.113.89.
These are the exact addresses of the MPLS Peer Pathway.
        </t>
        <t>
Both the East and West routers would use the same address pairs (only
reversed) for the bidirectional session, using the allocated source and 
destination ports to recognize the specific session. All packets from 
all sessions on a peer path will have the same exact IP addresses, 
differentiated solely by their port numbers.
        </t>
      </section> <!-- svr_fib -->

      <section anchor="svr_name_fib" numbered="true" toc="include">
        <name>Optional FIB Containing Service Names</name>
        <t>
SVR Metadata in the first packet contains text strings that contain 
service names. SVR routing can route traffic by these names if the FIB 
contained text entries. There are some use cases where this is preferred
over CIDR look-ups:
        </t>
        <dl newline="false" spacing="normal">
          <dt>Avoiding Dynamic DNS:</dt>
          <dd>
Dynamic DNS is used to augment network routing protocols by answering 
the question: What best IP Address is available and best for a session 
now? Dynamic DNS can be plagued by delays in real time updates and 
additional complexity and cost. In private networks, path service state 
may not be reflected in Dynamic DNS responses.
          </dd>
          <dt>Multi-Cloud Networking:</dt>
          <dd>
Public clouds run service instances on dynamically allocated private IP 
addresses. They provide very accurate and responsive DNS updates to help
find IP addresses for networking. These DNS services are not available 
outside of the cloud, making internetworking difficult. SVR Routers can 
use DNS resolution to find IP Addresses for named services.
          </dd>
        </dl>
        <t>
Below is an example FIB that contains named services and traditional FIB
entries. The FIB is now an SVR FIB containing service names, protocols, 
and ports, with next-hop addresses changed to Waypoint Addresses.
        </t>
        <figure anchor="ex_name_fib">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

  East's Extended SVR Forward Information Base (OPTIONAL)

                                                       Egress 
  Service Name     Route                 Waypoint      Action
  --------------   --------------------  ------------  --------
  github.example   172.15.11.23:TCP:22   203.0.113.89  FWD
  github.example   172.15.11.23:TCP:22   198.51.80.8   FWD
  logsvc.example   172.15.11.20:UDP:514  203.0.113.89  DNS
  logsvc.example   172.15.11.20:UDP:514  198.51.80.8   DNS
  https.example    172.15.11.24:TCP:443  203.0.113.89  DEST NAT
                                                       -196.168.1.1
                                                       -196.168.1.2
                                                       -196.168.1.3
     [FIB Entries to reach Waypoints omitted]

            ]]>
          </artwork>
        </figure>
        <t>
Longest prefix matching (LPM) of the destination address, along with 
protocol and port will be used to match routes for packets intended for 
github on ingress to SVR. The text string &quot;github.example&quot; 
will be used by all other SVR routers until egress from SVR. The SVR FIB
can be used to LPM match on IP addresses and exactly match protocol and 
ports. In the above illustrative example, only three protocols are 
supported (SSH, Syslog, and HTTPs). All other packets will be denied by 
default.
        </t>
        <t>
The egress action in the SVR FIB can be used to support three different 
egress actions:
        </t>
        <dl newline="false" spacing="normal">
          <dt>Forward Packet (Default):</dt>
          <dd>
Restore the IP Addresses and forward. If a source NAT is provided in the
SVR Metadata, NAT the source address.
          </dd>
          <dt>DNS:</dt>
          <dd>
Use DNS to resolve the service name locally. In this example DNS 
resolution procedures would be used on egress to resolve 
&quot;logsvc.example&quot;.
          </dd>
          <dt>Destination NAT:</dt>
          <dd>
NAT the destination address to one (or load balance to a pool of 
addresses). This is identical to loadbalancers.
          </dd>
        </dl>
        <t>
These named routes can co-exist with traditional FIB entries shown 
above. SVR will always match a named route first, and fall through to 
the CIDR routes second.
        </t>
      </section> <!-- svr_name_fib -->

      <section anchor="security_definitions" numbered="true" toc="include">
        <name>SVR Security Definitions</name>
        <t>
For basic SVR functionality to work between peers, there must be an 
Authority wide provisioned set of rules. These rules include:
        </t>
        <dl newline="false" spacing="normal">
          <dt>HMAC Method:</dt>
          <dd>
This describes the method/technique for signing SVR packets. This could 
be SHA1, SHA256, or SHA256-128.
          </dd>
          <dt>Use Time Based HMAC:</dt>
          <dd>This is either YES or NO.</dd>
          <dt>HMAC SVR Metadata or ALL:</dt>
          <dd>This is NONE, SVR Metadata Only, ALL</dd>
          <dt>SVR Metadata Block Cipher:</dt>
          <dd>This is either NONE, AES128, AES256.</dd>
        </dl>
        <t>
SVR does not limit the use of ciphers and techniques to those listed 
above. The requirements for both signatures and encryption are to use a 
cipher where the results are fixed, well-known, block sizes.
        </t>
        <t>
Security Policies are used during session setup to establish payload 
encryption for individual sessions. These are exchanged in first packet 
SVR Metadata.
        </t>
        <t>
For this example, the following SVR security definitions are used.
        </t>
        <figure anchor="security_definition_example">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

      HMAC: (On, time-based, SHA256-128, ALL Packets)
      SVR Metadata Encryption (On, AES256)

            ]]>
          </artwork>
        </figure>
      </section> <!-- security_definitions -->

      <section anchor="hmac_details" numbered="true" toc="include">
        <name>Time-Based HMAC Details</name>
        <t>
To positively authenticate and provide integrity for SVR session, SVR 
peers use Time-Based HMAC signatures. HMAC signatures are defined in    
<xref format="default" target="RFC2104"/>. Please see <xref 
format="default" target="std_hmac_signature"/>.
        </t>
        <t>
In our example, we are using SHA256-128 with a size of 16 Bytes.
        </t>
      </section> <!-- hmac_details -->

      <section anchor="payload_encryption" numbered="true" toc="include">
        <name>Payload Encryption</name>
        <t>
Every SVR Metadata transaction includes a security ID header TLV (see 
<xref format="default" target="security_id"/>).
        </t>
        <t>
Payload keys are asymmetric and are transmitted in the encrypted portion
of metadata. A unique payload key is used for each flow of a session,
bidirectionally.
        </t>
        <t>
Payload keys and IVs should minimally use FIPS 140-2 approved highly 
secure DRBG for generation.
        </t>
        <t>
Using a unique payload key per flow simplifies key exchange and 
complexity, avoiding the need to address glare conditions. Long-lived 
sessions may need to have their payload key rotated if the duration of 
the session exceeds the rekey-interval. When a new payload key is 
generated, it is inserted in mid-flow metadata update. The interval for 
rekey events should be configurable.
        </t>
        <t>
The originating router of the flow will always generate the payload key 
and insert it into metadata. The terminating router generates its own 
unique key for the reverse flow. As packets flow through the originating
router, and a rekey event is triggered, mid-flow metadata is enabled, 
and the new key is populated into metadata and the packet is forwarded 
along.
        </t>
        <t>
Second/subsequent router(s) continue to monitor for mid-flow metadata, 
and if the key changes, it will update the key to be used for subsequent
payload decryption. The key will be stored and used for all subsequent 
packets.
        </t>
      </section> <!-- payload_encryption -->

      <section anchor="new_session_init" numbered="true" toc="include">
        <name>New Session Initiation Detailed</name>
        <t>
The diagram below shows the example github TCP session flowing between a
client and server through the East and West routers in our example 
network.
        </t>
        <t keepWithNext="true">Ladder Diagram for SSH Example:</t>
        <figure anchor="ladder_ssh_ex">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

    Engineering                                      Github
    Client . . . . . . . . . . . . . . . . . . . . . Server
      |                                                 |
      |         East Router              West Router    |
      |            |                        |           |
      |---SYN----->|                        |           |
      |            |--SYN[w/MD]------------>|           |
      |            |                        |--SYN----->|
      |            |                        |           |
      |            |                        |<--SYN/ACK-|
      |            |<------SYN/ACK[w/RMD]---|           |
      |<--SYN/ACK--|                        |           |
      |            |                        |           |
      |----ACK---->|                        |           |
      |            |-----------ACK--------->|           |
      |            |                        |---ACK---->|
      |            |                        |           |
      |<== Session Packets Flow with No SVR Metadata ==>|

            ]]>
          </artwork>
        </figure>
        <t>
The East Router MUST construct and insert SVR Metadata (MD) in the first
packet of the SSH session, which will be a TCP SYN packet. The West 
Router must remove the SVR Metadata, and forward the SYN packet, and 
wait for the server to respond with a SYN/ACK. Upon receipt of the 
SYN/ACK, the West Router will create reverse SVR Metadata (RMD), and 
insert it into the SYN/ACK. This will complete the SVR Metadata 
handshake for the SSH session. All forward and reverse SVR Metadata are 
inserted into existing packets if possible.
        </t>
        <t>
When a client or router detects that a new session is being established,
the East Router will insert SVR Metadata into the first packet to 
communicate intent to the West Router. At both East and West Routers, 
the first packet will require specialized handling. Detecting a first 
packet for a session is protocol specific. For TCP, it is a new 5-Tuple 
packet (new flow) with the just the SYN flag set. For UDP, it is a new 
5-Tuple packet not currently in active use.
        </t>

        <section anchor="east_first_pkt_proc" numbered="true" toc="include">
          <name>East First Packet Processing</name>
          <t>
Utilizing the same example, assume that the packet shown below arrives 
on the East Router from the Client LAN. The packet is the result of an 
engineer attempting to access a github service via SSH.
          </t>
          <t keepWithNext="true">Arriving Packet at East Router</t>
          <figure anchor="arriving_pkt">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

      Packet received on LAN side East Router 
      Engineer using SSH to access Github
      +---------+---------------------+--------------+----------+
      |L2 HDR   | IP Header           | TCP Header   | PAYLOAD  |
      |  VLAN=2 |    SRC=10.0.1.1     |   Sport=6969 |   Data   |
      |         |    DST=172.15.11.23 |   Dport=22   |  (N/A)   |
      +---------+---------------------+--------------+----------+
      
              ]]>
            </artwork>
          </figure>

          <section anchor="determine_tenant" numbered="true" toc="include">
            <name>Determine Tenant</name>
            <t>
The tenant is a text name which describes the routes and policies that 
are available for a group of source IP addresses. Tenants are like 
security zones. In our example, the &quot;engineer&quot; is based upon 
VLAN 2, and the tenant will be &quot;engineer&quot; as named by the 
Authority &quot;example&quot;. The configuration and data models to map 
physical network attributes to named tenants is implementation specific.
Associating a default tenant with every logical interface on an SVR 
Router is recommended.
            </t>
          </section> <!-- determine_tenant -->

          <section anchor="determine_service" numbered="true" toc="include">
            <name>Determine Service</name>
            <t>
There are multiple ways to determine the associated service for a new 
session. Application Identification technology is used that understands 
all popular SaaS offerings. These techniques include, but are not 
limited to, the use combinations of IP address ranges and ports, SNI 
fields in TLS, Common Name from Certificates, and extraction of URLs 
from HTTP requests. Most popular SaaS vendors today publish and 
frequently update their CIDR blocks and ports used by their services. 
The means of service identification are out of scope for this document,
but importantly are the mechanism used to associate the session with a 
given policy.
            </t>
            <t>
We will assume for this document, that the address 172.15.11.23 is a 
well-known address for git servers in the network defined by Authority 
&quot;example&quot;, and port 22 is known to be SSH.
            </t>
          </section> <!-- determine_service -->

          <section anchor="determine_network_requirements" numbered="true" toc="include">
            <name>Determine Network Requirements</name>
            <t>
Once the tenant and service have been determined, a lookup for network 
requirements can be determined.
            </t>
            <t keepWithNext="true">Example Network Requirements</t>
            <figure anchor="example_network_requirements">
              <artwork align="left" alt="" name="" type="">
                <![CDATA[

          SERVICE: github
            Access Policies:
              Tenants Allowed: engineering
              Tenants Denied: release.engineering
            Quality Policy: latency < 40ms
            Security Policy: None

                ]]>
              </artwork>
            </figure>
            <t>
The above definition for github defines an example network requirement. 
Access policies determine which tenants are allowed, and if any are
specifically denied. The Quality policy defines the service level 
experience requirements. Secure Vector Routing exchanges tenants, 
services, and security policies using character strings in SVR Metadata.
Access and quality policies are defined and used locally within a router
and logically associated with the service. The implementation of quality
and access policy controls are site specific. For example, VLAN based 
subnets may have different meanings at various locations. Also, QoS 
management schemes may be different for different network areas.
            </t>
          </section> <!-- determine_network_requirements -->

          <section anchor="picking_a_peer_path" numbered="true" toc="include">
            <name>Picking a Peer Path</name>
            <t>
As stated previously, the East Router has three peer paths that can 
reach the destination based on L3 reachability. The next step is to 
apply the network requirements to see which of the peer paths are within
the service level experience. Our policy requires latency to be less 
than 40 msecs, which eliminates East's LTE pathway from consideration. 
The remaining two pathways, MPLS and Internet, are both within SLA. We 
will choose MPLS as it has the lowest latency, offering the user the 
best experience.
            </t>
            <t>
Many different criteria can be used in selecting a peer pathway. In 
practice, how busy a peer path is and its capacity result in new 
sessions routing to 2nd best options. Often simple load balancing is 
used. In cases where there are higher costs (such as LTE or 5G 
networking), these may be held in reserve for backup or disaster 
recovery. The actual algorithms for picking peer pathways are outside 
the scope of this protocol.
            </t>
          </section> <!-- picking_a_peer_path -->

          <section anchor="perform_source_nat" numbered="true" toc="include">
            <name>Allocate Source NAT if Necessary</name>
            <t>
In this github example, there is a source NAT at the East Router on the 
MPLS interface to the data center. This design allows all of the remote 
branch sites to use overlapping addresses, and is very common in larger 
networks. Routers that perform source NAT have two options: use the 
interface address and allocate a new source port, or use an IP address 
pool and allocate full IP addresses for each session. Either way, this 
allocated address only needs to be placed into SVR Metadata, as the 
existing packet address will be translated to Waypoint Addresses 
shortly. The egress SVR router will apply the source NAT.
            </t>
          </section> <!-- perform_source_nat -->

          <section anchor="allocate_svr_ports" numbered="true" toc="include">
            <name>Allocation of Ports</name>
            <t>
The next step is to allocate new ports for the SVR session. The ports 
being allocated must not be in use, and should not have been used 
recently to avoid any issues with middleboxes. See <xref 
format="default" target="std_md_insertion"/>.
            </t>
            <t>
The range of ports that can be used may be site specific and tied to 
policies that exist in upstream firewalls or middleboxes. For these 
reasons, the actual pool of available addresses is provisioned on every
SVR router. The East router has ports 8000 to 24000 available for both 
the source and destination ports. In this example we will allocate an 
even source port of 8000, and an odd destination port of 8001. Note that
both source and destination ports are allocated by the router that 
initiates SVR Metadata.
            </t>
          </section> <!-- allocate_svr_ports -->

          <section anchor="save_session_state" numbered="true" toc="include">
            <name>Session State and SVR Metadata Construction</name>
            <t>
The router now has reached a point where it can forward the packet. It 
has valid network requirements, available peer paths, and has available
SVR ports. The next step is to create and save all session state 
information for subsequent packet processing. A session UUID is created 
for end-to-end tracking of sessions. The table below refers to SVR 
Metadata TLVs and specific contents that are documented in  <xref 
format="default" target="meta_format"/>.
            </t>
            <t keepWithNext="true">Session State Table Entry</t>
            <figure anchor="meta_format_fig">
              <artwork align="left" alt="" name="" type="">
                <![CDATA[

State Information & Mappings to SVR Metadata Fields

              SVR Metadata TLV                       |------TLV------|
Category       -Field              VALUE             Type   Len  Hdr 
--------      ------------------   ----------------
Header                                                       12   
Header TLVs
              Security ID          1                   16     4    4
              Path Metrics                             26    10    4
               -Tx Color           5
               -Tx TimeValue       4200 MSecs
               -Rx Color           3
               -Rx TimeVlue        3950 MSecs
               -Drop               No
               -Prev Color Count   950 Packets
                                                            ---  ---
                            Total Header Length = 34 (26+8)  26    8

Payload TLVs
               Forward Context                         2     13    4
               - Source IP Addr     10.0.0.1
               - Dest IP Addr       172.15.11.23
               - Protocol           TCP
               - Source Port        6969
               - Dest Port          22
               Tenant Name          engineering         7    11    4
               Service Name         github             10     6    4
               UUID                 e9b083df-d922.....  6    16    4
               Source Router Name   East Router        14    11    4
               Source NAT Address   203.0.113.1        25     4    4
               Security Policy      NONE               15     4    4
               Peer Path                               19    22    4
               - Source Addr        203.0.113.1
               - Dest Addr          203.0.113.89
                                                            ---  ---
                         Total Payload Length = 119 (87+32)  87   32 

                                 To West     Fr West
              Allocated Ports     Router      Router
               -Source Port        8000        8001
               -Dest Port          8001        8000

              Session HMAC Key    [Peer Key at session start]

                ]]>
              </artwork>
            </figure>
            <t>
The required SVR Metadata attributes that must be inserted in a first 
packet of a new sessions are defined in <xref format="default" 
target="std_ip_session_tlvs"/>, include Security ID, Forward Context, 
Tenant Name, Service Name, Session UUID, Source Router Name, Security 
Policy, Peer Pathway ID.
            </t>
            <t>
Two optional SVR Metadata attributes Path Metrics and Source NAT Address
are both included in this example. This is documented in <xref 
format="default" target="path_metrics"/> and <xref format="default" 
target="src_nat_addr_v4"/>.
            </t>
            <t>
The order of the TLVs is arbitrary, but header TLVs must be before any 
payload TLVs. If a TLV is received that is unknown to a peer, it MUST 
be ignored. In this example, the header length including the two header 
TLVs is 34, and the 8 payload TLVs total 119 octets in length.
            </t>
            <t>
The Session HMAC Key is state information retained by the router. The 
Session HMAC Key is communicated between SVR peers as part of BFD 
Metadata. This key is used for the life of a session.
            </t>
          </section> <!-- save_session_state -->

          <section anchor="encryption_of_metadata" numbered="true" toc="include">
            <name>Encryption of SVR Metadata</name>
            <t>
The next step is to encrypt the SVR Metadata block as defined in <xref 
format="default" target="std_metadata_encryption"/>. In our example, our
provisioned security definitions include AES256 for SVR Metadata 
encryption. AES has a 128-bit block size for all key lengths. In our 
example, the SVR Metadata payload TLVs are 119 octets large.  Padding 
is added during encryption to ensure the payload is 128 octets (or 9 
octets of padding). In addition, to make the encrypted data stateless, 
we must also include a 16 octet initialization vector directly after the 
encrypted block. The resultant encrypted SVR Metadata block is 178 
octets and looks like this:
            </t>
            <t keepWithNext="true">SVR Metadata Block</t>
            <figure anchor="SVR_metadata_block_fig">
              <artwork align="left" alt="" name="" type="">
                <![CDATA[

      +--------------+--------------+---------+----------------+
      |   SVR        |   SVR        |         |                |
      | Metadata     | Metadata     | Padding | Initialization |
      | Header       | Payload TLVs |         |    Vector      |
      | (Unecrypted) |              |         |                |
      | 34 Bytes     | 119 Bytes    | 9 Bytes |  16 Bytes      |
      +--------------+--------------+---------+----------------+
      |<---Clear---->|<---Encrypted Portion-->|

      |<--------------178 Byte SVR Metadata Block------------->|

                ]]>
              </artwork>
            </figure>
          </section> <!-- encryption_of_metadata -->

          <section anchor="insert_metadata" numbered="true" toc="include">
            <name>Insert SVR Metadata</name>
            <t>
The SVR Metadata block is inserted into the packet directly after the L4
Header. The total length of this specific SVR Metadata block is 178 
octets, 34 of which are header octets and 119 for payload TLVs. If there 
is data in the payload portion of the IP Packet, the payload data is 
moved down to make room for the SVR Metadata.  The packet structure will
now look like:
            </t>
            <t keepWithNext="true">SVR Metadata Added</t>
            <figure anchor="svr_metadata_added_fig">
              <artwork align="left" alt="" name="" type="">
                <![CDATA[

      Packet with SVR Metadata inserted
      +---------------------+--------------+-----------+------------+
      | IP Header           | TCP Header   |  SVR      |  PAYLOAD   |
      |    SRC=10.0.1.1     |   Sport=6969 | Metadata  |    Data    |
      |    DST=172.15.11.23 |   Dport=22   | 178 Bytes | (optional) |
      +---------------------+--------------+-----------+------------+
      
                ]]>
              </artwork>
            </figure>
            <t>
The transport addresses in the packet are updated to use the selected
peer path.
            </t>
            <t keepWithNext="true">Transport Addresses Updated</t>
            <figure anchor="transport_addr_update_fig">
              <artwork align="left" alt="" name="" type="">
                <![CDATA[

      Final Transformed Packet with SVR Metadata inserted
      +---------------------+--------------+-----------+------------+
      | IP Header           | TCP Header   |  SVR      |  PAYLOAD   |
      |    SRC=203.0.113.1  |   Sport=8000 | Metadata  |    Data    |
      |    DST=203.0.113.89 |   Dport=8001 | 178 Bytes | (optional) |
      +---------------------+--------------+-----------+------------+

              ]]>
              </artwork>
            </figure>
          </section> <!-- insert_metadata -->

          <section anchor="signing_svr_pkts" numbered="true" toc="include">
            <name>Signing SVR Packet</name>
            <t>
The packet containing SVR Metadata is now signed with a HMAC signature
(See <xref format="default" target="hmac_details"/>). The HMAC signature
is placed at the very end of the packet, extending the packet size by 
the signature's length. The IP header is excluded from the signature. 
The current SVR Metadata Key is used (see <xref format="default" 
target="svr_metadata_key_procedure"/>) for signing and verifying the 
authenticity of the packet. In this case the HMAC is 16 octets.
            </t>
            <t keepWithNext="true">HMAC Signature Added</t>
            <figure anchor="HMAC_sig_added_fig">
              <artwork align="left" alt="" name="" type="">
                <![CDATA[

    Packet with SVR Metadata inserted
    +-------------------+--------------+-----------+---------+-------+
    | IP Header         | TCP Header   | Encrypted | PAYLOAD | HMAC  |
    |  SRC=203.0.113.1  |   Sport=8000 |   SVR     |   Data  |  16   |
    |  DST=203.0.113.89 |   Dport=8001 | Metadata  |         | Bytes |
    +-------------------+--------------+-----------+---------+-------+
                        |                                    |
                        |<=========HMAC Signed Data=========>|

                ]]>
              </artwork>
            </figure>
          </section> <!-- signing_svr_pkts -->

          <section anchor="xmit_first_packet" numbered="true" toc="include">
            <name>Sending the First Packet</name>
            <t>
The packet length and checksum are corrected, and the packet is 
transmitted. The sending side will include the same exact SVR Metadata 
on every packet until a packet in the opposite direction (reverse 
direction) arrives with reverse SVR Metadata indicating a complete 
handshake. For TCP, the SYN packet contains SVR Metadata, and typically 
a SYN-ACK from the server side responds with SVR Metadata, and there is 
no further SVR Metadata inserted in a session that remains on the same
path for its duration. Metadata is inserted mid-flow for a session 
during path migration events.
            </t>
            <figure anchor="syn-ack-fig">
              <artwork align="left" alt="" name="" type="">
                <![CDATA[

        Client ----> TCP SYN w/SVR Metadata --------> Server
        Client <---- TCP SYN-ACK w/SVR Metadata <---- Server

                ]]>
              </artwork>
            </figure>
            <t>
For UDP, SVR Metadata can be inserted in packets until there is a 
reverse flow packet with SVR Metadata, except for unidirectional flows 
as noted in Section <xref format="default" 
target="unicast_async_flows"/>
            </t>
          </section> <!-- xmit_first_packet -->

        </section> <!-- east_first_pkt_proc -->

        <section anchor="west_first_pkt_proc" numbered="true" toc="include">
          <name>West First Packet Processing</name>
          <t>
If a packet arrives at the West Router having the West Routers Waypoint 
(interface address) as a destination address (i.e., the packet was sent 
to the router, and not to a destination beyond the router) the packet 
may likely contain SVR Metadata. When this occurs, the following steps 
are taken.
          </t>

          <section anchor="ck_src_addr_is_waypoint" numbered="true" toc="include">
            <name>Verify Source Address is a Waypoint</name>
            <t>
Packets arriving on the routers must be validated before they are 
processed (see <xref format="default" target="std_metadata_checking"/>).
These simple checks can eliminate any potential attack vectors. If the 
packet fails authentication or validation, the packet MAY be dropped or 
responded to with an ICMP Destination Unreachable packet.
            </t>
            <t>
In the example case we are using, there are only three source addresses 
that could be possible:
            </t>
            <t keepWithNext="true">Possible Source Addresses</t>
            <figure anchor="possible_source_address_fig">
              <artwork align="left" alt="" name="" type="">
                <![CDATA[

            203.0.113.1      MPLS Peer Pathway
            198.51.80.2      Internet Peer Pathway
            169.254.231.106  LTE Peer Pathway

                 ]]>
              </artwork>
            </figure>
          </section> <!-- west_first_pkt_proc -->

          <section anchor="ck_metadata_block" numbered="true" toc="include">
            <name>Verify SVR Metadata Block</name>
            <t>
The very first and most efficient test is to verify that the SVR 
Metadata is present is to look for the existence of SVR header magic 
number (see <xref format="default" target="std_metadata_dpi"/>).
            </t>
            <t>
The next verification step is to check the HMAC signature (see <xref 
format="default" target="std_hmac_signature"/>).  If the signature is
invalid, the packet should be dropped and a security event noted. If 
valid, processing continues.
            </t>
            <t>
The unencrypted portions of the SVR Metadata header should be verified 
for reasonableness. The header length and payload length must be less 
than the SVR Metadata block size.
            </t>
          </section> <!-- ck_metadata_block -->

          <section anchor="save_state_and_xlations" numbered="true" toc="include">
            <name>Parse SVR Metadata and Save State and Translations</name>
            <t>
The next step is to decrypt the SVR Metadata (See <xref format="default"
target="std_metadata_decryption"/>). If there are any reasons why the 
SVR Metadata block cannot be decrypted, or the decryption fails, the 
packet is dropped.
            </t>
            <t>
The payload TLVs can now be parsed and the necessary state and 
translations loaded into memory. If there is a failure to parse all 
TLVs, the packet is dropped.
            </t>
            <t>
Next the SVR Metadata block and HMAC signatures are removed from the 
packet.
            </t>
          </section> <!-- save_state_and_xlations -->

          <section anchor="restore_addresses_and_route" numbered="true" toc="include">
            <name>Restore Addresses and Route Packet</name>
            <t>
The SVR Metadata information is used to restore the original context to 
the packet. The packet is then recursively processed exactly like the 
first packet described in <xref format="default" 
target="east_first_pkt_proc"/>, with a few differences. The Context, 
Tenant, Service, Security Policy and Session UUID strings are used from 
the SVR Metadata (as opposed to locally determining them). These are 
then used for applying policy and routing decisions locally. The end 
result is the packet may go through another SVR Peer Pathway or be 
delivered via standard networking techniques. In this example, the West 
Router delivers the packet to the Server LAN.
            </t>
            <t>
When the packet is forwarded to another SVR Peer, there are some 
differences. The Tenant, Service, Session UUID, Security Policy and the 
original 5-tuple addresses are all cloned. This provides consistent data
across a multi-hop SVR network. It should be noted that the SVR Metadata
must be decrypted at every SVR Router and then re-encrypted because the 
Waypoint addresses are different for each selected peer pathway. Payload 
decryption however, is only encrypted at the first SVR router and 
decrypted at the last SVR router.
            </t>
          </section> <!-- restore_addresses_and_route -->

          <section anchor="looping_session_detection" numbered="true" toc="include">
            <name>Detection of a Looping Session</name>
            <t>
Because every hop between SVR Routers utilizes the same session UUID, a 
looping first packet is easy to detect. There MUST never be two sessions
with the same UUID. Any session that loops must be dropped. By detecting
looping packets during the first packet transmitted, subsequent packets 
can be dropped on ingress by the SVR Router that detected the looping 
behavior. SVR routers must also decrement the TTL and operate in all 
ways like a traditional router to prevent looping packets that are not 
detected by SVR.
            </t>
            <t>
When a packet arrives with SVR Metadata after the SVR Metadata handshake
has been completed, it is assumed to be an update and not classified as 
looping. Updates can be used to change any attribute, but most commonly 
to change a peer pathway for a session. See <xref format="default" 
target="moving_session"/>.
            </t>
          </section> <!-- looping_session_detection -->

        </section> <!-- west_first_pkt_proc -->

        <section anchor="return_rules_establish" numbered="true" toc="include">
          <name>Pre-Established Return Packet Path</name>
          <t>
After processing the first forward packet at both East and West routers,
both the East and West routers have established packet forwarding rules 
and translations for both directions. This means that eastbound rules 
and westbound rules are all established and installed. The router is 
thus capable now of recognizing 5-tuples in either direction and acting 
on the packets without consulting routing tables. This is known as fast 
path processing.
          </t>
        </section> <!-- return_rules_establish -->

        <section anchor="sending_reverse_metadata" numbered="true" toc="include">
          <name>Sending Reverse SVR Metadata</name>
          <t>
On a session-by-session basis, SVR Routers must know the status of an 
SVR Metadata handshake. If a packet for a session arrives and the SVR 
Metadata handshake is not complete, the SVR Router must insert SVR 
Metadata for the session. This will continue until there is verification
that the SVR Peer has received the information. As stated previously, 
for TCP SYN this is normally the first reverse packet which is a TCP 
SYN/ACK. The purpose of reverse SVR Metadata is:
            </t>
          <ul spacing="normal">
            <li>
To indicate to the sender that it can stop sending SVR Metadata 
(Completion of the SVR Metadata handshake).
            </li>
            <li>
Provide backward information about the service for routing of future 
instances.
            </li>
          </ul>
          <t>In this example, the reverse SVR Metadata includes:</t>
          <t keepWithNext="true">Reverse SVR Metadata Response</t>
          <figure anchor="reverse_metadata_response_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

          Reverse SVR Metadata Response
State Information & Mappings to SVR Metadata Fields

              SVR Metadata TLV                      |------TLV------|
Category       -Field              VALUE             Type   Len  Hdr 
--------      ------------------   ----------------
Header                                                       12   
Header TLVs
              Security ID          1                   16     4    4
              Path Metrics                             26    10    4
               -Tx Color           3
               -Tx TimeValue       4100 msecs
               -Rx Color           5
               -Rx TimeVlue        4050 msecs
               -Drop               No
               -Prev Color Count   1950 packets
                                                            ---  ---
                           Total Header Length = 34 (26+8)   26    8

Payload TLVs
               Reverse Context                         4     13    4
               - Source IP Addr     203.0.113.1
               - Dest IP Addr       172.15.11.23
               - Protocol           TCP
               - Source Port        7891
               - Dest Port          6969
               Peer Path                               19    22    4
               - Source Addr        203.0.113.89
               - Dest Addr          203.0.113.1
                                                            ---  ---
                          Total Payload Length = 43 (35+8)   35    8 

                                   To East     From East
               Allocated Ports     Router       Router 
               - Source Port        8001         8000
               - Dest Port          8000         8001

              Session HMAC Key   [Peer key used by remote peer]

              ]]>
            </artwork>
          </figure>
          <t>
See <xref format="default" target="std_req_tlvs"/> for required and 
optional TLVs in reverse SVR Metadata.
          </t>
          <t>
One optional SVR Metadata attribute is included in this example for the 
pathway metrics. This is documented in <xref format="default" 
target="path_metrics"/>.
          </t>
          <t>
The Session HMAC Key is state information retained by the router. The 
Session HMAC Key is communicated between SVR peers as part of BFD 
Metadata. The lifetime of the HMAC key typically follows the lifetime of
the Peer Metadata key. This key is used for the life of a session.
          </t>
          <t>
One of the benefits of SVR is the complete tracking of sessions 
end-to-end. In this example, the SVR Metadata state located in the SVR 
router contains all addresses used. The forward context provides the 
egress SVR router with the addresses being used pre-NAT, and the source 
NAT information. The reverse context would likewise supply the ingress 
SVR destination NAT addresses. Knowing the Waypoint Addresses used along
with the ports used provides complete end-to-end visibility of each 
session.
          </t>
          <t>
This SVR Metadata will be encrypted, inserted, and an HMAC checksum will
be computed and attached as per the previous example. The reverse packet
in this example will have 34 octets of header data, and 43 octets of 
payload data, 5 octets of padding, and a 16 octets initialization vector 
resulting in an SVR Metadata block that is 98 octets long.
          </t>
        </section> <!-- sending_reverse_metadata -->

        <section anchor="subs_pkt_proc" numbered="true" toc="include">
          <name>Subsequent Packet Processing</name>
          <t>
As soon as an SVR peer receives a packet of a session from another SVR 
peer and there is no SVR Metadata, the SVR Handshake is complete, and it
can stop sending SVR Metadata. This works for both the East Router and 
the West Router. Both will transmit SVR Metadata until they receive a 
packet without SVR Metadata.
          </t>
        </section> <!-- subs_pkt_proc -->

        <section anchor="session_terminate" numbered="true" toc="include">
          <name>Session Termination</name>
          <t>
No SVR Metadata is sent upon normal session termination. The router can
monitor the TCP state machine and have a guard timer after seeing a 
FIN/ACK or RST exchange. After the guard timer, the session can be 
removed from the system. If a new session arrives during this period (a 
TCP SYN), then it will cause immediate termination of the existing 
session. All protocols also have an associated inactivity timeout, after
which the session gets terminated if no packets flow in either 
direction. Should an existing session send a packet after the inactivity
timeout, it will be processed as a new session.
          </t>
        </section> <!-- session_terminate -->

        <section anchor="unicast_async_flows" numbered="true" toc="include">
          <name>Unidirectional/Asymmetric Flows</name>
          <t>
When there are unidirectional flows, or path asymmetry (e.g., TCP 
sequence numbers advance with no reverse packets observed), and there
is end-to-end communication, one can stop sending SVR Metadata. For UDP
asymmetry, the sending router will send a maximum of 20 packets with
SVR Metadata; if no reverse packets are seen during that time, the 
receiving peer router generates and sends a disable SVR Metadata packet 
to the originating router to complete the SVR Metadata handshake. The 
total number of packets sent with SVR Metadata without receiving a 
reverse packet is an implementation detail and is not a strict 
requirement.
          </t>
        </section> <!-- unicast_async_flows -->

        <section anchor="session_ladder" numbered="true" toc="include">
          <name>Multi-Hop Session Ladder Diagram</name>
          <t>
The diagram below shows a typical TCP session flowing between a client 
and server through routers in a network.
          </t>
          <t keepWithNext="true">Ladder Diagram for Session Initiation
            with SVR Metadata:</t>
          <figure anchor="ladder_session_init_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

        Client . . . . . . . . . . . . . . . . . . . . . . Server
          |                                                   |
          |         Router A      Router B     Router C       |
          |            |             |            |           |
          |----SYN---->|             |            |           |
          |            |--SYN[MD1]-->|            |           |
          |            |             |--SYN[MD2]->|           |
          |            |             |            |----SYN--->|
          |            |             |            |           |
          |            |             |            |<--SYN/ACK-|
          |            |             |<--SYN/ACK--|           |
          |            |<--SYN/ACK---|   [RMD2]   |           |
          |<--SYN/ACK--|    [RMD1]   |            |           |
          |            |             |            |           |
          |            |             |            |           |
          |<=== Session Packets Flow with No SVR Metadata ===>|

              ]]>
            </artwork>
          </figure>
          <t>
Each router constructs SVR Metadata for the next chosen peer in the 
routed pathway, as depicted by MD1 and MD2 in the above diagram. Upon 
receipt of the first reverse packet, reverse SVR Metadata RMD2 and RMD1
is inserted. Each router allocates its own transport addresses 
(Waypoints) for each session. The context, service name, tenant name, 
and session UUID sent are unchanged between all routers, and can be used
for determining the application of routing policies. The session UUID is
the same in MD1, MD2, RMD1, and RMD2 in the above diagram.
          </t>
          <t>
Likewise, the diagram below shows a session teardown sequence for a 
typical TCP session.
          </t>
          <t keepWithNext="true">Ladder Diagram for Session Teardown SVR Metadata:</t>
          <figure anchor="ladder_diagram_session_teardown_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

        Client . . . . . . . . . . . . . . . . . . . . . . Server
          |                                                   |
          |         Router A      Router B     Router C       |
          |            |             |            |           |
          |---FIN----->|             |            |           |
          |            |-----FIN---->|            |           |
          |            |             |----FIN---->|           |
          |            |             |            |-----FIN-->|
          |            |             |            |           |
          |            |             |            |<--FIN/ACK-|
          |            |             |<--FIN/ACK--|           |
          |            |<--FIN/ACK---|            |           |
          |<--FIN/ACK--|             |            |           |
          |            |             |            |           |
          |            |             |            |           |

              ]]>
            </artwork>
          </figure>
          <t>
No SVR Metadata is sent or required when sessions terminate. Each router
keeps its state information for a programmed length of time in case a 
FIN/ACK is delayed or dropped, then the state information is removed.
          </t>
        </section> <!-- session_ladder -->
      </section> <!-- new_session_init -->
    </section> <!-- SVR_example -->

    <section anchor="std_svr" numbered="true" toc="include">
      <name>SVR Protocol Definition</name>
      <t>
This section provides the normative requirements for SVR Metadata to 
achieve interoperability.
      </t>

      <section anchor="std_session_types" numbered="true" toc="include">
        <name>SVR Session Definitions and Types</name>
        <t>
SVR implementations MUST support TCP, UDP, and ICMP. SVR implementations
SHOULD support UDP Unicast. Sessions are characterized by having an 
initial first packet that is a unique to an SVR router. Often this is 
described as a unique 5-tuples as seen by the router.  Sessions start 
when the first packet is processed, and end when either the L4 protocol 
indicates the session is completed (TCP FIN/FIN ACK, RST) or there has 
been no activity for a length of time (UDP, ICMP, UDP Unicast, 
point-to-point ethernet).
        </t>
        <t>
SVR is always OPTIONAL. SVR implementations can choose when to use SVR 
on a session-by-session basis. SVR implementations MUST support non-SVR 
traffic.
        </t>
      </section> <!-- std_session_types -->

      <section anchor="std_md_insertion" numbered="true" toc="include">
        <name>SVR Metadata Insertion</name>
        <section anchor="std_md_location" numbered="true" toc="include">
          <name>SVR Metadata Packet Location</name>
          <t>
SVR implementations MUST insert SVR Metadata into packets directly after
the L4 header, even if the resulting increase in packet size would cause
the packet to require fragmentation. For Ethernet point-to-point and 
ICMP error messages, IP Headers and L4 headers MUST be created. If 
associated with an existing session, the packet MUST share the exact 
transport 5-tuples (SVR Waypoints and Ports) as the session the ICMP 
error message. The SVR Metadata MUST be in the very first packet of a 
new session (TCP or UDP bidirectional flow) to have any role in path 
selection or security. SVR Metadata SHALL be sent in any subsequent 
packet in any direction to change or update the networking requirements.
The SVR Metadata is inserted into the payload portion of a packet to 
guarantee it makes it unchanged through the network. Packet lengths and 
checksums MUST be adjusted accordingly. TCP sequence numbers MUST NOT be
adjusted.
          </t>
        </section> <!-- std_md_location -->

        <section anchor="std_md_prereq" numbered="true" toc="include">
          <name>SVR Metadata Prerequisites</name>
          <t>
A prerequisite for SVR Metadata insertion is that a Peer Pathway MUST be
selected for the purposes of routing a session. This is similar to 
choosing a tunnel between two networks. This Peer Pathway has IP 
addresses on either side (Waypoint Addresses), and these addresses will 
always be the transport IP addresses for packets containing SVR 
Metadata.
          </t>
        </section> <!-- std_md_prereq -->
        <section anchor="std_md_port_alloc" numbered="true" toc="include">
          <name>SVR Metadata Port Allocation for Sessions</name>
          <t>
The SVR peer originating the session (client side) MUST allocate both 
source and destination ports. The ingress side MUST choose even ports 
for local (source port) and odd ports for remote (destination port). 
This provides uniqueness between any two peers, with no negotiation or 
collision possibilities. The range of ports to use for allocation is 
provisioned. Ports in use MUST be excluded from allocation. Ports MUST 
be unallocated when session state is removed. Ports MUST have a 60 
second guard time before being reallocated.
          </t>
        </section> <!-- std_md_port_alloc -->

        <section anchor="std_md_no_piggyback" numbered="true" toc="include">
          <name>SVR Metadata on Idle Sessions</name>
          <t>
SVR implementations MAY need to send SVR Metadata to a peer at a time 
when there are no packets flowing between client and server. See 
<xref format="default" target="nat_keep_alive"/> for an example. In 
these cases an IP packet MUST be created and inserted into the 
appropriate existing session with an indication the packet should be 
dropped. The packet MUST be processed, interpreted, and dropped by the 
directly adjacent peer and not forwarded to any other SVR peer.
          </t>
        </section> <!-- std_md_no_piggyback -->

        <section anchor="std_md_pkt_structure" numbered="true" toc="include">
          <name>SVR Metadata Packet Structure</name>
          <figure anchor="metadata_pkt_structure">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   Existing IP Packet with SVR Metadata inserted
   +------------------+-----------------+----------+----------+------+
   | Existing IP Hdr  | Existing L4 Hdr |  SVR     | PAYLOAD  | HMAC |
   |   Source IP Addr |   Source Port   | Metadata |   Data   |      |
   |   Dest IP Addr   |   Dest Port     | Block    |(optional)|      |
   +------------------+-----------------+----------+----------+------+

   Generated IP Packet with SVR Metadata inserted
   +-------------------+------------------+----------+------+
   | Created  IP Hdr   | Created L4 Hdr   |  SVR     | HMAC |
   |   Source IP Addr  |   Source Port    | Metadata |      |
   |   Dest IP Addr    |   Dest Port      | Block    |      |
   +-------------------+------------------+----------+------+

   ICMP Packet with SVR Metadata inserted
   +-----------------+-----------------+----------+--------+------+
   | Created IP Hdr  | Created UDP Hdr |  SVR     |  ICMP  | HMAC |
   |  Source IP Addr |   Source Port   | Metadata |  MSG   |      |
   |  Dest IP Addr   |   Dest Port     | Block    |        |      |
   +-----------------+-----------------+----------+--------+------+

   Ethernet Packet with SVR Metadata inserted
   +-----------------+-----------------+----------+----------+------+
   | Created IP Hdr  | Created UDP Hdr |  SVR     | Ethernet | HMAC |
   |  Source IP Addr |   Source Port   | Metadata | MSG      |      |
   |  Dest IP Addr   |   Dest Port     | Block    |          |      |
   +-----------------+-----------------+----------+----------+------+

              ]]>
            </artwork>
          </figure>
          <t>
If UDP protocol, the UDP Header MUST be updated to have the correct 
packet length.
          </t>
          <t>
The Layer 4 header (TCP/UDP) MUST have its checksum recalculated per the
appropriate procedures.
          </t>
          <t>
The IP Packet length field MUST be updated to reflect the number of 
octets added for the SVR Metadata block and the HMAC signature.
          </t>
          <t>
The IP Header Checksum MUST be updated after the IP Packet length is
adjusted.
          </t>
          <t>
If TCP protocol, the TCP Sequence numbers MUST NOT be changed.
          </t>
        </section> <!-- std_md_pkt_structure -->

        <section anchor="std_false_positives" numbered="true" toc="include">
          <name>Prevention of False Positives</name>
          <t>
SVR Metadata is sent inside the payload portion of TCP and UDP packets.
Given that no octet sequence is truly unique in the payload of a packet,
in the scenario where the original payload after the L4 header contained
the same octet sequence as the SVR magic number, false positive logic is
enacted on the packet. This guarantees downstream SVR routers will not 
confuse SVR Metadata magic number signatures.
          </t>
          <t>
False positives SHALL NOT occur when first packets are processed, since
valid SVR Metadata will always be inserted regardless of the contents of
the first 8 octets of the payload. False positive can only occur during 
existing valid SVR sessions between peers.
          </t>
          <t>
To implement false positive logic, SVR implementations MUST insert an 
empty SVR Metadata header (12-octet header with 0 TLVs). This creates a 
contract with downstream SVR routers that if the magic number is 
present, there MUST be valid SVR Metadata that requires processing and 
removal.
          </t>
          <t>
The structure of a false positive SVR Metadata includes just a header of
length 12 octets, with zero header TLVs and zero payload TLVs. The SVR 
router receiving a packet with false positive SVR Metadata will strip 
out the SVR Metadata header and any TLVs as is normally expected. The 
inserted SVR Metadata header has no TLVs and is not encrypted.
          </t>
          <t keepWithNext="true">SVR Metadata Location</t>
          <figure anchor="svr_metadata_location_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   Received Midstream SVR Packet matching SVR Magic Number
   +-------+--------+--------------------------+
   |IP Hdr | L4 Hdr | 0x4c48dbc6ddf6670c ..... |
   +-------+--------+--------------------------+

   Midstream SVR Packet with False Positive SVR Metadata inserted
   +--------+--------+----------+---------------------------+
   |        |        |   SVR    |                           |
   | IP Hdr | L4 Hdr | Metadata | 0x4c48dbc6ddf6670c ...... |
   |        |        |   HDR    |                           |
   +--------+--------+----------+---------------------------+

              ]]>
            </artwork>
          </figure>
          <t>
Insertion of header or payload TLVs is OPTIONAL and at the discretion
of the implementation. If adding TLVs, standard procedures MUST be 
applied including encryption if payload TLVs are added.
          </t>
        </section> <!-- std_false_positives -->

        <section anchor="std_udp_transform" numbered="true" toc="include">
          <name>TCP to UDP Transformation</name>
          <t>
TCP to UDP transformation is required when a middlebox blocks certain 
TCP packets that contain SVR Metadata. SVR implementations typically 
test Peer Pathways to ensure SVR Metadata insertion into TCP SYN packets
will pass through any middleboxes. If TCP SYN packets with SVR Metadata 
are dropped by a middle box, then TCP packets are transformed to UDP for
SVR processing, and restored when exiting SVR processing. The steps to 
transform TCP to UDP are:
          </t>
          <t>
The protocol field in the IP header MUST be changed from 0x06 (TCP) to 
0x11 (UDP).
          </t>
          <t>
The UDP checksum will overwrite the sequence number. To save the 
sequence number, it is copied to the 32-bit checksum/urgent pointer 
location of the TCP header.
          </t>
          <t>
To positively communicate that TCP to UDP transformation has occurred,
one must add TLV 12 to the SVR Metadata being transmitted. See <xref 
format="default" target="tcp_syn_pkt"/>.
          </t>
          <t>
The UDP transformation is for every packet in a session, not just the
packets with SVR Metadata. The restoration process is depicted in <xref 
format="default" target="std_udp_untransform"/>.
          </t>
        </section> <!-- std_udp_transform -->
      </section> <!-- std_md_insertion -->

      <section anchor="std_req_tlvs" numbered="true" toc="include">
        <name>Required and Optional TLVs</name>
        <section anchor="std_ip_session_tlvs" numbered="true" toc="include">
          <name>New and Moved IP Sessions TLVs</name>
          <t>
The SVR Metadata TLVs that MUST be inserted in a first forward SVR 
Metadata packet of a new session include:
          </t>
          <ul spacing="normal">
            <li>
Header: Security ID: see <xref format="default" target="security_id"/>.
            </li>
            <li>
Payload: Forward Context: see <xref format="default" 
target="fwd_ctx_v4"/>, <xref format="default" target="fwd_ctx_v6"/>.
            </li>
            <li>
Payload: Tenant Name: see <xref format="default" target="tenant_name"/>.
            </li>
            <li>
Payload: Service Name: see <xref format="default"
target="service_name"/>.
            </li>
            <li>
Payload: Session UUID: see <xref format="default" 
target="session_uuid"/>.
            </li>
            <li>
Payload: Source Router Name: see <xref format="default" 
target="src_rtr_name"/>.
            </li>
            <li>
Payload: Security Policy: see <xref format="default" 
target="src_rtr_sec_policy"/>.
            </li>
            <li>
Payload: Peer Pathway ID: see <xref format="default" 
target="peer_rtr_id"/>.
            </li>
          </ul>
          <t>
Optional SVR Metadata TLVs that MAY be included in forward SVR Metadata
are:
          </t>
          <ul spacing="normal">
            <li>
Header: Path Metrics: see <xref format="default" 
target="path_metrics"/>.
            </li>
            <li>
Header: SVR Control Message: see <xref format="default" 
target="proto_msg"/>.
            </li>
            <li>
Payload: Session Encrypted: see <xref format="default" 
target="session_encrypt"/>.
            </li>
            <li>
Payload: TCP Syn Packet: see <xref format="default" 
target="tcp_syn_pkt"/>.
            </li>
            <li>
Payload: IPv4 Source NAT Address: see <xref format="default"
target="src_nat_addr_v4"/>.
            </li>
            <li>
Payload: Remaining Session Time: see <xref format="default"
target="remaining_session_time"/>.
            </li>
          </ul>
          <t>
The order of the TLVs is arbitrary, but header TLVs must be before any 
payload TLVs. If a TLV is received that is unknown to a peer, it MUST 
be ignored.
          </t>
          <t>
The SVR Metadata TLVs that MUST be inserted in a first reverse packet of
a new session include:
          </t>
          <ul spacing="normal">
            <li>
Header: Security ID: see <xref format="default" target="security_id"/>.
            </li>
            <li>
Payload: Reverse Context: see <xref format="default"
target="rev_ctx_v4"/>, <xref format="default" target="rev_ctx_v6"/>.
            </li>
            <li>
Payload: Peer Pathway ID: see <xref format="default" 
target="peer_rtr_id"/>.
            </li>
          </ul>
          <t>
Optional SVR Metadata TLVs that MAY be included reverse SVR Metadata 
are:
          </t>
          <ul spacing="normal">
            <li>
Payload: Path Metrics: see <xref format="default" 
target="path_metrics"/>.
            </li>
          </ul>
        </section> <!-- std_ip_session_tlvs -->

        <section anchor="std_icmp_session_tlvs" numbered="true" toc="include">
          <name>ICMP TLVs</name>
          <t>
The SVR Metadata TLVs that MUST be inserted when returning an ICMP Error
include:
          </t>
          <ul spacing="normal">
            <li>
Header: ICMP Error Location Address: see <xref format="default" 
target="rtr_egress_src_addr_v4"/>, <xref format="default" 
target="rtr_egress_src_addr_v6"/>.
            </li>
          </ul>
          <t>
Optional SVR Metadata TLVs that MAY be included reverse SVR Metadata 
are:
          </t>
          <ul spacing="normal">
            <li>
Header: Path Metrics: see <xref format="default" 
target="path_metrics"/>.
            </li>
          </ul>
        </section> <!-- std_icmp_session_tlvs -->
      </section> <!-- std_req_tlvs -->

      <section anchor="std_metadata_encryption" numbered="true" toc="include">
        <name>SVR Metadata Encryption</name>
        <t>
Encryption of SVR Metadata utilizes block mode ciphers. Ciphers MUST 
have a consistent block size. The cipher to use and its block size MUST 
be provisioned and known to peers in advance. The provisioning 
methodology is outside the scope of this document. The SVR Metadata Key 
used for encryption is specific to all Peer Pathways between any two 
peers and is obtained using BFD with SVR Metadata (see <xref 
format="default" target="svr_metadata_key_procedure"/>). When data is 
encrypted with block mode ciphers, the block will be padded with zeros 
(0x0s) to equal an increment of the block size used by the cipher. An 
initialization vector allows the decryption to be performed without any 
state.
        </t>
        <t keepWithNext="true">SVR Metadata Block</t>
        <figure anchor="svr_metadata_encrypted_block_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

          Cipher       Block Size         IV Size
         -------    ------------------    --------
          AES256    128 Bits(16 Bytes)    16 Bytes
          AES128    128 Bits(16 Bytes)    16 Bytes

      +----------+--------+---------+---------+----------------+
      |   SVR    |        |         |         |                |
      | Metadata | Header | Payload | Padding | Initialization |
      | Header   | TLVs   | TLVs    |         |    Vector      |
      +----------+--------+---------+---------+----------------+
      |<------Clear------>|<--- Encrypted --->|

      |<------------------ SVR Metadata Block ---------------->|

            ]]>
          </artwork>
        </figure>
        <t>
Padding can be computed as the length of the SVR Metadata payload TLVs 
MOD'ed by the block size.
        </t>
      </section> <!-- std_metadata_encryption -->

      <section anchor="std_metadata_hmac" numbered="true" toc="include">
        <name>SVR Packet Authentication</name>
        <section anchor="std_hmac_signature" numbered="true" toc="include">
          <name>HMAC Signatures</name>
          <t>
Through provisioning (outside the scope of this document), an SVR 
Authority MUST define if HMAC signatures are to be used. An SVR 
Authority MUST also define if Time-Based HMAC is to be used. AN SVR 
Authority MUST determine if ALL packets are signed, or just packets 
containing SVR Metadata. Due to the possibility of replay attacks, it is
RECOMMENDED that Time-Based HMAC signatures be used on ALL SVR packets. 
The Session HMAC Key is communicated between SVR peers as part of BFD 
Metadata. This key is used for the life of a session. (see 
<xref format="default" target="svr_metadata_key_procedure"/>).
          </t>
          <t>
SVR Peers SHOULD sign all packets with HMAC signatures defined in <xref
format="default" target="RFC2104"/>. The Session HMAC Key should be used
when creating an HMAC signature. When present there MUST be only one 
HMAC signature in an IP packet even if it fragments across multiple IP 
packets. Time-based HMAC signatures are RECOMMENDED. For time-based HMAC
signatures, SVR routers append the current time since epoch (measured in
seconds) divided by 2 to the data being signed. SVR routers MUST have 
clocks synchronized accurately. Methods for synchronizing clocks and 
measuring any differences or drifts are outside the scope of this 
document. Minimally NTP <xref format="default" target="RFC5905"/> should
be implemented. In cases where the current time cannot be relied on, one
may need to disable the time-based HMAC and use a standard HMAC, but 
this is NOT RECOMMENDED.
          </t>
          <t>
The HMAC signature is always added to the very end of a packet. The size
of the HMAC signature depends on which signature is used. Well known 
HMAC types are used with SVR including SHA1, SHA256-128, and SHA256.
          </t>
          <t keepWithNext="true">Location of HMAC Checksum</t>
          <figure anchor="hmac_location_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

    SVR Packet with SVR Metadata inserted
    +-----------+--------------+----------+----------+------+
    | IP Header |  L4 Header   |   SVR    | PAYLOAD  | HMAC |
    |           |              | Metadata |(optional)|      |
    +-----------+--------------+----------+----------+------+
                |                                    |
                |<======= HMAC Signed Data =========>|

    Subsequent SVR Packet 
    +-----------+--------------+---------+------+
    | IP Header |  L4 Header   | Payload | HMAC |
    |           |              |         |      |
    +-----------+--------------+---------+------+
                |                        |
                |<== HMAC Signed Data ==>|


      HMAC TYPE     LENGTH OF SIGNATURE
      ----------    -------------------
      SHA1          20 Bytes
      SHA256-128    16 Bytes
      SHA256        32 Bytes

              ]]>
            </artwork>
          </figure>
        </section> <!-- std_hmac_signature -->

        <section anchor="std_hmac_verification" numbered="true" toc="include">
          <name>HMAC Verification</name>
          <t>
If HMAC signatures are present in an SVR implementation, SVR 
implementations MUST verify and remove the signature. Verification 
provides both authentication of the SVR router that sent the packet, and
integrity that the packet has not been modified in any way 
intentionally, or through transmission errors between two SVR routers.
          </t>
          <t>
Through provisioning (outside the scope of this document), an SVR 
Authority MUST define if HMAC signatures are present. An SVR Authority 
MUST also define if Time-Based HMAC is to be used. AN SVR Authority MUST
determine if ALL packets are signed, or just packets containing SVR 
Metadata. Due to the possibility of replay attacks, it is RECOMMENDED 
that Time-Based HMAC signatures be used on ALL SVR packets. The Session 
HMAC Key associated with the session state is used for all HMAC 
signatures and verification.
          </t>
          <t>
To verify the HMAC signature, a new signature is generated on the packet
and bytewise compared to the signature transmitted in the packet.
          </t>
          <t keepWithNext="true">HMAC Signature Removed</t>
          <figure anchor="hmac_signature_removed_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

    SVR Packet with HMAC Signature
    +-----------+--------------+----------+------+
    | IP Header |  L4 Header   | PAYLOAD  | HMAC |
    |           |              |(optional)|      |
    +-----------+--------------+----------+------+
                |                         |
                |<== Signed Data ========>|

    SVR Packet with HMAC Signature removed
    +-----------+--------------+----------+
    | IP Header |  L4 Header   | PAYLOAD  |
    |           |              |(optional)|
    +-----------+--------------+----------+

              ]]>
            </artwork>
          </figure>
          <t>
For efficiency reasons, when verifying a Time-Based HMAC signature,
implementers SHOULD compute the HMAC on the packet (not including the IP
header) and save the preliminary result. Then try updating the HMAC 
signature with the current window value. If this fails to match the 
signature, one must try updating the preliminary result using the next 
time window by adding 2 seconds (or previous by subtracting 2). If the 
time window is determined to be the next time window; it will remain 
that way for all packets received from a particular peer until it 
advances with clock time. Keeping an active time window per peer can 
make this process much more efficient.
          </t>
          <t>
If the signature does not match after checking adjacent time windows and
newly issued keys, then the packet is dropped and a security event 
noted.
          </t>
          <t>
If the signature matches exactly the signature in the packet, then the 
packet has been authenticated as being sent by the previous SVR router, 
and assured that the packets integrity between the two routers is good. 
The HMAC signature MUST be removed from the packet.
          </t>
          <t>
The IP Packet length field MUST be updated to reflect the number of 
octets removed.
          </t>
          <t>
The IP Header Checksum MUST be updated after the IP Packet length is
adjusted.
          </t>
        </section> <!-- std_hmac_verification -->
      </section> <!-- std_metadata_hmac -->

      <section anchor="std_metadata_processing" numbered="true" toc="include">
        <name>Processing SVR Packets with Potential SVR Metadata</name>
        <t>
Routers MUST process SVR traffic and non-SVR traffic. SVR Routers MUST 
keep track of sessions that are using SVR. Only sessions setup with SVR 
may use the procedures described below. Traffic that is using SVR will 
always originate and terminate on Waypoint addresses (known peer 
pathways). This provides efficient separation of non-SVR traffic and SVR
traffic.
        </t>
        <t>
Packets received on known Peer Pathways MUST be assumed to either have 
SVR Metadata or be packets associated with existing SVR sessions.
        </t>

        <section anchor="std_metadata_dpi" numbered="true" toc="include">
          <name>Detection of Potential SVR Metadata in Packets</name>
          <t>
Any packet could arrive at any time with SVR Metadata. DPI MUST be used
to scan for the presence of SVR Metadata on every packet. SVR Metadata 
MAY be expected and required for first packet processing, and the 
absence of SVR Metadata will result in dropped packets.
          </t>
          <t>
The HMAC verification step (defined above) MUST be performed prior to 
performing any other SVR Metadata verification steps. This prevents 
attacks by modifying packet on the wire.
          </t>
          <t>
If the first 8 octets of the payload (TCP or UDP) exactly matches the SVR
magic number (0x4c48dbc6ddf6670c) it indicates that packet MUST have SVR
Metadata. If the first 8 octets do not match, the packet does not contain
SVR Metadata. If SVR Metadata is not present, the packet SHOULD be 
routed if part of an existing session (see <xref format="default" 
target="std_session_packets"/>). If not part of an existing session the 
packet MUST be dropped and a security event noted.
          </t>
        </section> <!-- std_metadata_dpi -->

        <section anchor="std_metadata_checking" numbered="true" toc="include">
          <name>Verification of SVR Metadata in Packets</name>
          <section anchor="std_metadata_initial_parsing" numbered="true" toc="include">
            <name>TLV Parsing</name>
            <t>
The SVR Metadata header is parsed (see <xref format="default" 
target="meta_header"/>). If the header length and payload length are 
both zero, the SVR Metadata is simply removed and the packet is 
forwarded. Please see <xref format="default" 
target="std_false_positives"/> for description of false positive SVR 
Metadata header insertion. The next step is to walk the header TLVs to 
ensure they are reasonable. If the payload length is zero, then the SVR
Metadata can be accepted and processed. Decryption of SVR Metadata is 
only required when there are payload TLVs.
            </t>
            <t>
If a TLV is sent that is unknown to the implementation, the TLV SHOULD 
be skipped and the TLV MUST be forwarded.
            </t>
            <t>
If the SVR Metadata TLVs are not reasonable, the packet MUST be dropped 
and security events noted.
            </t>
          </section> <!-- std_metadata_initial_parsing -->
          
          <section anchor="std_metadata_decryption" numbered="true" toc="include">
            <name>Decryption of SVR Metadata Blocks</name>
            <t>
If the peers have been provisioned to encrypt SVR Metadata with a 
specific cipher AND the payload length in the header is non-zero, then 
the SVR implementation MUST assume that an encrypted SVR Metadata block 
was transmitted.
            </t>
            <t>
To decrypt the encrypted SVR Metadata block, an SVR implementation MUST 
have the pre-provisioned cipher, block size, and initialization vector 
size. Once these are known, it is possible based on the payload length 
in the SVR Metadata header to determine the exact structure of the 
packet, and how to decrypt it.
            </t>
            <t keepWithNext="true">Encrypted SVR Metadata Block</t>
            <figure anchor="encrypted_svr_block_fig">
              <artwork align="left" alt="" name="" type="">
                <![CDATA[

        Known in advance: Cipher, Block Size, IV size
        From SVR Metadata Header: Payload TLV size

   +----------+--------+---------+---------+----------------+--~~~
   | SVR      | Header | Payload | Padding | Initialization | Rest...
   | Metadata | TLVs   | TLVs    |         |   Vector (IV)  | of  ...
   | Header   |        |         |         |                | Pkt ...
   +----------+--------+---------+---------+----------------+--~~~
   |<----- Clear ----->|<--- Encrypted --->|

   |<---------------- SVR Metadata Block ------------------>|

                ]]>
              </artwork>
            </figure>
            <t>
The padding is equal to the payload length from the header MOD'ed by the
cipher block size. The &quot;block&quot; is then decrypted assuming that
the octets following the &quot;block&quot; is the Initialization vector.
            </t>
            <t>
If the decryption fails, then the packet MUST be assumed invalid and 
dropped. When this happens a security event is noted.
            </t>
            <t>
Upon successful decryption, the payload TLVs MUST be reviewed for 
reasonableness and completeness. See <xref format="default" 
target="std_req_tlvs"/> for minimum required TLVs. If there are 
insufficient TLVs present for the SVR implementation, the packets MUST 
be dropped and errors noted.
            </t>
            <t>
After review of the TLVs, the SVR Metadata is considered valid and
accepted by the SVR implementation. The SVR Metadata block is removed 
from the packet, and the IP header length and checksum MUST be 
corrected. The packet signatures and decryption provide a very high 
degree of assurance that the SVR Metadata is authentic and has 
integrity.
            </t>
          </section> <!-- std_metadata_decryption -->
        </section> <!-- std_metadata_checking -->

        <section anchor="std_udp_untransform" numbered="true" toc="include">
          <name>UDP to TCP Transformation</name>
          <t>
If the received SVR Metadata block contains a TCP SYN Packet TLV (see 
<xref format="default" target="tcp_syn_pkt"/>) then the following 
procedures MUST be performed on EVERY packet of the session. This also 
signals to the SVR Router that packets flowing in the opposite direction
MUST also be UDP transformed. See <xref format="default" 
target="std_udp_transform"/>. The steps performed are:
          </t>
          <t>
The protocol field in the IP header MUST be changed from 0x11 (UDP) to 
0x06 (TCP).
          </t>
          <t>
Copy the 32-bit integer in the checksum/urgent pointer location of the 
TCP header to the sequence number, effectively restoring it. The urgent 
pointer is zeroed out and urgent flag is cleared.
          </t>
          <t>
The TCP Checksum MUST be recalculated.
          </t>
        </section> <!-- std_udp_untransform -->
        <section anchor="std_session_packets" numbered="true" toc="include">
          <name>SVR Session Packets</name>
          <t>
Any packet that is has a source and destination IP address that map to a
Peer Pathway is an SVR packet. SVR Packets that do not have SVR Metadata
are SVR session packets. Each of these MUST have corresponding known 
session state. If no session state exists, these packets MUST be 
dropped, or there must be an attempt to restore session state (see <xref
format="default" target="session_state_reqs"/>).
          </t>
          <t>
Packets ingressing to a peer pathway that are part of existing SVR 
sessions that do not contain SVR Metadata MUST be translated (all 
5-tuples, bidirectionally). The source address MUST be replaced with 
the local Waypoint address associated with the peer pathway. The 
destination address MUST be replaced with the Waypoint of the SVR Peer 
chosen. The protocol either remains the same, or is modified if UDP 
Transformation is required (See <xref format="default" 
target="std_udp_transform"/>). The source and destination port fields 
MUST be replaced with the ports allocated for this SVR session. For 
efficiency, implementers SHOULD save a single checksum delta as part of 
the session state because the address/protocol/port modifications will 
always be identical for each packet of a session.
          </t>
          <t>
Packets egressing from a peer pathway must have their addresses 
restored. SVR session state MUST contain the original packet context 
5-tuples for every SVR session. The original Source IP Address MUST be 
restored. The original Destination IP Address MUST be restored. The 
original protocol must be restored, and if it is changes from UDP to TCP
then one MUST follow the procedures defined in <xref format="default" 
target="std_udp_untransform"/>. The source port MUST be restored. The 
destination port MUST be restored.
          </t>
        </section> <!-- std_session_packets -->

        <section anchor="std_tenant_service_overview" numbered="true" toc="include">
          <name>Tenant/Service Overview</name>
          <t>
A provisioned SVR Policy SHOULD include both a tenant and service. 
Absence of an applicable SVR policy SHOULD prevent SVR sessions from 
being established. Traditional IP routing can be used when SVR policies 
do not apply.
          </t>
          <section anchor="std_service_processing" numbered="true" toc="include">
            <name>Interpretation of the Service</name>
            <t>
Services are textual names for sets of CIDR blocks, protocols, and 
ports. Services map directly to our human understanding of a network use
case. Examples include &quot;Zoom&quot; or &quot;Office365&quot;.
            </t>
            <t keepWithNext="true">Service Definition</t>
            <figure anchor="service_definition_fig">
              <artwork align="left" alt="" name="" type="">
                <![CDATA[

            Service Name
                protocol: TCP/UDP
                port ranges[]
                CIDR Blocks[]

                ]]>
              </artwork>
            </figure>
            <t>
When a packet arrives with SVR Metadata at an SVR Router, the name of 
the service MUST be in first packet SVR Metadata.
            </t>
            <t>
When a first packet arrives without SVR Metadata, the service must be 
determined through a lookup of the IP destination address, port, and
protocol. The resultant string becomes the service name. If this fails
to result in a service, the name of the service can be determined by 
using application recognition techniques. These are omitted from this
document, but include HTTP Request Analysis, TLS SNI, and Common Names
in certificates.
            </t>
            <t>
Services can have associated quality policies and security policies 
associated with them via provisioning, which are outside the scope of 
this document.
            </t>
            <t>
When egressing an SVR Peer Pathway, the service name can be used to 
route the packet to another SVR Peer, or to the final destination. If 
another SVR peer is chosen, the service name MUST be used as provided by
the previous SVR peer. When exiting SVR and returning to traditional
network routing, the textual service name MUST be resolved to an IP
address. SVR supports several options:
            </t>
            <dl newline="false" spacing="normal">
              <dt>Use Destination from Context:</dt>
              <dd>
This is the default action. The original destination address will be 
restored and the packet will be forwarded to the destination.
              </dd>
              <dt>Destination NAT Based on Local Configuration:</dt>
              <dd>
Some provisioned service configurations locally (nearest the destination
SVR router) will map the service to one or more local IP addresses 
through implementation of a destination NAT. This effectively becomes a 
load balancing algorithm to destination service instances, and is useful
in public clouds.
              </dd>
              <dt>Resolve Destination using Local DNS:</dt>
              <dd>
DNS resolution can be provisioned for services when the IP address is 
not known. This if often the case with services in private clouds.
              </dd>
            </dl>
            <t>
Services SHOULD be provisioned to have lists of Tenants that are 
permitted to use a Service, and tenants that are denied using a service.
These access controls are RECOMMENDED.
            </t>
          </section> <!-- std_service_processing -->

          <section anchor="std_tenant_processing" numbered="true" toc="include">
            <name>Determination and Interpretation of the Tenant</name>
            <t>
Tenant is a text string hierarchy delimited by periods. Tenants are 
logically similar to VLANs, CIDR block subnets, and Security Zones. The 
entire text string, including the full hierarchy is used to define a 
tenant, and for policy application, the tenant MAY match right to left 
in full segments (delimited by periods). The longest match will always 
be used (the most segments).
            </t>
            <t>
Tenants SHOULD be referenced and associated with Services to create a 
from-to vector. This has the benefits of associating ACLs directly with 
Destinations. A provisioned SVR Policy SHOULD include both a tenant and 
service. Absence of a applicable SVR policy prevents SVR sessions from 
being established. The deny by default approach is RECOMMENDED.
            </t>
            <t>
It is RECOMMENDED that a tenant be associated with physical interfaces 
and logical interfaces (VLANs) as a default for arriving sessions. CIDR 
block-based tenants SHOULD override these defaults. Tenant definitions 
directly from clients that self-assert their tenancy SHOULD override all
other tenant definitions.
            </t>
            <t>
All network interface-based tenant definitions are local to an SVR 
router. The tenant definitions on ingress to SVR may not match those on 
egress from SVR. This permits the use of different segmentation 
techniques in different networks.
            </t>
          </section> <!-- std_tenant_processing -->
        </section> <!-- std_tenant_service_overview -->

        <section anchor="std_sec_policy_processing" numbered="true" toc="include">
          <name>Payload Encryption</name>
          <t>
If payload encryption is required, a Security Policy is used to describe
all aspects of the agreed upon methods. The Security Policy meaning must
be valid and equal at the point of encryption and decryption in 
multi-hop use cases.
          </t>
          <t>
SVR routers generate a Payload Key locally when processing the first 
packet requiring encryption that conforms to the defined security 
policy. A FIPS 140-2 approved highly secure DRBG is used to generate 
keys and IV. It is also highly recommended that NIST SP800.90B be 
followed for ensuring proper entropy. See <xref format="default" 
target="NIST_SP_800-90B"/>. The OpenSSL function RAND_bytes() can be 
used to generate a key that is the current number of bits long and 
conforms to NIST SP-800-90B. This key is included in the first encrypted
packet as SVR Metadata. In a post quantum world, the key could be 
generated from quantum sources.
          </t>
          <t>
The SVR Metadata is forwarded hop-by-hop through the network until the 
packet egresses SVR. The router that terminates the SVR routing MUST 
extract the Payload Key from the SVR Metadata, and store it as part of 
the session state information. This key will be used to decrypt all 
payload packets from this session.
          </t>
          <t>
Packets traversing the reverse pathway will use its own key, generated
by the same methods described above, and transmitted in reverse metadata
Payload encryption and decryption uses asymmetric keys. This simplifies
key management and glare conditions for payload.
          </t>
          <t>
The originator of the session can re-key at any time by adding SVR 
metadata with the new key to a packet within the session. The payload 
will immediately be encrypted by the new key.
          </t>
          <t>
In the forward direction, the Security KEY TLV (see <xref 
format="default" target="src_rtr_sec_key"/>) contains the key for 
encryption/decryption in the first packet in each direction. This allows
the key for decryption to go end-to-end in multi-hop router cases. The 
key is safe because SVR Metadata is encrypted hop-by-hop through the 
network. Thus, each payload encrypted packet is decrypted once at the 
end of the SVR route. Using a named Security Policy permits 
implementations to use whatever ciphers are required, as long as they 
can be named. The default cipher is AES256 with a 256 bit key.
          </t>
          <t keepWithNext="true">Payload Encryption:</t>
          <figure anchor="payload_encryption_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

          Peer A          Peer B          Peer C
            |               |               |
    fpkt--->|               |               |
            |               |               |
         Gen Key            |               |
         Encrypt Payload    |               |
         Add Key to MD      |               |
            |               |               |
            |--fpkt w/md--->|               |
            |            Forward            |
            |               |--fpkt w/md--->|
            |               |             Save Key
            |               |               |
            |               |               |--fpkt->
            |               |               |<-rpkt
            |               |               |
            |               |             Lookup Key
            |               |             from session
            |               |               |
            |               |             Gen Key
            |               |             Encrypt Payload
            |               |             Add Key to MD
            |               |<--rpkt w/md---|
            |            Forward            |
            |<--rpkt w/md---|               |
            |               |               |
     <-rpkt-|               |               |
            <== ALL PAYLOAD PKTS ENCRYPTED =>

              ]]>
            </artwork>
          </figure>
        </section> <!-- std_sec_policy_processing -->
      </section> <!-- std_metadata_processing -->
    </section> <!-- std_svr -->

    <section anchor="std_bfd" numbered="true" toc="include">
      <name>BFD for Peer Pathways</name>
      <t>
Peer Pathways are similar to Tunnels insofar as they represent virtual 
transport pathways between routers. BFD is used to determine 
reachability, measure quality of a pathway, and to perform 
authentication and key management.
        </t>

      <section anchor="svr_peering" numbered="true" toc="include">
        <name>SVR Peering and use of BFD</name>
        <t>
It is RECOMMENDED for every configured or discovered SVR Peer pathway, 
A UDP BFD session be used to monitor the state of the pathway, and 
through extensions, measure path quality.
        </t>
        <t>
BFD Control messages are sent by each router on each peer path. The BFD
message is constructed with appropriate timers for the Peer Pathway 
which are administratively determined. BFD as defined in <xref 
format="default" target="RFC5880"/> does not support certificates or 
exchange of public keys. To overcome this, BFD Metadata is used.
        </t>
        <t>
BFD Metadata is inserted into existing BFD messages for the following 
purposes:
        </t>
        <ul spacing="normal">
          <li>
To determine the Peer Received IP Address.
          </li>
          <li>
To determine if there are NATs on a Peer Pathway.
          </li>
          <li>
To determine if a router's Peer Received IP Address has changed.
          </li>
          <li>
To determine MTU size on a pathway.
          </li>
          <li>
Measuring path quality during periods of idle traffic (see 
<xref format="default" target="path_metrics"/> for measuring quality on 
active circuits).
          </li>
          <li>
Determine if a Peer Pathway has failed to another redundant physical 
link.
          </li>
          <li>
To authenticate a peer through certificate exchange.
          </li>
          <li>
To determine a Peer Key for encryption of SVR Metadata Keys.
          </li>
        </ul>
        <t>
BFD Metadata is added to the end of the BFD packet when required. If BFD
Metadata is added, the length field in the IP Header, UDP Header, and 
BFD Control message are all adjusted accordingly.
        </t>
        <t keepWithNext="true">BFD Metadata Location:</t>
        <figure anchor="bfd_metadata_location_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

      BFD Control Packet with BFD Metadata

    +-----------+--------+---------+----------+
    | IP Header | UDP    | BFD     | protobuf |
    |           | Header | Control | BFD      |
    |           |        | Packet  | Metadata |
    +-----------+--------+---------+----------+
                         |                    |
                         |<== BFD Pkt Len  ==>|

            ]]>
          </artwork>
        </figure>
        <t>
In all cases, BFD packets will be defined as BFD Control Packets. When 
sending &quot;MeasureData&quot; messages which behave like BFD Echo 
packets, the Required Min Echo RX Interval (see <xref format="default" 
target="RFC5880"/>) must be greater than zero.
        </t>
        <t>
BFD Metadata is described as follows:
        </t>
        <t keepWithNext="true">BFD Metadata Protobuf Definition:</t>
        <figure anchor="protobuf_definition_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

  syntax = "proto2";
  package pb.bfd;
  import "ip.proto";

  message SessionData {
      required ip.Tuple original_ipTuple = 1;
      required ip.Tuple received_ipTuple = 2;
      optional string peername           = 3;
      optional string routername         = 4;
      optional string routerID           = 5;
  }

  message MeasureData {
      message Request {
          required uint32 transId = 1;
      }
      message Response {
          required uint32 request_transId  = 1;
          required uint32 response_transId = 2;
      }
      oneof type {
          Request  request  = 1;
          Response response = 2;
      }
      optional bool mtu_discovery = 3;
  }

  message NodeInfo {
      required uint32 id               = 1;
      required uint64 create_timestamp = 2;
      optional uint64 time_value       = 3;
      optional string nonce            = 4;
      optional string public_key       = 5;
      optional uint32 salt             = 6;
  }

  message Encrypted { 
    optional NodeInfo node_info          = 1; 
    optional string   metadata_key       = 2; 
    optional uint32   metadata_key_index = 3; 
    optional string   hmac_key           = 4; 
  }

  message Metadata {
      optional SessionData sessionData = 1;
      optional MeasureData measure     = 2;
      optional NodeInfo    nodeInfo    = 3;
      optional Encrypted   encrypted   = 4; 
  }

            ]]>
          </artwork>
        </figure>

        <section anchor="bfd_peer_received_address" numbered="true" toc="include">
          <name>Peer Determination of Received Peer IP Address</name>
          <t>
The SessionData message can be used to determine the source address of a
remote peer router on a Peer Pathway. This is required to establish a 
peer path. Configuration will be associated with a router ID, and not a 
dynamic address associated with a hostname. Remote Peers will create a 
local address resolution table (i.e., /etc/hosts) to resolve the 
hostname in configuration to the dynamic IP address. This action can be
performed simultaneously with detection of NAT between Peers below.
          </t>
          <t keepWithNext="true">Determination of Peer Received Address:</t>
          <figure anchor="det_peer_addr_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

     Router A                Router B                 Local
    [Addr A -> Addr B]                                 DNS
        |                       |                       |
        |- BFD ---------------->|                       |
        | original_ipTuple=A    |                       |
        | hostname="Router A"   |                       |
        |                       |- DNS Update---------->|
        |                       | Router A: Address A   |
        |                       |                       |
        |                       |                       |

    Router B has hostname lookup for Router A

              ]]>
            </artwork>
          </figure>
        </section> <!-- bfd_peer_received_address -->

        <section anchor="bfd_nat_detection" numbered="true" toc="include">
          <name>Detection of NAT between Peers using BFD</name>
          <t>
The SessionData message can optionally be used to detect NATs between 
two routing peers. Typically, this is performed during initial peer 
pathway establishment and often grouped together with sending Peer 
Authorization certificates. Similar to STUN, the IP address of the 
originating interface is stored in the field 
SessionData.original_ipTuple. If the router has received any BFD packets
from its peer router, it will store the IP address of the received BFD 
packet in this field. When sending the SessionData BFD Metadata, a 
router OPTIONALLY places its own name in the peername field. Through the
process of comparing addresses within the IP header with addresses used 
by the router's interfaces, one can detect when there is a NAT on a Peer
Pathway.
          </t>
          <t keepWithNext="true">BFD NAT Detection on Pathway:</t>
          <figure anchor="bfd_nat_detec_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

     Router A                  NAT                  Router B
     Addr A                   Addr N                 Addr B
        |                       |                       |
        |- BFD ---------------->|                       |
        | original_ipTuple=A    |                       |
        |                       |                       |
        |                       |- BFD ---------------->|
        |                       | original_ipTuple=N    |
        |                       |                       |
        |                       |                       |
        |                       |
        |                       |               NAT Detected
        |                       |               Router B gets N 
        |                       |               address on the wire
        |                       |               and it doesn't match
        |                       |               original_ipTuple
        |                       |
        |                       |                       |
        |                       |                       |
        |                       |<---------------- BFD -|
        |                       |    original_ipTuple=B |
        |                       |    received_ipTuple=N |
        |<---------------- BFD -|                       |
        |    original_ipTuple=B |                       |
        |    received_ipTuple=N |                       |
        |                       |                       |

    No NAT detected
    Router A gets B's address
    on the wire which matches
    the original_ipTuple

      ]]>
            </artwork>
          </figure>
          <t>
If a NAT is detected in a Peer Pathway, care must be taken to associate
address N with the Peer Pathway to Router A. Sessions that are 
traversing this Peer Pathway may require NAT Keep Alive processing. See 
<xref format="default" target="nat_keep_alive"/>.
        </t>
        </section> <!-- bfd_nat_detection -->

        <section anchor="bfd_router_address_change" numbered="true" toc="include">
          <name>Detection of Routers Address Changes using BFD</name>
          <t>
Often routers at branch locations are connected to networks and receive 
their IP address dynamically from DHCP, LTE or PPPoE procedures. 
Although it is rare, sometimes these addresses change unexpectedly. This
may be the result of a lease running out, or a router reestablishing 
connectivity after a failure. When this happens, any peer that was using
the old address will lose connectivity to this peer. By including 
SessionData BFD Metadata, learning the address of the peer and recovery 
occur veryquickly.
          </t>
          <t keepWithNext="true">BFD Detection on Router Address Change:</t>
          <figure anchor="bfd_det_router_addr_change_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

     Router A               DHCP                Router B
    [Addr A -> Server  <- Addr B]
        |                     |                     |
        |- BFD ------------------------------------>|
        | original_ipTuple=A  |                     |
        | received_ipTuple="" |                     |
        |                     |                     |
        |<------------------------------------ BFD -|
        |                     |  original_ipTuple=B |
        |                     |  received_ipTuple=A |
        |- BFD ------------------------------------>|
        | original_ipTuple=A  |                     |
        | received_ipTuple=B  |                     |

        Both routers have learned each other's IP Address
        and have determined there are no NATs between them

        |- DHCP Lease Exp --->|                     |
        |<---- New Address C -|                     |
        |                     |                     |
        |- BFD ------------------------------------>|
        | original_ipTuple=C  |                     |
        | received_ipTuple=B  |                     |
        |<------------------------------------ BFD -|
        |                     |  original_ipTuple=B |
        |                     |  received_ipTuple=C |

        Both routers have the correct IP Address and
        have determined there are no NATs between them

      ]]>
            </artwork>
          </figure>
        </section> <!-- bfd_router_address_change -->

        <section anchor="bfd_mtu" numbered="true" toc="include">
          <name>Determining MTU Size with BFD</name>
          <t>
Knowing the MTU size on a path is important for routers so they can 
fragment packets when necessary. After a peer pathway is established, a 
series of BFD MeasureData packets that increase in size can help us find
the limit of packet size between peers. To make the BFD packet larger, 
the lengths are adjusted in the IP header, UDP header, and BFD header. A
peer receiving a fragmented BFD request with the MTU Discovery field 
equal to TRUE simply does not respond.
          </t>
          <t>
Often there is an entire network between peers. As such, the MTU size 
may change over time. It is recommended that MTU be measured routinely 
and updated, should it change.
          </t>
          <t keepWithNext="true">BFD MeasureData for Determining Pathway MTU:</t>
          <figure anchor="bfd_mtu_size_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

     Router A                                          Router B
    [Addr A -> <-Addr B]
         |                                                 |
         |-BFD MeasureData (id=1, size 1200)-------------->|
         |-BFD MeasureData (id=2, size 1250)-------------->|
         |-BFD MeasureData (id=3, size 1300)-------------->|
         |-BFD MeasureData (id=4, size 1350)-------------->|
         |-BFD MeasureData (id=5, size 1400)-------------->|
         |-BFD MeasureData (id=6, size 1450)-------------->|
         |-BFD MeasureData (id=7, size 1500)-{fragmented}->|
         |                                                 |
         |<----(req_id=1, resp_id=1)-------BFD MeasureData-|
         |<----(req_id=2, resp_id=2)-------BFD MeasureData-|
         |<----(req_id=3, resp_id=3)-------BFD MeasureData-|
         |<----(req_id=4, resp_id=4)-------BFD MeasureData-|
         |<----(req_id=5, resp_id=5)-------BFD MeasureData-|
         |<----(req_id=6, resp_id=6)-------BFD MeasureData-|

         MTU Size = 1450
         
              ]]>
            </artwork>
          </figure>
        </section> <!-- bfd_mtu -->

        <section anchor="bfd_quality_measurement" numbered="true" toc="include">
          <name>Measuring Peer Pathway quality using BFD</name>
          <t>
After a Peer Pathway is authenticated and ready for use, BFD can be used
to measure latency and packet loss. This is performed by sending BFD
packets with BFD MeasureData Metadata. Both sides of a Peer Pathway can
test for quality if desired. The number of packets in a burst is 
determined by configuration. The frequency of quality tests is also 
determined by configuration. Quite often routers with a large number of 
Peer Pathways (such as a data center hub router) may never perform 
quality tests, and rely solely on observations made by its peer spoke 
routers.
          </t>
          <t>
BFD-based quality measurements are only required when circuits are idle. 
When sessions are traversing a peer path, quality measurements can made 
for existing sessions using SVR Path Metrics (see <xref format="default"
target="path_metrics"/>).
          </t>
          <t>
The receiving side generates a response message by rewriting the BFD
Metadata request and supplies information if requested. Each 
&quot;request&quot; generates a &quot;response&quot;. Each request has a
transaction ID, and so does each response. This solves a problem of 
exact symmetry where by a peer may not know if a message is a response 
or a request from a peer.
          </t>
          <t keepWithNext="true">BFD MeasureData for Measuring Pathway Quality:</t>
          <figure anchor="bfd_measure_quality_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

     Router A                                      Router B
    [Addr A -> <-Addr B]
         |                                              |
         |-BFD MeasureData (req_id=1)------------------>|
         |-BFD MeasureData (req_id=2)------------------>|
         |-BFD MeasureData (req_id=3)------------------>|
                 .......
         |-BFD MeasureData (req_id=n)------------------>|
         |                                              |
         |<----(req_id=1, resp_id=1)----BFD MeasureData-|
         |<----(req_id=3, resp_id=2)----BFD MeasureData-|
         |<----(req_id=1, resp_id=3)----BFD MeasureData-|
                  ......
         |<----(req_id=N, resp_id=N-1)--BFD MeasureData-|
         
      Latency = Sum of RTT(pkt 1-n)/(2*n)
      Jitter = Std Dev RTT(pkt 1-n)
      Packet Loss = 1-((Pcks_Sent - Pcks_recv)/Pkts_Sent)

              ]]>
            </artwork>
          </figure>
          <t>
Router B responds to each BFD MeasureData message it receives by 
responding to the original message and adding a serialized resp_id. To 
measure latency, the sending (measuring) side (Router A in this case) 
can measure the elapsed time between each req_id sent, and its response.
Absence of a response counts as a packet lost. The variability in 
latency provides a method of calculating jitter, and MoS scores can be 
computed once latency, packet loss, and jitter are known.
          </t>
          <t>
Both Router A and Router B must send their own BFD MeasureData messages 
to produce their own quality measurements from their own specific point 
of view. The actual network quality between these two routers can vary 
based on direction.
          </t>
        </section> <!-- bfd_quality_measurement -->

        <section anchor="bfd_path_failover" numbered="true" toc="include">
          <name>Detection of Path Failover using BFD</name>
          <t>
If one side of a Peer Pathway fails and there exists a policy to choose 
an alternate path, BFD NodeInfo Metadata can be used to detect this 
event. Knowledge of a Peer Pathway failover may be required by routers
in certain scenarios.
          </t>
          <t>
For redundancy, routers are often grouped into a cluster of 
active/active nodes. Responsibility for a Peer Pathway may change from 
one member of a cluster to another. When sending BFD with Metadata, by 
including the Node ID (instance number in a cluster) and a timestamp of 
when the Peer router started, one can detect redundancy events at the 
far end side of a Peer Pathway.
          </t>
          <t>
Inclusion of this information is optional. This data can be used by a 
remote peer to trigger actions where redundancy events impact them.
          </t>
        </section> <!-- bfd_path_failovers -->

        <section anchor="peer_auth_procedure" numbered="true" toc="include">
          <name>Peer Authentication Procedures</name>
          <t>
When a router is initialized, if it does not have a signed 
authentication certificate that is valid, it must obtain one from a 
certificate authority (CA). The router will create an elliptic-curve 
public/private key pair (see <xref format="default" target="RFC8422"/>).
The public key is used to create an X.509 certificate signing request 
(CSR) with the common name field set to the router's UUID. 
Elliptic-curve is used to ensure the X.509 certificate is as small as 
possible. A certificate signing request is initiated to a known and 
trusted CA through a secure connection. The CA will digitally sign 
(ECDSA) the CSR and return it to the requesting router. The specific 
details of this process is omitted from this specification, but it is 
recommended that it follow the procedures and guidelines defined in 
<xref format="default" target="RFC4210"/>. Certificates and Public Keys 
are stored locally on each router in PEM format defined by <xref 
format="default" target="RFC7468"/>.
          </t>
          <t keepWithNext="true">Router Authentication:</t>
          <figure anchor="router_auth_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

                           Router A
                         Certificate
          Router A        Authority
              |                | 
       +------+------+         |
       |Cert Missing,|         |
       | Invalid     |         |
       | or Expiring |         |
       +-------------+         |
              |                |
        +-----+------+         |
        |   Create   |         |
        | Curve-P256 |         |
        |  Pub/Priv  |         |
        |  Key Pair  |         |
        +------------+         |
              |                |
        +-----+------+         |
        |   Create   |         |
        | X.509 Cert |         |
        | CN=RouterA |         |
        +------------+         |
              |                |
              +------CSR------>|
                               |
              |<-X.509 Signed--+

              ]]>
            </artwork>
          </figure>
          <t>
The certificate is stored on the router persistently in PEM format. The 
private key associated with the certificate should be created and stored 
in a secure non-volatile storage, such as a Trusted Platform Module 
(TPM).
          </t>
          <t>
When establishing a peer pathway, the SVR Routers will authenticate with
each other using their public key and UUID. The result will be a 
symmetric Peer Key derived from the router's private and public keys 
from the X.509 certificate above. UUIDs are used for authentication 
because router IP Addresses often change. This is true when transport 
addresses of branch routers are established using DHCP and leases
expire.
          </t>
          <t>
The diagram below shows two routers, each with two peer pathways. BFD 
Messages with Nodeinfo are sent that contain the X.509 Certificate in 
the public_key field. The BFD Nodeinfo messages are sent by both routers
on all pathways, but only need to be validated one time for each router 
peer.
          </t>
          <t keepWithNext="true">Router Authentication:</t>
          <figure anchor="router_auth_process_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

           Router A     Router A     Router B     Router B
           Peerpath 1   Peerpath 2   Peerpath 1   Peerpath 2
               |           |            |            |
       =============ALL PEER PATHS ARE DISCONNECTED==========
               |           |            |            |
               |--BFD w/X.509 Cert----->|            |
               |           |--BFD w/X.509 Cert------>|
               |           |            |            |
              ....Delay between retransmissions .......
               |           |            |            |
               |--BFD w/X.509 Cert----->|            |
               |           |         Router A        |
               |           |        Validated        |
               |           |            |            |
               |           |--BFD w/X.509 Cert------>|
               |           |            |            |
               |<----BFD w/X.509 Cert---|            |
            Router B       |            |            |
           Validated       |            |            |
               |           |<-----BFD w/X.509 Cert---|
               |           |            |            |
      =============ALL PEER PATHS ARE OPERATIONAL==========
               |           |            |            |
              ....Delay between retransmissions .......
               |           |            |            |
               |----BFD---------------->|            |
               |           |-------BFD-------------->|
               |<-------------BFD-------|            |
               |           |<-------------BFD--------|
            
              ]]>
            </artwork>
          </figure>
          <t>
When a certificate is received from a peer, it must be validated. The 
validation includes the following checks:
          </t>
          <ul spacing="normal">
            <li>
Verify the dates are valid.
            </li>
            <li>
Verify the signature of the Certificate Authority.
            </li>
            <li>
If revocation list available, verify the certificate has not been 
revoked.
            </li>
            <li>
Verify the router name is supported in configuration. Administrative
revocation is a primary means of control.
            </li>
          </ul>
          <t>
The validation for a peer only needs to be done one time. When a 
certificate is received from a peer on multiple peer paths, if the 
certificate is identical to a previously validated certificate, a cached
validation response can be used.
          </t>
          <t>
When receiving a certificate from a peer router, after validation, the 
receiving router must extract the peer router's public key and save it. 
This will be used for validating Peer Key/rekey request's authenticity.
          </t>
          <t>
Each router should update its authentication certificate before the 
current certificate expires utilizing the same exact steps identified 
herein.
          </t>
        </section> <!-- peer_auth_procedure -->

        <section anchor="peer_key_procedure" numbered="true" toc="include">
          <name>Peer Key-Rekey Procedures</name>
          <t>
A single Peer Key is used for all paths between two router peers. The 
key is kept and considered valid until a new key is accepted as a 
replacement. This key continues to be used through network outages and 
path failures. If a key is lost, or doesn't appear to function 
correctly, a new key must be obtained before processing of encrypted BFD
traffic.
          </t>
          <t>
Anytime a key replacement is desired, or a key is needed, a new salt 
value is created by the initiator and sent with BFD NodeInfo to a peer. 
The peer responds by generating a new salt value and responding with a 
BFD NodeInfo message. Once both salt values are obtained, the Concat KDF
calculation can proceed resulting in a symmetric key value for both 
peering routers.
          </t>
          <t>
A Key Derivation Function called Concat KDF (See <xref format="default" 
target="NIST_SP_800-56A"/> is used to calculate an authenticated peer 
key. This key calculation utilizes the routers authenticated 
certificates private keys, and as such the key is safe from man in the 
middle attacks.
          </t>
          <t>
OpenSSL has a standard function called ConcatKDF() that can
be called to compute this key in a FIPS compliant fashion. The 
parameters are:
          </t>
          <t keepWithNext="true">ConcatKDF Function (Part of OpenSSL):</t>
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

          Peer Key = ConcatKDF(SharedSecret,
                               AlgorithmID,
                               PartyUInfo,
                               PartyVInfo,
                               SuppPubInfo,
                               SuppPrivInfo,
                               KeyDataLen)

          Here's what each parameter represents:

          SharedSecret: The result of an ECDH calculation with the peer
          AlgorithmID: "ECDH"
          PartyUInfo: UUID of the Router
          PartyVInfo: UUID of the Peer Router
          SuppPubInfo: Initiator Salt Concatenated with Responder Salt
          SuppPrivInfo: ""
          KeyDataLen: 256
            ]]>
          </artwork>
          <t>
The Salt values are concatenated octet strings, with initiator salt 
first followed by responder's salt. For ECDH calculations, please see
<xref format="default" target="ECDH_Key_Exchange"/>.
          </t>
          <t>
After a short guard time (1-2 seconds) to allow both peers to complete 
their calculation, the Peer Key is ready for use and replaces any 
pre-existing key. The key is then valid on all peer paths between two 
peers. Once calculated on one peer path, it can be used immediately on 
all other paths with the same remote peer.
          </t>
          <t>
The key can be immediately used for encrypting BFD Metadata.
          </t>
          <t keepWithNext="true">Peer Key-Rekeying:</t>
          <figure anchor="peer_key_calc_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

           Router A     Router A     Router B     Router B
           Peerpath 1   Peerpath 2   Peerpath 1   Peerpath 2
               |           |            |            |
            .......NO Current Peer Key Exists............
               |           |            |            |
            Gen Salt       |            |            |
               |           |            |            |
               |--BFD Nodeinfo Req----->|            |
               |           |            |            |
               |           |        Gen Salt         |
               |           |            |            |
               |<----BFD Nodeinfo Req---|            |
               |           |            |            |
              Key          |           Key           |
            Computed       |         Computed        |
               |           |            |            |
             ........Transition Guard Time..............
               |           |            |            |
             ......... 1st Peer Key Exists..............
               |           |            |            |
             ...........At Rekeying Interval............
               |           |            |            |
               |        Gen Salt        |            |
               |           |            |            |
               |           |--BFD NodeinfoReq------->|
               |           |            |            |
               |           |            |         Gen Salt
               |           |            |            |
               |           |<---BFD Node Info Req----|
               |           |            |            |
              Key          |           Key           |
            Computed       |         Computed        |
               |           |            |            |
             ..........Transition Guard Time.............
               |           |            |            |
             ........... 2nd Peer Key Exists.............

              ]]>
            </artwork>
          </figure>
          <t>
The peer key is a symmetric key used to encrypt the delivery of the SVR 
Metadata Key. If the Peer Key is invalid, or expired, or can't be 
generated, the SVR Routers will not be able share their SVR Metadata 
Key, which will prevent the routers from functioning. The Concat KDF is 
a form of ECDH-ES that will only produce a symmetric key if there is no 
man-in-the-middle. If the keys fail to decrypt messages, it is likely a 
man-in-the-middle exists, and the route peers should remove the Peer 
Pathway from service.
          </t>
          <t>
If a peer sends a BFD NodeInfo to a peer, and there is no response, the 
peer continues to resend it at periodic intervals. If there is no 
response after a very long period of time (1 hour), the peer path can be  
declared invalid and removed from service based on administrative 
timers.
          </t>
        </section> <!-- peer_key_procedure -->

        <section anchor="svr_metadata_key_procedure" numbered="true" toc="include">
          <name>SVR Metadata Key-Rekey</name>
          <t>
SVR Metadata requires a security association that is not Peer Pathway
specific. The interface or source IP Address can not uniquely identify 
an SVR Peer. For example, there could be many Peer Pathways connected 
over the public internet. The only way to identify the peer positively 
is to decrypt the SVR Metadata and extract the peer ID. Each SVR 
router MUST be able to decrypt SVR Metadata arriving on any interface.
          </t>
          <t>
SVR Metadata is encrypted specifically for the chosen next-hop SVR 
router. No other SVR router should be able to decrypt the metadata. Thus
when sending SVR Metadata, peers must select a key that is directly 
associated with the chosen next hop SVR router.
          </t>
          <t>
To distribute their keys, SVR routers generate a key locally that 
conforms to the defined security policy. A FIPS 140-2 approved highly 
secure DRBG is used to generate keys and IV.  Its also highly 
recommended that NIST SP800.90B be followed for ensuring proper entropy.
See <xref format="default" target="NIST_SP_800-90B"/>. OpenSSL function 
RAND_bytes() can be used to generate a key that is 256 Bits long and 
conforms to NIST SP-800-90B.
          </t>
          <t>
The key and its index are then shared with all known peers using an 
Encrypted BFD Metadata that contains NodeInfo. The current Peer Key 
is used to encrypt the 256 Bit SVR Metadata Key calculated above 
resulting in a 32 Byte Encrypted block and a 16 Byte IV, creating a 48 
octet encrypted string. The key index is incremented. The encrypted 
key is then included in a BFD packet (NodeInfo message), and broadcast 
to all peers. The encryption technique is identical to SVR Metadata 
Encryption but uses the Peer Key as opposed to the SVR Metadata 
Key.  (See <xref format="default" target="encryption_of_metadata"/>). 
This also means that SVR Metadata keys are asymmetric. The forward SVR 
Metadata is encrypted with the Key of the destination router, while 
reverse SVR Metadata is encrypted with the Key or the originating 
router.
          </t>
          <t keepWithNext="true">SVR Metadata Key/Rekeying:</t>
          <figure anchor="svr_key_broadcast_fig">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

         Peer A       Peer B       Peer C       Peer D
            |            |            |            |
         ...NO Current SVR Metadata Key Exists For A....
            |            |            |            |
         Gen Key         |            |            |
         Inc Indx        |            |            |
            |            |            |            |
            |-BFD w/key->|            |            |
            |<-BFD w/key-|            |            |
            |                         |            |
            |--------BFD w/key------->|            |
            |<-------BFD w/key--------|            |
            |                                      |
            |----------------BFD w/key------------>|
            |<---------------BFD w/key-------------|
            |            |            |            |
         ..........A updates SVR Metadata Key .........
            |            |            |            |
       Gen New Key       |            |            |
         Inc Indx        |            |            |
            |            |            |            |
            |-BFD w/key->|            |            |
            |<-BFD w/key-|            |            |
            |                         |            |
            |--------BFD w/key------->|            |
            |<-------BFD w/key--------|            |
            |                                      |
            |----------------BFD w/key------------>|
            |<---------------BFD w/key-------------|
            
              ]]>
            </artwork>
          </figure>
          <t>
The above diagram shows Peer A distributing its key and index to Peers 
B, C, and D followed by a subsequent rekey. Each peer responds with its 
current key and index to provide a handshake. This is also an efficient
way for a router that is restarting to acquire all of its needed keys. 
If a router needs to send SVR Metadata to a peer and it does not have a 
key, this procedure can be used to acquire the missing key. Anytime a 
Peer decides to rekey, it must update all of its peers. When an SVR 
Metadata Key is shared via BFD, the metadata_key_index field number is 
extracted and is stored with the key for the peer. When SVR Metadata is 
to be decrypted, the Security ID field in the metadata provides the key 
index to use for decryption. Please see <xref format="default" 
target="security_id"/>.
          </t>
        </section> <!-- svr_metadata_key_procedure -->

        <section anchor="certificate_replacement_procedure" numbered="true" toc="include">
          <name>Certificate Revocation/Replacement Procedures</name>
          <t>
In the event that a router's certificate is about to expire, or needs to
be replaced, a new certificate can be added to the system. Once a new 
certificate file has been loaded into the system, an event is triggered 
to restart the peer authentication <xref format="default" 
target="peer_auth_procedure"/> procedure again. The method of loading 
the certificate is out of the scope of this document.
          </t>
          <t>
In the event that a system has become compromised, it may be desirable 
to revoke its certificate so that it can no longer authenticate with its 
peers. The management platform of the router is responsible for 
periodically checking the CRL for any revocations, or OSCP can be used
to check the validity of the certificate directly. A notification is 
sent to any router that has its certificate revoked. Upon receiving this 
revocation, the router will check its configuration to determine the 
appropriate behavior.
          </t>
          <t>
There SHOULD exist a policy to define the system behavior in the event 
that a certificate has expired or has been revoked. The default behavior
SHOULD be to fail-soft (i.e., providing indication that the certificate 
is no longer valid and action needs to be taken). Alternatively, if the 
system is configured to fail-hard, it should remove all of its peering 
relationships and subsequently would no longer be able to participate in
SVR.
          </t>
        </section> <!-- certificate_replacement_procedure -->
      </section> <!-- svr_peering -->
    </section> <!-- std_bfd -->

    <section anchor="meta_use_cases" numbered="true" toc="include">
      <name>Additional SVR Metadata Exchanges and Use Cases</name>
      <t>
SVR Metadata can be inserted and used to share network intent between 
routers. Below are examples for specific use cases. These examples are 
illustrative and the use of SVR Metadata is not limited to these use 
cases alone.
      </t>

      <section anchor="moving_session" numbered="true" toc="include">
        <name>Moving a Session</name>
        <t>
To change the pathway of a session between two routers, any SVR Router 
will reinsert the SVR Metadata described in section <xref 
format="default" target="save_session_state"/> and transmits the packet 
on a different peer path while retaining the same Session UUID of the 
existing session that is being moved.
        </t>
        <ul spacing="normal">
          <li>
Simultaneously it will update its fast path forwarding tables to reflect
the new IP addresses and ports (Waypoints) for the transport - all other 
aspects of the session remain the same. The presence of middle boxes 
means that routers on both sides must once again perform NATP detection 
and update real transmit addresses/ports to ensure that sessions will 
continue.
        </li>
        </ul>
        <t>
After 5 seconds the old path state entries can be removed. By keeping 
the old and new fast path entries during this 5 second transition, no 
packets in flight will be dropped. The diagram below shows the sequence 
for moving sessions around a failed mid-pathway router.
        </t>
        <t keepWithNext="true">
Ladder Diagram for Existing Session Reroute with SVR Metadata:
        </t>
        <figure anchor="session_move_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

                   RTR-A      RTR-B      RTR-C      RTR-D
        Client . . . . . . . . . . . . . . . . . . . . . . . . Server
          |          |          |          |          |          |
          |--PUSH--->|          |          |          |          |
          |          |--PUSH-------------->|          |          |
          |          |          |          |--PUSH--->|          |
          |          |          |          |          |--PUSH--->|
          |          |          |          |          |<---ACK---|
          |          |          |          |<---ACK---|          |
          |          |<--------------ACK---|          |          |
          |<---ACK---|          |          |          |          |
          |          |          |          |          |          |
          ......................RTR-C Fails.......................
          |--PUSH--->|          |          |          |          |
          |          |--PUSH--->|          |          |          |
          |          |  [MD1]   |          |          |          |
          |          |          |--PUSH[MD2]--------->|          |
          |          |          |          |          |--PUSH--->|
          |          |          |          |          |<--ACK----|
          |          |          |<-----ACK[RMD2]------|          |
          |          |<--ACK----|          |          |          |
          |<--ACK----|  [RMD1]  |          |          |          |
          |          |          |          |          |          |
          |<==== Session Packets Flow without SVR Metadata =====>|

            ]]>
          </artwork>
        </figure>
        <t>
When router C fails, SVR Metadata MD1, MD2 can be included in the very
next packet being sent in either direction. Confirmation that the move
was completed is confirmed with reverse SVR Metadata RMD2, RMD1. For 
established TCP sessions, this is either a PUSH (as shown) or an ACK 
(not shown). This can reestablish the SVR session state into a new 
router (Router B in this example) that previously did not have any 
involvement in the session. This technique can also be used to modify 
paths between two routers effectively moving TCP sessions from one 
transport (MPLS for example) to another (LTE). A session move can be 
initiated by any router at any time.
        </t>
        <t keepWithNext="true">
Ladder Diagram for Session Reroute Between Peers with SVR Metadata:</t>
        <figure anchor="session_reroute_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[
                                                           
                 +-------+              +--------+        
                 |       +-----MPLS-----+        |       
         Client--| Rtr-A |              | Rtr-B  +----Server
                 |       +------LTE-----+        |
                 +-------+              +--------+ 

        Client . . . . . . . . . . . . . . . . . . . . . . Server
          |                                                   |
          |         RouterA                    RouterB        |
          |            |                          |           |
          |---PUSH---->|                          |           |
          |            |---PUSH over MPLS-------->|           |
          |            |                          |---PUSH--->|
          ................MPLS has Poor Quality ................
          |            |                          |           |
          |---PUSH---->|                          |           |
          |            |---PUSH over LTE[MD]----->|           |
          |            |                          |---PUSH--->|
          |            |                          |<---ACK----|
          |            |<---ACK over LTE[RMD]-----|           |
          |<---ACK-----|                          |           |
          |            |                          |           |
          |<=== Session Packets Flow without SVR Metadata ===>|
          
            ]]>
          </artwork>
        </figure>
        <t>
The diagram shows moving an active TCP session from one transport 
network to another by injecting SVR Metadata (MD) into any packet that 
is part of the transport in either direction. Reverse SVR Metadata (RMD)
is sent on any packet going in the reverse direction to confirm that the 
move was successful.
        </t>
      </section> <!-- moving_session -->

      <section anchor="one_way_media_move" numbered="true" toc="include">
        <name>Moving Sessions that are Quiescent or One-Way Flows</name>
        <t>
Certain sessions may be idle or packets may create a one-way information
flow (TCP pushes) with one way acknowledgement (TCP ACKs). In these 
scenarios, insertion of SVR Metadata into existing packets may not be 
possible.
        </t>
        <t>
After moving a session, if an SVR router determines no packets are 
received or sent for an active session over an elapsed time of 1 second,
the SVR router will generate an SVR Control Message to the peer.
        </t>
        <t keepWithNext="true">
Ladder Diagram for One Way Media Move with SVR Metadata:
        </t>
        <figure anchor="one_way_media_move_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[
                                                           
                 +-------+              +--------+        
                 |       +-----MPLS-----+        |       
         Client--| Rtr-A |              | Rtr-B  +----Server
                 |       +------LTE-----+        |
                 +-------+              +--------+ 

        Client . . . . . . . . . . . . . . . . . . . . . . Server
          |                                                   |
          |         RouterA                    RouterB        |
          |            |                          |           |
          |            |                          |<---PUSH---|
          |            |<---PUSH over MPLS------->|           |
          |<---PUSH----|                          |           |
          |----ACK---->|                          |           |
          |            |------ACK over MPLS------>|           |
          |            |                          |---ACK---->|
          |            X RouterA MPLS FAILS       |           |
          |            X           RouterB MPLS OK|           |
          |            X                          |           |
          ..............RouterA Moves Session to LTE..........
          |            |                          |<---PUSH---|
          |            X<---PUSH over MPLS------->|           |
          |            |                          |<---PUSH---|
          |            X<---PUSH over MPLS------->|           |
          |            |                          |           |
          .......NO Packets at Router A for Moved Session......
          |            |                          |           |
          |            |-----[MD over LTE]------->|           |
          ...............RouterB Moves Session to LTE..........
          |            |                          |<---PUSH---|
          |            |<--PUSH over LTE [RMD]--->|           |
          |<---PUSH----|                          |           |
          |----ACK---->|                          |           |
          |            |------ACK over LTE------->|           |
          |            |                          |---ACK---->|
          |<======== Session Packets Continue flowing =======>|

            ]]>
          </artwork>
        </figure>
        <t>
The SVR Control Message uses the new SVR router interface addresses
(Waypoints) and contains the standard first packet SVR Metadata fields 
with the SVR Control Message TLV added to the header with drop reason
&quot;FLOW MOVED&quot;. Also added is a TLV attribute with the remaining
session time. This is essential to ensure mid-stream routers remove 
sessions from their tables roughly at the same time. This message will 
be transmitted once every second for 5 seconds OR reverse SVR Metadata 
has been received. If no reverse SVR Metadata has been received in 5 
seconds the session is torn down. For a quiescent flow, the RMD is a 
generated SVR Control Message as well as shown below:
        </t>
        <t keepWithNext="true">
Ladder Diagram for Quiescent Moved Session with SVR Metadata:
        </t>
        <figure anchor="quiescent_move_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[
                                                           
                 +-------+              +--------+        
                 |       +-----MPLS-----+        |       
         Client--| Rtr-A |              | Rtr-B  +----Server
                 |       +------LTE-----+        |
                 +-------+              +--------+ 

        Client . . . . . . . . . . . . . . . . . . . . . . Server
          |                                                   |
          |         RouterA                    RouterB        |
          |            |                          |           |
          |<========== Quiescent Session Established ========>|
          |            |                          |           |
          |            X RouterA MPLS FAILS       |           |
          |            X           RouterB MPLS OK|           |
          |            X                          |           |
          ..............RouterA Moves Session to LTE..........
          |            |                          |           |
          |            |-----[MD over LTE]------->|           |
          |            |                          |           |
          ...............RouterB Moves Session to LTE..........
          |            |                          |           |
          |            |<-----[RMD over LTE]----->|           |
          |            |                          |           |
          |<=========== Quiescent Session Continues =========>|

            ]]>
          </artwork>
        </figure>
      </section> <!-- one_way_media_move -->

      <section anchor="nat_keep_alive" numbered="true" toc="include">
        <name>NAT Keep Alive</name>
        <t>
If an SVR Router determines there is one or more NATs on a peer pathway
(see <xref format="default" target="path_obstruct"/>, the SVR Peer must 
maintain the NAT bindings for each active session by sending keep alive 
SVR Metadata in the direction of the NAT. For keep alive, SVR utilizes a
packet that matches the L4 header of the idle session that includes SVR 
Metadata type 24 with the drop reason set to Keep Alive.
        </t>
        <t keepWithNext="true">
Ladder Diagram for NAT Keep Alive with SVR Metadata:
        </t>
        <figure anchor="nat_keep_alive_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

                   RTR-A       NAT       RTR-B
        Client . . . . . . . . . . . . . . . . . . Server
          |          |          |          |          |
          ...................Existing SVR Session......
          |--PUSH--->|          |          |          |
          |          |--PUSH--->|          |          |
          |          |          |---PUSH-->|          |
          |          |          |          |--PUSH--->|
          |          |          |          |<---ACK---|
          |          |          |<---ACK---|          |
          |          |<--PUSH---|          |          |
          |<--PUSH---|          |          |          |
      .........NO PACKETS EITHER DIRECTION FOR 20 SECS.......
          |          |          |          |          |
          |          |--[MD1]-->|          |          |
          |          |          |--[MD1]-->|          |
          |          |          |          |          |
      .........NO PACKETS EITHER DIRECTION FOR 20 SECS.......
          |          |          |          |          |
          |          |--[MD1]-->|          |          |
          |          |          |--[MD1]-->|          |
          |          |          |          |          |

            ]]>
          </artwork>
        </figure>
        <t>
The SVR Metadata attributes that MUST be inserted in a keep alive for 
existing packet sessions includes:
        </t>
        <ul spacing="normal">
          <li>
Header: SVR Control Message: see <xref format="default" 
target="proto_msg"/>.
          </li>
          <li>
Header: Security ID: see <xref format="default" target="security_id"/>.
          </li>
          <li>
Payload: Session UUID: see <xref format="default" 
target="session_uuid"/>.
          </li>
          <li>
Payload: Source Router Name: see <xref format="default" 
target="src_rtr_name"/>.
          </li>
          <li>
Payload: Peer Pathway ID: see <xref format="default" 
target="peer_rtr_id"/>.
          </li>
        </ul>
        <t>
With this minimum set of information, the receiver of this message can 
verify and update any modifications in a session NAT state. The Session 
UUID is used to verify all information positively.
        </t>
      </section> <!-- nat_keep_alive -->

      <section anchor="adaptive_encryption" numbered="true" toc="include">
        <name>Adaptive Encryption</name>
        <t>
Unlike a tunnel where all packets must be encrypted, each session in SVR
is unique and independent. Most modern application sessions are already 
using TLS or DTLS. SVR Routers have the capability of encrypting only 
sessions that are not already encrypted. Below is an example of adaptive
encryption. With adaptive encryption, every session begins unencrypted. 
By analyzing the first 4 packets, the router can determine that 
encryption is required or not. If the fourth packet is a TLS Client 
hello message, encryption is NOT required. Any sequence of packets that 
does not indicate TLS or DTLS setup would immediately toggle encryption 
on.
        </t>
        <t keepWithNext="true">
Ladder Diagram of Adaptive Encryption with Client Hello:
        </t>
        <figure anchor="adapt_enc_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

        Client . . . . . . . . . . . . . . . . . . Server
          |                                           |
          |         RouterA            RouterB        |
          |---SYN----->|                  |           |
          |            |----SYN[MD1]----->|           |
          |            |                  |---SYN---->|
          |            |                  |<--SYN/ACK-|
          |            |<----SYN/ACK------|           |
          |<--SYN/ACK--|    [RMD1]        |           |
          |---ACK----->|                  |           |
          |            |------ACK-------->|           | 
          |            |                  |---ACK---->|
          |--Client--->|                  |           |
          |  Hello     |<== ENCRYPTION===>|           |
          |            |   Not Required   |           |
          |            |                  |           |
          |            |-----Client------>|           |
          |            |     Hello        |--Client-->|
          |            |                  |           |

            ]]>
          </artwork>
        </figure>
        <t>
If the fourth packet is not an indication that encryption will be 
performed by the transport layer, then the ingress SVR Routers must 
encrypt and the egress SVR router must decrypt the session 
bidirectionally. This ensures that any data between the SVR Routers is 
encrypted.
        </t>
        <t keepWithNext="true">
Ladder Diagram of Adaptive Encryption with data:
        </t>
        <figure anchor="adapt_enc_req_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

        Client . . . . . . . .  . . . . . . . . Server
          |                                       |
          |         RouterA        RouterB        |
          |---SYN----->|              |           |
          |            |--SYN[MD1]--->|           |
          |            |              |---SYN---->|
          |            |              |<--SYN/ACK-|
          |            |<--SYN/ACK----|           |
          |<--SYN/ACK--|    [RMD1]    |           |
          |---ACK----->|              |           |
          |            |----ACK------>|           | 
          |            |              |---ACK---->|
          |---Data---->|              |           |
          |            |<==ENCRYPT===>|           |
          |            |  Required    |           |
          |            |              |           |
          |            |--Encrypted-->|           |
          |            |   Data       |---Data--->|

            ]]>
          </artwork>
        </figure>
        <t>
Adaptive encryption is part of the security provisioning. Security
policies are associated with services, and as such certain applications 
can mandate encryption; others may allow adaptive encryption, and still
others may specify no encryption.
      </t>
      </section> <!-- adaptive_encryption -->

      <section anchor="packet_fragmentation_v4" numbered="true" toc="include">
        <name>IPv4 Packet Fragmentation</name>
        <t>
When a fragmented packet is presented to an SVR Router, the packet must 
be completely assembled to be processed. As such, the HMAC must be 
applied to the entire packet, and the entire packet must be routed as a 
whole. Each resulting fragment must be turned into an IP packet with 
5-tuples that match the corresponding session to ingress and pass 
through an SVR. The SVR Router will simply use the same L4 header on all
fragments from the session state table (peer pathway and transit ports).
A time-based HMAC signature is created for the entire packet and 
appended to the last fragment. Each fragment must also have SVR Metadata
inserted that clearly identifies the fragment to the SVR routing peer.
        </t>
        <t keepWithNext="true">Ladder Diagram Fragmented Packets:</t>
        <figure anchor="frag_pkt_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

     Client . . . . . . . . . . . . . . . . . . . . . . Server
       |                                                   |
       |         RouterA                    RouterB        |
       |            |                          |           |
       |--Frag 1--->|                          |           |
       |--Frag 3--->|                          |           |
       |--Frag 2--->|                          |           |
       |        +---+----+                     |           |
       |        |Assemble|                     |           |
       |        +---+----+                     |           |
       |            |----Frag 1[L4/MD]-------->|           |
       |            |                          |           |
       |            |----Frag 2[L4/MD]-------->|           |
       |            |                          |           |
       |            |----Frag 3[L4/MD]-------->|           |
       |            |                     +--------+       |
       |            |                     |Assemble|       |
       |            |                     +--------+       |
       |            |                          |--Frag 1-->|
       |            |                          |--Frag 2-->|
       |            |                          |--Frag 3-->|

            ]]>
          </artwork>
        </figure>
        <t>
In the diagram above, Router A collects all the fragments 1, 2, and 3. 
Reassembly is performed. Router A records two things from the inbound 
fragments: The Original ID, and the largest fragment size received. 
Router A then proceeds to send the jumbo packet by fragmenting it again,
but this time sending each piece inside a packet with a newly created L4
which maps exactly to the peer pathway chosen with ports assigned from 
the session state table. The fragment size will be the lesser of the 
smallest MTU on the path OR the largest fragment seen, whichever is 
smaller. The SVR Metadata header and header TLVs are not encrypted. The
packet construction looks like this:
        </t>
        <t keepWithNext="true">SVR Packet Layout</t>
        <figure anchor="svr_pkt_frag_layout_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

     Fragment 1
    +------+------+----------+----------+----------+
    |      |      |  SVR     |          |          |
    | Peer | Peer | Metadata | Header   | First    |
    | IP   | L4   | Header   | TLV-1,16 | Fragment |
    | HDR  | HDR  | 12 Bytes | 22 Bytes |          |
    +------+------+----------+----------+----------+

     Fragment 2
    +------+------+----------+----------+----------+
    |      |      |  SVR     |          |          |
    | Peer | Peer | Metadata | Header   | Second   |
    | IP   | L4   | Header   | TLV-1    | Fragment |
    | HDR  | HDR  | 12 Bytes | 14 Bytes |          |
    +------+------+----------+----------+----------+

     Fragment 3
    +------+------+----------+----------+----------+-----------+
    |      |      |  SVR     |          |          |           |
    | Peer | Peer | Metadata | Header   | Third    | PKT       |
    | IP   | L4   | Header   | TLV-1    | Fragment | HMAC      |
    | HDR  | HDR  | 12 Bytes | 14 Bytes |          | SIGNATURE |
    +------+------+----------+----------+----------+-----------+

            ]]>
          </artwork>
        </figure>
        <t>
The SVR Metadata type 1 inside the SVR fragment will have its own 
extended ID assigned. This allows a different number of fragments to be 
sent between Router A and B than the Client and Server have. It also 
allows independent fragmentation by SVR, should it be required. Router B
will process the fragments from router A. Router B will look at its 
egress MTU size, and the largest fragment seen recorded by Router A and 
transmitted in SVR Metadata to determine the proper size fragments to 
send, and the packet is fragmented and sent.
        </t>
        <t>
There are no other SVR Metadata fields required. All information about 
the session state is tied to the 5-tuple peer pathway and transports 
ports.
        </t>
        <t>
The details on packet fragmentation are identical to what is performed 
in IP fragmentation, exception for the full L4 headers and SVR Metadata
insertion.
        </t>
        <t>
If a packet traversing an SVR needs to be fragmented by the router for 
an SVR segment for any reason, including the insertion of SVR Metadata, 
the initiating router inserts SVR Metadata on the first packet and 
duplicates the L4 header (either TCP or UDP) on subsequent fragments and
inserts SVR Metadata. In this case the Largest Fragment Seen and 
Original ID field in the SVR Metadata is left blank.
        </t>
        <t keepWithNext="true">Ladder Diagram Fragmented Packets:</t>
        <figure anchor="frag_pkt_ladder_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

        Client . . . . . . . . . . . . . . . . . . . . . . Server
          |                                                   |
          |         RouterA                    RouterB        |
          |            |                          |           |
          |--Lg Pkt--->|                          |           |
          |            |--------Frag 1[MD]------->|           |
          |            |                          |           |
          |            |----Frag 2[L4 Hdr|MD]---->|           |
          |            |                          |--Lg Pkt-->|
          |            |                          |           |

            ]]>
          </artwork>
        </figure>
      </section> <!-- packet_fragmentation_v4 -->


      <section anchor="packet_fragmentation_v6" numbered="true" toc="include">
        <name>IPv6 Packet Fragmentation</name>
        <t>
Since IPv6 fragments packets at the source node, the SVR router performs
no special handing for IPv6 networks. If the packet is too large for the
destination, the destination will respond with an ICMPv6 response 
indicating the message is too large, including the recommended MTU. The 
router returns this message back to the originator on its reverse flow.
        </t>
        <figure anchor="ipv6_frag_diagram">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

        Client . . . . . . . . . . . . . . . . . Server
          |                                        |
          |         RouterA        RouterB         |
          |--Lg Pkt--->|              |            |
          |            |----Lg Pkt--->|            |
          |            |              |--Lg Pkt--->|
          |            |              |<--ICMPv6---|
          |            |<--ICMPv6-----|            |
          |<--ICMPv6---|              |            |
          |            |              |            |

            ]]>
          </artwork>
        </figure>
      </section> <!-- packet_fragmentation_v6 -->

      <section anchor="icmp" numbered="true" toc="include">
        <name>ICMP and SVR</name>
        <t>
There are two types of ICMP messages. There are messages associated with
specific packet delivery network errors. This includes:
        </t>
        <ul spacing="normal">
          <li>Type 3: Destination Unreachable </li>
          <li>Type 11: Time Exceeded (TTL)</li>
        </ul>
        <t>
These messages have information from the packet that generated the error
by including the IP header + 8 octets in the ICMP message (see <xref 
format="default" target="RFC0792"/>. It is important to deliver the ICMP
message back to the origin. For these ICMP messages, the router MUST 
determine what active session the ICMP message belongs to by parsing the
IP header information inside the ICMP message. Once a session is found,
the ICMP message is transported across the SVR and reverse SVR Metadata 
is applied by having its destination address changed to the Waypoint 
Addresses of the routers.
        </t>
        <t>
SVR Metadata type 20 and 21 are used to send the source of the ICMP 
error backward through the networks. See <xref format="default" 
target="rtr_egress_src_addr_v4"/> and <xref format="default" 
target="rtr_egress_src_addr_v6"/> for information about these SVR 
Metadata formats. This repeats until the ICMP packet arrives at the 
initial SVR router. At this point the ICMP packet is recreated and the 
source address is changed to the address communicated through SVR 
Metadata type 20 and 21.
        </t>
        <t keepWithNext="true">SVR Fragment Packet Layout</t>
        <figure anchor="frag_icmp_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[
    +------------+------------+----------------+--------------+
    |            |            |    SVR         |              |
    |  IP HEADER | UDP HEADER | Metadata 20/21 | ICMP Packet  |
    +------------+------------+----------------+--------------+
            ]]>
          </artwork>
        </figure>
        <t keepWithNext="true">ICMP over SVR for Network Failures</t>
        <figure anchor="icmp_for_network_faillures_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

    Client . . . . . . . . . . . . . . . . . . . . . . .No Network 
      |                                                  Found
      |         Router A                   Router B         |
      |            |                          |             |
      |----PKT---->|                          |             |
      |            |------PKT[MD]------------>|             |
      |            |                          |<---ICMP-----|
      |            |                          |  (Router B) |
      |            |<--UDP[ICMP[RMD]]---------|             |
      |<---ICMP----|                          |             |
      | (Client)   |                          |             |
      |            |                          |             |

            ]]>
          </artwork>
        </figure>
        <t>
The first ICMP message is directed to Router B. Router B examines the 
ICMP error to locate the session and forwards the message back to the 
correct Waypoint for Router A. Router A recreates the ICMP message, and 
sends to the Client.
        </t>
        <t>
The second type of ICMP message is not related to any specific sessions.
These types of messages include ICMP ECHO, for example. These are always 
encapsulated as UDP, and a session is created for the ICMP message. The 
identifier field in ICMP and the IP addresses are used as the 5-tuple 
session key. This includes:
        </t>
        <ul spacing="normal">
          <li>Type 8:ECHO Request (Ping)  </li>
        </ul>
        <t keepWithNext="true">ICMP over SVR for Information </t>
        <figure anchor="icmp_over_svr_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

        Client . . . . . . . . . . . . . . . . . . . . . . . Target
          |                                                     |
          |             RouterA             RouterB             |
          |                |                   |                |
          |--ICMP ECHO---->|                   |                |
          |                |---UDP[ICMP ECHO]->|                |
          |                |       [MD1]       |                |
          |                |                   |---ICMP ECHO--->|
          |                |                   |<--ECHO RESP----|
          |                |<--UDP[ECHO RESP]--|                |
          |                |       [RMD1]      |                |
          |<--ECHO RESP----|                   |                |

            ]]>
          </artwork>
        </figure>
        <t>
The ICMP message creates a session on Router A directed towards Router 
B. SVR Metadata MD1 is inserted just like any UDP session to establish 
the return pathway for the response. Reverse SVR Metadata is inserted 
into the ECHO Response, effectively creating an ICMP session. Subsequent
identical ICMP messages will utilize this path without SVR Metadata 
being inserted. This session state MUST be guarded with an inactivity 
timer and the state deleted.
        </t>
        <t>
The aforementioned handling of ICMPv4 applies to ICMPv6 as well. The
obvious notable difference is the size and different header types that 
are used between the two.
        </t>
      </section> <!-- icmp -->

      <section anchor="state_recovery_examples" numbered="true" toc="include">
        <name>State Recovery Examples</name>
        <t>
While rare, there are cases where session state can be lost. Well 
written applications generally self correct for any networking changes 
or interruptions. There are however applications with long lived nearly 
idle sessions (for example Session Initiation Protocol on idle 
handsets). In these situations, session state recovery is required.
        </t>
        <t>
Every SVR session has one or more SVR routers that have the full session
state. Below is a set of techniques to obtain the session state either
from a peer or through regeneration and replacement.
        </t>
        <t>
The simplest scenario is when the Ingress SVR router loses state. In 
this scenario, it simply creates a new session for the preexisting 
session but has the exact parameters of the original session. When this 
packet with first packet SVR Metadata reaches the egress SVR, the 
session state tables are updated, allowing two-way end-to-end packet
processing.
        </t>
        <t>
This is secured against attack because the first packet SVR Metadata is 
both signed and encrypted.
        </t>
        <t keepWithNext="true">
State Recovering Ingress Router with Active Session
        </t>
        <figure anchor="ingress_lose_state_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

      Client . . . . . . . . . . . . . . . . . . . . . . . Server
        |                                                     |
        |        Ingress      Middle        Egress            |
        |          SVR         BOX           SVR              |
        |           |           |             |               |
      <================Existing Bi-Directional Session=========>
        |           |           |             |               |
        |         State         |             |               |
        |         Lost          |             |               |
        |           |           |             |               |
        |---PKT---->|           |             |               |
        |         Create        |             |               |
        |          New          |             |               |
        |        Session        |             |               |
        |           |--PKT[MD]->|             |               |
        |           |           |--PKT[MD]--->|               |
        |           |           |           Update            |
        |           |           |          Existing           |
        |           |           |           Session           |
        |           |           |             |----PKT------->|
                  
            ]]>
          </artwork>
        </figure>
        <t>
The next scenario is when the Ingress SVR loses session state, and the 
client application is idle. There is data from the server that can't be 
delivered. If a packet arrives from the server at the Egress SVR, the 
length of time the client has been inactive is reviewed. If longer than 
the defined inactivity timer (provisioned, but defaults to 5 seconds), 
Session Health Check (see <xref format="default" 
target="session_health_check"/>), SVR Metadata will be inserted into the
packet. The Ingress SVR responds by generating a packet (UDP) with the 
same L3 and L4 information as the session and adds SVR Control Message
to respond (see <xref format="default" target="proto_msg"/>). If the 
Ingress SVR needs state for the session, it sets the drop reason in SVR 
Metadata to type=6, delete session. This causes the very next packet 
from the server to include first packet SVR Metadata. The session will 
be treated as a new session. This data is used to restore all aspects of
the session.
        </t>
        <t keepWithNext="true">
State Recovering Ingress Router Client Inactive
        </t>
        <figure anchor="state_recover_client_inactive_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

      Client . . . . . . . . . . . . . . . . . . . . . . Server
        |                                                     |
        |        Ingress        Middle        Egress          |
        |          SVR           BOX           SVR            |
        |           |             |             |             |
        <============== Existing Bi-Directional Session ======>
        |           |             |             |             |
        |         State           |             |             |
        |         Lost            |             |             |
        |           |             |             |<----PKT-----|
        |           |             |             |             |
        |           |             |       Client Inactivity   |
        |           |             |         Timer Exceeded    |
        |           |             |             |             |
        <---<--< SEND SESSION HEALTH CHECK METADATA <---<---<--
        |           |             |             |             |
        |           |             |<---PKT[MD]--|             |
        |           |<--PKT[MD]---|             |             |
        |       No State          |             |             |
        |           |             |             |             |
        >---->--->SEND SVR Control Metadata Drop=6 >--->---->-
        |           |             |             |             |
        |           |-GenPKT[MD]->|             |             |
        |           |             |-GenPKT[MD]->|             |
        |           |             |             |             |
        |           |             |         Clear State       |
        |           |             |             |             |
        |           |             |          Send First       |
        |           |             |       PKT SVR Metadata    |
        |           |             |          Next PKT         |
        |           |             |             |             |
        <--<- ON NEXT PACKET SEND FIRST PACKET METADATA <---<--
        |           |             |             |             |
        |           |             |             |<---PKT------|
        |           |             |<--PKT[MD]---|             |
        |           |<--PKT[MD]---|             |             |
        |           |             |             |             |
        |    New Session State    |             |             |
        |           |             |             |             |
        =======Treat as a new session from this point =========
                  
            ]]>
          </artwork>
        </figure>
        <t>
If an Egress router loses state for a session, it must obtain the state 
from a peer. In the example shown below, the Ingress SVR detects the 
request for recovery upon receipt of a packet that the server has not 
responded for more than the inactivity timer. The packet that arrived is
then augmented with Session Health Check SVR Metadata (see 
<xref format="default" target="session_health_check"/>). The egress 
router MUST reply to the session health check by generating a UDP packet
with SVR Control Message SVR Metadata (see <xref format="default" 
target="proto_msg"/>). If it requires state, it must set the drop reason
to a type=2, indicating SVR Metadata needs to be sent. The next packet 
from the client will include all of the first packet SVR Metadata which 
is used to restore the mission state information.
        </t>
        <t keepWithNext="true">State Recovering Egress Router</t>
        <figure anchor="egress_state_recovery_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

      Client . . . . . . . . . . . . . . . . . . . . . . Server
        |                                                     |
        |        Ingress        Middle        Egress          |
        |          SVR           BOX           SVR            |
        |           |             |             |             |
        <============ Existing Bi-Directional Session ========>
        |           |             |             |             |
        |           |             |           State           |
        |           |             |            Lost           |
        |           |             |             |             |
        |---PKT---->|             |             |<----PKT-----|
        |           |----PKT----->|             |             |
        |           |             |----PKT----->|             |
        |           |             |             |             |
        |           |             |          Pkts Dropped     |
        |---PKT---->|             |             |             |
        |       Inactivity        |             |             |
        |       Exceeded          |             |             |
        |           |             |             |             |
        >--->---> SEND SESSION HEALTH CHECK METADATA >--->--->|
        |           |             |             |             |
        |           |---PKT[MD]-->|             |             |
        |           |             |--PKT[MD]--->|             |
        |           |             |          No State         |
        |           |             |             |             |
        <----<---- SEND SVR CONTROL MESSAGE TYPE=2 <----<----<-
        |           |             |             |             |
        |           |             |<-GenPKT[MD]-|             |
        |           |<-GenPKT[MD]-|             |             |
        |---PKT---->|             |             |             |
        |           |             |             |             |
        -->---> SEND FIRST PACKET METADATA IN NEXT PACKET --->|
        |           |             |             |             |
        |           |---PKT[MD]-->|             |             |
        |           |             |--PKT[MD]--->|             |
        |           |             |          Session          |
        |           |             |        State Restored     |
        |           |             |             |----PKT----->|
        |           |             |             |             |
                  
            ]]>
          </artwork>
        </figure>
        <t>
The most likely loss of state occurs in middle boxes. Often the middle 
box will either stop routing packets in one direction, both directions, 
or modify the UDP or TCP ports without notice.
        </t>
        <t>
In this instance, we do not know for certain where the state was lost, 
so we attempt to recover it from our SVR peer by including Session 
Health Check SVR Metadata in a packet of the session. SVR Peers must 
respond to this packet, so no response indicates there is a middle box
or network problem.
        </t>
        <t>
To restore the session, the session state is cleared and the next packet
is treated as a first packet. A full SVR Metadata exchange between peers
is completed as documented in <xref format="default" 
target="east_first_pkt_proc"/>. Both Ingress and Egress SVRs can detect 
that there is an existing session with the exact same addresses and 
ports and simply replace the session state.
        </t>
        <t keepWithNext="true">State Recovering of Middlebox</t>
        <figure anchor="middlebox_state_recovery_fig">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

      Client . . . . . . . . . . . . . . . . . . . . . . Server
        |                                                     |
        |        Ingress        Middle        Egress          |
        |          SVR           BOX           SVR            |
        |           |             |             |             |
        <============ Existing Bi-Directional Session =======>|
        |           |             |             |             |
        |           |          State            |             |
        |           |           Lost            |             |
        |           |             |             |             |
        |---PKT---->|             |             |<---PKT------|
        |           |----PKT----->|             |             |
        |           |             |<---PKT------|             |
        |           |          Packets          |             |
        |           |          Dropped          |             |
        |        Inactivty        |             |             |
        |        Exceeded         |             |             |
        |           |             |             |             |
        |---PKT---->|             |             |             |
        |           |             |             |             |
        |           |             |             |             |
        |           |---PKT[MD]-->|             |             |
        |           |             |             |             |
        |      No Response        |             |             |
        |           |             |             |             |
        |      Re Allocate Ports  |             |             |
        |   Update Session State  |             |             |
        |           |             |             |             |
        |---PKT---->|             |             |             |
        |           |             |             |             |
        ---> SEND FIRST PACKET METADATA, KEEP OLD SESSIONID -->
        |           |             |             |             |
        |           |--PKT[MD]--->|             |             |
        |           |             |--PKT[MD]--->|             |
        |           |             |          Update           |
        |           |             |          Session          |
        |           |             |             |----PKT----->|
        |           |             |             |             |

            ]]>
          </artwork>
        </figure>
      </section> <!-- state_recovery_examples -->
    </section> <!-- meta_use_cases -->

    <section anchor="meta_format" numbered="true" toc="include">
      <name>SVR Metadata Format and Composition</name>
      <t>
The format of SVR Metadata has both Header attributes as well as Payload
attributes. Header attributes are always guaranteed to be unencrypted. 
These headers may be inspected by intermediate network elements but 
cannot be changed. Header attributes do not have a forward or reverse 
direction. Header attributes are used for router and peer pathway 
controls.
      </t>
      <t>
Payload attributes optionally can be encrypted by the sender. Payload
attributes are associated with sessions, and as such have a forward and
reverse direction. Each SVR attribute defined will indicate whether it 
is a header attribute (unencrypted) or payload attribute (optionally 
encrypted). There are no attributes that can exist in both sections.
      </t>
      <section anchor="meta_header" numbered="true" toc="include">
        <name>SVR Metadata Header</name>
        <t>
The SVR Metadata header is shown below. A well-known &quot;cookie&quot;
(0x4c48dbc6ddf6670c in network byte order) is built into the header 
which is used in concert with contextual awareness of the packet itself 
to determine the presence of SVR Metadata within a packet. This is an 
eight-octet pattern that immediately follows the L4 header and is 
an indicator to a receiving router that a packet contains SVR Metadata. 
NOTE: Normal IP traffic will never have the Waypoint Address as its 
destination. If a packet arrives at an SVR Router Waypoint, it must have
SVR Metadata or be associated with an active SVR session. Please see 
<xref format="default" target="session_state_reqs"/> for a discussion of
state recovery techniques.
        </t>
        <figure anchor="meta_header_diagram">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

   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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                                                               |
  +                             Cookie                            +
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |Version|   Header Length       |         Payload Length        |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |     Header TLVs ...           |       Payload TLVs ...        |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

            ]]>
          </artwork>
        </figure>
        <dl newline="false" spacing="normal">
          <dt>Cookie (8 octets):</dt>
          <dd>
The fingerprint of SVR Metadata. This value is used to determine the 
existence of SVR Metadata within a packet.
          </dd>
          <dt>Version (4-bits):</dt>
          <dd>
Field representing the version of the SVR Metadata header. The current 
version of SVR Metadata is 0x1.
          </dd>
          <dt>Header Length (12-bits):</dt>
          <dd>
Length of the SVR Metadata header including any added Header TLV 
attributes that are guaranteed to be unencrypted. When there are no 
Header TLVs, the value Header Length is 12 Bytes or OxC.
          </dd>
          <dt>Payload Length (2 octets):</dt>
          <dd>
Length of data following the SVR Metadata header, not including the size
of the header. This data may be encrypted. The value of this field is
the number of octets in the Payload TLVs. If there are no TLVs the 
value is zero.
          </dd>
        </dl>
        <section anchor="false_positives" numbered="true" toc="include">
          <name>False Positives</name>
          <t>
Given that no octet sequence is truly unique in the payload of a packet, 
in the scenario where the original payload after the L4 header contained
the same octet sequence as the cookie, false positive logic is enacted on
the packet. If the SVR Metadata HMAC signature can't verify that the SVR
Metadata is valid, then a false positive SVR Metadata header is added to
the packet to indicate that the first eight octets of the payload 
matches the cookie.
          </t>
          <t>
The structure of a false positive SVR Metadata includes just a header of
length 12 octets, with zero header TLVs and zero payload TLVs. The 
receiving side of a packet with false positive SVR Metadata will strip 
out the SVR Metadata header.
          </t>
          <t>
In the scenario where a router receives a false positive SVR Metadata
header but intends to add SVR Metadata to the packet, the false positive
SVR Metadata header is modified to contain the newly added attributes. 
Once attributes are added, the SVR Metadata header is no longer 
considered to be false positive.
        </t>
        </section> <!-- false_positives -->

        <section anchor="fwd_rev_attr" numbered="true" toc="include">
          <name>Forward and Reverse Attributes</name>
          <t>
Payload SVR Metadata attributes may be valid in the forward direction, 
the reverse direction, or both. If not valid, it is ignored quietly by 
the receiving side.
          </t>
        </section> <!-- fwd_rev_attr -->
      </section> <!-- meta_header -->

      <section anchor="tlv_structure" numbered="true" toc="include">
        <name>TLVs for Attributes</name>
        <t>
All SVR Metadata attributes are expressed as Tag Length Values or TLVs.
This includes Header and Payload TLVs. It is recommended that Payload
TLVs be encrypted, but not mandatory. When debugging networks, or if
mid-stream routers need to consult the TLVs, they can be transmitted in
clear text. The entire SVR Metadata block is signed, and thus the 
integrity of the data can be verified. No midstream router or middlebox
can modify any aspect of the SVR Metadata. Doing so will invalidate the
signature, and the SVR Metadata will be dropped.
        </t>
        <figure anchor="tlv_diagram">
          <artwork align="left" alt="" name="" type="">
            <![CDATA[

   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              |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |          Variable Length Values .....                         |
  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

            ]]>
          </artwork>
        </figure>
        <dl newline="false" spacing="normal">
          <dt>Type (2 octets):</dt>
          <dd>
Type of data that follows. Each of different Header and Payload TLVs 
are defined below.
          </dd>
          <dt>Length (2 octets):</dt>
          <dd>
Number of octets associated with the length of the value (not including 
the 4 octets associated with the type and length fields).
          </dd>
        </dl>
      </section> <!-- tlv_structure -->
      <section anchor="header_attr" numbered="true" toc="include">
        <name>Header Attributes</name>
        <section anchor="fragment" numbered="true" toc="include">
          <name>Fragment</name>
          <t>
When a packet is fragmented to insert SVR Metadata, a new fragmentation
mechanism must be added to prevent fragmentation attacks and to support
reassembly (which requires protocol and port information). If a packet
is received that IS a fragment, and it must transit through an SVR 
Metadata signaled pathway, it must also have this SVR Metadata attached 
to properly bind the fragment with the correct session.
          </t>
          <t>
All fragments will have an SVR Metadata header and the fragment TLV 
added to the guaranteed unencrypted portion of the SVR Metadata header. 
If the original packet already has an SVR Metadata header on it, the 
fragment TLV will be added to it. See <xref format="default" 
target="RFC0791"/> for information about IP Fragmentation. For a 
detailed example of packet fragmentation in SVR please see <xref 
format="default" target="packet_fragmentation_v4"/>
          </t>
          <figure anchor="fragment_attr_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 1           |           Length = 10         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                         Extended ID                           |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |       Original ID             |Flags|    Fragment Offset      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |    Largest Seen Fragment      |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 1, Length 10.</dd>
            <dt>Extended ID (4 octets):</dt>
            <dd>
Uniquely identifies a packet that is broken into fragments. This ID is 
assigned by the SVR that is processing fragmented packets. IPv6 uses a 
32-bit Extended ID, and IPv4 uses a 16-bit ID. The same algorithm for 
fragmenting packets is used for both IPv6 and IPv4, therefore a 32-Bit 
Extended ID is used.
            </dd>
            <dt>Original ID (2 octets):</dt>
            <dd>
Original identification value of the L3 header of a received packet that
is already fragmented.
            </dd>
            <dt>Flags (3-bits):</dt>
            <dd>
              <t>
Field used for identifying fragment attributes. They are (in order, from
most significant to least
              </t>
              <ul empty="true" spacing="normal">
                <li>bit 0: Reserved; must be zero.</li>
                <li>bit 1: Don't fragment (DF).</li>
                <li>bit 2: More fragments (MF).</li>
              </ul>
            </dd>
            <dt>Fragment Offset (13-bits):</dt>
            <dd>
Field associated with the number of eight-octet segments the fragment 
payload contains.
            </dd>
            <dt>Largest Seen Fragment (2 octets):</dt>
            <dd>
Each SVR router keeps track of the largest fragment processed from each 
interface. This allows the router to make inferences about the MTU size 
when fragmenting packets in the opposite direction. This information is 
used along with a given egress network interface MTU to determine the 
fragment size of a reassembled packet.
            </dd>
          </dl>
        </section> <!-- fragment -->
        <section anchor="security_id" numbered="true" toc="include">
          <name>Security ID</name>
          <t>
A versioning identifier used to determine which security key version 
should be used when handling features dealing with security and
authenticity of a packet.
          </t>
          <figure anchor="security_id_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 16           |            Length = 4         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                        Security Key Version                   |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 16, Length 4.</dd>
            <dt>Security Key Version (4 octets):</dt>
            <dd>
This is a four-octet security key version identifier. This is used to 
identify the algorithmic version used for SVR Metadata authentication 
and encryption.
            </dd>
          </dl>
        </section> <!-- security_id -->
        <section anchor="disabled_fwd_meta" numbered="true" toc="include">
          <name>Disable Forward SVR Metadata</name>
          <t>
An indication that forward SVR Metadata should be disabled.  This is 
sent in the reverse SVR Metadata to acknowledge receipt of the SVR 
Metadata. This is the second part of the SVR Metadata handshake.
          </t>
          <figure anchor="disabled_fwd_attr_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 18           |         Length = 0            |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 18, Length 0.</dd>
          </dl>
          <t>
No other data is required. The specific session referenced is looked up 
based on the 5-tuple address of the packet. See SVR Metadata handshake 
in <xref format="default" target="handshake"/>.
          </t>
        </section> <!-- disabled_fwd_meta -->

        <section anchor="rtr_egress_src_addr_v4" numbered="true" toc="include">
          <name>IPv4 ICMP Error Location Address</name>
          <t>
This is exclusively used to implement ICMP messages that need to travel 
backwards through SVR pathways. See <xref format="default" 
target="icmp"/> for more information. The IPv4 address of the source of 
the ICMP message is placed into SVR Metadata. This SVR Metadata travels 
in the reverse direction backwards to the originating SVR, which 
restores the information and sends an ICMP message to the originator of 
the packet.
          </t>
          <figure anchor="rtr_egress_src_addr_v4_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 20           |          Length = 4           |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                        Source Address                         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 20, Length 4.</dd>
            <dt>Source Address (4 octets):</dt>
            <dd>
Original IPv4 source address of the originating router.
            </dd>
          </dl>
        </section> <!-- rtr_egress_src_addr_v4 -->
        <section anchor="rtr_egress_src_addr_v6" numbered="true" toc="include">
          <name>IPv6 ICMP Error Location Address</name>
          <t>
This is exclusively used to implement ICMP messages that need to travel 
backwards through SVR pathways. See <xref format="default" 
target="icmp"/> for more information. The IPv6 address of the source of 
the ICMP message is placed into SVR Metadata. This SVR Metadata travels 
in the reverse direction backwards to the originating SVR, which 
restores the information and sends an ICMP message to the originator of 
the packet.
          </t>
          <figure anchor="rtr_egress_src_addr_v6_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 21           |          Length = 16          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                                                               |
  +                                                               +
  |                                                               |
  +                        Source Address                         +
  |                                                               |
  +                                                               +
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 21, Length 16.</dd>
            <dt>Source Address (16 octets):</dt>
            <dd>
Original IPv6 source address of the originating router.
            </dd>
          </dl>
        </section> <!-- rtr_egress_src_addr_v6 -->
        <section anchor="proto_msg" numbered="true" toc="include">
          <name>SVR Control Message</name>
          <t>
The SVR Control Message is used for protocol specific purposes that are
limited to a single peer pathway. This message is sent by an SVR router 
to a peer. This SVR Metadata is always sent in a UDP message originating
by the SVR control plane.
          </t>
          <dl newline="false" spacing="normal">
            <dt>Keep Alive:</dt>
            <dd>
When an SVR peer is behind a NAT device and the SVR peer has active 
sessions, the SVR peer will generate a &quot;Keep Alive&quot; at a rate 
(e.g., one message every 20 seconds) to prevent the firewall from 
closing a pinhole. This message is generated completely by the SVR 
router, and directed to the SVR peer for a session. The UDP address and 
ports fields must exactly match the session that has been idle longer 
than the provisioned time.
            </dd>
            <dt>Turn On SVR Metadata:</dt>
            <dd>
When a packet is received and there is missing SVR Session State, the 
correction procedure may involve sending this request to a peer SVR 
router that has the information. Please see <xref format="default" 
target="session_state_reqs"/> for more information.
            </dd>
            <dt>Turn Off SVR Metadata:</dt>
            <dd>
Disable SVR Metadata on a specific 5-tuple. In certain cases the SVR 
peer may continue so send SVR Metadata because there are no reverse flow
packets or because SVR Metadata was enabled to recover from a loss of
state. This message is not part of the normal SVR Metadata handshake and
only has a scope of a single peer pathway.
            </dd>
            <dt>Delete Session:</dt>
            <dd>
The session associated with the flow spec used by this generated packet 
should be deleted. This provides an administrative and error correcting 
capability to remove a session when required.
            </dd>
            <dt>Session State Exists:</dt>
            <dd>
In response to a Session Health Check request (see <xref 
format="default" target="session_health_check"/> to indicate that state 
for a session exists.
            </dd>
          </dl>
          <figure anchor="proto_msg_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 24            |           Length = 1          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |  Drop Reason  |
  +-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 24, Length 1.</dd>
            <dt>Drop Reason (1 octet):</dt>
            <dd>
              <t>Reason why this packet should be dropped.</t>
              <ul spacing="normal">
                <li>
0 = Unknown. This value is reserved and used for backwards 
compatibility.
                </li>
                <li>
1 = Keep Alive. A packet that is dropped by the receiving node. Used 
only to keep NAT pinholes alive on middleboxes.
                </li>
                <li>
2 = Enable SVR Metadata. Begin sending SVR Metadata on the peer pathway 
for the 5-tuple matching this control packet.
                </li>
                <li>
3 = Disable SVR Metadata. Stop sending SVR Metadata on the peer pathway 
for a 5-tuple matching this control packet.
                </li>
                <li>
6 = Delete Session. Delete any state for the session associated with 
this SVR Metadata.
                </li>
                <li>
8 = Session Health Check indicates state exists, and is valid.
                </li>
              </ul>
            </dd>
          </dl>
        </section> <!-- proto_msg -->

        <section anchor="path_metrics" numbered="true" toc="include">
          <name>Path Metrics</name>
          <t>
This SVR Metadata type is used to allows peers to measure and compute 
inline flow metrics for a specific peer pathway and a chosen subset of 
traffic class. The flow metrics can include jitter, latency and packet 
loss. This is an optional SVR Metadata type.
          </t>
          <t>
When a peer sends this SVR Metadata, it provides the information for the
period of time to the peer.
          </t>
          <t>
When a peer receives this SVR Metadata type 26, it responds with SVR 
Metadata type 26.
          </t>
          <t>
After several exchanges, each side can compute accurate path metrics for
the traffic included. This SVR Metadata can be sent at any time, but is 
normally sent when SVR Metadata is being sent for other reasons. The SVR
Metadata includes &quot;colors&quot; which represent blocks of packets. 
Packet loss and latency can be determined between routers using this in 
line method. Using colors to measure inline flow performance is outside 
the scope of this document. Please refer to <xref format="default" 
target="RFC9341"/>
          </t>
          <figure anchor="path_metrics_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 26           |           Length = 10         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  | Tx Co |                Transmit TimeValue                     |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  | Rx Co |                Received TimeValue                     |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |D|   Previous Rx Color Count   |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 26, Length 10.</dd>
            <dt>Transmit Color (4-bits):</dt>
            <dd>Current color of a transmitting node.</dd>
            <dt>Transmit Time Value (28-bits):</dt>
            <dd>
Current time value in milliseconds at time of marking. This time value 
represents the amount of time that has elapsed since the start of a 
transmit color.
            </dd>
            <dt>Received Color (4-bits):</dt>
            <dd>
Most recently received color from a remote node. This represents the 
color last received from a specific peer.
            </dd>
            <dt>Receive Time Value (28-bits):</dt>
            <dd>
Cached time value in milliseconds from adjacent node, adjusted by the 
elapsed time between caching of the value and current time. This time 
value is associated with the received color.
            </dd>
            <dt>Drop Bit (1-bit):</dt>
            <dd>
Should this packet be dropped. This is required if a packet is being 
sent solely to measure quality on an otherwise idle link.
            </dd>
            <dt>Previous Rx Color Count (15-bits):</dt>
            <dd>
Number of packets received from the previous color block. This count is 
in reference to the color previous to the current RX color which is 
defined above.
            </dd>
          </dl>
        </section> <!-- path_metrics -->
        <section anchor="session_health_check" numbered="true" toc="include">
          <name>Session Health Check</name>
          <t>
This SVR Metadata is used to request a session state check by a peer. 
The peer responds upon receipt with a generated packet with SVR Metadata
confirming presence of SVR Metadata. This SVR Metadata type can be 
included in an existing packet to check that the peer has session state.
The peer will always respond with a generated packet that includes a 
forced drop SVR Metadata attribute. See <xref format="default" 
target="state_recovery_examples"/> for an example.
          </t>
          <figure anchor="session_health_check_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 46          |           Length = 1          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |   Type = 1    |
  +-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 46, Length 1.</dd>
            <dt>TYPE: (1=Request, 2=Request/Timeout)</dt>
            <dd>
Request to verify session state with backward SVR Metadata. Type 1 
indicates session state is available, Type 2 indicates session state is 
available but will be cleared and replaced upon receipt of state from a 
peer. Type 2 is used when a middle box closes pinholes that must be 
recovered.
            </dd>
          </dl>
        </section> <!-- remaining_session_time -->
      </section> <!-- header_attr -->

      <section anchor="payload_attrs" numbered="true" toc="include">
        <name>Payload Attributes</name>
        <t>
Payload attributes are used for session establishment and SHOULD be
encrypted to provide privacy. Encryption can be disabled for debugging.
        </t>
        <section anchor="fwd_ctx_v4" numbered="true" toc="include">
          <name>Forward Context IPv4</name>
          <t>
The context contains a five-tuple associated with the original 
addresses, ports, and protocol of the packet. This is also known as the
Forward Session Key.
          </t>
          <figure anchor="fwd_ctx_v4_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 2          |           Length = 13         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                        Source Address                         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Destination Address                       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |         Source Port           |      Destination Port         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |   Protocol    |
  +-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 2, Length 13.</dd>
            <dt>Source Address (4 octet):</dt>
            <dd>Original IPv4 source address of the packet.</dd>
            <dt>Destination Address (4 octets):</dt>
            <dd>Original IPv4 destination address of the packet.</dd>
            <dt>Source Port (2 octets):</dt>
            <dd>Original source port of the packet.</dd>
            <dt>Destination Port (2 octets):</dt>
            <dd>Original destination port of the packet.</dd>
            <dt>Protocol (1 octet):</dt>
            <dd>Original protocol of the packet.</dd>
          </dl>
        </section> <!-- fwd_ctx_v4 -->
        <section anchor="fwd_ctx_v6" numbered="true" toc="include">
          <name>Forward Context IPv6</name>
          <t>
A five-tuple associated with the original addresses, ports, and protocol
of the packet for IPv6.
          </t>
          <figure anchor="fwd_ctx_v6_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 3            |          Length = 37          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                                                               |
  +                                                               +
  |                                                               |
  +                         Source Address                        +
  |                                                               |
  +                                                               +
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                                                               |
  +                                                               +
  |                                                               |
  +                       Destination Address                     +
  |                                                               |
  +                                                               +
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |          Source Port          |        Destination Port       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |   Protocol    |
  +-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 3, Length 37.</dd>
            <dt>Source Address (16 octets):</dt>
            <dd>Original IPv6 source address of the packet.</dd>
            <dt>Destination Address (16 octets):</dt>
            <dd>Original IPv6 destination address of the packet.</dd>
            <dt>Source Port (2 octets):</dt>
            <dd>Original source port of the packet.</dd>
            <dt>Destination Port (2 octets):</dt>
            <dd>Original destination port of the packet.</dd>
            <dt>Protocol (1 octet):</dt>
            <dd>Original protocol of the packet.</dd>
          </dl>
        </section> <!-- fwd_ctx_v6 -->
        <section anchor="rev_ctx_v4" numbered="true" toc="include">
          <name>Reverse Context IPv4</name>
          <t>
Five-tuple associated with the egress (router) addresses, ports, and
protocol of the packet. Forward context and reverse context session keys
are not guaranteed to be symmetrical due to functions which apply source
NAT, destination NAT, or both to a packet before leaving the router.
          </t>
          <figure anchor="rev_ctx_v4_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 4          |           Length = 13         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                        Source Address                         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Destination Address                       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |         Source Port           |      Destination Port         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |   Protocol    |
  +-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 4, Length 13.</dd>
            <dt>Source Address (4 octets):</dt>
            <dd>Egress IPv4 source address of the packet.</dd>
            <dt>Destination Address (4 octets):</dt>
            <dd>Egress IPv4 destination address of the packet.</dd>
            <dt>Source Port (2 octets):</dt>
            <dd>Egress source port of the packet.</dd>
            <dt>Destination Port (2 octets):</dt>
            <dd>Egress destination port of the packet.</dd>
            <dt>Protocol (1 octet):</dt>
            <dd>Original protocol of the packet.</dd>
          </dl>
        </section> <!-- rev_ctx_v4 -->
        <section anchor="rev_ctx_v6" numbered="true" toc="include">
          <name>Reverse Context IPv6</name>
          <t>
Five-tuple associated with the egress (router) addresses, ports, and
protocol of the packet. Forward and reverse session keys are not
guaranteed to be symmetrical due to functions which apply source NAT,
destination NAT, or both to a packet before leaving the router.
          </t>
          <figure anchor="rev_ctx_v6_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 5            |          Length = 37          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                                                               |
  +                                                               +
  |                                                               |
  +                         Source Address                        +
  |                                                               |
  +                                                               +
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                                                               |
  +                                                               +
  |                                                               |
  +                       Destination Address                     +
  |                                                               |
  +                                                               +
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |          Source Port          |        Destination Port       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |   Protocol    |
  +-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 5, Length 37.</dd>
            <dt>Source Address (16 octets):</dt>
            <dd>Egress IPv6 source address of the packet.</dd>
            <dt>Destination Address (16 octets):</dt>
            <dd>Egress IPv6 destination address of the packet.</dd>
            <dt>Source Port (2 octets):</dt>
            <dd>Egress source port of the packet.</dd>
            <dt>Destination Port (2 octets):</dt>
            <dd>Egress destination port of the packet.</dd>
            <dt>Protocol (1 octet):</dt>
            <dd>Original protocol of the packet.</dd>
          </dl>
        </section> <!-- rev_ctx_v6 -->
        <section anchor="session_uuid" numbered="true" toc="include">
          <name>Session UUID</name>
          <t>
Unique identifier of a session. The UUID MUST be conformant to <xref 
format="default" target="RFC9562"/>. This is assigned by the peer that 
is initiating a session. Once assigned, it is maintained through all
participating routers end-to-end.
          </t>
          <t>
The UUID is used to track sessions across multiple routers. The UUID 
also can be used to detect a looping session. The UUID SVR Metadata 
field is required for all session establishment.
          </t>
          <figure anchor="session_uuid_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 6           |           Length = 16         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                                                               |
  +                                                               +
  |                                                               |
  +                              UUID                             +
  |                                                               |
  +                                                               +
  |                                                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 6, Length 16.</dd>
            <dt>UUID (16 octets):</dt>
            <dd>Unique identifier of a session.</dd>
          </dl>
        </section> <!-- session_uuid -->
        <section anchor="tenant_name" numbered="true" toc="include">
          <name>Tenant Name</name>
          <t>
An alphanumeric ASCII string which dictates what tenancy the session
belongs to.
          </t>
          <figure anchor="tenant_name_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 7           |       Length = variable       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                 Name (1 - n octets) ....                      |
  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 7, Length variable.</dd>
            <dt>Name (variable length):</dt>
            <dd>The tenant name represented as a string.</dd>
          </dl>
        </section> <!-- tenant_name -->
        <section anchor="service_name" numbered="true" toc="include">
          <name>Service Name</name>
          <t>
An alphanumeric string which dictates what service the session belongs 
to.
          </t>
          <figure anchor="service_name_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 10          |       Length = variable       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                  Service Name (1-n octets) .....              |
  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 10, Length variable.</dd>
            <dt>Name (variable length):</dt>
            <dd>The service name represented as a string.</dd>
          </dl>
        </section> <!-- service_name -->
        <section anchor="session_encrypt" numbered="true" toc="include">
          <name>Session Encrypted</name>
          <t>
Indicates if the session is having its payload encrypted by the SVR 
router. This is different from having the SVR Metadata encrypted. The 
keys used for payload encryption are dependent on the Security Policy 
defined for a session.
          </t>
          <t>
This field is necessary because often traffic is already encrypted 
before arriving at an SVR router (making DPI a poor choice). Also in 
certain use cases, re-encryption may be required. This SVR Metadata TLV 
is always added when SVR encrypts the payload.
          </t>
          <figure anchor="session_encrypt_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 11          |           Length = 0          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 11, Length 0.</dd>
          </dl>
        </section> <!-- session_encrypt -->
        <section anchor="tcp_syn_pkt" numbered="true" toc="include">
          <name>TCP SYN Packet</name>
          <t>
Indicates if the session is being converted from TCP to UDP to enable 
passing through middle boxes that are TCP session stateful. A SVR 
implementation must verify that SVR Metadata can be sent inside TCP 
packets through testing the Peer Pathway. If the data is blocked, then 
all TCP sessions must be converted to UDP sessions and restored on the 
destination peer.
          </t>
          <t>
Although this may seem redundant with the Forward Context that also has 
the same originating protocol, this refers to a specific peer pathway. 
In a multi-hop network, the TCP conversion to UDP could occur at the 
second hop. It's important to restore the TCP session as soon as 
possible after passing through the obstructive middlebox.
          </t>
          <t>
When TCP to UDP conversion occurs, no octets are changed other than the 
protocol value (TCP-&gt;UDP). Because the UDP message length and 
checksum overlap with the TCP Sequence Number, the Sequence number is 
overwritten. The Sequence number is saved by copying it to the TCP 
Checksum and Urgent Pointer portion of the packet. The Checksum is 
recalculated upon restoration of the packet. The urgent pointer is 
zeroed out and urgent flag is cleared.
          </t>
          <figure anchor="tcp_syn_pkt_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 12          |           Length = 0          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 12, Length 0.</dd>
          </dl>
          <t>
Note: This type does not contain any value as its existence in SVR 
Metadata indicates a value.
          </t>
        </section> <!-- tcp_syn_pkt -->
        <section anchor="src_rtr_name" numbered="true" toc="include">
          <name>Source Router Name</name>
          <t>
An alphanumeric string which dictates which source router the packet is 
originating from. This attribute may be present in all forward SVR 
Metadata packets if needed.
          </t>
          <figure anchor="src_rtr_name_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 14          |       Length = variable       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |               Router Name (1-n octets) ....                   |
  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 14, Length variable.</dd>
            <dt>Name (variable length):</dt>
            <dd>The router name represented as a string.</dd>
          </dl>
        </section> <!-- src_rtr_name -->
        <section anchor="src_rtr_sec_policy" numbered="true" toc="include">
          <name>Security Policy</name>
          <t>
An alphanumeric string containing the Security Policy to use for a 
particular session. This is used only when payload encryption is being
performed. The Security Policy describes the specifics about ciphers
used for payload encryption.
          </t>
          <figure anchor="src_rtr_sec_policy_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 15          |       Length = variable       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                        SECURITY POLICY                        |
  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 15, Length variable.</dd>
            <dt>KEY (variable length):</dt>
            <dd>
The session key to use for encryption/decryption for this packet and 
future packets in a session.
            </dd>
          </dl>
        </section> <!-- src_rtr_sec_policy -->
        <section anchor="peer_rtr_id" numbered="true" toc="include">
          <name>Peer Pathway ID</name>
          <t>
An ASCII string which dictates which router peer pathway has been chosen
for a packet. This name is the hostname or IP address of the egress 
interface of the originating router. This can be used to determine the 
peer pathway used exactly when there may be multiple possibilities. This
enables association of policies with specific paths.
          </t>
          <figure anchor="peer_rtr_id_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 19          |       Length = variable       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |            Peer Pathway Name (1-n octets) ....                |
  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 19, Length variable.</dd>
            <dt>Name (variable length):</dt>
            <dd>
The peer pathway name which is represented as a string.
            </dd>
          </dl>
        </section> <!-- peer_rtr_id -->
        <section anchor="src_nat_addr_v4" numbered="true" toc="include">
          <name>IPv4 Source NAT Address</name>
          <t>
Routers may be provisioned to perform source NAT functions while routing
packets. When a source NAT is performed by an SVR Peer, this SVR 
Metadata TLV MUST be included. When the far end router reconstructs the 
packet, it will use this address as the source address for packets 
exiting the SVR.
          </t>
          <figure anchor="src_nat_addr_v4_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 25          |           Length = 4          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     IPv4 Source Nat Address                   |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 25, Length 4.</dd>
            <dt>Source Address (4 octets):</dt>
            <dd>Source NAT address of the packet.</dd>
          </dl>
        </section> <!-- src_nat_addr_v4 -->
        <section anchor="remaining_session_time" numbered="true" toc="include">
          <name>Remaining Session Time</name>
          <t>
After a path failure, it may become necessary to transmit an SVR Control 
Message when there are one-way flows waiting for a packet to be 
transmitted. In these cases, the SVR Metadata includes an attribute 
defining the remaining session time so intermediate routers creating new
session entries will expire the session at the correct time.
          </t>
          <figure anchor="remaining_session_time_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 42          |           Length = 4          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Remaining Session Time (seconds)          |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 42, Length 4.</dd>
            <dt>Remaining Session Time (4 octets):</dt>
            <dd>
Number of seconds remaining on a session packet guard time. This ensures
accurate guarding of sessions that have been moved.
            </dd>
          </dl>
        </section> <!-- remaining_session_time -->
        <section anchor="src_rtr_sec_key" numbered="true" toc="include">
          <name>Security Encryption Key</name>
          <t>
An alphanumeric string containing the cryptographic key to use for a 
payload encryption of a particular session. This is used only when 
payload encryption is being performed. The key is encrypted in SVR 
Metadata hop-by-hop through a network, preventing any party from 
obtaining the key. The router terminating the session utilizes this key 
to decrypt payload portions of packets. This prevents re-encryption 
penalties associated with multi-hop routing scenarios.
          </t>
          <t>
To rekey a session, this SVR Metadata can be included in any subsequent 
packet with the new key to use. When rekeying, the SVR that initiated 
the encrypted session must compute a new key, and include the key as SVR
Metadata.
          </t>
          <figure anchor="src_rtr_sec_key_diagram">
            <artwork align="left" alt="" name="" type="">
              <![CDATA[

   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 = 46          |       Length = variable       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                        SECURITY KEY                           |
  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

              ]]>
            </artwork>
          </figure>
          <dl newline="false" spacing="normal">
            <dt>TLV:</dt>
            <dd>Type 46, Length variable.</dd>
            <dt>KEY (variable length):</dt>
            <dd>
The session key to use for encryption/decryption for this packet and 
future packets in a session.
            </dd>
          </dl>
        </section> <!-- src_rtr_sec_policy -->
      </section> <!-- payload_attrs -->
    </section> <!-- meta_format -->

    <section anchor="implementation_status" numbered="true" toc="include">
      <name>Implementation Status</name>
      <t>
This section records the status of known implementations of the protocol
defined by this specification at the time of posting of this 
Internet-Draft, and is based on a proposal described in RFC 7942. The 
description of implementations in this section is intended to assist the
IETF in its decision processes in progressing drafts to RFCs.  Please 
note that the listing of any individual implementation here does not 
imply endorsement by the IETF. Furthermore, no effort has been spent to 
verify the information presented here that was supplied by IETF 
contributors. This is not intended as, and must not be construed to be, 
a catalog of available implementations or their features. Readers are 
advised to note that other implementations may exist.

According to RFC 7942, &quot;this will allow reviewers and working 
groups to assign due consideration to documents that have the benefit of
running code, which may serve as evidence of valuable experimentation 
and feedback that have made the implemented protocols more mature.  It 
is up to the individual working groups to use this information as they 
see fit&quot;.
      </t>

      <section anchor="session_smart_router" title="Session Smart Router" numbered="true" toc="default">
        <ul>
          <li>Organization: Juniper Networks, Inc.</li>
          <li>Name: Session Smart Router</li>
          <li>
Description: The Session Smart Router exists as a SDWAN router following
the implementation defined in this document.
          </li>
          <li>Level of maturity: Production</li>
          <li>Coverage: All aspects of the protocol are implemented.</li>
          <li>Licensing: Proprietary</li>
          <li>Contact: mbaj@juniper.net</li>
          <li>URL: https://www.juniper.net/documentation/us/en/software/session-smart-router/</li>
        </ul>
      </section> <!-- session_smart_router -->

    </section> <!-- implementation_status -->

    <section anchor="sec_consider" numbered="true" toc="include">
      <name>Security Considerations</name>
      <section anchor="hmac_auth" numbered="true" toc="include">
        <name>HMAC Authentication</name>
        <t>
HMAC signatures are REQUIRED for the packets that contain SVR Metadata 
to guarantee the contents were not changed, and that the router sending 
it is known to the receiver. Any HMAC algorithm can be used, from 
SHA128, or SHA256 as long as both sides agree. HMAC is always performed 
on the layer 4 payload of the packet. The signature is placed at the end
of the existing packet.
        </t>
      </section> <!-- hmac_auth -->

      <section anchor="replay_prevent" numbered="true" toc="include">
        <name>Replay Prevention</name>
        <t>
Optional HMAC signatures are RECOMMENDED for every packet. This prevents
any mid-stream attempts to corrupt or impact sessions that are ongoing. 
This also helps detect and correct lost state at egress SVR routers. See 
<xref format="default" target="session_state_reqs"/>. The signature must
include all of the packet after Layer 4, and include a current time of
day to prevent replay attacks. The signature is placed at the end of
the existing packet.
        </t>
        <t>
Both the sending and receiving routers must agree on these optional HMAC
signatures, details of which are outside the scope of this document.
        </t>
      </section> <!-- replay_prevent -->

      <section anchor="payload_encrypt" numbered="true" toc="include">
        <name>Payload Encryption</name>
        <t>
Payload encryption can use AES-CBC-128 or AES-CBC-256 ciphers which can
be configured. Since these are block-ciphers, the payload should be
divisible by 16. If the actual payload length is divisible by 16, then 
the last 16 octets will be all 0s. If the actual payload is not 
divisible by 16, then the remaining data will be padded and the last 
octet will indicate the length.
        </t>
      </section> <!-- payload_encrypt -->

      <section anchor="ddos_attack" numbered="true" toc="include">
        <name>DDoS and Unexpected Traffic on Waypoint Addresses</name>
        <t>
Waypoint addresses could be addressed by any client at any time. IP 
packets that arrive on the router's interface will be processed with the
assumption that they MUST contain SVR Metadata or be part of an existing
established routing protocol.
        </t>
        <t>
Routers will only accept SVR Metadata from routers that they are 
provisioned to speak with. As such, an ACL on incoming source addresses 
is limited to routers provisioned to communicate. All other packets are
dropped.
        </t>
        <t>
When a packet is received the &quot;cookie&quot; in the SVR Metadata 
header is reviewed first. If the cookie isn't correct, the packet is 
dropped.
        </t>
        <t>
The HMAC signature is checked. If the signature is valid, the packet is
assumed to be good and processing continues. If the HMAC fails, the
packet is dropped.
        </t>
        <t>
These methods prevent distributed denial of service attacks on the 
Waypoint Addresses of routers.
        </t>
      </section> <!-- ddos_attack -->
    </section> <!-- sec_consider -->

    <section anchor="iana_considerations" numbered="true" toc="include">
      <name>IANA Considerations</name>
      <t>This document does not require any IANA involvement.</t>
    </section> <!-- iana_considerations -->

    <section anchor="acknowledgements" numbered="true" toc="include">
      <name>Acknowledgements</name>
      <t>
The authors would like to thank Anya Yungelson, Scott McCulley, and Chao
Zhao for their input into this document.
      </t>
      <t>
The authors would like to thank Tony Li for his extensive support and 
help with all aspects of this document.
      </t>
      <t>
The authors want to thank Ron Bonica, Kireeti Kompella, and other 
IETFers at Juniper Networks for their support and guidance.
      </t>
    </section> <!-- acknowledgements -->
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="ECDH_Key_Exchange" target="https://cryptobook.nakov.com/asymmetric-key-ciphers/ecdh-key-exchange">
        <front>
          <title>Practical Cryptography for Developers</title>
          <author fullname="Svetlin Nakov, PhD" initials="S." surname="Nakov">
            <organization/>
          </author>
          <date month="November" year="2018"/>
        </front>
        <seriesInfo name="ISBN" value="978-619-00-0870-5"/>
        <seriesInfo name="Publisher" value="Sofia"/>
      </reference>
      <reference anchor="NIST_SP_800-56A" target="https://csrc.nist.gov/pubs/sp/800/56/a/r3/final">
        <front>
          <title>Recommendation for Pair-Wise Key-Establishment Schemes Using Discrete Logarithm Cryptography</title>
          <author fullname="Elaine Barker" initials="E." surname="Barker">
            <organization>NIST</organization>
          </author>
          <author fullname="Lily Chen" initials="L." surname="Chen">
            <organization>NIST</organization>
          </author>
          <author fullname="Allen Roginsky" initials="A." surname="Roginsky">
            <organization>NIST</organization>
          </author>
          <author fullname="Apostol Vassilev" initials="A." surname="Vassilev">
            <organization>NIST</organization>
          </author>
          <author fullname="Richard Davis" initials="R." surname="Davis">
            <organization>NSA</organization>
          </author>
          <date month="April" year="2018"/>
        </front>
        <seriesInfo name="ISBN" value="NIST Special Publication 800-56A Rev3"/>
        <seriesInfo name="Publisher" value="National Security Agency"/>
      </reference>
      <reference anchor="NIST_SP_800-90B" target="https://csrc.nist.gov/pubs/sp/800/90/b/final">
        <front>
          <title>Recommendation for the Entropy Sources Used for Random Bit Generation</title>
          <author fullname="Meltem Sönmez Turan" initials="M." surname="Turan">
            <organization>Information Technology Laboratory</organization>
          </author>
          <author fullname="Elaine Barker" initials="E." surname="Barker">
            <organization>Information Technology Laboratory</organization>
          </author>
          <author fullname="John Kelsey" initials="J." surname="Kelsey">
            <organization>Information Technology Laboratory</organization>
          </author>
          <author fullname="Kerry A. McKay" initials="K." surname="McKay">
            <organization>Information Technology Laboratory</organization>
          </author>
          <author fullname="Mary L. Baish" initials="M." surname="Baish">
            <organization>National Security Agency</organization>
          </author>
          <author fullname="Mike Boyle" initials="M." surname="Boyle">
            <organization>National Security Agency</organization>
          </author>
          <date month="January" year="2018"/>
        </front>
        <seriesInfo name="ISBN" value="NIST Special Publication 800-90B"/>
        <seriesInfo name="Publisher" value="National Institute of Standards and Technology"/>
      </reference>
      <reference anchor="RFC0791" target="https://www.rfc-editor.org/info/rfc791">
        <front>
          <title>Internet Protocol</title>
          <author fullname="J. Postel" initials="J." surname="Postel">
            <organization/>
          </author>
          <date month="September" year="1981"/>
        </front>
        <seriesInfo name="STD" value="5"/>
        <seriesInfo name="RFC" value="791"/>
        <seriesInfo name="DOI" value="10.17487/RFC0791"/>
      </reference>
      <reference anchor="RFC0792" target="https://www.rfc-editor.org/info/rfc792">
        <front>
          <title>Internet Control Message Protocol</title>
          <author fullname="J. Postel" initials="J." surname="Postel">
            <organization/>
          </author>
          <date month="September" year="1981"/>
        </front>
        <seriesInfo name="STD" value="5"/>
        <seriesInfo name="RFC" value="792"/>
        <seriesInfo name="DOI" value="10.17487/RFC0792"/>
      </reference>
      <reference anchor="RFC2104" target="https://www.rfc-editor.org/info/rfc2104" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2104.xml">
        <front>
          <title>HMAC: Keyed-Hashing for Message Authentication</title>
          <author fullname="H. Krawczyk" initials="H." surname="Krawczyk"/>
          <author fullname="M. Bellare" initials="M." surname="Bellare"/>
          <author fullname="R. Canetti" initials="R." surname="Canetti"/>
          <date month="February" year="1997"/>
          <abstract>
            <t>
This document describes HMAC, a mechanism for message authentication 
using cryptographic hash functions. HMAC can be used with any iterative
cryptographic hash function, e.g., MD5, SHA-1, in combination with a 
secret shared key. The cryptographic strength of HMAC depends on the 
properties of the underlying hash function. This memo provides 
information for the Internet community. This memo does not specify an 
Internet standard of any kind
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="2104"/>
        <seriesInfo name="DOI" value="10.17487/RFC2104"/>
      </reference>
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>
In many standards track documents several words are used to signify the 
requirements in the specification. These words are often capitalized. 
This document defines these words as they should be interpreted in IETF 
documents. This document specifies an Internet Best Current Practices 
for the Internet Community, and requests discussion and suggestions for 
improvements.
            </t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC9562" target="https://www.rfc-editor.org/info/rfc9562" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9562.xml">
        <front>
          <title>A Universally Unique IDentifier (UUID) URN Namespace</title>
          <author fullname="P. Leach" initials="P." surname="Leach"/>
          <author fullname="M. Mealling" initials="M." surname="Mealling"/>
          <author fullname="R. Salz" initials="R." surname="Salz"/>
          <date month="July" year="2005"/>
          <abstract>
            <t>
This specification defines a Uniform Resource Name namespace for UUIDs 
(Universally Unique IDentifier), also known as GUIDs (Globally Unique 
IDentifier). A UUID is 128 bits long, and can guarantee uniqueness 
across space and time. UUIDs were originally used in the Apollo Network 
Computing System and later in the Open Software Foundation\'s (OSF) 
Distributed Computing Environment (DCE), and then in Microsoft Windows 
platforms.
            </t>
            <t>
This specification is derived from the DCE specification with the kind 
permission of the OSF (now known as The Open Group). Information from 
earlier versions of the DCE specification have been incorporated into 
this document. [STANDARDS-TRACK]
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9562"/>
        <seriesInfo name="DOI" value="10.17487/RFC9562"/>
      </reference>
      <reference anchor="RFC4210" target="https://www.rfc-editor.org/info/rfc4210" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4210.xml">
        <front>
          <title>Internet X.509 Public Key Infrastructure Certificate Management Protocol (CMP)</title>
          <author fullname="C. Adams" initials="C." surname="Adams"/>
          <author fullname="S. Farrell" initials="S." surname="Farrell"/>
          <author fullname="T. Kause" initials="T." surname="Kause"/>
          <author fullname="T. Mononen" initials="T." surname="Mononen"/>
          <date month="September" year="2005"/>
          <abstract>
            <t>
This document describes the Internet X.509 Public Key Infrastructure 
(PKI) Certificate Management Protocol (CMP). Protocol messages are 
defined for X.509v3 certificate creation and management.  CMP provides 
on-line interactions between PKI components, including an exchange 
between a Certification Authority (CA) and a client system. 
[STANDARDS-TRACK]
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="4210"/>
        <seriesInfo name="DOI" value="10.17487/RFC4210"/>
      </reference>
      <reference anchor="RFC5880" target="https://www.rfc-editor.org/info/rfc5880" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5880.xml">
        <front>
          <title>Bidirectional Forwarding Detection (BFD)</title>
          <author fullname="D. Katz" initials="D." surname="Katz"/>
          <author fullname="D. Ward" initials="D." surname="Ward"/>
          <date month="June" year="2010"/>
          <abstract>
            <t>
This document describes a protocol intended to detect faults in the 
bidirectional path between two forwarding engines, including interfaces,
data link(s), and to the extent possible the forwarding engines 
themselves, with potentially very low latency.  It operates 
independently of media, data protocols, and routing protocols. 
[STANDARDS-TRACK]
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="5880"/>
        <seriesInfo name="DOI" value="10.17487/RFC5880"/>
      </reference>
      <reference anchor="RFC5758" target="https://www.rfc-editor.org/info/rfc5758" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5758.xml">
        <front>
          <title>Internet X.509 Public Key Infrastructure: Additional Algorithms and Identifiers for DSA and ECDSA</title>
          <author fullname="Q. Dang" initials="Q." surname="Dang"/>
          <author fullname="S. Santesson" initials="S." surname="Santesson"/>
          <author fullname="K. Moriarty" initials="K." surname="Moriarty"/>
          <author fullname="D. Brown" initials="D." surname="Brown"/>
          <author fullname="T. Polk" initials="T." surname="Polk"/>
          <date month="January" year="2010"/>
          <abstract>
            <t>
This document updates RFC 3279 to specify algorithm identifiers and 
ASN.1 encoding rules for the Digital Signature Algorithm (DSA) and 
Elliptic Curve Digital Signature Algorithm (ECDSA) digital signatures 
when using SHA-224, SHA-256, SHA-384, or SHA-512 as the hashing 
algorithm.  This specification applies to the Internet X.509 Public Key 
infrastructure (PKI) when digital signatures are used to sign 
certificates and certificate revocation lists (CRLs).  This document 
also identifies all four SHA2 hash algorithms for use in the Internet 
X.509 PKI. [STANDARDS-TRACK
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="5758"/>
        <seriesInfo name="DOI" value="10.17487/RFC5758"/>
      </reference>
      <reference anchor="RFC5905" target="https://www.rfc-editor.org/info/rfc5905" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5905.xml">
        <front>
          <title>Network Time Protocol Version 4: Protocol and Algorithms Specification</title>
          <author fullname="D. Mills" initials="D." surname="Mills"/>
          <author fullname="J. Martin" initials="J." role="editor" surname="Martin"/>
          <author fullname="J. Burbank" initials="J." surname="Burbank"/>
          <author fullname="W. Kasch" initials="W." surname="Kasch"/>
          <date month="June" year="2010"/>
          <abstract>
            <t>
The Network Time Protocol (NTP) is widely used to synchronize computer 
clocks in the Internet.  This document describes NTP version 4 (NTPv4), 
which is backwards compatible with NTP version 3 (NTPv3), described in 
RFC 1305, as well as previous versions of the protocol.  NTPv4 includes 
a modified protocol header to accommodate the Internet Protocol version 
6 address family.  NTPv4 includes fundamental improvements in the 
mitigation and discipline algorithms that extend the potential accuracy 
to the tens of microseconds with modern workstations and fast LANs.  It 
includes a dynamic server discovery scheme, so that in many cases, 
specific server configuration is not required.  It corrects certain 
errors in the NTPv3 design and implementation and includes an optional 
extension mechanism. [STANDARDS-TRACK]
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="5905"/>
        <seriesInfo name="DOI" value="10.17487/RFC5905"/>
      </reference>
      <reference anchor="RFC6062" target="https://www.rfc-editor.org/info/rfc6062" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6062.xml">
        <front>
          <title>Traversal Using Relays around NAT (TURN) Extensions for TCP Allocations</title>
          <author fullname="S. Perreault" initials="S." role="editor" surname="Perreault"/>
          <author fullname="J. Rosenberg" initials="J." surname="Rosenberg"/>
          <date month="November" year="2010"/>
          <abstract>
            <t>
This specification defines an extension of Traversal Using Relays around
NAT (TURN), a relay protocol for Network Address Translator (NAT) 
traversal. This extension allows a TURN client to request TCP 
allocations, and defines new requests and indications for the TURN 
server to open and accept TCP connections with the client\'s peers. 
TURN and this extension both purposefully restrict the ways in which the
relayed address can be used.  In particular, it prevents users from 
running general-purpose servers from ports obtained from the TURN 
server. [STANDARDS-TRACK]
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="6062"/>
        <seriesInfo name="DOI" value="10.17487/RFC6062"/>
      </reference>
      <reference anchor="RFC9300" target="https://www.rfc-editor.org/info/rfc9300" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9300.xml">
        <front>
          <title>The Locator/ID Separation Protocol (LISP)</title>
          <author fullname="D. Farinacci" initials="D." surname="Farinacci"/>
          <author fullname="V. Fuller" initials="V." surname="Fuller"/>
          <author fullname="D. Meyer" initials="D." surname="Meyer"/>
          <author fullname="D. Lewis" initials="D." surname="Lewis"/>
          <date month="January" year="2013"/>
          <abstract>
            <t>
This document describes a network-layer-based protocol that enables 
separation of IP addresses into two new numbering spaces: Endpoint 
Identifiers (EIDs) and Routing Locators (RLOCs). No changes are required
to either host protocol stacks or to the &quot;core&quot; of the 
Internet infrastructure. The Locator/ID Separation Protocol (LISP) can 
be incrementally deployed, without a &quot;flag day&quot;, and offers 
Traffic Engineering, multihoming, and mobility benefits to early 
adopters, even when there are relatively few LISP-capable sites.
            </t>
            <t>
Design and development of LISP was largely motivated by the problem 
statement produced by the October 2006 IAB Routing and Addressing 
Workshop. This document defines an Experimental Protocol for the 
Internet community.
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9300"/>
        <seriesInfo name="DOI" value="10.17487/RFC9300"/>
      </reference>
      <reference anchor="RFC7468" target="https://www.rfc-editor.org/info/rfc7468" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7468.xml">
        <front>
          <title>Textual Encodings of PKIX, PKCS, and CMS Structures</title>
          <author fullname="S. Josefsson" initials="S." surname="Josefsson"/>
          <author fullname="S. Leonard" initials="S." surname="Leonard"/>
          <date month="April" year="2015"/>
          <abstract>
            <t>
This document describes and discusses the textual encodings of the 
Public-Key Infrastructure X.509 (PKIX), Public-Key Cryptography 
Standards (PKCS), and Cryptographic Message Syntax (CMS).  The textual 
encodings are well-known, are implemented by several applications and 
libraries, and are widely deployed.  This document articulates the de 
facto rules by which existing implementations operate and defines them 
so that future implementations can interoperate.
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="7468"/>
        <seriesInfo name="DOI" value="10.17487/RFC7468"/>
      </reference>
      <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>
RFC 2119 specifies common key words that may be used in protocol 
specifications. This document aims to reduce the ambiguity by clarifying
that only UPPERCASE usage of the key words have the defined special 
meanings.
            </t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
      <reference anchor="RFC9341" target="https://www.rfc-editor.org/info/rfc9341" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9341.xml">
        <front>
          <title>Alternate-Marking Method for Passive and Hybrid Performance Monitoring</title>
          <author fullname="G. Fioccola" initials="G." role="editor" surname="Fioccola"/>
          <author fullname="A. Capello" initials="A." surname="Capello"/>
          <author fullname="M. Cociglio" initials="M." surname="Cociglio"/>
          <author fullname="L. Castaldelli" initials="L." surname="Castaldelli"/>
          <author fullname="M. Chen" initials="M." surname="Chen"/>
          <author fullname="L. Zheng" initials="L." surname="Zheng"/>
          <author fullname="G. Mirsky" initials="G." surname="Mirsky"/>
          <author fullname="T. Mizrahi" initials="T." surname="Mizrahi"/>
          <date month="January" year="2018"/>
          <abstract>
            <t>
This document describes a method to perform packet loss, delay, and 
jitter measurements on live traffic. This method is based on an 
Alternate-Marking (coloring) technique. A report is provided in order 
to explain an example and show the method applicability. This technology
can be applied in various situations, as detailed in this document, and 
could be considered Passive or Hybrid depending on the application.
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9341"/>
        <seriesInfo name="DOI" value="10.17487/RFC9341"/>
      </reference>
      <reference anchor="RFC8422" target="https://www.rfc-editor.org/info/rfc8422" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8422.xml">
        <front>
          <title>Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer Security (TLS) Versions 1.2 and Earlier</title>
          <author fullname="Y. Nir" initials="Y." surname="Nir"/>
          <author fullname="S. Josefsson" initials="S." surname="Josefsson"/>
          <author fullname="M. Pegourie-Gonnard" initials="M." surname="Pegourie-Gonnard"/>
          <date month="August" year="2018"/>
          <abstract>
            <t>
This document describes key exchange algorithms based on Elliptic Curve 
Cryptography (ECC) for the Transport Layer Security (TLS) protocol. In 
particular, it specifies the use of Ephemeral Elliptic Curve 
Diffie-Hellman (ECDHE) key agreement in a TLS handshake and the use of 
the Elliptic Curve Digital Signature Algorithm (ECDSA) and Edwards-curve
Digital Signature Algorithm (EdDSA) as authentication mechanisms.
            </t>
            <t>This document obsoletes RFC 4492.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8422"/>
        <seriesInfo name="DOI" value="10.17487/RFC8422"/>
      </reference>
      <reference anchor="RFC8445" target="https://www.rfc-editor.org/info/rfc8445" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8445.xml">
        <front>
          <title>Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal</title>
          <author fullname="A. Keranen" initials="A." surname="Keranen"/>
          <author fullname="C. Holmberg" initials="C." surname="Holmberg"/>
          <author fullname="J. Rosenberg" initials="J." surname="Rosenberg"/>
          <date month="July" year="2018"/>
          <abstract>
            <t>
This document describes a protocol for Network Address Translator (NAT) 
traversal for UDP-based communication. This protocol is called 
Interactive Connectivity Establishment (ICE). ICE makes use of the 
Session Traversal Utilities for NAT (STUN) protocol and its extension, 
Traversal Using Relay NAT (TURN).
            </t>
            <t>This document obsoletes RFC 5245.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8445"/>
        <seriesInfo name="DOI" value="10.17487/RFC8445"/>
      </reference>
      <reference anchor="RFC8489" target="https://www.rfc-editor.org/info/rfc8489" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8489.xml">
        <front>
          <title>Session Traversal Utilities for NAT (STUN)</title>
          <author fullname="M. Petit-Huguenin" initials="M." surname="Petit-Huguenin"/>
          <author fullname="G. Salgueiro" initials="G." surname="Salgueiro"/>
          <author fullname="J. Rosenberg" initials="J." surname="Rosenberg"/>
          <author fullname="D. Wing" initials="D." surname="Wing"/>
          <author fullname="R. Mahy" initials="R." surname="Mahy"/>
          <author fullname="P. Matthews" initials="P." surname="Matthews"/>
          <date month="February" year="2020"/>
          <abstract>
            <t>
Session Traversal Utilities for NAT (STUN) is a protocol that serves as 
a tool for other protocols in dealing with NAT traversal. It can be used
by an endpoint to determine the IP address and port allocated to it by a
NAT. It can also be used to check connectivity between two endpoints and
as a keep-alive protocol to maintain NAT bindings. STUN works with many 
existing NATs and does not require any special behavior from them.
            </t>
            <t>
STUN is not a NAT traversal solution by itself. Rather, it is a tool to 
be used in the context of a NAT traversal solution.
            </t>
            <t>This document obsoletes RFC 5389.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8489"/>
        <seriesInfo name="DOI" value="10.17487/RFC8489"/>
      </reference>
      <reference anchor="RFC8986" target="https://www.rfc-editor.org/info/rfc8986" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8986.xml">
        <front>
          <title>Segment Routing over IPv6 (SRv6) Network Programming</title>
          <author fullname="C. Filsfils" initials="C." role="editor" surname="Filsfils"/>
          <author fullname="P. Camarillo" initials="P." role="editor" surname="Camarillo"/>
          <author fullname="J. Leddy" initials="J." surname="Leddy"/>
          <author fullname="D. Voyer" initials="D." surname="Voyer"/>
          <author fullname="S. Matsushima" initials="S." surname="Matsushima"/>
          <author fullname="Z. Li" initials="Z." surname="Li"/>
          <date month="February" year="2021"/>
          <abstract>
            <t>
The Segment Routing over IPv6 (SRv6) Network Programming framework 
enables a network operator or an application to specify a packet 
processing program by encoding a sequence of instructions in the IPv6 
packet header.
            </t>
            <t>
Each instruction is implemented on one or several nodes in the network 
and identified by an SRv6 Segment Identifier in the packet.
            </t>
            <t>
This document defines the SRv6 Network Programming concept and specifies
the base set of SRv6 behaviors that enables the creation of 
interoperable overlays with underlay optimization.
            </t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8986"/>
        <seriesInfo name="DOI" value="10.17487/RFC8986"/>
      </reference>
      <reference anchor="RFC8200" target="https://www.rfc-editor.org/info/rfc8200" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8200.xml">
        <front>
          <title>Internet Protocol, Version 6 (IPv6) Specification</title>
          <author fullname="S. Deering" initials="S." surname="Deering"/>
          <author fullname="R. Hinden" initials="R." surname="Hinden"/>
          <date month="July" year="2017"/>
          <abstract>
            <t>
This document specifies version 6 of the Internet Protocol (IPv6). It 
obsoletes RFC 2460.
            </t>
          </abstract>
        </front>
        <seriesInfo name="STD" value="86"/>
        <seriesInfo name="RFC" value="8200"/>
        <seriesInfo name="DOI" value="10.17487/RFC8200"/>
      </reference>
    </references>
  </back>
</rfc>