# Mobility Support 5G Architecture with Real-Time Routing for Sustainable Smart Cities
## 3 The Proposed Architecture
It associates each medical node to the nearest medoid \(m_{i}\) and computes the cost function by determining the commutative distance in the forming of clusters. Afterward, it again selects a set of medoids \(m_{i}\) and re-performs the aforementioned process. If it gives a better cost value, the value is swapped with the new \(m_{i}\). Otherwise, the newly computed value is ignored. The nodes that are closest to the centroid with the highest channel bandwidth are selected as cluster heads. The proposed architecture exploits some gateway nodes in the proximity of computed clusters that act as intermediate points for data management and transmission to mobile sink. The gateway nodes advertise their identities (IDs) and location to the nearest clusters. As a result, the cluster heads located at the boundary of the gateway nodes respond with their ID and positioning information. Accordingly, gateway nodes store their initialization factors in the memory table. Unlike most of the existing work, the proposed architecture adopts a multi-hop transmission model from IoT nodes to gateways and from gateways to the mobile sink using maximum bandwidth \(Bd\) and minimum transmission load \(Tl\). Each node computes a score \(Sc\) for the determination of forwarding among neighbors and can be defined in Equation (1). \[Sc=max(Bd)+Min(Tl) \tag{1}\]  
In Equation (1), \(Bd\) is inversely proportional to the incoming data traffic \(T\) for a communication channel. This means that if the value of \(T\) is high, then the available bandwidth indicates low weightage, and vice versa, i.e., \(Bd\)\(\alpha\)\(\frac{1}{T}\). On the other hand, \(Tl\) is directly proportional to the number of data blocks \(d\) that are transmitted on the communication channel at a time \(t\). This means that the \(Tl\) weightage is high if the ratio of transmitting the data packets is high, i.e., \(Tl\)\(\alpha\)\(d\). To offer a protected 5G communication system against threats among mobile sink and application users, the proposed architecture offers a fault-tolerant and high data rate solution. To cope with security for privacy and authentication, the proposed architecture utilizes the Rabin cryptosystem [54], which is an asymmetric cryptography technique. It generates the pair of public-private keys and distributes securely among associated nodes, where a public key is used for data encryption and the private key is used for data decryption. The cryptography-based security system for the generation of a set of keys is deployed on the gateway nodes. After the key generation, the gateway nodes distribute them among IoT nodes and mobile sink. We consider the sink mobile and rotating across the boundary of gateway nodes to support the real-time data efficiency with minimum delay. Let us consider that \(x_{i}\) and \(x_{j}\) are two large prime numbers and \(Y\) is the product of both numbers, as given in Equation (2). \[Y\!\!=x_{i}.x_{j} \tag{2}\]  
where \(Y\) is a public key and the pair of \((x_{i},x_{j})\) is a private key. Afterward, the generated keys are concatenated with an MAC value by using the private key of gateway nodes; thus, the IoT nodes authenticate the incoming pair of public-private keys \(K\). The generated data from the nodes is encrypted by converting it to a number using reversible mapping such as \(m<n\). Then the encryption process takes place, as given in Equation (3). \[C\!\!=m^{2}\ mod\ n \tag{3}\]where \(C\) denotes ciphertext. In addition, the digital signature \(S^{\prime}\) is made on the ciphertext \(C\) using source key private key \(ki\) to attain the data authentication as given in Equation (4). \[S^{\prime}=S_{n,ki}(C),\ ki\ \varepsilon\ (x_{i},x_{j}) \tag{4}\]  
On receiving the ciphertext \(C\), the adjacent node performs the verification function \(\alpha\) for both the incoming data and digital signature \(S^{\prime}\), as given in Equation (5).