hs-test: cache docker build in local filesystem
[vpp.git] / src / vnet / srv6 / sr_policy.rst
1 .. _srv6_policy_doc:
2
3 Creating a SR Policy
4 ====================
5
6 An SR Policy is defined by a Binding SID and a weighted set of Segment
7 Lists.
8
9 A new SR policy is created with a first SID list using:
10
11 ::
12
13    sr policy add bsid 2001::1 next A1:: next B1:: next C1:: (weight 5) (fib-table 3)
14
15 -  The weight parameter is only used if more than one SID list is
16    associated with the policy.
17 -  The fib-table parameter specifies in which table (VRF) the Binding
18    SID is to be installed.
19
20 An SR policy is deleted with:
21
22 ::
23
24    sr policy del bsid 2001::1
25    sr policy del index 1
26
27 The existing SR policies are listed with:
28
29 ::
30
31    show sr policies
32
33 Adding/Removing SID Lists from an SR policy
34 -------------------------------------------
35
36 An additional SID list is associated with an existing SR policy with:
37
38 ::
39
40    sr policy mod bsid 2001::1 add sl next A2:: next B2:: next C2:: (weight 3)
41    sr policy mod index 3      add sl next A2:: next B2:: next C2:: (weight 3)
42
43 Conversely, a SID list can be removed from an SR policy with:
44
45 ::
46
47    sr policy mod bsid 2001::1 del sl index 1
48    sr policy mod index 3      del sl index 1
49
50 Note that this cannot be used to remove the last SID list of a policy.
51
52 The weight of a SID list can also be modified with:
53
54 ::
55
56    sr policy mod bsid 2001::1 mod sl index 1 weight 4
57    sr policy mod index 3      mod sl index 1 weight 4
58
59 SR Policies: Spray policies
60 ---------------------------
61
62 Spray policies are a specific type of SR policies where the packet is
63 replicated on all the SID lists, rather than load-balanced among them.
64
65 SID list weights are ignored with this type of policies.
66
67 A Spray policy is instantiated by appending the keyword **spray** to a
68 regular SR policy command, as in:
69
70 ::
71
72    sr policy add bsid 2001::1 next A1:: next B1:: next C1:: spray
73
74 Spray policies are used for removing multicast state from a network core
75 domain, and instead send a linear unicast copy to every access node. The
76 last SID in each list accesses the multicast tree within the access
77 node.
78
79 Encapsulation SR policies
80 -------------------------
81
82 In case the user decides to create an SR policy an IPv6 Source Address
83 must be specified for the encapsulated traffic. In order to do so the
84 user might use the following command:
85
86 ::
87
88    set sr encaps source addr XXXX::YYYY
89
90 Default hop-limit for the encapsulating IPv6 header is 64. It is
91 possible to specify custom hop-limit value from 1 to 255 using this
92 command:
93
94 ::
95
96    set sr encaps hop-limit N