# Anchor-Based Method for Inter-Domain Mobility Management in Software-Defined Networking
## 4 Proposed Methodology
### The RI-SDN Method  
#### 4.2.1 Algorithm Description  
The algorithm of the RI-SDN method can be summarized in two stages: the first stage involves selecting the anchor domain, which is followed by the stage of suitable route selection.  
The first stage, which aims to select the anchor domain, is summarized as illustrated in Figure 1. This stage consists of the following steps.  
* **Step 1**: After initializing the network graph, the adjacency matrix is determined. The adjacency matrix is a table representing connections between different nodes of the network. For each pair of nodes, the matrix contains a value of 1 if a direct link exists between them, or 0 otherwise. This matrix is used to determine the set of most connected nodes, \(SMC\). In the matrix, the row or column with the most 1s corresponds to the most connected node (that represent a domain).
* **Step 2**: If \(SMC\) is a singleton, then go to step 3. Otherwise, go to step 4.
* **Step 3**: If there does not exist a domain between the most connected domain and the destination domain, then the most connected domain is taken as the anchor domain. If there exists a single domain between the most connected domain and the destination domain, then this single domain is taken as the anchor domain. Otherwise, go to step 5.
* **Step 4**: For each domain \(d\in SMC\), compute the distance between \(d\) and the destination domain. The domain \(d\) with the smallest distance to the destination domain is considered the most connected domain. Go back to step 3.
* **Step 5**: Determine the set of domains closest to the destination, \(SCD\). If this set is a singleton, then the closest domain is taken as the anchor domain. Otherwise, a domain d belonging to SMC(SCD) is taken as the anchor domain. SMC(SCD) means the set of most connected domains among the domains belonging to SCD.  
The next stage of the RI-SDN method is based on the output of the first stage (i.e., the anchor domain selected) and aims to determine the data transfer path (also called the route) during inter-domain mobility. The next stage is summarized as shown in Figure 2. This stage consists in the following steps.  
* **Step 1**: Determine RMA, the set of routes that pass through the mobility anchor MA.
* **Step 2**: If RMA is empty, then go to step 3. Otherwise, go to step 4.
* **Step 3**: Use the default route suggested by the controller for communication between the mobile node (MN) and its correspondent node (CN).
* **Step 4**: For each route \(r_{k}\in RMA\), determine the smallest bandwidth \(B_{k}\) and compare to \(B_{s}\) (service's bandwidth). This is because the minimum bandwidth \(B_{k}\) of a route \(r_{k}\) is the smallest bandwidth of the links in the route \(r_{k}\). If \(B_{k}<B_{s}\), then add \(r_{k}\) to \(RMA(Sup)\) and go to step 5, with \(RMA(Sup)\) being the set of routes \(r_{k}\) that have a bandwidth link higher than \(B_{s}\). Otherwise, add \(r_{k}\)\(RMA(inf)\), with \(RMA(inf)\) being the set of routes \(r_{k}\) that have a bandwidth link lower than \(B_{s}\), and go back to step 3 if \(RMA(Sup)\) is empty.
* **Step 5**: For each route \(r_{k}\in RMA(Sup)\), compute \(M_{k}\) according to Equation (8).
* **Step 6**: Determine SRK, which is the set of routes having the smallest value of \(M_{k}\). If SRK is a singleton, route \(r_{k}\) in SRK is selected as the suitable route. Otherwise go to step 7.
* **Step 7**: We take route \(r_{k}\), where the sum of the bandwidth over each link is the smallest, with links having minimum bandwidths greater than the one required to ensure a quality-of-service service \(B_{s}\), in order to avoid bandwidth wastage.  
Figure 1: Algorithm for anchor domain selection.