Nathan Skrzypczak | d4a7064 | 2021-10-08 14:01:27 +0200 | [diff] [blame] | 1 | .. _srv6_localsid_doc: |
| 2 | |
| 3 | SR LocalSIDs |
| 4 | ============ |
| 5 | |
| 6 | A local SID is associated to a Segment Routing behavior -or function- on |
| 7 | the current node. |
| 8 | |
| 9 | The most basic behavior is called END. It simply activates the next SID |
| 10 | in the current packet, by decrementing the Segments Left value and |
| 11 | updating the IPv6 DA. |
| 12 | |
| 13 | A local END SID is instantiated using the following CLI: |
| 14 | |
| 15 | :: |
| 16 | |
| 17 | sr localsid (del) address XX::YY behavior end |
| 18 | |
| 19 | This creates a new entry in the main FIB for IPv6 address XX::YY. All |
| 20 | packets whose IPv6 DA matches this FIB entry are redirected to the |
| 21 | sr-localsid node, where they are processed as described above. |
| 22 | |
| 23 | Other 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 | |
| 35 | Note that all of these behaviors match the definitions of the SRv6 |
| 36 | architecture (*draft-filsfils-spring-srv6-network-programming*). Please |
| 37 | refer to this document for a detailed description of each behavior. |
| 38 | |
| 39 | Note also that you can configure the PSP flavor of the End and End.X |
| 40 | behaviors 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 | |
| 47 | Help on the available local SID behaviors and their usage can be |
| 48 | obtained with: |
| 49 | |
| 50 | :: |
| 51 | |
| 52 | help sr localsid |
| 53 | |
| 54 | Alternatively they can be obtained using. |
| 55 | |
| 56 | :: |
| 57 | |
| 58 | show sr localsids behavior |
| 59 | |
| 60 | The difference in between those two commands is that the first one will |
| 61 | only display the SR LocalSID behaviors that are built-in VPP, while the |
| 62 | latter will display those behaviors plus the ones added with the SR |
| 63 | LocalSID Development Framework. |
| 64 | |
| 65 | VPP keeps a ‘My LocalSID Table’ where it stores all the SR local SIDs |
| 66 | instantiated as well as their parameters. Every time a new local SID is |
| 67 | instantiated, a new entry is added to this table. In addition, counters |
| 68 | for correctly and incorrectly processed traffic are maintained for each |
| 69 | local SID. The counters store both the number of packets and bytes. |
| 70 | |
| 71 | The 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 | |
| 86 | The traffic counters can be reset with: |
| 87 | |
| 88 | :: |
| 89 | |
| 90 | vpp# clear sr localsid-counters |