]> git.proxmox.com Git - mirror_frr.git/blame - doc/user/sharp.rst
Merge pull request #12531 from opensourcerouting/feature/snmp_tests
[mirror_frr.git] / doc / user / sharp.rst
CommitLineData
a3488351
DS
1.. _sharp:
2
20b35e46 3*****
a3488351 4SHARP
20b35e46
QY
5*****
6
7:abbr:`SHARP (Super Happy Advanced Routing Process)` is a daemon that provides
8miscellaneous functionality used for testing FRR and creating proof-of-concept
9labs.
a3488351 10
a3488351
DS
11.. _starting-sharp:
12
13Starting SHARP
14==============
15
16Default configuration file for *sharpd* is :file:`sharpd.conf`. The typical
17location of :file:`sharpd.conf` is |INSTALL_PREFIX_ETC|/sharpd.conf.
18
19If the user is using integrated config, then :file:`sharpd.conf` need not be
20present and the :file:`frr.conf` is read instead.
21
22.. program:: sharpd
23
24:abbr:`SHARP` supports all the common FRR daemon start options which are
25documented elsewhere.
26
27.. _using-sharp:
28
20b35e46 29Using SHARP
a3488351
DS
30===========
31
56f0bea7 32All sharp commands are under the enable node and preceded by the ``sharp``
20b35e46 33keyword. At present, no sharp commands will be preserved in the config.
a3488351 34
9a06c157 35.. clicmd:: sharp install routes A.B.C.D <nexthop <E.F.G.H|X:X::X:X>|nexthop-group NAME> (1-1000000) [instance (0-255)] [repeat (2-1000)] [opaque WORD]
a3488351 36
20b35e46 37 Install up to 1,000,000 (one million) /32 routes starting at ``A.B.C.D``
fa83edf0
DS
38 with specified nexthop ``E.F.G.H`` or ``X:X::X:X``. The nexthop is
39 a ``NEXTHOP_TYPE_IPV4`` or ``NEXTHOP_TYPE_IPV6`` and must be reachable
41390893
DS
40 to be installed into the kernel. Alternatively a nexthop-group NAME
41 can be specified and used as the nexthops. The routes are installed into
42 zebra as ``ZEBRA_ROUTE_SHARP`` and can be used as part of a normal route
fa83edf0 43 redistribution. Route installation time is noted in the debug
20b35e46
QY
44 log. When zebra successfully installs a route into the kernel and SHARP
45 receives success notifications for all routes this is logged as well.
41390893
DS
46 Instance (0-255) if specified causes the routes to be installed in a different
47 instance. If repeat is used then we will install/uninstall the routes the
9a06c157
DS
48 number of times specified. If the keyword opaque is specified then the
49 next word is sent down to zebra as part of the route installation.
a3488351 50
20b35e46 51.. clicmd:: sharp remove routes A.B.C.D (1-1000000)
a3488351 52
20b35e46
QY
53 Remove up to 1,000,000 (one million) /32 routes starting at ``A.B.C.D``. The
54 routes are removed from zebra. Route deletion start is noted in the debug
55 log and when all routes have been successfully deleted the debug log will be
56 updated with this information as well.
a3488351 57
f59e6418
DS
58.. clicmd:: sharp data route
59
60 Allow end user doing route install and deletion to get timing information
61 from the vty or vtysh instead of having to read the log file. This command
62 is informational only and you should look at sharp_vty.c for explanation
63 of the output as that it may change.
64
20b35e46 65.. clicmd:: sharp label <ipv4|ipv6> vrf NAME label (0-1000000)
a3488351 66
20b35e46
QY
67 Install a label into the kernel that causes the specified vrf NAME table to
68 be used for pop and forward operations when the specified label is seen.
a3488351 69
03750f1e 70.. clicmd:: sharp watch <nexthop <A.B.C.D|X:X::X:X>|import <A.B.C.D/M:X:X::X:X/M> [connected]
a3488351 71
20b35e46
QY
72 Instruct zebra to monitor and notify sharp when the specified nexthop is
73 changed. The notification from zebra is written into the debug log.
80d5ff33
DS
74 The nexthop or import choice chooses the type of nexthop we are asking
75 zebra to watch for us. This choice affects zebra's decision on what
76 matches. Connected tells zebra whether or not that we want the route
238f69af
DS
77 matched against to be a static or connected route for the nexthop keyword,
78 for the import keyword connected means exact match. The no form of
80d5ff33 79 the command obviously turns this watching off.
86da53ab 80
86da53ab
DS
81.. clicmd:: sharp data nexthop
82
83 Allow end user to dump associated data with the nexthop tracking that
84 may have been turned on.
c9e5adba 85
921af54d
DS
86.. clicmd:: sharp watch [vrf NAME] redistribute ROUTETYPE
87
88 Allow end user to monitor redistributed routes of ROUTETYPE
89 origin.
90
faa75dfa 91.. clicmd:: sharp lsp [update] (0-100000) nexthop-group NAME [prefix A.B.C.D/M TYPE [instance (0-255)]]
c9e5adba
MS
92
93 Install an LSP using the specified in-label, with nexthops as
faa75dfa
MS
94 listed in nexthop-group ``NAME``. If ``update`` is included, the
95 update path is used. The LSP is installed as type ZEBRA_LSP_SHARP.
96 If ``prefix`` is specified, an existing route with type ``TYPE``
97 (and optional ``instance`` id) will be updated to use the LSP.
c9e5adba 98
c9e5adba
MS
99.. clicmd:: sharp remove lsp (0-100000) nexthop-group NAME [prefix A.B.C.D/M TYPE [instance (0-255)]]
100
101 Remove a SHARPD LSP that uses the specified in-label, where the
102 nexthops are specified in nexthop-group ``NAME``. If ``prefix`` is
103 specified, remove label bindings from the route of type ``TYPE``
104 also.
c8b27f2a 105
c8b27f2a
MS
106.. clicmd:: sharp send opaque type (1-255) (1-1000)
107
108 Send opaque ZAPI messages with subtype ``type``. Sharpd will send
109 a stream of messages if the count is greater than one.
110
cc2a89db 111.. clicmd:: sharp send opaque unicast type (1-255) PROTOCOL [{instance (0-1000) | session (1-1000)}] (1-1000)
c8b27f2a
MS
112
113 Send unicast opaque ZAPI messages with subtype ``type``. The
114 protocol, instance, and session_id identify a single target zapi
115 client. Sharpd will send a stream of messages if the count is
116 greater than one.
117
cc2a89db 118.. clicmd:: sharp send opaque <reg | unreg> PROTOCOL [{instance (0-1000) | session (1-1000)}] type (1-1000)
c8b27f2a
MS
119
120 Send opaque ZAPI registration and unregistration messages for a
121 single subtype. The messages must specify a protocol daemon by
122 name, and can include optional zapi ``instance`` and ``session``
123 values.
2be4d61a 124
2be4d61a
MS
125.. clicmd:: sharp create session (1-1024)
126
127 Create an additional zapi client session for testing, using the
128 specified session id.
129
2be4d61a
MS
130.. clicmd:: sharp remove session (1-1024)
131
132 Remove a test zapi client session that was created with the
133 specified session id.
d68e74b4 134
d68e74b4
JU
135.. clicmd:: sharp neigh discover [vrf NAME] <A.B.C.D|X:X::X:X> IFNAME
136
137 Send an ARP/NDP request to trigger the addition of a neighbor in the ARP
138 table.
1888e243
OD
139
140.. clicmd:: sharp import-te
141
621fb5f3 142 Import Traffic Engineering Database produced by OSPF or IS-IS.
1888e243
OD
143
144.. clicmd:: show sharp ted [verbose|json]
145
146.. clicmd:: show sharp ted [<vertex [A.B.C.D]|edge [A.B.C.D]|subnet [A.B.C.D/M]>] [verbose|json]
147
148 Show imported Traffic Engineering Data Base
149
621fb5f3
OD
150.. clicmd:: show sharp cspf source <A.B.C.D|X:X:X:X> destination <A.B.C.D|X:X:X:X> <metric|te-metric|delay> (0-16777215) [rsv-bw (0-7) BANDWIDTH]
151
152 Show the result of a call to the Constraint Shortest Path First (CSPF)
153 algorithm that allows to compute a path between a source and a
154 destination under various constraints. Standard Metric, TE Metric, Delay
155 and Bandwidth are supported constraints. Prior to use this function, it is
156 necessary to import a Traffic Engineering Database with `sharp import-te`
157 command (see above).
158
4ccd4033 159.. clicmd:: sharp install seg6-routes [vrf NAME] <A.B.C.D|X:X::X:X> nexthop-seg6 X:X::X:X encap X:X::X:X (1-1000000)
1888e243 160
4ccd4033
HS
161 This command installs a route for SRv6 Transit behavior (on Linux it is
162 known as seg6 route). The count, destination, vrf, etc. have the same
163 meaning as in the ``sharp install routes`` command. With this command,
164 sharpd will request zebra to configure seg6 route via ZEBRA_ROUTE_ADD
165 ZAPI. As in the following example.
166
167::
168
169 router# sharp install seg6-routes 1::A nexthop-seg6 2001::2 encap A:: 1
170 router# sharp install seg6-routes 1::B nexthop-seg6 2001::2 encap B:: 1
171
172 router# show ipv6 route
173 D>* 1::A/128 [150/0] via 2001::2, dum0, seg6 a::, weight 1, 00:00:01
174 D>* 1::B/128 [150/0] via 2001::2, dum0, seg6 b::, weight 1, 00:00:01
175
176 bash# ip -6 route list
177 1::A encap seg6 mode encap segs 1 [ a:: ] via 2001::2 dev dum0 proto 194 metric 20 pref medium
178 1::B encap seg6 mode encap segs 1 [ b:: ] via 2001::2 dev dum0 proto 194 metric 20 pref medium
179
180.. clicmd:: sharp install seg6local-routes [vrf NAME] X:X::X:X nexthop-seg6local NAME ACTION ARGS.. (1-1000000)
181
182 This command installs a route for SRv6 Endpoint behavior (on Linux it is
183 known as seg6local route). The count, destination, vrf, etc. have the same
184 meaning as in the ``sharp install routes`` command. With this command,
185 sharpd will request zebra to configure seg6local route via ZEBRA_ROUTE_ADD
186 ZAPI. As in the following example.
187
188 There are many End Functions defined in SRv6, which have been standardized
189 in RFC 8986. The current implementation supports End, End.X, End.T, End.DX4,
b71e1a52 190 End.DT6 and End.DT46, which can be configured as follows.
4ccd4033
HS
191
192::
193
194 router# sharp install seg6local-routes 1::1 nexthop-seg6local dum0 End 1
195 router# sharp install seg6local-routes 1::2 nexthop-seg6local dum0 End_X 2001::1 1
196 router# sharp install seg6local-routes 1::3 nexthop-seg6local dum0 End_T 10 1
197 router# sharp install seg6local-routes 1::4 nexthop-seg6local dum0 End_DX4 10.0.0.1 1
198 router# sharp install seg6local-routes 1::5 nexthop-seg6local dum0 End_DT6 10 1
b71e1a52 199 router# sharp install seg6local-routes 1::6 nexthop-seg6local dum0 End_DT46 10 1
4ccd4033
HS
200
201 router# show ipv6 route
202 D>* 1::1/128 [150/0] is directly connected, dum0, seg6local End USP, weight 1, 00:00:05
203 D>* 1::2/128 [150/0] is directly connected, dum0, seg6local End.X nh6 2001::1, weight 1, 00:00:05
204 D>* 1::3/128 [150/0] is directly connected, dum0, seg6local End.T table 10, weight 1, 00:00:05
205 D>* 1::4/128 [150/0] is directly connected, dum0, seg6local End.DX4 nh4 10.0.0.1, weight 1, 00:00:05
206 D>* 1::5/128 [150/0] is directly connected, dum0, seg6local End.DT6 table 10, weight 1, 00:00:05
b71e1a52 207 D>* 1::6/128 [150/0] is directly connected, dum0, seg6local End.DT46 table 10, weight 1, 00:00:05
4ccd4033
HS
208
209 bash# ip -6 route
210 1::1 encap seg6local action End dev dum0 proto 194 metric 20 pref medium
211 1::2 encap seg6local action End.X nh6 2001::1 dev dum0 proto 194 metric 20 pref medium
212 1::3 encap seg6local action End.T table 10 dev dum0 proto 194 metric 20 pref medium
213 1::4 encap seg6local action End.DX4 nh4 10.0.0.1 dev dum0 proto 194 metric 20 pref medium
214 1::5 encap seg6local action End.DT6 table 10 dev dum0 proto 194 metric 20 pref medium
b71e1a52 215 1::6 encap seg6local action End.DT46 table 10 dev dum0 proto 194 metric 20 pref medium
4ccd4033
HS
216
217.. clicmd:: show sharp segment-routing srv6
218
219 This command shows us what SRv6 locator chunk, sharp is holding as zclient.
220 An SRv6 locator is defined for each SRv6 router, and a single locator may
221 be shared by multiple protocols.
222
223 In the FRRouting implementation, the Locator chunk get request is executed
224 by a routing protocol daemon such as sharpd or bgpd, And then Zebra
225 allocates a Locator Chunk, which is a subset of the Locator Prefix, and
226 notifies the requesting protocol daemon of this information.
227
228 This command example shows how the locator chunk of sharpd itself is
229 allocated.
230
231::
232
233 router# show segment-routing srv6 locator
234 Locator:
235 Name ID 2 2001:db8:2:2::/64 Up
236
237 router# show sharp segment-routing srv6
238 Locator loc1 has 1 prefix chunks
239 2001:db8:1:1::/64
240
241.. clicmd:: sharp srv6-manager get-locator-chunk
242
243 This command requests the SRv6 locator to allocate a locator chunk via ZAPI.
244 This chunk can be owned by the protocol daemon, and the chunk obtained by
245 sharpd will not be used by the SRv6 mechanism of another routing protocol.
246
247 Since this request is made asynchronously, it can be issued before the SRv6
248 locator is configured on the zebra side, and as soon as it is ready on the
249 zebra side, sharpd can check the allocated locator chunk via zapi.
250
251::
252
253 router# show segment-routing srv6 locator loc1 detail
254 Name: loc1
255 Prefix: 2001:db8:1:1::/64
256 Chunks:
257 - prefix: 2001:db8:1:1::/64, owner: system
258
259 router# show sharp segment-routing srv6
260 (nothing)
261
262 router# sharp srv6-manager get-locator-chunk loc1
263
264 router# show segment-routing srv6 locator loc1 detail
265 Name: loc1
266 Prefix: 2001:db8:1:1::/64
267 Chunks:
268 - prefix: 2001:db8:1:1::/64, owner: sharp
269
270 router# show sharp segment-routing srv6
271 Locator loc1 has 1 prefix chunks
272 2001:db8:1:1::/64
273
274.. clicmd:: sharp srv6-manager release-locator-chunk
275
276 This command releases a locator chunk that has already been allocated by
277 ZAPI. The freed chunk will have its owner returned to the system and will
278 be available to another protocol daemon.
279
280::
281
282 router# show segment-routing srv6 locator loc1 detail
283 Name: loc1
284 Prefix: 2001:db8:1:1::/64
285 Chunks:
286 - prefix: 2001:db8:1:1::/64, owner: sharp
287
288 router# show sharp segment-routing srv6
289 Locator loc1 has 1 prefix chunks
290 2001:db8:1:1::/64
291
292 router# sharp srv6-manager release-locator-chunk loc1
293
294 router# show segment-routing srv6 locator loc1 detail
295 Name: loc1
296 Prefix: 2001:db8:1:1::/64
297 Chunks:
298 - prefix: 2001:db8:1:1::/64, owner: system
299
300 router# show sharp segment-routing srv6
301 (nothing)
3393afc9
SW
302
303.. clicmd:: sharp interface IFNAME protodown
304
305 Set an interface protodown.