# Bindings and RESTlets: A Novel Set of CoAP-Based Application Enablers to Build IoT Applications
## 6 Implementation and Evaluation
### Packet Size
#### 6.4.2 Performance Evaluation of RESTIet
The new packet generation time, \(T_{NPG}\), for the RESTlet case was also found to be 14 ms. In order to see the difference in terms of processing time, we used the following simplified formula by using the aforementioned values as an average:  
For No-RESTlet case (for \(n\) number of data generating nodes): \(T_{p}=6 ms\ \times\ n+TD+(TF_{i}\ \times n)\)  
For RESTlet case (for \(n\) number of data generating nodes): \(T_{p}=22 ms\ \times\ n+TD+14 ms+\ TF_{i}\)  
This enables us to calculate the resulted packet processing them for a varying number of data generating nodes (1, 2, 3, 4 and 5). Figure 19 depicts the result in graphs for both approaches using different \(TF_{i}\) values. Figure 19 shows that when the number of data generating nodes becomes more than one, the delay introduced by processing incoming packets by RESTlets becomes less important. For congested networks, which are characterized by larger \(TF_{i}\) values, the advantage will become more pronounced. This is due to the fact that the RESTlets only generate a single packet after processing (or no packet at all depending on the type of processing) whereas the No-RESTlet case blindly forwards all the packets it receives which will be subject to large forwarding times. B. End to End Latency with Multiple Data Nodes (Impact of Number of Nodes)  
In the previous sub-section we mathematically showed that the reduced number of packets that results from the aggregation process by RESTlets compensates for the processing delay introduced by the RESTlets and result in better latency. To prove this concept, we measured the actual end-to-end  
Figure 19: Packet Processing and Forwarding time at RESTlet Node for Various Number of Data Generating Nodes. delay from data generating nodes all the way to the border router. We used the topology shown in Figure 18 (above). The data nodes generate data every five seconds that will go to the border router. In the RESTIet case, all data is sent to the RESTIet node (RN) which processes the data and generates a new packet destined to the border router. The new packet is generated either upon arrival of data from all data nodes or within five seconds interval, depending on which condition is met first. The end-to-end latency is calculated as the difference between the data generation time of the first node and the arrival of the new packet at the border router. On the other hand, for the No-RESTIet case, all data is sent directly to the border router by traversing the RESTIet node as a router. In this case, the end-to-end latency is computed by taking the difference between the data generation time of the first data node and the arrival time of the last data packet at the border router. We run the tests by sending the packets as CONfirmable and NON-confirmable requests. Figure 20 shows the results. For both CON and NON transactions, the RESTIet case results in a reduced latency compared to the No-RESTIet case. The difference is significantly higher for the confirmable case when the number of data nodes is higher. In the no-RESTIet case, all data packets are forwarded to the border router which is expected to produce ACKs for all. This results in an increased load on the border router and hence increased latency. Even if the processing is done by an external more powerful device such as the gateway, still all requests, acknowledgements and responses have to go through the border router and contribute to the increased overall latency of the NON-RESTIet case. In the experiments we conducted, we made two interesting observations. When the transaction is CON, there were a number of duplicate packets and out of order arrivals especially when the data nodes are more than three. This is much more visible for the NO-RESTIet case where, out of 75 packets sent, there were 28 duplicate packets while for the RESTIet case there were only 13 duplicates when the number of data generating nodes is five. The other observation is the difference in packet loss between NON and CON transactions.