## 2 Research Methodology
### Redirection Algorithm  
Adaptive routing algorithms make decisions based on real-time information about the state of the network and servers, which means they can choose the optimal replica server at any given moment. However, this also means that adaptive algorithms require more bandwidth and computational resources to continuously monitor and exchange information about the state of the network and servers. On the other hand, non-adaptive routing algorithms do not consider the current state of the network and servers when making routing decisions. Instead, they use a predetermined set of rules or metrics to select  
Figure 2: Content Push Server protocols. a replica server. Non-adaptive algorithms are less complex and do not require real-time monitoring of network and server states, which means they consume less bandwidth and computational resources. The choice between adaptive and non-adaptive routing algorithms depends on the specific requirements of the system, such as the desired level of performance, scalability, and fault tolerance. In general, adaptive algorithms are better suited for systems that require high performance and scalability, while non-adaptive algorithms are more suitable for simple, low-resource systems or applications that are not highly sensitive to performance. In this work, an adaptive algorithm to select the optimal replica server is proposed based on modified CSA. The Cuckoo Search (CS) algorithm is considered as an efficient swarm-intelligence-based algorithm [31]. The mathematical model of the modified cuckoo search algorithm is explained as follows:  
Let f(X) be the objective function to be optimized, where Xi = (x1, x2,..., xn) represents the solution or position in the search space, and n is the dimensionality of the problem. Generate an initial population of cuckoo search algorithm with random positions X = (x1, x2,..., xn) within the defined search space. Evaluate the fitness of each cuckoo in the population using the objective function f(X). For each cuckoo, update its position X by performing a Levy flight, which is a random walk with a heavy-tailed distribution. The new position X\({}^{\prime}\) is given by:  
\[X^{\prime}=X+\text{Levy}(\lambda)*(X-X\text{best}) \tag{1}\]  
where Levy(\(\lambda\)) is a random number drawn from a Levy distribution with parameter \(\lambda\), Xbest is the position of the best cuckoo in the population, and \(*\) denotes element-wise multiplication [32; 33]. Our modification is based on many parameters of the testbed such as (Throughput, CPU usage, Memory consumption, QoS (delay, jitter, packet lost)). To be adaptively rout for an optimal edge server, some thresholds have been used to minimize the response time using CSA. First of all, we put a condition with a maximum throughput to retrieve all servers that is greater than 95%. Then, another condition has been made by minimizing CPU usage less than to 60%. Finally, we have taken into account the memory consumption by selecting those edge servers that have memory consumption of less than 40%. The modified pseudo code of CSA is written in Algorithm 1. ```
1:Objective function \(f(X)\), \(X\)= (\(f(x1,x2,\ldots,xd)^{T}\)
2:Generate initial population of n host nests Xi (i = 1, 2,..., n)
3:While t < Max iterations do
4: Get a cuckoo randomly by Levy flights
5: Evaluate its quality / fitness Fi
6: Choose a nest among n (say, j) randomly
7: If Fi > Fj then
8: Replace j by the new solution;
9: End If
10: Get (max_Throughput, min_cpu, min_memory)
11: If max_Throughput [i] > 95 then
12: max_Throughput [j] = max_Throughput [i]
13: Else If min_cpu [i] < 60 then
14: min_cpu [j] = min_cpu [i]
15: Else If min_memory [i] < 40
16: min_memory [j] = min_memory [i]
17: End If
18: Keep the best solutions
```  
**Algorithm 1** Modified Cuckoo Search Algorithm  
The general flowchart of the proposed adaptive video streaming system based on MCSA is presented in Figure 3. First, all input parameters are initialized in the virtual CDN Linux-based platform, such as the number of servers, routers, and clients.