## 4 Simulations and Results
### Results and Discussions  
In this subsection, the overall performance of our proposed system is given. The execution cost and transaction cost are measured in terms of _gas_. Any action performed in an Ethereum environment is considered a transaction. For each transaction, pre-defined amount of gas consumption is charged. The pre-defined gas consumption amount is mentioned in Ethereum yellow paper [28]. 1 gas unit = 4 gwei (1 Ether = 1000,000,000 gwei)  
In Figure 3, we calculate the total gas consumption based on two different consensus mechanisms. Two smart contracts are designed for the proposed system. One contract is of IPFS and the other is of VN. From the experimental analysis, we conclude that the PoA consensus mechanism is more efficient than PoW, in terms of gas consumption. In PoW, all miners participate in the complex mathematical puzzle-solving process, which requires a large execution time as well as excess resource consumption. From the simulation results, it is shown that PoA is efficient for resource constraint devices. In Figure 4, gas consumption of main functions of IPFS is presented. It is observed that function _Add Data_ consumes more gas than other functions and it depends on the size of the file to be uploaded and the network conditions. Once the data are uploaded, the gas consumption is not too much high, which shows the effectiveness of the system. IPFS is used as a secure data storing and sharing  
Figure 3: Smart Contracts Deployment Cost. mechanism, which supports data integrity. We proposed modular contract based system in which impact of attacks is minimum. In Figure 5, gas consumption of different phases of IPFS, which are: _Return Hash_, _Set Access Rights_, _Set Recipient_ and _Set Blacklist_ is presented. From the simulation results, we conclude that gas consumption of these functions is not very high. Our proposed system is efficient and flexible for resource limited devices. In Figure 6, the transaction cost and execution cost of main functions of VN smart contract are given in terms of _gas_. Four functions are performed in VN, which are: _deployment cost_, _register vehicle_, _service request_ and _service response_. The difference between both cost is observed because execution cost is always less than the transaction cost. The reason is execution cost is the cost of executing only a certain function. Whereas, transaction cost involves both the contract deployment cost and the function execution cost. In Figure 7, the execution cost and the transaction cost of different phases of VN smart contract are presented, in terms of gas. These phases are: _assigning unique crypto ID, incorporation of cache memory in edge vehicles_ and _trust management among edge vehicles and ordinary vehicles_. From the results, we conclude that the trust management function consumes more gas as compared to other phases. Moreover, incorporation of cache memory optimizes the gas consumption. From gas consumption, we conclude that there is a smooth difference between gas consumptions of different phases. In Figure 8, comparison between different hashing algorithms is presented. With respect to our proposed system, keccak256 is efficient in terms of resource consumption. By using keccak256, resource consumption of proposed system is optimized and integrity of the system is achieved. Figure 6: Gas Consumption for VN Functions. Figure 7: Gas Consumption for VN Smart Contract. In Figure 9, system performance is evaluated using cache server and without using cache server. Cache servers are placed in edge vehicle nodes. When ordinary vehicles request for sensory information from edge vehicles, they check their cache memory for required service and give response. From the simulation results, we conclude that with the involvement of cache server, both the gas consumption and the execution time of the system are optimized and vice versa. With cache memory, both the communication time and the service charges are also minimized. In Figure 10, comparison between different cryptographic mechanisms is performed.