blob: 265bad44b6e356d7d06ecbb4abe6af5ecd9979c0 [file] [log] [blame]
Carmelo Cascone7623e7c2021-10-13 17:45:27 -07001.. _p4_upf:
2
Carmelo Cascone4a883cb2021-09-28 18:20:15 -07003P4-based User Plane Function (P4-UPF)
4=====================================
Daniele Moro69226c82021-09-28 17:37:49 +02005
Carmelo Cascone4a883cb2021-09-28 18:20:15 -07006Overview
7--------
8
9SD-Fabric supports running a 4G/5G mobile core User Plane Function (UPF) as part
10of the switches packet processing pipeline. Like the rest of the pipeline, this
11is realized using P4 and for this reason we call this P4-UPF.
12
13P4-UPF is integrated with the ONF's SD-Core project. By default, SD-Core ships
14with BESS-UPF, a containerized UPF implementation, based on the Berkeley
15Software Switch (BESS).
16
17SD-Fabric can be used with BESS-UPF or any other UPF implementation that runs on
18servers. In this case, the fabric switches can provide routing of GTP-U packets
19to and from radio base station and servers. When P4-UPF is enabled, the same
20fabric switches perform GTP-U tunnel termination.
21
22.. image:: ../images/bess-p4-upf.png
23 :width: 700px
24
25**Supported Features**
26
27SD-Fabric's P4-UPF implements a core set of features capable of supporting
28requirements for a broad range of enterprise use cases:
29
30* GTP-U tunnel encap/decap: including support for 5G extensions such as PDU
31 Session Container carrying QoS Flow Information.
32* Accounting: we use switch counters to collect per-flow stats and support usage
33 reporting and volume-based triggers.
34* Downlink buffering: when a user device radio goes idle (power-save mode) or
35 during a handover, switches are updated to forward all downlink traffic for
36 the specific device (UE) to DBUF, a K8s-managed buffering service running on
37 servers. Then, when the device radio becomes ready to receive traffic,
38 packets are drained from the software buffers back to the switch to be
39 delivered to base stations.
40* QoS: support for enforcement of maximum bitrate (MBR), minimum guaranteed
41 bitrate (GBR, via admission control), and prioritization using switch
42 queues and scheduling policy.
43* Slicing: multiple logical UPFs can be instantiated on the same switch, each
44 one with its own QoS model and isolation guarantees enforced at the hardware
45 level using separate queues.
46
47**Distributed UPF**
48
49.. image:: ../images/upf-distributed.png
50 :width: 700px
51
52In SD-Fabric we support different topologies to meet the requirements of
53different deployment sizes: from a single rack with just one leaf
Charles Chan3ec04612021-10-06 22:57:02 -070054switch, or a paired-leaves for redundancy, to N x M leaf-spine fabric for multi-rack
Carmelo Cascone4a883cb2021-09-28 18:20:15 -070055deployments. For this reason, P4-UPF is realized with a "distributed" data plane
56implementation where all leaf switches are programmed with the same UPF
57rules, such that any leaf can terminate any GTP-U tunnel. This provides several
58benefits:
59
60* Simplified deployment: base stations can be connected via any leaf switch.
61* Minimum latency: the UPF function is applied as soon as packets enter the
62 fabric, without going through additional devices before reaching their final
63 destination.
64* Fast failover: when using paired-leaves, if one switch fails, the other can
65 immediately take over as it is already programmed with the same UPF state.
66* Fabric-wide slicing & QoS guarantees: packets are classified as soon as they
67 hit the first leaf. We then use a custom DSCP-based marking to enforce the
68 same QoS rules on all hops. In case of congestion, flows deemed high priority
69 are treated as such by all switches.
70
71**Control Architecture and Integration with SD-Core**
72
73SD-Fabric's P4-UPF is integrated with the ONF SD-Core project to provide a
74high-performance 3GPP-compliant mobile core solution.
75
Jon Hall5145d5e2021-10-08 16:45:27 -070076The integration with SD-Core is achieved via an ONOS application called UP4,
77which is in charge of populating the UPF tables of the switch pipeline.
Carmelo Cascone4a883cb2021-09-28 18:20:15 -070078
79.. image:: ../images/up4-arch.png
80 :width: 600px
81
82The interface between the mobile core control plane and the UPF is defined by
83the 3GPP standard Packet Forwarding Control Protocol (PFCP). This is a complex
84protocol that can be difficult to understand, even though at its essence the
85rules that it installs are simple match-action rules. The implementation of such
86protocol, such as message parsing, state machines, and other bookkeeping can be
87common to many different UPF realizations. For this reason, SD-Fabric relies on
88an implementation of the PFCP protocol realized as an external microservice
Carmelo Cascone1935fde2021-10-12 00:57:05 -070089named “PFCP Agent”, which is provided by the SD-Core project.
Carmelo Cascone4a883cb2021-09-28 18:20:15 -070090
91The UP4 App abstracts the whole fabric as one virtual big switch with UPF
92capabilities, we call this the One-Big-UPF abstraction. Such abstraction allows
93the upper layers to be independent of the underlying physical topology.
94Communication between the PFCP Agent and the UP4 App is done via P4Runtime. This
95is the same API that ONOS uses to communicate with the actual switches. However,
96in the former case, it is used between two control planes, the mobile core, and
97the SDN controller. By doing this, the deployment can be scaled up and down,
98adding or removing racks and switches, without changing the mobile core control
99plane, which instead is provided with the illusion of controlling just one
100switch.
101
102The One-Big-UPF abstraction abstraction is realized with a ``virtual-upf.p4``
103program that formalizes the forwarding model described by PFCP as a series of
104match-action tables. This program doesn't run on switches, but it's used as the
105schema to define the content of the P4Runtime messages between PFCP Agent and
106the UP4 App. On switches, we use a different program, fabric.p4, which
107implements tables similar to the virtual UPF but optimized to satisfy the
108resource constraints of Tofino, as well as tables for basic bridging, IP
109routing, ECMP, and more. The UP4 App implements a P4Runtime server, like if it
110were a switch, but instead it internally takes care of translating P4Runtime
111rules from ``virtual-upf.p4`` to rules for the multiple physical switches running
112fabric.p4, based on an up-to-date global view of the topology.
113
Carmelo Casconecad8b342021-09-29 17:29:59 -0700114Downlink Buffering (DBUF)
115-------------------------
116
Carmelo Cascone1935fde2021-10-12 00:57:05 -0700117A UPF is required to buffer packets when UEs are in idle-mode or during
118handovers, this is usually called *downlink buffering*, as it applies only to
119the downlink direction of traffic. Most switches provide buffering capabilities
120to handle congestion, they cannot hold packets indefinitely. For this reason, we
121provide DBUF, a microservice
122responsible for providing the downlink buffering capabilities to P4-UPF.
123
124.. image:: ../images/dbuf.png
125 :width: 400px
126
127When a UE goes idle and turns off its radio, or during handovers, the mobile
128core control plane uses PFCP to update the Forwarding Action Rules (FARs) for
129that UE to enter buffering* mode. When this happens, UP4 updates the switch rules to
130steer packets to DBUF using GTP-U tunnels.
131
132UP4 uses gRPC to communicate with DBUF. DBUF notifies UP4 about buffering
133events, which are relayed to the mobile core control plane as Downlink Data
134Notifications (DDN). When a UE becomes available again, UP4 triggers a buffer
135drain on DBUF and updates the switch rules to start sending traffic to the UE again.
136
137Deploying DBUF is optional (can be enabled in the SD-Fabric Helm Chart).
138DBUF feature requires SR-IOV and DHCP support on NICs and Kubernetes CNIs.
Carmelo Casconecad8b342021-09-29 17:29:59 -0700139
Carmelo Cascone4a883cb2021-09-28 18:20:15 -0700140ONOS Configuration
141------------------
142
Carmelo Casconecad8b342021-09-29 17:29:59 -0700143The UPF configuration is split in two configurations, that can be provided
144independently to ONOS. Th first is used to configure the UP4 ONOS application
145and defines UPF-related information such as S1U Address, network devices
146implementing UPF etc. The second one, instead, is used to configure parameters
Carmelo Cascone1935fde2021-10-12 00:57:05 -0700147related to the DBUF functionality.
Carmelo Cascone4a883cb2021-09-28 18:20:15 -0700148
Carmelo Casconecad8b342021-09-29 17:29:59 -0700149Here's a list of fields that you can configure via the UPF Network Configuration
150for UP4:
Carmelo Cascone4a883cb2021-09-28 18:20:15 -0700151
Carmelo Casconecad8b342021-09-29 17:29:59 -0700152* ``devices``: A list of devices IDs that implements the UPF data plane. This
153 list must include all the leaf switches in the topology. The UPF state is
154 replicated on all devices specified in this configuration field. The devices
155 specified in this list must use a P4 pipeline implementing the UPF
156 functionality. *Required*
157
158* ``s1uAddr``: The IP address of the S1-U interface (equivalent to N3 for 5G).
159 It can be an arbitrary IP address. *Required*
160
161* ``uePools``: A list of subnets that are in use by the UEs. *Required*
162
163* ``dbufDrainAddr``: The IP address of the UPF data plane interface that the
164 DBUF service will drain packets towards. *Optional*
165
166* ``pscEncapEnabled``: Set whether the UPF should use GTP-U extension PDU
167 Session Container when doing encapsulation of downlink packets. *Optional*
168
169* ``defaultQfi``: The default QoS Flow Identifier to use when the PDU Session
170 Container encapsulation is enabled. *Optional*
171
172Here is an example of netcfg JSON for UP4:
173
174.. code-block:: json
175
176 {
177 "apps": {
178 "org.omecproject.up4": {
179 "up4": {
180 "devices": [
181 "device:leaf1",
182 "device:leaf2"
183 ],
184 "s1uAddr": "10.32.11.126",
185 "uePools": [
186 "10.240.0.0/16"
187 ],
188 "dbufDrainAddr": "10.32.11.126",
189 "pscEncapEnabled": false,
190 "defaultQfi": 0
191 }
192 }
193 }
194 }
195
196The DBUF configuration block is all *optional*, we can use UP4 without the
197downlink buffering functionality. Here's a list of fields that you can
198configure:
199
Carmelo Cascone1935fde2021-10-12 00:57:05 -0700200* ``serviceAddr``: The address of the DBUF service management interface in the
201 form IP:port. This address is used to communicate with the DBUF service via
202 gRPC (for example, to trigger the drain operation, or receive notification for
Carmelo Casconecad8b342021-09-29 17:29:59 -0700203 buffered packets).
204
205* ``dataplaneAddr``: The address of the DBUF service data plane interface in the
Carmelo Cascone1935fde2021-10-12 00:57:05 -0700206 form IP:port. Packets sent to this address by the UPF switches will be
207 buffered by DBUF. The IP address must be a routable fabric address.
Carmelo Casconecad8b342021-09-29 17:29:59 -0700208
209Here is an example of netcfg for DBUF:
210
211.. code-block:: json
212
213 {
214 "apps": {
215 "org.omecproject.up4": {
216 "dbuf": {
217 "serviceAddr": "10.76.28.72:10000",
218 "dataplaneAddr": "10.32.11.3:2152"
219 }
220 }
221 }
222 }
Carmelo Cascone4a883cb2021-09-28 18:20:15 -0700223
Carmelo Cascone1935fde2021-10-12 00:57:05 -0700224.. note::
225 When deploying DBUF using the SD-Fabric Helm Chart you do **NOT** need to
226 provide the ``"dbuf"`` part of the UP4 config. That will be pushed
227 automatically by the DBUF Kubernetes pod.
Carmelo Cascone4a883cb2021-09-28 18:20:15 -0700228
Carmelo Cascone1935fde2021-10-12 00:57:05 -0700229PFCP Agent Configuration
230------------------------
Carmelo Cascone4a883cb2021-09-28 18:20:15 -0700231
Carmelo Cascone1935fde2021-10-12 00:57:05 -0700232PFCP Agent can be deployed as part of the SD-Fabric Helm Chart.
Carmelo Cascone4a883cb2021-09-28 18:20:15 -0700233
Carmelo Cascone1935fde2021-10-12 00:57:05 -0700234See the Helm Chart documentation for more information on the configuration
235parameters. Once deployed, use ``kubectl get services -n sdfabric`` to find out
236the exact UDP endpoint used to listen for PFCP connection requests.
Carmelo Cascone4a883cb2021-09-28 18:20:15 -0700237
238UP4 Troubleshooting
239-------------------
240
Daniele Moro5212da62021-10-11 16:20:26 +0200241See :ref:`troubleshooting_guide`.