## 5 Proposed System
### Dynamic Broker Selection  
The QoS requirement for selecting the dynamic broker is based on the QoS metrics. Here, we will discuss what needs to be considered when selecting a dynamic broker and routing path. Algorithm 1 will describe the selection of the broker based on the QoS metrics. Some of the QoS metrics are described as follows.  
Availability is the occurrence of services to a node; it is the absence of service downtime and is associated with time to repair, which is the time it takes to repair the failed services. It is the probability of assessing the services for a particular node. The availability of services can be represented as  
\[Availability\ (A)=\frac{No.\ of\ services\ responded}{Total\ no.\ of\ services} \tag{1}\]  
\(\bullet\) _Data Packet Delivery Rate_  
The data packet delivery rate is calculated by dividing the total number of services received by the service provider by the total number of benefits that originated in the network. The data packet delivery rate can be expressed as  
\[Data\ Delivery\ (DD)=\frac{No.of\ services\ received}{Total\ no.of\ services\ originated} \tag{2}\]  
\(\bullet\) _Data Packet Loss Rate_  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{2}{*}{**P. Name**} & \multirow{2}{*}{**Node ID**} & \multicolumn{6}{c}{**Services**} & \multicolumn{6}{c}{**QoS Metrics**} \\ \cline{3-10}  & & **S1** & **S2** & **S3** & **S4** & **S5** & **S6** & **Cost** & **A** & **T(s)** \\ \hline SP1 & 10.10.1.1 & \(\surd\) & & & \(\surd\) & & \(\surd\) & 245 & 0.90 & 0.5 \\ SP2 & 10.10.12.2 & & & & \(\surd\) & & 754 & 0.87 & 0.9  
The data packet loss rate is calculated by dividing the total number of services transmitted by the service requester by the total number of services received by the service provider in a network. The data packet loss ratio can be calculated as  
\[Data\ Loss\ (DL)=\frac{\textit{services transmitted by requester}}{\textit{ services received by provider}} \tag{3}\]  
* _Comparative Mobility_  
Comparative mobility can be calculated by the node that exists in the network for a longer time and remains static with its own neighbor node. The node with lesser node mobility is considered to act as a broker. The mobility of the particular node \(n\) at time \(t\) is given by  
\[M_{n}^{t}\ =\frac{N_{t}}{N_{t-1}} \tag{4}\]  
where \(N\) is the neighbor set of nodes for '\(n\)', \(N_{t}\) is the neighbor set of node \(n\) at time \(t-1\), and \(N_{t-1}\) is the neighbor set of node \(n\) at time \(t\) but not in time \(t-1\). The comparative mobility for '\(s\)' time is given as  
\[C_{n}^{t}=\frac{1}{s}\ \sum_{k=t-n}^{t}M_{n}^{t} \tag{5}\]
* _Energy_  
Energy can be calculated by the physical battery life of a node to hold the services.
* _Network Load Balancing_  
The network load balancing can be calculated by dividing the total number of service messages transmitted for routing by the total number of services received by the node. Network load balancing is expressed as  
\[Load\ Balancing\ (LB)=\frac{\textit{total number of service messages transmitted}}{\textit{total number of service messages received}} \tag{6}\]
* _Delay_  
Delay is when the service travels from the service-requester node to the service-provider node across the prescribed channel. Delay can be calculated by  
\[delay(d)=\big{(}d_{propagation}+d_{transmission}+d_{processing}\big{)}. \tag{7}\]
* _Throughput_  
Troughput is defined as the number of service requests served successfully for a given amount of time period over the prescribed channel. Throughput can be calculated by  
\[Throughput\ (T)=\frac{No.of\ service\ request}{\textit{Communication Channel}} \tag{8}\]
* _Node Memory Capacity_  
Node memory capacity indicates the amount of data storage available for a node to store service descriptions.  
The overall total weight of a node can be calculated by  
\[\begin{array}{c}Wt=(W1\ *\ A+W2\ *\ DD+W3\ *\ DL+W4\ *\ M+W5\ *\ LB+W6\ *\ d\\ \