# Mobility Support 5G Architecture with Real-Time Routing for Sustainable Smart Cities
## 3 The Proposed Architecture
\[\alpha=D_{ki}\big{(}m^{\prime},\ S^{\prime}\big{)},\ ki\ \varepsilon\ Y\ \text{and}\ m^{\prime}=h(m) \tag{5}\]  
Consequently, the IoT data is transmitted towards gateway nodes for aggregation and further processing in a multi-hop paradigm. In the proposed architecture, the deployed gateway nodes are interconnected with the mobile sink, which explicitly improves the high data rate for the delivery of sensitive information to storage centers. In addition, it offers a security scheme among mobile sink and storage centers in terms of privacy and integrity. In this stage, the sink node establishes a separate session with a storage center using the secret key \(K_{i}\) based on the additive congruential method [55], as given in Equation (6). \[K_{i+1}=K_{i}+c\ mod\ m \tag{6}\]  
where \(K\) is a sequence of pseudo-random numbers, \(m\) is modulus and should be \(>0\), and \(c\) is incremental value \(0\leq m\). The sink node integrates the incoming fixed-length IoT data and performs Exclusive-OR cipher \(C_{i}\) for their transmission, as given in Equation (7). \[C_{i}=(D_{i}+D_{i+1}+\cdots+D_{n})\oplus K_{i}+S^{\prime} \tag{7}\]  
Upon receipt in the medical center, first the incoming \(C_{i}\) is decomposed and the hash function \(S^{\prime}\) is verified using the public key of the mobile sink. If successful, then it performs the decryption function using the same session key \(K_{i}\) and obtains the network data. Figure 2 presents the flow chart of the proposed architecture. The flow chart was created to identify the various activities in transmitting the data of smart cities and increase sustainability against unpredictable conditions and risks. When data are gathered from the IoT network, the proposed architecture first groups the nodes using medoids and selects the most competent nodes for data forwarders. The cost of the medoid is also recomputed until the optimal value is obtained. The data forwarders are tagged as cluster heads for the established group. Tagged nodes are registered with the nearest gateway nodes to minimize the routing cost and improve response time. The mobile sink circulates in the proximity of the gateway nodes and interacts with application users directly. The gateway nodes perform the intermediate role between the IoT network and the mobile sink node. In case of any risk identification, it copes with a lightweight cryptosystem and reduces the chances of data insecurity during attacks. Moreover, the mobile sink establishes direct session dialogue with application users and upon verification of access control, the network data are forwarded. The proposed architecture supports application users in receiving the network data and offers a sustainable solution for emergency and real-time tasks. Figure 3 shows the message flow of the proposed architecture to achieve a sustainable solution. At the beginning of the connection, the IoT nodes are registered by advertising their attributes and establishing routing tables. On this point, the values of the IoT nodes are advertised on specific conditions instead of preset intervals. Afterward, the data analysis is performed and a set of medoids is determined, and nodes are grouped in clusters using the nearest distance to the medoid. Next, nodes are tagged as cluster heads that are closest to the centroid. However, if more than one node is close to the centroid then the second option of resuming the battery power of the node is incorporated into the decision. The messages flow ends at this point to group the IoT nodes. To forward the collected data from smart cities, all the tagged cluster heads are registered with the gateway nodes. Upon successful registration, they receive a verification message from gateway nodes to send their data. Moreover, the gateway nodes analyze the security risks among incoming packets and  
upon identifying any threat, take appropriate security actions to eliminate the threat in the communication channels between the nodes and sink node.