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