Data policies

Control policy is provisioned on vSmart and stays there; data policy is provisioned on vSmart and pushed to the edges, with direction from the device's point of view. It acts on traffic, matched on source and destination address and port, DSCP and protocol. Its direction is from-service, from-tunnel or all, and one call can be matched at the sending edge and missed at the receiving one.

In Daveth Pro (Network)4 min video · lab: SD-WAN, step by step

By , founder of Daveth · Updated

Opening frame of the video walkthrough of Data policies

Watch this lesson

4 min · Video walkthrough

In Daveth Pro (Network)

The full 4 min walkthrough is in Daveth Pro (Network). See what the plan opens

Upcoming practical lab

Lab C18: SD-WAN, step by step

What the lab covers

What this page answers

What is the difference between SD-WAN control and data policy?

Control policy stays on vSmart and acts on routes, so it decides what a site learns. Data policy is pushed to the edge devices and acts on packets, so it decides what happens to traffic a site sends. Read it in “What it acts on, and where it actually runs”

What do from-service and from-tunnel mean in an SD-WAN data policy?

They are directions from the device's perspective: from-service is traffic arriving from the router's own LAN, the service side; from-tunnel is traffic arriving out of an overlay tunnel; all is both. Read it in “The three keywords, from the packet's point of view”

What does an SD-WAN data policy match?

A 6-tuple: source and destination IP addresses, source and destination ports, DSCP and protocol. Read it in “What it acts on, and where it actually runs”

Same framework, opposite reference point

Control policy is provisioned on vSmart, stays on vSmart, and its in and out are from the controller's perspective.

Data policy is provisioned on vSmart, is pushed to the edge devices, and its direction is from the device's perspective.

Hold on to that last phrase, because it is where this topic takes people apart. A person walking into your house is walking out of the street. Both sentences describe the same person taking the same step, and they disagree only about which doorway you decided to name. Direction is never a property of the movement. It is a property of the doorway you are standing in.

The router is standing in its own doorway, and you are looking at a drawing. Your diagram runs left to right across a page. The router has never seen your diagram. It knows traffic that came from its own service side and traffic that came out of its own tunnel, and neither of those is left or right.

Where the house stops: a house has two doors and a router has as many as it has interfaces. So the question is never just which direction. It is which direction, at which device, which is why the same policy means different things at the two ends of one call.

Same policy framework. Same configuration structure. Opposite reference point, and a different place it ends up.

                  control policy            data policy
provisioned on    vSmart                    vSmart
ends up on        vSmart only               pushed to devices, read-only
acts on           OMP routes and TLOCs      data traffic, on the 6-tuple
direction words   in / out                  from-service / from-tunnel / all
relative to       THE CONTROLLER            THE DEVICE

The framework looks symmetrical. It is not, and everything in the bottom half of that table differs. This is the pair to keep straight, and the rest of the page is one long demonstration of the last row.

What it acts on, and where it actually runs

Centralized data policy applies to the flow of data traffic throughout the VPNs in the overlay network. Not routes. Traffic: matched on a 6-tuple: source and destination IP addresses, source and destination ports, DSCP, and protocol.

So control policy decides what a site learns; data policy decides what happens to packets a site sends.

Which forces the first divergence. A controller that never sees a packet cannot apply a 6-tuple match to one. The policy has to be where the traffic is, so data policy is pushed to the devices in read-only fashion via OMP and executes on the edge.

Two consequences worth having. It is visible on the edge, unlike control policy, if traffic is being treated oddly, the device has something to show you. And you cannot edit it there: it arrives read-only, and changing it means changing it centrally and letting vSmart push the new version out.

The three keywords, from the packet's point of view

Before the keywords, the question you have to answer every time you write one: traffic arriving at this router from its own LAN, and traffic arriving out of an overlay tunnel, are not the same traffic. Which one do you mean?

Direction is from-tunnel, from-service, or all, and these are from the device's perspective. Stand on the router and follow a packet:

   LAN / service side                    overlay / tunnel side
        |                                          |
        |   ---- from-service ---->                |
        |   (traffic arriving from                 |
        |    the service side)                     |
        |                                          |
        |              <---- from-tunnel ----      |
        |              (traffic arriving from      |
        |               the tunnel side)           |
        |                                          |
        |   <---------------- all ---------------> |

from-service: arriving from the LAN, on its way into the overlay. from-tunnel: arriving out of the overlay, on its way to the LAN. all: both.

And notice where the decision is actually taken. The policy was written centrally and pushed out, the way a shop chain writes one rule at head office and has every shop door apply it. No packet takes a trip to head office to be checked. The Controller is not sitting in the middle stamping your voice traffic; it handed the rule to the door and the door does the work.

Applied the same way as any centralized policy:

apply-policy
    site-list <name>
        data-policy <name> <from-tunnel | from-service | all>
    !
!

State 1 One policy, one site, one keyword

from-service names one side of one router. Which router, and which side?

Before any traffic moves: what did EDGE-10 actually receive from vSmart, and with which keyword?

EDGE-10# show sdwan policy from-vsmart
from-vsmart data-policy VOICE-OUT
 direction from-service
! One word, and the only one on this page that is easy to get backwards.
 vpn-list VPN-10
  sequence 10
   match
    source-ip 10.10.10.0/24
    dscp      46
    protocol  17
   action accept
  default-action accept
! Pushed via OMP, read-only here: it is changed centrally, not on this device. And nothing in this output says which traffic matched it: that is a different question, and the one the reading below answers.
from-vsmart lists vpn-list VPN-10
 vpn 10

Proves: which policy this device received from vSmart, its direction and its sequences. The site list is not printed: the policy is here because this site is in it.
Does not prove: that any traffic matched a sequence. default-action applies here exactly as it does in control policy, and a policy that appears to do nothing may be doing precisely what its default says. It also does not prove the direction is the one you meant: that failure survives this command looking perfect.

The same call, in each direction

A call leaves PC-SITE10 for PC-SITE20. Stop at each router and ask the only question that matters: which interface did it arrive on here?

a call from PC-SITE10 to PC-SITE20
at        arrived from      policy applied          looked at it?
EDGE-10   the service side  VOICE-OUT from-service  yes
EDGE-20   the tunnel side   none                    no

At EDGE-10 it arrived from the service side, the policy is applied from-service, and a sequence matches. The policy looked at it. At EDGE-20 the same packet arrives out of a tunnel, and no policy is applied to site 20 at all.

State 2 Now the answer comes back

Same two hosts. Same ports, same DSCP, same protocol: source and destination swapped.

the same call the other way
at        arrived from      policy applied          looked at it?
EDGE-20   the service side  none                    no
EDGE-10   the tunnel side   VOICE-OUT from-service  no

At EDGE-10: the router the policy is applied to: this packet arrives out of a tunnel. from-service does not name that side, so the policy does not look at it. It is applied, it is correct, and it is not in this packet's way.

So a data policy is not a statement about a flow. It is a statement about a flow as seen from one place.