On-Demand Tunnel Mechanism in Detail
When you configure a site to use dynamic tunnels, the on-demand functionality is enabled. In this mode of operation, Cisco SD-WAN edge routers do not bring up direct tunnels to other sites that are also enabled with on-demand functionality.
Cisco SD-WAN selects one or more edge routers (typically centrally located routers) to act as backup forwarding node(s), providing a secondary path for traffic between two nodes. The backup node(s) are not enabled for on-demand. All on-demand sites form static tunnels with the backup node(s). The backup node(s) provide a static backup route for traffic between two nodes that have on-demand enabled.
The first packet of traffic between two nodes is routed though the static backup path, and triggers the on-demand tunnel to become active between the sites. The backup path continues to forward traffic until the direct path becomes active.
All on-demand sites learn the TLOCs and prefixes of all other on-demand remote sites. The prefixes also have a backup path set up through Cisco vSmart Controller control policy. So in the control plane, the on-demand tunnel network has the same state as a full-mesh tunnel network, including a backup path. The control plane downloads to the data plane, routes, with the backup path and remote TLOCs that represent a potential direct path between any two sites, but it does not set up a direct path tunnel to remote TLOCs.
Traffic from either end of the on-demand tunnel triggers setting up the tunnel. This enables on-demand tunnels to accommodate network address translation (NAT) traversal.
The on-demand tunnel feature introduces two states for the on-demand branch site:
-
Inactive: The on-demand tunnel is not set up with the remote site. There is no active traffic to or from the remote site. Remote site TLOCs are inactive - no bidirectional forwarding detection (BFD) is set up, the prefix is installed with the inactive paths, and the backup path is set as the path to forward any traffic. The inactive path detects flows and triggers a direct site-to-site tunnel to be set up.
-
Active: The on-demand direct site-to-site tunnel is set up to the remote site. There is active traffic to or from the remote site. This state is identical to the case of a typical tunnel, where the remote TLOCs have BFD set up, and the prefix is installed with the direct path tunnel. In this state, tunnel activity is tracked. If there is no traffic for the “idle time” duration (default 10 minutes), the direct site-to-site tunnel is removed and the state changes to Inactive.
Steps in Illustrations
The figures below show the following steps that occur between two edge routers with an on-demand tunnel configured.
-
There is no active tunnel between the two edge routers. edge-1 and edge-4 are in Inactive state.
-
The host behind edge-1 initiates traffic toward the host behind edge-4.
-
edge-1 forwards the traffic through the backup path using the hub or backup node to edge-4.
-
edge-1 provisions the on-demand tunnel and begins bidirectional forwarding detection (BFD). edge-4 is now in Active state on edge-1.
-
When edge-4 receives the return traffic for the host behind edge-1, it forwards the traffic through the backup path using the hub or backup node to edge-1.
-
edge-4 provisions the on-demand tunnel and begins BFD. edge-1 is now in Active state on edge-4.
-
At this point, the on-demand tunnel between edge-1 and edge-4 is up, and BFD is up.
-
Traffic between the two edge devices takes the direct route through the on-demand tunnel.
-
Both edge-1 and edge-4 track the traffic activity on the on-demand tunnel in both directions.
If there is no traffic for the idle timeout duration, the on-demand tunnel is deleted, and the edge-1 and edge-4 devices go back to the Inactive state.