Skip to content

CaptainAni187/Trust-Based-Routing-in-MANET-Using-Bayesian-Inference

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Trust-Based Routing in MANET Using Bayesian Inference

Animesh Kumar (230907478) & Prakhar Bhagat (230907328)
School of Electrical Engineering — Manipal Institute of Technology, Manipal
CN Lab Project — 3rd Year B.Tech


Overview

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.


Key Concepts

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

Project Structure

├── Routing_in_MANET.py     # Main simulation — PDR, Throughput, Delay plots
├── manet_live.py           # Live animated demo — real-time packet routing
└── README.md

Simulation Parameters

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

Installation

pip install networkx numpy matplotlib

Note for Mac users: Both files use matplotlib.use('MacOSX'). On Windows/Linux, remove or change that line to matplotlib.use('TkAgg').


How to Run

1. Main Simulation (Results & Plots)

python Routing_in_MANET.py

Generates performance comparison plots (PDR, Throughput, Delay) across 10%–40% malicious node ratios and saves manet_results.png.

2. Live Simulation (Animated Demo)

python manet_live.py

Shows 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.


Results

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

References

  1. S. Marti et al., "Mitigating routing misbehavior in mobile ad hoc networks," IEEE MobiCom, 2000.
  2. Y. Sun et al., "A trust evaluation framework in distributed networks," IEEE INFOCOM, 2006.
  3. D. Johnson et al., "Dynamic source routing protocol," IETF Draft, 2001.
  4. A. S. Tanenbaum and D. Wetherall, Computer Networks, 5th ed., Pearson, 2011.
  5. J. F. Kurose and K. W. Ross, Computer Networking: A Top-Down Approach, 8th ed., Pearson, 2021.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages