blob: d4e55d5a77faa60775eccae9254d616422064fcc [file] [log] [blame]
Carmelo Cascone4a883cb2021-09-28 18:20:15 -07001P4-based User Plane Function (P4-UPF)
2=====================================
Daniele Moro69226c82021-09-28 17:37:49 +02003
4.. toctree::
5 :maxdepth: 2
6 :glob:
7
8 upf_configuration
Carmelo Cascone4a883cb2021-09-28 18:20:15 -07009
10Overview
11--------
12
13SD-Fabric supports running a 4G/5G mobile core User Plane Function (UPF) as part
14of the switches packet processing pipeline. Like the rest of the pipeline, this
15is realized using P4 and for this reason we call this P4-UPF.
16
17P4-UPF is integrated with the ONF's SD-Core project. By default, SD-Core ships
18with BESS-UPF, a containerized UPF implementation, based on the Berkeley
19Software Switch (BESS).
20
21SD-Fabric can be used with BESS-UPF or any other UPF implementation that runs on
22servers. In this case, the fabric switches can provide routing of GTP-U packets
23to and from radio base station and servers. When P4-UPF is enabled, the same
24fabric switches perform GTP-U tunnel termination.
25
26.. image:: ../images/bess-p4-upf.png
27 :width: 700px
28
29**Supported Features**
30
31SD-Fabric's P4-UPF implements a core set of features capable of supporting
32requirements for a broad range of enterprise use cases:
33
34* GTP-U tunnel encap/decap: including support for 5G extensions such as PDU
35 Session Container carrying QoS Flow Information.
36* Accounting: we use switch counters to collect per-flow stats and support usage
37 reporting and volume-based triggers.
38* Downlink buffering: when a user device radio goes idle (power-save mode) or
39 during a handover, switches are updated to forward all downlink traffic for
40 the specific device (UE) to DBUF, a K8s-managed buffering service running on
41 servers. Then, when the device radio becomes ready to receive traffic,
42 packets are drained from the software buffers back to the switch to be
43 delivered to base stations.
44* QoS: support for enforcement of maximum bitrate (MBR), minimum guaranteed
45 bitrate (GBR, via admission control), and prioritization using switch
46 queues and scheduling policy.
47* Slicing: multiple logical UPFs can be instantiated on the same switch, each
48 one with its own QoS model and isolation guarantees enforced at the hardware
49 level using separate queues.
50
51**Distributed UPF**
52
53.. image:: ../images/upf-distributed.png
54 :width: 700px
55
56In SD-Fabric we support different topologies to meet the requirements of
57different deployment sizes: from a single rack with just one leaf
58switch, or a paired-leaves for redundancy, to NxM leaf-spine fabric for multi-rack
59deployments. For this reason, P4-UPF is realized with a "distributed" data plane
60implementation where all leaf switches are programmed with the same UPF
61rules, such that any leaf can terminate any GTP-U tunnel. This provides several
62benefits:
63
64* Simplified deployment: base stations can be connected via any leaf switch.
65* Minimum latency: the UPF function is applied as soon as packets enter the
66 fabric, without going through additional devices before reaching their final
67 destination.
68* Fast failover: when using paired-leaves, if one switch fails, the other can
69 immediately take over as it is already programmed with the same UPF state.
70* Fabric-wide slicing & QoS guarantees: packets are classified as soon as they
71 hit the first leaf. We then use a custom DSCP-based marking to enforce the
72 same QoS rules on all hops. In case of congestion, flows deemed high priority
73 are treated as such by all switches.
74
75**Control Architecture and Integration with SD-Core**
76
77SD-Fabric's P4-UPF is integrated with the ONF SD-Core project to provide a
78high-performance 3GPP-compliant mobile core solution.
79
80The integration with SD-Core is achieved via an ONOS called UP4, which is in
81charge of populating the UPF tables of the switch pipeline.
82
83.. image:: ../images/up4-arch.png
84 :width: 600px
85
86The interface between the mobile core control plane and the UPF is defined by
87the 3GPP standard Packet Forwarding Control Protocol (PFCP). This is a complex
88protocol that can be difficult to understand, even though at its essence the
89rules that it installs are simple match-action rules. The implementation of such
90protocol, such as message parsing, state machines, and other bookkeeping can be
91common to many different UPF realizations. For this reason, SD-Fabric relies on
92an implementation of the PFCP protocol realized as an external microservice
93named “PFCP-Agent”, which is provided by the SD-Core project.
94
95The UP4 App abstracts the whole fabric as one virtual big switch with UPF
96capabilities, we call this the One-Big-UPF abstraction. Such abstraction allows
97the upper layers to be independent of the underlying physical topology.
98Communication between the PFCP Agent and the UP4 App is done via P4Runtime. This
99is the same API that ONOS uses to communicate with the actual switches. However,
100in the former case, it is used between two control planes, the mobile core, and
101the SDN controller. By doing this, the deployment can be scaled up and down,
102adding or removing racks and switches, without changing the mobile core control
103plane, which instead is provided with the illusion of controlling just one
104switch.
105
106The One-Big-UPF abstraction abstraction is realized with a ``virtual-upf.p4``
107program that formalizes the forwarding model described by PFCP as a series of
108match-action tables. This program doesn't run on switches, but it's used as the
109schema to define the content of the P4Runtime messages between PFCP Agent and
110the UP4 App. On switches, we use a different program, fabric.p4, which
111implements tables similar to the virtual UPF but optimized to satisfy the
112resource constraints of Tofino, as well as tables for basic bridging, IP
113routing, ECMP, and more. The UP4 App implements a P4Runtime server, like if it
114were a switch, but instead it internally takes care of translating P4Runtime
115rules from ``virtual-upf.p4`` to rules for the multiple physical switches running
116fabric.p4, based on an up-to-date global view of the topology.
117
118ONOS Configuration
119------------------
120
121``TODO Daniele``
122
123How to enable P4-UPF?
124
125* up4 app should be already active in ONOS
126* change pipeconf ID
127* explain/push netcfg
128
129SD-Core Configuration
130---------------------
131
132TODO Carmelo:
133
134* Assuming SD-Core is already installed...
135* Instructions to install PFCP Agent for UP4
136* Reference for helm values configuration
137
138Should be similar to BESS install instructions (where the same helm chart
139installs both PFCP agent and BESS):
140https://docs.aetherproject.org/master/edge_deployment/bess_upf_deployment.html
141
142But using this helm chart (without BESS), just PFCP Agent:
143https://gerrit.opencord.org/plugins/gitiles/aether-helm-charts/+/refs/heads/master/omec/omec-upf-pfcp-agent/
144
145UP4 Troubleshooting
146-------------------
147
148``TODO Daniele``
149
150Example of UP4 CLI commands to debug the state of UP4.
151
152DBUF
153----
154
155
156``TODO Carmelo`` overview
157
158
159``TODO Hung-Wei`` deployment instructions (helm chart)