## 3 Mobility Management Architecture Using CoAP
### Mobility Management Procedure of CoMP  
Figure 4 shows the detailed mobility management procedure for IP mobility management. The CoMP consists of four procedures, _i.e._, registration, discovery, binding, and notification, to provide mobility management for a moving CoAP node. The operation of CoMP is described in detail below. First, in Figure 4, both the CoAP client and CoAP node send the POST request message for registration to the MMS in order to register their own P_Addr and Lifetime in the MMT of the MMS. As the CoAP client attempts to communicate with the CoAP node, the CoAP client sends a GET request message to the MMS for discovery. This message includes the CoAP client's destination IP address. In response, the CoAP client receives the current T_Addr for the CoAP node and its Lifetime in the ACK response message for discovery. Then, the CoAP client stores the T_Addr and Lifetime for the CoAP node in the LBC. Subsequently, the CoAP client can exchange data with the CoAP node directly until the Lifetime of T_Addr expires. Next, let us consider the case in which the CoAP node moves from the old base station (BS) such as router, access router to the new BS of the new WSN. As the CoAP node moves away from the old WSN BS and enters the network domain of the new BS, it requires the IP handover operation (as illustrated in Figure 4). In order to perform the handover operation, the CoAP node first detects the radio signal strength (RSS) from the old ER at the link layer. When the RSS from the old BS drops below a certain threshold value, the CoAP node prepares the handover operation. In order to prevent packet loss during the handover operation, the CoAP node notifies the CoAP client of its status--_i.e._, handover mode--by sending a PUT request message to withhold access requests from the WMMS. The WMMS then updates the H_Flag of the CoAP node in the MMT to \"1.\" It also forwards the PUT request message so that requests from the CoAP Client are withheld. In response, the CoAP client likewise updates the H_Flag in its LBC to \"1.\" Because the H_Flag of a CoAP node indicates that the node is performing a handover operation--and consequently cannot be accessed. During a handover, the CoAP node resides in the overlapped region of two network domains: the old BS and the new BS. The CoAP node detects the movement of a CoAP node through the Router Advertisement (RA) and Router Solicitation (RS) messages. As soon as it detects the new BS network  
Figure 3: LBC schema. domain, the CoAP node attempts to secure a new temporary IP address--_i.e._, T_Addr from the new ER--by using Neighbor Solicitation and Neighbor Advertisement. After receiving a new T_Addr, the CoAP node notifies both the MMS and the Web client of its new T_Addr by using a PUT request message for a binding update. It also changes the H_Flag in its LBC and the MMT of the WMMS. The PUT request message for the binding update includes the P_Addr and T_Addr of the CoAP node, and the H_Flag status. After receiving the binding update message from the CoAP node, the CoAP client changes the H_Flag for the CoAP node to \"0.\" Finally, the CoAP client can retrieve the sensing data from the CoAP node. As a result, the CoAP client and the CoAP node can exchange data without packet loss during the handover. As previously described in Section 1, a CoAP node may be in sleep mode operation. In sleep mode, a CoAP node may not send or receive the data. The CoAP node can wake up when it receives the beacon message from the WSN BS. Without being notified of the sleep mode of CoAP node, a CoAP client which tries to get a CoAP node in sleep mode, may retry to connect to the CoAP node in sleep mode, continuously. This may result to a large traffic overhead in WoT environment. Furthermore, if the CoAP node in active operation abruptly falls into the sleep mode due to the power shortage, the ongoing connection may be disrupted, and large packet loss may occur.