 flows and sends configuration instructions via the SDN control plane. In abstract terms, for all nodes in a directed rooted tree (or directed acyclic graph), TP needs to provide the set of child nodes $\{\mathcal{V}^{(v)}\}_{v \in \mathcal{V}}$ from which to accept MTC data flows, and to identify the exact MTC data flows that will be filtered for each output flow, if there are multiple output flows.

Based on the MTC server application requests and the configured topology, FP processes the global function request, and, based on the available library of AFC modules, it generates the set of atomic functions to be used: $\{g^{(a)}\}_{a \in \mathcal{A}}$. Note that, as described before, AFC modules may be: i) A-AFC modules, ii) hardware-based D-AFC modules, and ii) software-based D-AFC modules. A-AFC modules (e.g., PLNC module) need more complex instantiation control as they spread over several physical nodes and involve configuration of input and output interfaces and pre/post-processing functions (Sec. IVA). Hardware-based D-AFC modules (e.g., internal/external FPGA modules within or attached to network elements) require SDN-based control of MTC data flows that will filter selected flows and direct them through the D-AFC module. Finally, the most flexible case of software-based D-AFC modules (e.g., software-based modules in virtual machines running over the virtualized hardware in network elements or external servers) is a library of AFC implementations where each atomic function from the library can be remotely instantiated via the NFV control. Overall, FP needs to know the list of available AFC resources in the entire NFC network in order to optimize the set of instantiated AFC modules.

\begin{figure}
\centering
\includegraphics[trim = 0mm 45mm 10mm 0mm, clip, width=3.2in]{Figure_7.pdf}
\caption{NFC layer modules within SDN/NFV architecture.}
\label{NFC-modules}
\end{figure}

In terms of realization, we use the standard proposal for NFV/SDN complementary coexistence \cite{Li2015} where the FP module can be implemented as an NFV architecture block called the NFV orchestrator. The TP module can be implemented as an SDN application. Besides communicating directly, both FP and TP modules, observed as SDN applications, approach the SDN control plane via the SDN northbound interface. Based on the FP/TP inputs, the SDN control plane will configure physical devices (network nodes) via the southbound interface. This NFV/SDN based control of Condense is illustrated in Fig.~{7}.

\section{Application Layer}

In this section, we present three examples of applications at the application layer of the Condense architecture: data recovery through network coding, minimizing population risk via a stochastic gradient method, and binary classification via neural networks\footnote{Strictly speaking, learning a neural network can be considered a special case of a stochastic gradient method (with a non-convex loss function). We present it here as a distinct subsection as we consider the implementation where the neural network weight parameters are distributed across the Condense network.}. The purpose of these examples is two-fold. First, they demonstrate that a wide range of applications can be handled via the Condense architecture. Second, they show that Condense is compatible with widely-adopted concepts in learning and communications, such as random linear network coding, stochastic gradient methods, and neural networks.

The three examples are also complementary from the perspective of the workload required by the FP module. With the first example (data recovery via network coding), the function of interest is decomposed into mutually uncoordinated atomic (random) linear functions, and hence no central intervention by the function controller is required, nor is the inter-AFC modules coordination needed as long as atomic functions are concerned. With the third example (binary classification via neural networks), the desired network-wide function is realized through a distributed coordination of the involved AFC modules. Finally, with the second example (minimizing population risk via a stochastic gradient method), the most generic case requires the intervention of the central FP module, in order that the desired network-wide function be decomposed and computed.

\subsection{Data recovery through network coding}

A special case of an application task with the Condense architecture is to deliver the \emph{raw data} to the data center of interest. This corresponds to a trivial, identity function over the input data as a goal of the overall network function computation. However, this is not achieved through simply forwarding the raw data to the data center, but through the usage of network coding. In other words, atomic functions are not identity functions but random linear combinations over the input data. While such solution may not reduce the total communication cost with respect to the conventional (forwarding) solution, this solution is significantly more flexible, robust and reliable, e.g.,~\cite{fragouli2006},~\cite{practicalNC}. As recently noted, it can be flexibly implemented within the context of network coded cloud storage \cite{RLNCcloud}.

We follow the standard presentation of linear network coding, e.g.,~\cite{fragoulibook}, adapting it to our setting. For ease of presentation, we assume here that graph $\mathcal G$ is a directed rooted tree. Therein, the destination node is the root of the tree. Suppose that each of the $N$ available MTC devices has a packet $\mathbf{x}_s$ consisting of $L$ symbols, each symbol belonging to a finite field~$\mathbb F$. We adopt the finite field framework as it is typical with network coding. The goal is to deliver the whole packet vector $\mathbf{x}=(\mathbf{x}_1,...,\mathbf{x}_N)$ to the data center (the destination node~$d$). With Condense, this is achieved as follows. Each atomic node~$a$ generates the message pair $\left( \mathbf{x}^{(a)}, \mathbf{c}^{(a)} \right)$ (to be sent to the parent node) based on the received messages from its child nodes $\left( \mathbf{x}^{(b)}, \mathbf{c}^{(b)} \right)$, where $b \in {\mathcal V}^{(a)}$, and we recall that $\mathcal{V}^{(a)}$ is the set of child nodes of node~$a$. As we will see, the quantity $\mathbf{x}^{(a)} \in {\mathbb F}^L$ is by construction a linear combination of the (subset of) MTC devices' packets $\mathbf{x}_s \in {\mathbb F}^L$, $s=1,...,N$. The quantity $\mathbf{c}^{(a)} = (c^{(a)}[1],...,c^{(a)}[N]) \in {\mathbb F}^N$ stacks the corresponding weighting (or coding) coefficients; that is:
     \begin{equation}
     \label{eqn-net-cod-1}
     \mathbf{x}^{(a)} = \sum_{s=1}^N c^{(a)}[s]\,\,\mathbf{x}_s.
     \end{equation}
Now, having received $\left( \mathbf{x}^{(b)}, \mathbf{c}^{(b)} \right)$, $b \in {\mathcal V}^{(a)}$, node $a$ computes $\mathbf{x}^{(a)}$ using random linear network coding approach. It first generates new random (local) coding coefficients ${e}^{(a)}[b] \in \mathbb F$, $b \in {\mathcal V}^{(a)}$, uniformly from $\mathbb F$, and independently of the received messages. Then, it forms $x^{(a)} $ as:
      %
      \[
     x^{(a)} = \sum_{b \in \mathcal{V}^{(a)}} e^{(a)}[b] \,\,\mathbf{x}^{(b)}.
     \]
Once $\mathbf{x}^{(a)}$ has been computed, node $a$ also has to compute the global coding coefficients $\mathbf{c}^{(a)}$ \emph{with respect to the MTC packets} $\mathbf{x}_s$, $s=1,...,N$, as per~\eqref{eqn-net-cod-1}. It can be shown that:
     \[
     c^{(a)}[s] = \sum_{b \in \mathcal{V}^{(a)}} e^{(a)}[b] \,\,c^{(b)}[s],\,s=1,...,N.
     \]
     %
For the end-leaf (MTC device) nodes~$s$, we clearly have that $c^{(s)}[s]=1,$ and $c^{(s)}[u] =0$, $u \neq s$.
Once the destination (root) node~$d$ receives all its incoming messages, it has available a random linear
combination of the MTC's packets $\mathbf{x}_1,...,\mathbf{x}_N$:
       %
       \[
       \mathbf{x}^{(d),1} = \sum_{s=1}^N c^{(d),1}[s]\,\,\mathbf{x}_s,
       \]
and the corresponding global coding coefficients vector~$\mathbf{c}^{(d),1} = \left( c^{(d),1}[1],...,c^{(d),1}[N] \right)$.        Afterwards, the whole process described above is repeated sequentially $N^\prime -1$ times,