hs-test: added filenames to test names
[vpp.git] / src / plugins / srv6-ad / ad_plugin_doc.rst
1 .. _srv6_ad_plugin_doc:
2
3 SRv6 dynamic proxy
4 ==================
5
6 SRv6 endpoint to SR-unaware appliance via dynamic proxy (End.AD)
7 ----------------------------------------------------------------
8
9 Overview
10 ~~~~~~~~
11
12 The dynamic proxy is an improvement over the static proxy (@ref
13 srv6_as_plugin_doc) that dynamically learns the SR information before
14 removing it from the incoming traffic. The same information can then be
15 re-attached to the traffic returning from the SF. As opposed to the
16 static SR proxy, no CACHE information needs to be configured. Instead,
17 the dynamic SR proxy relies on a local caching mechanism on the node
18 instantiating this segment. Therefore, a dynamic proxy segment cannot be
19 the last segment in an SR SC policy. A different SR behavior should thus
20 be used if the SF is meant to be the final destination of an SR SC
21 policy.
22
23 Upon receiving a packet whose active segment matches a dynamic SR proxy
24 function, the proxy node pops the top MPLS label or applies the SRv6 End
25 behavior, then compares the updated SR information with the cache entry
26 for the current segment. If the cache is empty or different, it is
27 updated with the new SR information. The SR information is then removed
28 and the inner packet is sent towards the SF.
29
30 The cache entry is not mapped to any particular packet, but instead to
31 an SR SC policy identified by the receiving interface (IFACE-IN). Any
32 non-link-local IP packet or non-local Ethernet frame received on that
33 interface will be re-encapsulated with the cached headers as described
34 in @ref srv6_as_plugin_doc. The SF may thus drop, modify or generate new
35 packets without affecting the proxy.
36
37 For more information, please see
38 `draft-xuclad-spring-sr-service-chaining <https://datatracker.ietf.org/doc/draft-xuclad-spring-sr-service-chaining/>`__.
39
40 CLI configuration
41 ~~~~~~~~~~~~~~~~~
42
43 The following command instantiates a new End.AD segment that sends the
44 inner packets on interface ``IFACE-OUT`` towards an appliance at address
45 ``S-ADDR`` and restores the encapsulation headers of the packets coming
46 back on interface ``IFACE-IN``.
47
48 ::
49
50    sr localsid address SID behavior end.ad nh S-ADDR oif IFACE-OUT iif IFACE-IN
51
52 For example, the below command configures the SID ``1::A1`` with an
53 End.AD function for sending traffic on interface
54 ``GigabitEthernet0/8/0`` to the appliance at address ``A1::``, and
55 receiving it back on interface ``GigabitEthernet0/9/0``.
56
57 ::
58
59    sr localsid address 1::A1 behavior end.ad nh A1:: oif GigabitEthernet0/8/0 iif GigabitEthernet0/9/0
60
61 Pseudocode
62 ~~~~~~~~~~
63
64 The dynamic proxy SRv6 pseudocode is obtained by inserting the following
65 instructions between lines 1 and 2 of the static proxy SRv6 pseudocode.
66
67 ::
68
69    IF NH=SRH & SL > 0 THEN
70        Decrement SL and update the IPv6 DA with SRH[SL]
71        IF C(IFACE-IN) different from IPv6 encaps THEN              ;; Ref1
72            Copy the IPv6 encaps into C(IFACE-IN)                   ;; Ref2
73    ELSE
74        Drop the packet
75
76 **Ref1:** “IPv6 encaps” represents the IPv6 header and any attached
77 extension header.
78
79 **Ref2:** C(IFACE-IN) represents the cache entry associated to the
80 dynamic SR proxy segment. It is identified with IFACE-IN in order to
81 efficiently retrieve the right SR information when a packet arrives on
82 this interface.
83
84 In addition, the inbound policy should check that C(IFACE-IN) has been
85 defined before attempting to restore the IPv6 encapsulation, and drop
86 the packet otherwise.