Consolidate all UPF docs in the same file

Change-Id: I4f94ce90cd99c0eebee7952273da590495817975
diff --git a/advanced/upf.rst b/advanced/upf.rst
index d4e55d5..619271f 100644
--- a/advanced/upf.rst
+++ b/advanced/upf.rst
@@ -1,12 +1,6 @@
 P4-based User Plane Function (P4-UPF)
 =====================================
 
-.. toctree::
-   :maxdepth: 2
-   :glob:
-
-   upf_configuration
-
 Overview
 --------
 
@@ -115,16 +109,94 @@
 rules from ``virtual-upf.p4`` to rules for the multiple physical switches running
 fabric.p4, based on an up-to-date global view of the topology.
 
+Downlink Buffering (DBUF)
+-------------------------
+
+TODO Carmelo: overview of DBUF
+
 ONOS Configuration
 ------------------
 
-``TODO Daniele``
+The UPF configuration is split in two configurations, that can be provided
+independently to ONOS. Th first is used to configure the UP4 ONOS application
+and defines UPF-related information such as S1U Address, network devices
+implementing UPF etc. The second one, instead, is used to configure parameters
+related to the Downlink Buffering (DBUF) functionality.
 
-How to enable P4-UPF?
+Here's a list of fields that you can configure via the UPF Network Configuration
+for UP4:
 
-* up4 app should be already active in ONOS
-* change pipeconf ID
-* explain/push netcfg
+* ``devices``: A list of devices IDs that implements the UPF data plane. This
+  list must include all the leaf switches in the topology. The UPF state is
+  replicated on all devices specified in this configuration field. The devices
+  specified in this list must use a P4 pipeline implementing the UPF
+  functionality. *Required*
+
+* ``s1uAddr``: The IP address of the S1-U interface (equivalent to N3 for 5G).
+  It can be an arbitrary IP address. *Required*
+
+* ``uePools``: A list of subnets that are in use by the UEs. *Required*
+
+* ``dbufDrainAddr``: The IP address of the UPF data plane interface that the
+  DBUF service will drain packets towards. *Optional*
+
+* ``pscEncapEnabled``: Set whether the UPF should use GTP-U extension PDU
+  Session Container when doing encapsulation of downlink packets. *Optional*
+
+* ``defaultQfi``: The default QoS Flow Identifier to use when the PDU Session
+  Container encapsulation is enabled. *Optional*
+
+Here is an example of netcfg JSON for UP4:
+
+.. code-block:: json
+
+    {
+        "apps": {
+            "org.omecproject.up4": {
+                "up4": {
+                  "devices": [
+                    "device:leaf1",
+                    "device:leaf2"
+                  ],
+                  "s1uAddr": "10.32.11.126",
+                  "uePools": [
+                    "10.240.0.0/16"
+                  ],
+                "dbufDrainAddr": "10.32.11.126",
+                "pscEncapEnabled": false,
+                "defaultQfi": 0
+                }
+            }
+        }
+    }
+
+The DBUF configuration block is all *optional*, we can use UP4 without the
+downlink buffering functionality. Here's a list of fields that you can
+configure:
+
+* ``serviceAddr``: The address DBUF service management interface in the form
+  IP:port. This address is used to communicate with the DBUF service via gRPC
+  (for example, to trigger the drain operation, or receive notification for
+  buffered packets).
+
+* ``dataplaneAddr``: The address of the DBUF service data plane interface in the
+  form IP:port. Packets sent to this address by the UPF will be buffered by
+  DBUF. The IP address must be a routable fabric address.
+
+Here is an example of netcfg for DBUF:
+
+.. code-block:: json
+
+    {
+        "apps": {
+            "org.omecproject.up4": {
+                "dbuf": {
+                    "serviceAddr": "10.76.28.72:10000",
+                    "dataplaneAddr": "10.32.11.3:2152"
+                }
+          }
+        }
+    }
 
 SD-Core Configuration
 ---------------------