# A Mechanism for Reliable Mobility Management for Internet of Things Using CoAP
## 2 Architecture and Procedure of Reliable Mobility Management
### Architecture for Reliable Mobility Management  
In Figure 1, we present the reliable mobility management architecture using CoAP-based Mobility Management Protocol (CoMP). The components of the architecture consist of a mobile constrained sensor node (mCSN), IoT Mobility Management Server (IMMS), and CoAP Web Client (CWC). The IMMS maintains the location information in the Mobility Management Table (MMT), which is necessary to perform mobility management, thereby managing the changed IP address of an mCSN. The CWC is a Web browser equipped with the CoAP protocol. The protocol stack of the mCSN consists of IEEE 802.15.4 Medium Access Control (MAC), IPv6 over Low Power Personal Area Network (6 LoWPAN), CoAP, and CoMP. A local binding cache (LBC) locally maintains the permanent IPaddress P_Adddr, temporary IP address T_Adddr, and Lifetime, which is retrieved by the edge router in the visited network by accessing the Dynamic Host Configuration Protocol (DHCP) server.  
In the following, we present the CoMP handover procedure, which consists of four procedures--registration, connection, binding, and hold--to provide the mobility management. The signaling messages of CoMP use the Confirmable (CON) message of CoAP. First, the mCSN and CWC register their own P_Addr and T_Adddr at the MMT of the IMMS by exchanging CoAP POST request/response messages. As the CWC attempts to establish a connection with the mCSN, the CWC sends a GET request message to the IMMS to retrieve the IP addresses of an mCSN. As a response, the CWC receives an Acknowledge (ACK) response message with the current T_Addr and its Lifetime, which are stored at the LBC of the mCSN. Then, the CWC stores the T_Addr and Lifetime in the LBC of the CWC. Afterwards, the CWC can exchange data with the mCSN directly.  
Now, let us consider the case where the mCSN moves from an old edge router (old-ER) to a new edge router (new-ER). As the mCSN moves away from the old-ER and enters into the network domain of the new-ER, it requires an IP handover operation. To accomplish this, the mCSN first detects the radio signal strength (RSS) from the access point or base station connected to the old-ER. As the RSS from the old-ER drops below a threshold value, the mCSN prepares the handover operation in advance.  
Before the mCSN performs the handover, it notifies the handover start operation by exchanging a Hold message with the IMMS. The Hold message uses the CoAP PUT request/response message with a Hold flag (H_Flag). H_Flag indicates that the mCSN is performing the handover procedure. The mCSN cannot receive the request of the CWC until H_Flag is set to \"0\" by the PUT request message for binding update. Thus, the usage of H_Flag can prevent packet loss during the handover operation of the mCSN. The PUT messages can also be used for status notification as the mCSN experiences a power failure or enters into the sleep mode.  
As the mCSN moves into the overlapped region of the two network domains which are covered by old-ER and new-ER, the mCSN attempts to acquire a new temporary IP address (i.e., T_Addr) from the new-ER through DHCP. Then, the mCSN sends a PUT request message for binding update to the IMMS. The message includes T_Addr, P_Addr, and the H_Flag, which is set to \"0\". As the IMMS receives the PUT request message, it sends it to the CWC by referring to MMT. As the IMMS and CWC receive the PUT request message for binding update, they update the T_Addr and H_Flag in the MMT and LBC. The IMMS and CWC can then retrieve the data from the mCSN in the new network domain. In this way, the CWC and the mCSN can exchange the data without packet loss during the handover  
Figure 1: Reliable mobility management architecture using Constrained Application Protocol (CoAP)-based Mobility Management Protocol CoMP.  
operation. The CoMP signaling messages are configured by extending the option delta and payload in the CoAP message format [17].