fd45aca637c223313cd11481b4886abc5790c9b2
[vpp.git] / src / plugins / srv6-mobile / mobile_plugin_doc.md
1 SRv6 Mobile User Plane Plugin for VPP
2 ========================
3
4 # Introduction
5
6 This plugin module can provide the stateless mobile user plane protocols translation between GTP-U and SRv6. The functions of the translation take advantage of SRv6 network programmability.
7
8 [SRv6 Mobile User Plane](https://tools.ietf.org/html/draft-ietf-dmm-srv6-mobile-uplane) defines the user plane protocol using SRv6
9 including following stateless translation functions:
10
11 - **T.M.GTP4.D:**  
12    GTP-U over UDP/IPv4 -> SRv6
13 - **End.M.GTP4.E:**  
14    SRv6 -> GTP-U over UDP/IPv4
15 - **End.M.GTP6.D:**   
16    GTP-U over UDP/IPv6 -> SRv6
17 - **End.M.GTP6.E:**  
18    SRv6 -> GTP-U over UDP/IPv6
19
20 These functions benefit user plane(overlay) to be able to utilize data plane(underlay) networks properly. And also it benefits data plane to be able to handle user plane in routing paradigm.
21
22 Noted that the prefix of function names follow naming convention of SRv6 network programming. "T" means transit function, "End" means end function, "M" means Mobility specific function. The suffix "D" and "E" mean that "decapsulation" and "encapsulation" respectively.
23
24
25 # Implementation
26
27 All SRv6 mobile functions are implemented as VPP plugin modules. The plugin modules leverage the sr_policy and sr_localsid mechanisms.
28
29 # Configurations
30
31 ## GTP-U to SRv6
32
33 The GTP-U tunnel and flow identifiers of a receiving packet are mapped to a Segment Identifier(SID) of sending SRv6 packets.
34
35 ### IPv4 infrastructure case
36
37 In case that **IPv4** networks are the infrastructure of GTP-U, T.M.GTP4.D function translates the receiving GTP-U packets to SRv6 packets.
38
39 A T.M.GTP4.D function is associated with the following mandatory parameters:
40
41 - SID: A SRv6 SID to represents the function
42 - DST-PREFIX: Prefix of remote SRv6 segment. The destination address or last SID of out packets consists of the prefix followed by dst IPv4 address, QFI and TEID of the receiving packets.
43 - SRC-PREFIX: Prefix for src address of sending packets. The src IPv6 address consists of the prefix followed by the src IPv4 address of the receiving packets.
44
45 The following command instantiates a new T.M.GTP4.D function.
46
47 ```
48 sr policy add bsid SID behavior t.m.gtp4.d DST-PREFIX v6src_prefix SRC-PREFIX [nhtype {ipv4|ipv6|non-ip}]
49 ```
50
51 For example, the below command configures the SID 2001:db8::1 with `t.m.gtp4.d` behavior for translating receiving GTP-U over IPv4 packets to SRv6 packets with next-header type is IPv4.
52
53 ```
54 sr policy add bsid 2001:db8::1 behavior t.m.gtp4.d D1::/32 v6src_prefix A1::/64 nhtype ipv4
55 ```
56
57 It should be interesting how a SRv6 BSID works to decapsulate the receiving GTP-U packets over IPv4 header. To utilize ```t.m.gtp4.d``` function, you need to configure some SR steering policy like:
58
59 ```
60 sr steer l3 172.20.0.1/32 via bsid 2001:db8::1
61 ```
62
63 The above steering policy with the BSID of `t.m.gtp4.d` would work properly for the GTP-U packets destined to 172.20.0.1.
64
65 If you have a SID(s) list of SR policy which the configured gtp4.d function to be applied, the SR Policy can be configured as following:
66
67 ```
68 sr policy add bsid D1:: next A1:: next B1:: next C1::
69 ```
70
71 ### IPv6 infrastructure case
72
73 In case that GTP-U is deployed over **IPv6** infrastructure, you don't need to configure T.M.GTP4.D function and associated SR steering policy.  Instead of that, you just need to configure a localsid of End.M.GTP6.D segment.
74
75 An End.M.GTP6.D segment is associated with the following mandatory parameters:
76
77 - SID-PREFIX: SRv6 SID prefix to represent the function. In this function, it should be the dst address of receiving GTP-U packets.
78 - DST-PREFIX: Prefix of remote SRv6 Segment. The destination address or last SID of output packets consists of the prefix followed by QFI and TEID of the receiving packets.
79
80 The following command instantiates a new End.M.GTP6.D function.
81
82 ```
83 sr localsid prefix SID-PREFIX behavior end.m.gtp6.d DST-PREFIX [nhtype {ipv4|ipv6|non-ip}]
84 ```
85 For example, the below command configures the SID prefix 2001:db8::/64 with `end.m.gtp6.d` behavior for translating receiving GTP-U over IPv6 packets which have IPv6 destination addresses within 2001:db8::/64 to SRv6 packets. The dst IPv6 address of the outgoing packets consists of D4::/64 followed by QFI and TEID.
86
87 ```
88 sr localsid prefix 2001:db8::/64 behavior end.m.gtp6.d D4::/64
89 ```
90
91 In another case, the translated packets from GTP-U over IPv6 to SRv6 will be re-translated back to GTP-U, which is so called 'Drop-In' mode.
92
93 In Drop-In mode, an additional IPv6 specific end segment is required, named End.M.GTP6.D.Di. It is because that unlike `end.m.gtp6.d`, it needs to preserve original IPv6 dst address as the last SID in the SRH.
94
95 Regardless of that difference exists, the required configuration parameters are same as `end.m.gtp6.d`.
96
97 The following command instantiates a new End.M.GTP6.D.Di function.
98
99 ```
100 sr localsid prefix 2001:db8::/64 behavior end.m.gtp6.d.di D4::/64
101 ```
102
103
104 ## SRv6 to GTP-U
105
106 The SRv6 Mobile functions on SRv6 to GTP-U direction are End.M.GTP4.E and End.M.GTP6.D.
107
108 In this direction with GTP-U over IPv4 infrastructure, an End.M.GTP4.E segment is associated with the following mandatory parameters:
109
110 - SID-PREFIX: SRv6 SID prefix to represent the function.
111 - V4SRC-ADDR-POSITION: Integer number indicates bit position where IPv4 src address embedded.
112
113 The following command instantiates a new End.M.GTP4.E function.
114
115 ```
116 sr localsid prefix SID-PREFIX behavior end.m.gtp4.e v4src_position V4SRC-ADDR-POSITION
117 ```
118
119 For example, the below command configures the SID prefix 2001:db8::/32 with `end.m.gtp4.e` behavior for translating the receiving SRv6 packets to GTP-U packets encapsulated with UDP/IPv4 header. All the GTP-U tunnel and flow identifiers are extracted from the active SID in the receiving packets. The src IPv4 address of sending GTP-U packets is extracted from the configured bit position in the src IPv6 address.
120
121 ```
122 sr localsid prefix 2001:db8::/32 behavior end.m.gtp4.e v4src_position 64
123 ```
124
125 In IPv6 infrastructure case, an End.M.GTP6.E segment is associated with the following mandatory parameters:
126
127 - SID-PREFIX: SRv6 SID prefix to represent the function.
128
129 The following command instantiates a new End.M.GTP6.E function.
130
131 ```
132 sr localsid prefix SID-PREFIX behavior end.m.gtp6.e
133 ```
134
135 For example, the below command configures the SID prefix 2001:db8::/64 with `end.m.gtp6.e` behavior for translating the receiving SRv6 packets to GTP-U packets encapsulated with UDP/IPv6 header. While the last SID indicates GTP-U dst IPv6 address, 32-bits GTP-U TEID and 6-bits QFI are extracted from the active SID in the receiving packets.
136
137 ```
138 sr localsid prefix 2001:db8::/64 behavior end.m.gtp6.e
139 ```