| Applicable Versions | NetSim Standard | NetSim Pro |
| Applicable Release | V13.1 |
TABLE OF CONTENTS
VANET refers to the group of vehicles that are interlinked to one another through a wireless network. Along with technology, comes the threats. Like other wireless networks, VANETs also are vulnerable to various security threats. one small security breach can cause big damage in the case of VANETs as in this case human lives are involved. Intrusion Detection Systems (IDS) are employed in VANETs to detect and identify any malicious activity in the network. The IDS works by analyzing the network and detecting any intrusions tried or made in the network so that proper steps could be taken timely to prevent damage from such activities.

The following steps show how a user can run the IDS in NetSim to detect a malicious node and then set up a new route to the destination to avoid the malicious node.
Pathrater.c
This file contains code for avoiding the malicious node and finding a new route (once the IDS detects the malicious node) in networks running DSR in Layer 3. Note that this system would work only for UDP and not for TCP since TCP involves receiving acks from the destination.
If _NETSIM_PATHRATER_ is defined, the code is used to validate routes. When the Node is a Malicious Node, and a Route Reply is processed, the Function verifies the route reply in the route cache and checks for the blacklisted node. i.e., malicious node. When a malicious node is found that route entry is deleted from the cache.
Watchdog.c
This file contains code for the IDS and is added in IEEE802_11 operating in Layer 2.
If _NETSIM_WATCHDOG_ is defined, a watchdog timer starts the moment a packet is sent. Once a packet is forwarded to the next-hop node, the current node checks for watchdog timer duration if the packet is getting forwarded further on to the destination node or not.
The malicious node does not forward packets that it receives. The watchdog timer in the node (which forwarded the packet to the malicious node) expires. A counter is present which measures the number of times the watchdog timer expires (in other words the number of packets sent out but not forwarded by the next-hop node). Once this counter’s value reaches the failure threshold the next hope is marked by the current node as a malicious node.


NetSim Scenario

4. Application Properties
Application Properties | |
| Application type | CBR |
Source Id | 2 |
Destination Id | 1 |
Transport Protocol | UDP |
5. Enable Packet trace in NetSim GUI.
6. Run Simulation for 300 seconds.






Useful webpages
1. NetSim documentation: https://tetcos.com/netsim-documentation.html
2. NetSim VANETs overview: https://tetcos.com/vanets.html