Time-Dependent Performance of a Multi-Hop Software Deﬁned Network

: It has been recently observed that Software Deﬁned Networks (SDN) can change the paths of different connections in the network at a relatively frequent pace to improve the overall network performance, including delay and packet loss, or to respond to other needs such as security. These changes mean that a network that SDN controls will seldom operate in steady state; rather, the network may often be in transient mode, especially when the network is heavily loaded and path changes are critically important. Hence, we propose a transient analysis of such networks to better understand how frequent changes in paths and the switches’ workloads may affect multi-hop networks’ performance. Since conventional queueing models are difﬁcult to solve for transient behaviour and simulations take excessive computation time due to the need for statistical accuracy, we use a diffusion approximation to study a multi-hop network controlled by SDN. The results show that network optimization should consider the transient effects of SDN and that transients need to be included in the design of algorithms for SDN controllers that optimize network performance.


Introduction
Software defined networking (SDN) is a dynamic, adaptable, and manageable paradigm that facilitates innovations in computer networks [1], together with the prototyping and deployment of flexible routing mechanisms [2,3]. Traditional networking is based on manual configurations of distributed proprietary network devices, a cumbersome and errorprone process that can underutilize network resources [4]. SDN offers a programmable architecture where routing decisions are moved to centralized controllers. SDN data plane switches are simple forwarding devices that forward the data traffic depending on the controller's flow forwarding rules. Routing algorithms are implemented and communicated by each SDN controller to the SDN switches, which follow its instructions. Metrics such as hub count, delay, packet loss, bandwidth, jitter, and power consumption can be measured by SDN switches and sent to the controllers, which may use these metrics to determine the best routing paths and then install the flow forwarding rules in the data plane SDN switches. Indeed, the IoT [5] interacting Cloud Services [6] for the decision and control of the cyber-physical world create challenges for networks that achieve a better quality of service (QoS) and security and less energy consumption, and can exploit the opportunities offered by machine learning [7][8][9]. These challenges can be met by SDN networks [9,10], which offer greater flexibility and ease of implementation [2,11].
These developments suggest that SDN is likely to become the preferred networking approach not only in core networks because of the centralized network intelligence and management that it enables but also for sub-networks of IoT devices and edge devices with specific QoS needs that can benefit from SDN programmability and flexibility. Thus, distributed phases-e.g., Cox distributions or hyper-Erlang distributions; the state definition is extended to include the current phase. There are numerous tools-e.g., [42]-that can match a phase-type distribution to any empirical histogram. However, the initial number of states should be multiplied-in this case, by the number of phases. This substantially increases the number of equations to be solved numerically. The solution is usually obtained using an existing tool-e.g., [43,44]. We have applied this approach in modelling the transient states of an IP router, ref. [45]; to represent the service time distribution, we needed a hyper-Erlang distribution with three parallel Erlang distributions with 21, 1387, and 2 phases. This could be conducted in the case of a single queue, as we are able to solve systems of millions of equations numerically, but it is hard to use this approach in modelling a network of switches. The typical method is to use either fluid flow approximation [46] or diffusion approximation. The fluid flow approximation is much simpler, as it considers only the time-dependent mean values of flows, queues, and delays. However, its errors are much larger than those of diffusion approximation; see a comparison in [47]. On the other hand, discrete event simulations of transients require many hundreds of independent repetitions of simulation runs to achieve a sufficient statistical accuracy, making the computation times of such simulations prohibitive [48].
Thus, in this paper we extend the approach we developed in [49] to the time-dependent analysis of multiple SDN switches using diffusion approximations [50,51], which are very convenient to analyze in a time-dependent regime. The accuracy of diffusion approximations has been validated in industry-based research over many decades [52][53][54][55], including for patented techniques [26], and also validated in many academic papers [56][57][58]. Their advantage includes a more accurate representation of interarrival and service processes, the ease of obtaining delay predictions from traffic measurements, and much faster numerics for transients than discrete queueing models [59] or simulations. Thus, we compute the transient behaviour of each SDN switch after changes occur in its input traffic rate. Packet loss probabilities can also be computed even when they are "tiny" and impossible to estimate by conventional means. The analysis we undertake considers both single SDN switch and multiple interconnected SDN switches controlled by an SDN controller.
The rest of the article is organized as follows. Section 2 presents the queueing model of an SDN switch, justifies its simplifications, and introduces the diffusion approach's principles. In Section 2.1, we give a detailed steady-state diffusion model of a single queueing station representing the SDN switch, and in Section 2.2 we extend this to the transient-state model. Section 3 presents a numerical analysis of the model from Section 2.2. We choose various parameters of the traffic and determine a scenario for the traffic changes. The obtained results include queue distributions, mean queues, and loss probabilities at the switch as a function of time. Section 4 presents the network model; the network may have any number of switches and any topology. Section 5 studies the transient behaviour of a chosen network of several nodes. It also gives a simple example of how the model may predict queue evolution and minimize the total backlog at nodes during a time interval. Conclusions are given in Section 6.

Diffusion Model of an SDN Switch
Figure 1 describes the basic system architecture of an SDN switch proposed in [1]. Arriving packets are temporarily queued at the input buffers and are then removed by the Arbiter and placed scheduled into the Packet Buffer. A copy of the packet header is forwarded to the Parser. The Parser parses the packet header to extract the header fields and then creates a tuple with the extracted information and forwards it to the Flow Match Unit. In the Flow Match Unit, the tuple is matched against existing flow rules stored in Flow Tables' flow entries. The flow entries in the Flow Tables are maintained under the controller's guidance and are updated when the controller installs new flow rules. The Flow Match Unit determines whether the packet is associated with a known flow and hence a known path. In case of success, the packet is then forwarded via the backplane. In case of failure (no flow table entry matches the packet header), a packet-in message will be sent by the SDN switch to the corresponding SDN controller [60] to notify the controller about the absence of a flow rule for the packet. The packet-in message contains either the packet or the packet's ID. The controller decides the correct action for the packet and then installs appropriate data in the flow table of the switch so that packets belonging to that particular flow can be forwarded subsequently. If there is no corresponding response from the controller, the packet will be dropped. The delay that can be experienced by packets consists of the queueing delay in the input buffer, the service delay in the input buffer, and the delay at the output buffers. When the output ports' processing and line speeds are significantly greater than the Openflow processing time, which includes the time required to parse the packet, check the flow tables to find matching entries, and execute the flow rule actions, the switch can be represented by a single server queueing as in several recent papers [27][28][29][30][61][62][63]. Since the size of the input buffer is limited, we represent the SDN switch as a single server queueing model with finite capacity N. The packet interarrival times depend on the type of traffic, which the switch carries so that we allow for a generally distributed interarrival time distribution. The service time distribution will also be general to represent the manner in which the packets are handled in the entry buffer.
The flow table matching process involves searching the flow tables to find the entries containing corresponding action sets-i.e., flow rules that match the header of the packets of the input flows that pass through the Parser. If there is more than one flow table, the flow match process starts from the first flow table, searches all of its entries, and jumps to the next flow table. The search process continues till an entry that matches the packet header is found. Otherwise, a "packet-in" message is generated. For hardware switches whose flow tables are implemented using Ternary Content Addressable Memory (TCAM) modules, the flow match process can be performed within one clock cycle, with parallel access to all the entries of the flow table, resulting in a constant access time. Because of the limited TCAM flow table size and the power-hungry nature of TCAM in hardware switches, software-based switches are an attractive alternative. However, they are limited by a slow processing speed when flow tables are searched sequentially. A majority of previous papers model the matching time as an exponentially distributed random variable [27][28][29][61][62][63]. The use of a diffusion process allows us to model the flow matching process with a service time distribution that includes the flow tables' sequential search.
Denote by p the probability that the flow rule of the arriving packet is not installed. The switch knows it after the examination of all K entries stored in the Flow Match Uniti.e., time KT-where the examination of each entry requires time T. As a consequence, p is the probability that the service time is a constant KT, representing the case when all the flow entries in the table are examined without success, while with probability (1 − p) the packet's flow match is found in a time that is uniformly distributed in [T, KT]-i.e., on average in time (K + 1)T/2 and variance (K 2 − 1)T 2 /12. Sophisticated hardware means may also be designed to improve this performance but are not considered in this paper. To analyze this system, we use a continuous state space and continuous time diffusion process {X(t), t ≥ 0} to replace the discrete state-space buffer queue, where the increments dX(t) = X(t + dt) − X(t) are normally distributed, with mean βdt and variance αdt, which appear in the diffusion Equation (1).
Assuming an arrival rate λ and average service time µ −1 , the changes in a small time interval ∆T tend to a normal distribution with mean (λ − µ)∆T and variance (λ are the variances of the interarrival and service times, and C 2 A and C 2 B are the corresponding squared coefficients of variation. Therefore, for the diffusion process we have β = λ − µ and α = λC 2 . The buffer's size is limited to N packets, therefore the diffusion process resides in the interval [0, N], and we use a diffusion process with returns from the barriers at x = 0 and x = N to represent the jumps that occur when the buffer queue is empty and a packet arrives, and when the queue is full and a service occurs as in [65], leading to the equations: where f (x, t; x 0 ) is the probability density function (pdf) of the diffusion process; p 0 (t) and p N (t) are, respectively, the probabilities that the process is at the barrier at x = 0 or x = N at time t, corresponding to probabilities that the system is empty or saturated; and δ(x) is the Dirac delta function. The first of the above equations defines the pdf of the diffusion process with jumps from x = 0 to x = 1 (arrival of the first customer after the idle period) with intensity λ and from x = N to x = N − 1 (departure of a customer ending the saturation period) with intensity µ. The next two equations represent the probability balance of the barriers.

Steady-State Diffusion Model with General Interarrival and Service Processes
In steady state, when lim t→∞ p 0 (t) = p 0 , lim t→∞ p N (t) = p N , lim t→∞ f (x, t; x 0 ) = f (x), Equation (1) becomes an ordinary differential one and its solution, for = λ/µ, ρ < 1, can be expressed as [64]: where z = 2β α , and due to normalization: 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 = λ/µ-i.e., the utilization of the system-are presented in Figure 2. The next figure presents p N ( ), 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 φ(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( 2µx 0 α 2 ) placed at x = 2x 0 : The density function γ 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): This density should be normalized to include only the cases when the process ends at the barrier, which is certain for β < 0. Therefore: The first passage time of the diffusion process from the point x = x 0 to the barrier at x = 0 becomes: 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 length probability density function is f (x), the probability density function of the packet's queueing delay is:   The mean delay experienced by a packet whose flow rule is contained in the flow table will be the sum of the queueing delay and processing time. If the mean queueing delay is D q and the processing time is t p , then the mean packet delay at the switch D s is: However, if a flow entry for an arriving packet is not found, then the packet is encapsulated and sent to the controller, which determines the flow rules, installs the flow entry for the packet, and sends back the packet in the packet-out message. In that case, the delay experienced by the packet, D is the sum of the delay in the switch and the delay at the controller D c [27][28][29][61][62][63]: The modelling of the controller's working mechanism to determine D c is beyond the scope of this work and will be considered in future works, and in our numerical examples all the flows are known, i.e., p = 0.

Transient Diffusion Model with General Interarrival and Service Processes
We express the time-dependent solution f (x, t; x 0 ) of Equation (1) for the diffusion process having barriers with jumps with the use of the pdf φ(x, t; x 0 ) of another diffusion process which has absorbing barriers at x = 0 and x = N. There is no jumps, the process ends once it reaches any of the barriers. The density of such a process is known [66]: where: If the initial condition is not given by a single point x 0 but by a density ψ(ξ), ξ ∈ (0, N), lim ξ→0 ψ(ξ) = lim ξ→N ψ(ξ) = 0, then the pdf of the process with absorbing barriers has the form: The Laplace transform of φ(x, t; x 0 ) is with A(s) = β 2 + 2αs. The process with jumps from barriers is a sequence of processes started by jumps at x = 1 and x = N − 1, ending at the barriers, and then after a time spent there starting again due to jumps, therefore the pdf f (x, t; ψ) of the diffusion processs with jumps may be represented by functions φ(x, t; ψ) as follows: [51,67]: where g 1 (t) and g N (t) are the densities of jumps and are related to the pdfs l 0 (x), l N (x), the densities of sojourn times at x = 0 and x = N respectively, and to γ 0 (t) and γ N (t), the probability densities that at time t the process enters x = 0 or x = N, in the following way: where: and γ 1,0 (t), γ 1,N (t), γ N−1,0 (t), γ N−1,N (t) are the densities of the first passage time between corresponding points-e.g.,: For absorbing barriers: ∂φ(x,t;1) ∂x . The functions γ ψ,0 (t), γ ψ,N (t) are the pdfs of first passage time when the initial condition is given by the density ψ(ξ).
The process is in the barriers with probabilities The original off (x, s; ψ) is obtained via the numerical inversion of the solution (19); in the examples, below Stehfest's algorithm [68] was used.
Note that the above transient solution assumes constant diffusion parameters. In the case of time-dependent traffic, and therefore time-dependent diffusion parameters, we should apply it in short consecutive intervals of time where we may treat the parameters as constant.

Single SDN Switch Model
We use the above model to examine the behaviour of a single SDN switch. Assume the length of the packet buffer N = 100, T = 8 · 10 −7 s, K = 950, and p = 0-i.e., all connections have their entries in the Flow Match Unit; in consequence, the service time is uniformly distributed with the mean 1/µ = 0.038 msec and the squared coefficient of variation is C 2 B = 0.33. Figure 5 presents an example of the distribution of interarrival times between IP packets taken from CAIDA measurements; on this basis, we determined C 2 A = 1.02 for the input flow. Additionally, we considered the greater variability of interarrival times expressed by C 2 A = 4.08 and C 2 A = 8.16 to investigate its influence on the performance of the switch. The changes in the input rate λ during the considered interval of 1 s are plotted in Figures 6 and 7. Figure 8 displays an example of the probability density function in Equation (14) for a chosen moment t = 0.750 s. when the empty queue is empty at the beginning of the interval under consideration, i.e., x 0 = 0 at t = 0; it shows the impact of the interarrival time variability on the density function. It is worth to note the logarithmic scale of the plot and the possibility to determine by the model very small numerical values of the function. Figure 6 shows the changes in p N (t)-i.e., probability of packet loss due to the buffer congestion-following the input traffic pattern, and also as a function of the variability of interarrival times, defined by the squared coefficient of variation C 2 A . Again, even very small numerical values are given by the model, and the computations are stable. Figure 7

Transient Analysis of Multiple SDN Switches
Consider a network of M stations with an arbitrary topology with routing probabilities r ij (t). We follow the approach of [69] developed for the steady-state network model then adapted to transient analysis in [70]. Additionally, we introduce time-dependent routing to model an SDN network.
The first step to solve the network model is to decompose the network-i.e., to determine the input traffic parameters λ i , C 2 Ai at every station i and then apply the single server model of the previous section to each station separately.
In the transient state, we should distinguish at any station i the input traffic λ i−in (t) and the output traffic intensities λ i−out (t): which are different; p 0i (t) denotes the probability that the station i is idle at time t, i.e., the diffusion process related to this station is inside the barrier at x = 0. The term 1 − p 0i (t) = i (t) presents probability that the station i is busy and customers are leaving it with the rate µ i .
The traffic equations balancing the flows of stations are: where the first term λ 0i represents the traffic flows coming from the outside of the network directly to station i. The routing probabilities r ji (t) change each interval ∆ following the decisions of the controler, remaining constant inside the interval, and the flow parameters may change every interval δ < ∆; we assume ∆ = nδ, in numerical examples below n = 10. This way all model parameters are constant witin intervals δ when the solution (14) is computed.
Denote by f Aj (x, t) and f Bj (x, t) the density functions of the interarrival and service times distributions at station j at time t. The pdf f Dj (x, t) of the interdeparture times from this node at time t may be expressed as: where * denotes the convolution with respect to x. The first term of the right side in (22) represents the interdepature times of packets when the node j is working, and the second term gives the interdeparture times when it is idle. The formula (22), known as Burke's theorem [71], is exact for Poisson input (the pdf of the idle period distribution that should be used in the second term of (22) is the same as f Aj (x, t)) and approximate in other cases. From (22), we receive: where C 2 Dj (t), C 2 Bj (t), and C 2 Aj (t) are time-dependent square coefficients of the variation in interdeparture, service, and interarrival times, respectively. Packets leaving the node j according to the distribution f Dj (x, t) choose any node i with probability r ji (t) and the times between two packets routed from node j to i has pdf f ji (x, t) For example, a packet leaving station j goes to station i with probability r ji (t) or with probability 1 − r ji (t) it goes elswhere but the second packet goes to i with probability r ji (t), hence the gap has has pdf f Dj (x, t) * f Dj (x, t) with probability [1 − r ji (t)]r ji (t), etc., or, after Laplace transform: Then we compute the squared coefficient of variation: Hence: where the parameters λ 0i and C 2 0i refer to the flows coming to station i from outside of the network.
The parameters of the input flow at station i are given by (21) and (25). Equations (23) and (25) form a system of linear equations yielding C 2 Ai (t) and also the diffusion parameters β i (t), α i (t) for every node i. At each interval δ, the functions f i (x, t; ψ i ) providing the queue length distributions at every station i for t ∈ δ are computed. Their values at the end of the interval yield, among others, the current utilizations i used to determine the flow parameters and diffusion parameters for the next interval δ.
The pdf f Ri (x, t) of the time-dependant response time (waiting time plus service) is determined using the first passage time from the end of the queue to zero, as defined by Equation (18). If f Ri (x, t) is the response time pdf at node i, then the response time pdf f R (x, t) for the path 1, . . . , n of n stations is: Ri (x, s).
The loss probability p loss (t) for same entire path may be computed from: where p Ni (t) is the probability that the queue at station i is saturated at time t-i.e., the diffusion process for this station is at time t at the barrier x = N.

Network Model
Consider a network composed of four SDN switches, S1-S4; see Figure 9. Their parameters are the same as the switch in Example 1, except for the SDN switch S4, which is twice as fast. Therefore µ 1 = µ 2 = µ 3 = 2628.8 packets/sec while µ 4 = 5257.6 packets/s. At all the switches, the squared coefficient of variation of service time is identical to the value C 2 Bi = 0.33. Similarly to Example 1, the network's performance is investigated during 1 s. Host 1 is sending packet flows of intensity λ 01 to Host 2, and the traffic rate is changing in the range 500-2500 packets/sec, as shown in Figure 10. Host 4 generates traffic at rate λ 02 , as shown in Figure 10, which is forwarded to Host 2 via the SDN switches S2 and S4.
As in Example 1, the squared coefficient of variation of interarrival times in the flows λ 01 is C 2 A1 = C 2 01 = 1.02, or C 2 A1 = 4.08 or C 2 A1 = 8.16. The second input traffic λ 02 at S2 has only one parameter C 2 A2 = C 2 02 = 1.02. The SDN controller alters-if needed-the routing to balance the load of nodes every 100 msec; in this example, it refers to the routing probabilities r 12 and r 13 ; see Figure 11. Figures 12 and 13 illustrate the decomposition of the network model. They present the flows λ i (t) given by Equation (21) and the squared coefficients of variation C 2 Ai (t) received from Equations (23) and (25). The service times at the stations have relatively small squared coefficients of variation C 2 Bi = 0.33. Therefore, the important variability of the first flow entering the network is reduced at the network interior, as defined by Equation (23); see Figure 13.
The transient solution of diffusion equations is computed in intervals of the length δ = 10 msec-i.e., we have 100 intervals with fixed diffusion parameters; at the end of each δ, the Equations (21) and (25) are solved to determine the new parameters of flow for the single-station models in the next interval. The diffusion density function obtained for any station i at the end of an interval gives the initial conditions for the diffusion equation at the next one.
The curves in Figure 14 compare the loss probability (note here the minimal values computed by the model), and, in Figure 15, the mean queues for all four stations, in case of C 2 A1 = 1.04. We may observe the changes in mean queues in S2 and S3 due to load balancing after the second flow becomes active. Observing the mean queues at S1 and S2, we can see that the transient periods may be longer than the time between the controller's decisions. As noted earlier, the length of the transient time increases with a load of a station and the variability of the input flow. For greater variabilities of the first flow, the path S1 − S3 − S4 becomes saturated; see Figure 16. This happens due to saturation in S4, as shown in Figure 17. P N for S1 P N for S2 P N for S3 P N for S4 mean number of packets mean queue length for S1 mean queue length for S2 mean queue length for S3 mean queue length for S4  Let us also consider a simple example of optimization. Suppose, as previously, that station S1 is forwarding a flow λ 01 packets to nodes S2 and S3. Station S2 is additionally receiving from Host 4 a flow of λ (loc) 02 packets. The controller is changing routing every ∆ = 100 msec and needs to determine the routing probabilities for the nearest ∆, knowing the current parameters of flows at the beginning of the interval, as well as the current queue distributions at S1, S2, and S3 representing previous behaviour of the network. The goal is to minimize the mean backlog Ψ at S2 and S3 during ∆: min r 12 ,r 13 We compute E[N 2 (t)], E[N 3 (t)] for t ∈ ∆ and minimize Ψ by the choice of r 12 , r 13 = 1 − r 12 ; see Figure 18.

Conclusions
The advent of SDN allows the implementation of smart adaptive routing, which changes network paths so that new connections may be established and inactive may be removed, as well as to deal with changes in traffic loads and incidents that affect network security. This leads to an interesting paradigm shift in network modelling, which has traditionally addressed "long term" behaviours and computational methods which are appropriate for steady-state analysis. However, when SDN intervenes dynamically to change paths and traffic levels, the network is seldom at a steady state, and optimization must take transients into account.
Therefore in this paper we have used diffusion approximation modelling for the performance evaluation of a network of SDN switches, that considers both steady-state and transient analysis. We have shown how changes in routing or forwarding decisions by the SDN controller can influence performance parameters such as delay, queue size, and packet loss probability in the transient state. Our results indicate that this method is computationally operational and can provide useful quantitative results for models with realistic parameter values.
Our analysis captures the interactions among the main parameters of the network, and numerical examples display the dependence of the queue lengths, queueing delays and their dynamics as a function of the changing flow intensity and variance of interarrival times. Our approach also confirms that transient periods play a significant role in the performance of SDN networks, and that they will be useful to analyze much larger networks in future work.
While the performance evaluations performed in this paper are purely numerical, and based on diffusion approximations models that have been widely validated by simulations [47,67,72], in future work we intend to use network emulation tools such as Mininet with real traffic, as well as experiments on a SDN test-bed, to study the influence of time dependent forwarding decisions on the main performance metrics of large SDN networks.