blob: cf042a847b4ef2145f05049ae181fbdcfefda9c2 [file] [log] [blame]
Nathan Skrzypczakd4a70642021-10-08 14:01:27 +02001.. _srv6_localsid_doc:
2
3SR LocalSIDs
4============
5
6A local SID is associated to a Segment Routing behavior -or function- on
7the current node.
8
9The most basic behavior is called END. It simply activates the next SID
10in the current packet, by decrementing the Segments Left value and
11updating the IPv6 DA.
12
13A local END SID is instantiated using the following CLI:
14
15::
16
17 sr localsid (del) address XX::YY behavior end
18
19This creates a new entry in the main FIB for IPv6 address XX::YY. All
20packets whose IPv6 DA matches this FIB entry are redirected to the
21sr-localsid node, where they are processed as described above.
22
23Other examples of local SIDs are the following:
24
25::
26
27 sr localsid (del) address XX::YY behavior end
28 sr localsid (del) address XX::YY behavior end.x GE0/1/0 2001::a
29 sr localsid (del) address XX::YY behavior end.dx6 GE0/1/0 2001::a
30 sr localsid (del) address XX::YY behavior end.dx4 GE0/1/0 10.0.0.1
31 sr localsid (del) address XX::YY behavior end.dx2 GigabitE0/11/0
32 sr localsid (del) address XX::YY behavior end.dt6 5
33 sr localsid (del) address XX::YY behavior end.dt6 5
34
35Note that all of these behaviors match the definitions of the SRv6
36architecture (*draft-filsfils-spring-srv6-network-programming*). Please
37refer to this document for a detailed description of each behavior.
38
39Note also that you can configure the PSP flavor of the End and End.X
40behaviors by typing:
41
42::
43
44 sr localsid (del) address XX::YY behavior end psp
45 sr localsid (del) address XX::YY behavior end.x GE0/1/0 2001::a psp
46
47Help on the available local SID behaviors and their usage can be
48obtained with:
49
50::
51
52 help sr localsid
53
54Alternatively they can be obtained using.
55
56::
57
58 show sr localsids behavior
59
60The difference in between those two commands is that the first one will
61only display the SR LocalSID behaviors that are built-in VPP, while the
62latter will display those behaviors plus the ones added with the SR
63LocalSID Development Framework.
64
65VPP keeps a My LocalSID Table where it stores all the SR local SIDs
66instantiated as well as their parameters. Every time a new local SID is
67instantiated, a new entry is added to this table. In addition, counters
68for correctly and incorrectly processed traffic are maintained for each
69local SID. The counters store both the number of packets and bytes.
70
71The contents of the My LocalSID Table is shown with:
72
73::
74
75 vpp# show sr localsid
76 SRv6 - My LocalSID Table:
77 =========================
78 Address: c3::1
79 Behavior: DX6 (Endpoint with decapsulation and IPv6 cross-connect)
80 Iface: GigabitEthernet0/5/0
81 Next hop: b:c3::b
82 Good traffic: [51277 packets : 5332808 bytes]
83 Bad traffic: [0 packets : 0 bytes]
84 --------------------
85
86The traffic counters can be reset with:
87
88::
89
90 vpp# clear sr localsid-counters