Course contents

Unit 13: Advanced scenariosLesson 13.1 (1 of 4 in this unit)22 of 25 in the Advanced Cisco SD-WAN course

Scenario: preferred data centre in a dual-DC design

Choose which data centre each application uses, in both directions, and prove the choice survives a failure.

Advanced · 14 min read

You'll learn to give each application its own primary data centre in a dual-DC design, make the return traffic agree, predict what each failure does, and prove it with a test plan.

Technical definition

Per-prefix data centre preference is a design in which both hubs advertise the same application prefixes into the overlay, but the OMP route preference is different for each prefix and each hub. A branch then uses DC-A for some applications and DC-B for others, and each application can fall back to the other data centre.

Two data centres, each the home of different applications

The earlier dual-hub lesson treated one data centre as the primary and the other as the disaster-recovery site. This scenario is less tidy. HUB-01 (site 10) serves DC-A and HUB-02 (site 20) serves DC-B, and both data centres host applications:

ApplicationPrefix (example)PrimaryReplica
ERP10.20.1.0/25DC-ADC-B
File and collaboration servers10.20.1.128/25DC-BDC-A
Voice gateways10.20.20.0/24 in VPN 20DC-ANone

The branches (BR-01, BR-02, BR-03A and BR-03B, sites 101 to 103) should use the primary data centre of each application, in both directions, and move to the other one if the primary fails. Two constraints matter. Traffic must not be asymmetric, because the firewalls in the data centres track connections. And the voice gateways have no replica, so for them there is nothing to fail over to.

Two data centres, each preferred for different prefixes
Two data centres, each preferred for different prefixesHUB-01 serves DC-A and HUB-02 serves DC-B. The ERP prefix 10.20.1.0/25 has DC-A as primary and DC-B as replica. The file servers 10.20.1.128/25 have DC-B as primary and DC-A as replica. The voice gateways 10.20.20.0/24 in VPN 20 are only in DC-A and have no replica. The two server prefixes are advertised as two /25 routes, not as a covering /24, so a preference can be set for each half.Branchessites 101 to 103HUB-01DC-A, site 10HUB-02DC-B, site 20DC-AERP 10.20.1.0/25 primaryFiles 10.20.1.128/25 replicaVoice 10.20.20.0/24 onlyDC-BFiles 10.20.1.128/25 primaryERP 10.20.1.0/25 replicaERP, voicefile serversAdvertise two /25 routes, not a /24: a covering route would hide the difference between the halves.

On small screens, swipe sideways or focus the diagram and use the arrow keys.

OMP preference is compared only between routes for the same prefix, so the two halves must stay separate /25 routes. Voice has no replica: there is nothing to fail over to.

Layer 1: advertise prefixes that can be told apart

Both hubs advertise both server prefixes into VPN 10 (corporate). They differ only in preference, which is set in the next layer. One point here decides whether the rest works: the two prefixes must be advertised as the two /25 routes, not as a covering 10.20.1.0/24. A router chooses the most specific matching prefix first, and OMP preference is only compared between routes for the same prefix. A /24 summary would hide the difference between the halves, and a leftover /24 from an older design could quietly override the /25 policy for traffic it still matches.

The voice gateways are advertised only by HUB-01, and only in VPN 20. VPN 20 is the voice service VPN in the lab, and the prefix 10.20.20.0/24 is an example.

Layer 2: one preference per prefix and per hub

OMP route preference is a value carried with an OMP route. Among otherwise valid routes for the same prefix, the higher value wins, and it is compared before the TLOC preference. The Controller can change it with a control policy that matches routes by prefix and by originating site. The values below are examples. Only the order matters.

PrefixRoute from HUB-01 (site 10)Route from HUB-02 (site 20)Branches use first
10.20.1.0/25 (ERP)200100DC-A
10.20.1.128/25 (files)100200DC-B
10.20.20.0/24 (voice, VPN 20)200Not advertisedDC-A

Every cell is set explicitly, including the lower values. Relying on a default for the second hub works until a release or a policy changes the default, and then the table in the design document and the table in the network disagree. The structure of a policy that does this follows.

policy lists prefix-list ERP ip-prefix 10.20.1.0/25 ! prefix-list FILES ip-prefix 10.20.1.128/25 ! site-list BRANCHES site-id 101-103 ! ! control-policy PREFERRED-DC sequence 10 match route prefix-list ERP site-id 10 ! action accept set preference 200 ! ! ! sequence 20 match route prefix-list ERP site-id 20 ! action accept set preference 100 ! ! ! sequence 30 match route prefix-list FILES site-id 10 ! action accept set preference 100 ! ! ! sequence 40 match route prefix-list FILES site-id 20 ! action accept set preference 200 ! ! ! default-action accept ! ! apply-policy site-list BRANCHES control-policy PREFERRED-DC out ! !

Outline of the policy structure only, shortened, and not tested on a device. Verify the keywords, the way a route's originating site is matched, and the effect of the direction in your release and in the policy builder of SD-WAN Manager. The preference values are examples. The direction out means towards the branch sites: the Controller edits the routes it sends to them.

The default action is accept, so every other route passes through unchanged. If it were reject, the first sequence you forgot would remove a whole application from the branches.

Why not TLOC preference?

TLOC preference looks like the obvious tool and does not fit. It is a property of a transport locator (system IP, colour and encapsulation, see TLOC components), so it applies to everything reached through that locator. Raise it on HUB-01 and the branches prefer HUB-01 for ERP, for files and for voice. The file servers then travel to DC-A and cross the data-centre interconnect to the primary copy in DC-B, which is the detour the design was meant to avoid. Use TLOC preference to rank the transports of one hub, and OMP route preference to rank the data centres per prefix.

Layer 3: the data-centre side must agree

The policy so far steers traffic from the branch to the data centre. The reply is routed by the data centre network, using the branch prefix (for example 10.10.1.0/24 for BR-01) as its destination. This is where the design is most likely to fail, for a reason that the SD-WAN side cannot see.

A return route is chosen by destination only. The data centre network does not know whether a reply to 10.10.1.0/24 belongs to an ERP session or a file session. So the return path cannot be preferred per application with a plain metric on the branch prefix. What can be controlled is the choice per data centre.

  • Separate routing domains per data centre. The ERP servers in DC-A reply to a DC-A core, which prefers HUB-01 for every branch prefix. The file servers in DC-B reply to a DC-B core, which prefers HUB-02. Each side agrees with its own primary automatically. The metrics (OSPF cost, or BGP local preference or AS-path length) are set so that each hub is the best exit for its own data centre, and the other hub, reached across the interconnect, is only a backup.
  • Failover has to be mirrored. When the branch moves ERP to DC-B, the request enters through HUB-02 and reaches the replica in DC-B. Its reply goes to the DC-B core, which prefers HUB-02. The path is symmetric again without any change, as long as the replica sits behind the DC-B core and not behind DC-A's.
  • One shared routing domain across both data centres. This is the hard case. A shared core has one best exit per branch prefix, so one of the two applications returns through the hub its branch did not use. Options are source-based routing in the core, a firewall or load balancer per data centre that forces replies back, or source NAT on the hub so the reply returns to the hub that sent the request. Each has a cost in complexity and in what the servers see as the client address. Treat this as a design review item before any SD-WAN policy is written.

The earlier lesson covers the same problem for a primary and DR pair, and the BGP course has the attributes used on the data centre side.

What the branch should see

Example output written for this lesson, simplified; real output has more fields and a different layout
BR-01#show sdwan omp routes vpn 10
VPN  PREFIX           FROM PEER    PATH ID  LABEL  STATUS  TLOC IP      COLOR         PREF
10   10.20.1.0/25     10.255.0.11  101      1002   C,I,R   10.255.1.1   mpls          200
10   10.20.1.0/25     10.255.0.11  102      1002   C,I,R   10.255.1.1   biz-internet  200
10   10.20.1.0/25     10.255.0.11  201      1002   R       10.255.1.2   mpls          100
10   10.20.1.0/25     10.255.0.11  202      1002   R       10.255.1.2   biz-internet  100
10   10.20.1.128/25   10.255.0.11  101      1002   R       10.255.1.1   mpls          100
10   10.20.1.128/25   10.255.0.11  102      1002   R       10.255.1.1   biz-internet  100
10   10.20.1.128/25   10.255.0.11  201      1002   C,I,R   10.255.1.2   mpls          200
10   10.20.1.128/25   10.255.0.11  202      1002   C,I,R   10.255.1.2   biz-internet  200
Eight routes, four per prefix. For ERP, the two paths via HUB-01 (10.255.1.1) carry preference 200 and are chosen (C) and installed (I). For the file servers it is the other way round: HUB-02 (10.255.1.2) wins. The losing paths are still resolved (R), which is what makes the fallback fast: nothing has to be learned when the primary disappears. If a prefix shows only one hub, the other hub is not advertising it or its TLOCs are not resolved.

Pair this with show sdwan bfd sessions from the dual-hub lesson: the fallback hub needs live tunnels before the failure, not after it.

Failure cases and expected behaviour

Failure cases and expected behaviour
Failure cases and expected behaviourFailure; What changes; Result for the branch. HUB-01 lost (power, both transports): BFD declares its tunnels down, after about seven seconds with default timers. Its routes become unresolved ERP moves to DC-B. Files stay in DC-B. Voice has no other gateway, so it fails DC-A application lost, HUB-01 up: Nothing, unless the hub withdraws the prefix. The hub withdraws it only if it learned the prefix dynamically and the route left its table With dynamic learning, ERP moves to DC-B. With a static route on the hub, branches keep sending ERP traffic into a black hole One transport lost at the branch: Half of the paths to each hub go down. Both hubs remain reachable over the other colour No change of data centre. The same DC is used over the surviving transport Controller lost: Routes and policy already on the branch stay in place. New updates cannot be sent Current preferences keep working. A failover that needs a new route may not happen, so test this on purpose DC interconnect lost: Replicas can no longer be refreshed, and the shared-core return paths may change Network paths look healthy while the data in the replica ages. Watch the application sideFailureWhat changesResult for the branchHUB-01 lost (power,both transports)BFD declares its tunnels down, afterabout seven seconds with defaulttimers. Its routes become unresolvedERP moves to DC-B. Files stay inDC-B. Voice has no other gateway, soit failsDC-A application lost,HUB-01 upNothing, unless the hub withdraws theprefix. The hub withdraws it only ifit learned the prefix dynamically andthe route left its tableWith dynamic learning, ERP moves toDC-B. With a static route on the hub,branches keep sending ERP trafficinto a black holeOne transport lost atthe branchHalf of the paths to each hub godown. Both hubs remain reachable overthe other colourNo change of data centre. The same DCis used over the surviving transportController lostRoutes and policy already on thebranch stay in place. New updatescannot be sentCurrent preferences keep working. Afailover that needs a new route maynot happen, so test this on purposeDC interconnect lostReplicas can no longer be refreshed,and the shared-core return paths maychangeNetwork paths look healthy while thedata in the replica ages. Watch theapplication side

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Read each row across: the left box names the item, the others describe it.

The second row decides how good the design really is. A hub detects its own death through BFD, but it detects a dead application only through routing. A service-side check (tracking, a dynamic route that depends on the server) is what turns an application failure into a withdrawn prefix. Without it the design only protects against hub and transport failures.

Test plan

Run these in a lab or a maintenance window, with a continuous ping or a connection test from a branch to an address in each prefix, and a trace from the data centre back to the branch. Keep the evidence listed.

Test plan
Test planTest; Expected result; Evidence to keep. Normal state: ERP and voice go via HUB-01, files via HUB-02, both directions OMP routes at two branches; a trace each way for ERP and for files Disable HUB-01's transports: ERP moves to HUB-02 in about seven seconds, and replies follow. Voice fails Ping loss duration; OMP table after; return trace Remove the ERP prefix at DC-A: HUB-01 withdraws it and ERP moves to HUB-02 Hub service-side table; branch OMP table Disable one branch transport: No change of data centre OMP table unchanged; BFD sessions Controller unreachable, then a hub failure: Record whether the branch still fails over, and how OMP peer state; forwarding result Restore everything: Each application returns to its primary, with no flapping. Check whether open sessions break Time to return; session log of the applicationTestExpected resultEvidence to keepNormal stateERP and voice go via HUB-01, filesvia HUB-02, both directionsOMP routes at two branches; a traceeach way for ERP and for filesDisable HUB-01'stransportsERP moves to HUB-02 in about sevenseconds, and replies follow. VoicefailsPing loss duration; OMP table after;return traceRemove the ERP prefixat DC-AHUB-01 withdraws it and ERP moves toHUB-02Hub service-side table; branch OMPtableDisable one branchtransportNo change of data centreOMP table unchanged; BFD sessionsController unreachable,then a hub failureRecord whether the branch still failsover, and howOMP peer state; forwarding resultRestore everythingEach application returns to itsprimary, with no flapping. Checkwhether open sessions breakTime to return; session log of theapplication

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Read each row across: the left box names the item, the others describe it.
Why test the stateful device in both directions?

A ping can pass a firewall that still drops a TCP connection, because the firewall may treat each echo as a simple flow and policy can differ by protocol. A connection with a handshake that leaves by one hub and returns by another is normally dropped. Test with a real TCP connection to the application port, in both directions, after every failover step.

When the replica is not identical

The network moves packets to the data centre that the policy picks. It cannot know whether that copy is current, writable or even running the same version. A failover can succeed in the network sense and still fail for users: the file replica may be read-only, the ERP replica may be an hour behind, or a licence server may exist only in DC-A. Agree with the application owners which replicas are meant to serve users, in which mode, and what the planned switchover is. Write it in the same document as the preference table, so a change in either one prompts a review of the other.

Test yourself on per-application data centre choice

Predict · scenario 1

You raise the TLOC preference on HUB-01 so that ERP prefers DC-A. After the change, the file servers (primary in DC-B) are reached through HUB-01 as well. Why?

Predict · scenario 2

ERP is advertised as 10.20.1.0/25 by both hubs. An old design still advertises 10.20.1.0/24 from HUB-02 with a higher preference. What does a branch use for a server at 10.20.1.20?

Predict · scenario 3

The ERP application in DC-A stops, but HUB-01 and its tunnels are healthy. Branches still send ERP traffic to DC-A. The prefix is a static route on HUB-01. What is the likely fix?

Predict · scenario 4

Both data centres share one routing domain. Files and ERP now use different hubs, but a firewall in DC-A drops file replies. What is the most likely cause?

FAQ

Can TLOC preference give each application a different primary hub?
No. TLOC preference belongs to a transport locator, so it applies to every prefix reached through that locator. Raising it on HUB-01 prefers HUB-01 for all applications at once. Per-prefix choices need OMP route preference set by a control policy that matches the prefix.
Who applies the preference, the hub or the Controller?
In the design shown here the Controller applies it, in a control policy that acts on the routes it sends to the branch sites. The hubs advertise their routes unchanged. The preference values in this lesson are examples, and the policy direction is worth checking in the branch's OMP table.
Does the network keep the two copies of the data in step?
No. Replication is done by the application or storage team. The network moves packets to the data centre that the policy picks. If the replica is behind or read-only, a failover can reach a server that cannot do the job.