Animesh Kumar (230907478) & Prakhar Bhagat (230907328)
School of Electrical Engineering — Manipal Institute of Technology, Manipal
CN Lab Project — 3rd Year B.Tech
Mobile Ad Hoc Networks (MANETs) operate without fixed infrastructure and depend entirely on node cooperation for packet forwarding. Conventional routing protocols like AODV and DSR select routes based on hop count alone and do not account for malicious nodes that intentionally drop packets.
This project implements a trust-based routing mechanism using Bayesian inference. Node behaviour is modelled using the Beta distribution. Trust values are updated dynamically after each packet transmission and incorporated into route cost calculation to progressively avoid unreliable nodes.
| Concept | Description |
|---|---|
| Trust Model | Beta distribution — T_ij = α / (α + β) |
| Route Cost | Cost = Σ (1 / T_ij) over all edges in path |
| Trust Update | α incremented on success, β on failure (Bayesian update) |
| Malicious Nodes | Drop packets with probability 0.5 |
| Routing | Low-trust paths avoided; trust-aware shortest path selected |
├── Routing_in_MANET.py # Main simulation — PDR, Throughput, Delay plots
├── manet_live.py # Live animated demo — real-time packet routing
└── README.md
| Parameter | Value |
|---|---|
| Area Size | 500 m × 500 m |
| Number of Nodes | 50 |
| Transmission Range | 100 m |
| Packet Size | 512 bytes |
| Malicious Nodes | 10% – 40% |
| Drop Probability | 0.5 |
| Trust Threshold | 0.4 |
pip install networkx numpy matplotlibNote for Mac users: Both files use
matplotlib.use('MacOSX'). On Windows/Linux, remove or change that line tomatplotlib.use('TkAgg').
python Routing_in_MANET.pyGenerates performance comparison plots (PDR, Throughput, Delay) across 10%–40% malicious node ratios and saves manet_results.png.
python manet_live.pyShows a real-time animated MANET — green = source, yellow = destination, red = malicious nodes, highlighted path = trust-selected route. Trust values printed to console after each packet.
Trust-based routing outperforms conventional shortest-path routing under adversarial conditions:
- Higher PDR — unreliable nodes progressively excluded from routes
- Better Throughput — fewer retransmissions due to trust-aware path selection
- Moderate Overhead — slight increase in routing cost justified by reliability gains
| Feature | Shortest Path | Proposed Method |
|---|---|---|
| Hop-Based Selection | Yes | No |
| Trust Awareness | No | Yes |
| Malicious Adaptation | No | Gradual |
| Routing Overhead | Low | Moderate |
- S. Marti et al., "Mitigating routing misbehavior in mobile ad hoc networks," IEEE MobiCom, 2000.
- Y. Sun et al., "A trust evaluation framework in distributed networks," IEEE INFOCOM, 2006.
- D. Johnson et al., "Dynamic source routing protocol," IETF Draft, 2001.
- A. S. Tanenbaum and D. Wetherall, Computer Networks, 5th ed., Pearson, 2011.
- J. F. Kurose and K. W. Ross, Computer Networking: A Top-Down Approach, 8th ed., Pearson, 2021.