# Time-Dependent Performance of a Multi-Hop Software Defined Network
## 2 Diffusion Model of an SDN Switch
### Steady-State Diffusion Model with General Interarrival and Service Processes  
In steady state, when \(\lim_{t\to\infty}p_{0}(t)=p_{0}\), \(\lim_{t\to\infty}p_{N}(t)=p_{N}\), \(\lim_{t\to\infty}f(x,t;x_{0})=f(x)\), Equation (1) becomes an ordinary differential one and its solution, for \(\varrho=\lambda/\mu\), \(\rho<1\), can be expressed as [64]:  
\[f(x)=\left\{ \begin{array}{lcl}\frac{\lambda p_{0}}{-\beta}(1-e^{zx})&\quad \text{for}&0<x\leq 1\,\\ \frac{\lambda p_{0}}{-\beta}(e^{-z}-1)e^{zx}&\quad\text{for}&1\leq x\leq N-1 \,\\ \frac{\mu p_{N}}{-\beta}(e^{z(x-N)}-1)&\quad\text{for}&N-1\leq x<N\,\end{array} \right. \tag{2}\]  
where \(z=\frac{2\beta}{a}\), and due to normalization:  
\[p_{0} = \{1+\varrho e^{z(N-1)}+\frac{\varrho}{1-\varrho}[1-e^{z(N-1)}]\} ^{-1}\, \tag{3}\] \[p_{N} = \varrho p_{0}e^{z(N-1)}\.\]  
In this way, \(f(n)\), given by Equations (2) and (4), approximates the steady-state distribution \(p(n)\) in the Packet Buffer queue. A few examples of the curve \(f(x)\) depending on \(\varrho=\lambda/\mu\)--i.e., the utilization of the system--are presented in Figure 2. The next figure presents \(p_{N}(\varrho)\), which is the loss probability due to the buffer overflow. The steady-state queueing delay can be modelled by the time it takes the diffusion process to drift from the point \(x=x_{0}\), corresponding to the queue length at the moment of the packet arrival, to \(x=0\) when the packet is already on the head of the queue (its distance to the transmitter is equal to zero), and is removed to be forwarded. The density of the diffusion process \(f(x)\) given by Equation (2) determines the queue distribution and, at the same time, the density of the initial point \(x_{0}\) at Equation (8). The density \(\phi(x,t;x_{0})\) of the diffusion process starting at \(x_{0}\) and ending at the absorbing barrier at the origin is given in [66]. The method of images, usually applied to heat conduction problems, is used. We may imagine the barrier as a mirror with an image source placed at \(x=2x_{0}\), and the solution is a superposition of a source of unit strength, placed at the origin and a source of strength \(-\exp(\frac{2\mu x_{0}}{\alpha^{2}})\) placed at \(x=2x_{0}\):  
\[\phi(x,t;x_{0})=\frac{e^{\frac{\beta}{\alpha}(x-x_{0})-\frac{\beta^{2}}{2 \alpha}t}}{\sqrt{2\beta\alpha t}}\left[e^{-\frac{(x-x_{0})^{2}}{2\alpha}}-e^{ -\frac{(x+x_{0})^{2}}{2\alpha t}}\right]. \tag{4}\]  
The density function \(\gamma_{x_{0},0}(t)\) of the first passage time from \(x=x_{0}\) to \(x=0\), i.e., probability density that the process enters the barrier at time \(t\), is equal to the probability density that the process is leaving the diffusion interval (\(x>0\)):  
\[\gamma_{x_{0},0}(t) = \frac{\partial}{\partial t}\int_{0+}^{\infty}\phi(s,t;x_{0})dx= \lim_{x\to 0}[\frac{\alpha}{2}\frac{\partial}{\partial x}\phi(x,t;x_{0})- \beta\phi(x,t;x_{0})]=\frac{x_{0}}{\sqrt{2\Pi\alpha t^{3}}}e^{-\frac{(x_{0}+ \beta)^{2}}{2\alpha t}}. \tag{5}\]  
This density should be normalized to include only the cases when the process ends at the barrier, which is certain for \(\beta<0\). Therefore:  
\[\int_{0}^{\infty}\gamma_{x_{0},0}(t)dt=e^{\frac{2\eta\beta}{\alpha}}. \tag{6}\]  
The first passage time of the diffusion process from the point \(x=x_{0}\) to the barrier at \(x=0\) becomes:  
\[\gamma_{x_{0},0}(t)=\frac{x_{0}}{\sqrt{2\Pi\alpha t^{3}}}e^{-\left[\frac{2\eta \beta}{\alpha}+\frac{(x_{0}-\beta)^{2}}{2\alpha t^{3}}\right]}. \tag{7}\]  
Suppose that a newly arrived packet joins the queue when the switch already contains \(x\) packets. Assuming the first-in-first-out service, the packet will be forwarded out from the switch after all the packets that arrived earlier have been forwarded, so that if the queue  
Figure 2: Steady-state pdf \(f(x)\) of the diffusion process as an approximation of the queue distribution: illustration of the solution in Equation (2).