# A Mobility Management Using Follow-Me Cloud-Cloudlet in Fog-Computing-Based RANs for Smart Cities
## 4 Mobility Management Using Follow-Me Cloud-Cloudlet Approach
### Follow-Me Phase  
This phase mainly implements the cooperation of cloud-cloudlet \(CL_{s\to s}\). Let \(REQ\_message\)\((UE\_id,prefix_{s},prefix_{d},TIM)\) or simplified as \(REQ\_message\) is denoted as a data transmission request message, where \(UE\_id\) is UE's ID, \(prefix_{s}\) and \(prefix_{d}\) are UE's the prefix of the network address, and \(TIM\) is the traffic indication map to indicate the packet receiving status. Assumed that a data file is divided into \(n\) packets, \(F=\{p_{1},p_{2},\cdots,p_{n}\}\). \(TIM\) of \(REQ\_message\) is \(n\)-bit map, \(TIM=\{b_{1},b_{2},\cdots,b_{k},\cdots,b_{n}\}\), if \(b_{k}\) is equal to 1 then \(k\)-th packet is received by UE, and if \(b_{k}\) is equal to 0, then \(k\)-th packet is not received by UE, where \(1\leq k\leq n\). Before the handover event of UE, assume that \(c_{s}\) and \(l_{s}\) are the current serving cloud and cloudlet of the current serving F-RAN. Packets \(p_{s}\) from the CN in data center of \(c_{s}\) are transmitted or not, which is dependent on the \(TIM\) which is extracted from received \(REQ\_message(UE\_id,prefix_{s},TIM)\), to UE through F-AP\({}_{s}\). The \(REQ\_message(UE\_id,prefix_{s},TIM)\) message is initiated from UE and forward the \(REQ\_message\) through the serving LMA to the inter domain mobility database (IDMD). After IDMD receiving \(REQ\_message\), a registration operation is executed in IDMD to create an entry in IDMD table as \(UE\_information(UE\_id,prefix_{s},LMA_{s})\). The \(REQ\_message(UE\_id,prefix_{s},TIM)\) is forward to follow me cloud controller (FMCC). if \(F\)MCC receives the message, \(REQ\_message(UE\_id,prefix_{s},TIM)\) is also forward to to the serving data center (DC) of cloud \(c_{s}\). DC of \(c_{s}\) extracts \(TIM=\{b_{1},b_{2},\cdots,b_{k},\cdots,b_{n}\}\) from received \(REQ\_message\). DC examines \(TIM=\{b_{1},b_{2},\cdots,b_{k},\cdots,b_{n}\}\), if the value of \(b_{k}\) of \(TIM\_message\) is 0, then DC transmits \(k\)-packet toward \(UE\) through \(l_{s}\). \(UE\) also keeps a same \(TIM\_UE=\{b_{1},b_{2},\cdots,b_{k},\cdots,b_{n}\}\)  
Figure 6: Message flow diagrams of (**a**) PMIPv6-based FMC approach and (**b**) our proposed mobility management using FMCL approach. \(UE\) changes the value of \(b_{k}\) from 0 to 1 if \(UE\) receives \(k\)-th packet from the serving DC. Then, \(TIM=(\underbrace{1,1,\cdots,1}_{m}\underbrace{0,0,\cdots,0}_{n-m})\). The detailed procedure is given below. 1. \(UE\) initiates \(REQ\_message(UE\_id,prefix_{s},TIM)\), to F-AP, where \(TIM=\{b_{1},b_{2},\cdots,b_{k},\cdots,b_{n}\}\), and \(b_{k}\) =0, \(1\leq k\leq n\), \[TIM=(\underbrace{0,0,\cdots,0}_{n})\] (2)
2. The \(REQ\_message(UE\_id,prefix_{s},TIM)\) reaches to F-AP\({}_{s}\) of \(l_{s}\). The F-AP\({}_{s}\) checks if \(k\)-th packets is already existed in cache of F-AP\({}_{s}\), then update \(b_{k}\) of \(TIM\) accordingly, where \(1\leq k\leq n\). The updated \(TIM\) is re-inserted into the \(REQ\_message(UE\_id,prefix_{s}\), updated \(TIM\)), and then forward the new \(REQ\_message\) to IDMD and FMCC. 3. DC of \(c_{s}\) extracts \(TIM=\{b_{1},b_{2},\cdots,b_{k},\cdots,b_{n}\}\) from received \(REQ\_message\). Before the handover event, DC repeatedly examines \(TIM=\{b_{1},b_{2},\cdots,b_{k},\cdots,b_{n}\}\), if the value of \(b_{k}\), for \(1\leq k\leq n\), of \(TIM\_message\) is 0, then serving DC transmits \(k\)-packet toward \(UE\) through \(l_{s}\). \(UE\) also keeps \(TIM\_UE=\{b_{1},b_{2},\cdots,b_{k},\cdots,b_{n}\}\), and \(UE\) concurrently updates the value of \(b_{k}\) from 0 to 1 if \(UE\) successfully receives \(k\)-th packet. 4. If the handover decision of UE is made by switching from F-AP\({}_{s}\) to F-AP\({}_{d}\), then go to the _follow-me cloudlet_ phase. Then, \(TIM=(\underbrace{1,1,\cdots,1}_{m}\underbrace{0,0,\cdots,0}_{n-m})\). As shown in Figure 7, \(UE\) sends out \(REQ\_message(UE\_id,prefix_{1},TIM)\) with \(TIM=(0,0,1,0,0,0,0,0,0)\) updated by F\({}_{1}\) through IDMD to FMCC, because that 3-th packet existed is in cache of \(l_{1}\).