Jiaxin's Homepage
Back to Projects
BLE 5.0 Network Simulation NS-3 Wireless Protocols

Blender: Toward Practical Simulation Framework for BLE Neighbor Discovery

Blender: Toward Practical Simulation Framework for BLE Neighbor Discovery

Overview

Blender is an open-source simulation framework for Bluetooth Low Energy (BLE) neighbor discovery, built on top of the NS-3 network simulator. It provides accurate modeling of the BLE 5.0 protocol stack, enabling researchers to evaluate and prototype neighbor discovery schemes without costly hardware deployments.

Motivation

The Challenge

BLE neighbor discovery is a fundamental building block for many IoT applications, including:

However, evaluating neighbor discovery schemes presents significant challenges:

  1. High Cost: Real-world deployments require multiple devices and extensive testing
  2. Limited Reproducibility: Environmental factors make experiments difficult to reproduce
  3. Time-Consuming: Large-scale studies can take weeks or months
  4. Lack of Accuracy: Existing simators oversimplify BLE protocol behavior

Our Solution

Blender addresses these challenges by providing a practical, accurate, and efficient simulation framework validated against real-world experiments.

System Design

Architecture

Blender extends NS-3 with a comprehensive BLE 5.0 implementation:

┌─────────────────────────────────────┐
│     Application Layer               │
│   (Neighbor Discovery Logic)        │
├─────────────────────────────────────┤
│     BLE Protocol Stack              │
│  - Link Layer                       │
│  - PHY Layer (BLE 5.0)             │
├─────────────────────────────────────┤
│     NS-3 Core                       │
│  - Mobility Models                  │
│  - Channel Models                   │
│  - Interference                     │
└─────────────────────────────────────┘

Key Features

1. Accurate BLE 5.0 Modeling

Implemented Features:

Real-World Factors:

2. Configurable Parameters

Parameter Range Default
Advertising Interval 20ms - 10.24s 100ms
Scan Interval 10ms - 10.24s 100ms
Scan Window 10ms - 10.24s 50ms
TX Power -20dBm - +10dBm 0dBm
RX Sensitivity -100dBm - -50dBm -80dBm

3. Multiple Discovery Schemes

Supported Schemes:

Validation

Experimental Setup

We validated Blender against real-world deployments:

Testbed:

Metrics:

Results

Accuracy

Metric Real World Blender Error
Discovery Time (avg) 2.3s 2.28s < 1%
Energy per Discovery 45mJ 44mJ 2.2%
Success Rate 94% 93% 1.1%

Overall validation error: < 5%

Scalability

Blender can simulate large-scale scenarios efficiently:

Devices Simulation Time Memory Usage
10 2 min 50 MB
100 15 min 200 MB
1000 2 hours 1.5 GB

Case Studies

Case Study 1: Impact of Density

Setup: Vary number of devices from 10 to 1000

Findings:

Case Study 2: Heterogeneous Intervals

Setup: Mix of devices with different advertising/scan intervals

Findings:

Case Study 3: Mobile Scenarios

Setup: Random waypoint and real human mobility traces

Findings:

Usage

Installation

# Clone Blender repository
git clone https://github.com/blender-ble/blender-ns3.git
cd blender-ns3

# Build NS-3 with Blender
./ns3 build

Example Script

import ns.core
import ns BLE
import ns.internet
import ns.mobility

# Create nodes
nodes = ns.network.NodeContainer()
nodes.Create(10)

# Install BLE devices
bleHelper = ns.BLE.BleHelper()
bleDevices = bleHelper.Install(nodes)

# Configure advertising
bleHelper.SetAdvertisingInterval(100)  # ms
bleHelper.SetScanInterval(100)  # ms
bleHelper.SetScanWindow(50)  # ms

# Setup mobility
mobility = ns.mobility.MobilityHelper()
mobility.SetMobilityModel("ns3::RandomWaypointMobilityModel",
                          "Speed", ns.core.StringValue("ns3::UniformRandomVariable[Min=1.0|Max=2.0]"),
                          "Pause", ns.core.StringValue("ns3::ConstantRandomVariable[Constant=0.0]"))
mobility.Install(nodes)

# Run simulation
ns.core.Simulator.Stop(ns.core.Seconds(100))
ns.core.Simulator.Run()

Impact

Adoption:

Benefits:

Publication

Blender: Toward Practical Simulation Framework for BLE Neighbor Discovery

Yuxia Ding, Tong Li, Jiaxin Liang, Dong Wang

Proceedings of the 25th International ACM Conference on Modeling Analysis and Simulation of Wireless and Mobile Systems (MSWiM ‘22), October 2022

DOI: 10.1145/3551659.3559052

PDF

Code

Future Work