IoT / ndnSIM / PQC / ns-3
An exhaustive architectural guide to simulating Internet of Things (IoT), Edge Computing, and Green Networking in ns-3. This article dissects Energy Harvesting & Wake-Up Radios (WuR) for battery-free zero-energy devices, Information-Centric Networking (ICN / NDN) with in-network edge caching in ndnSIM, and the performance and fragmentation impacts of Post-Quantum Cryptography (PQC – ML-KEM/Kyber & ML-DSA/Dilithium) over constrained wireless links.

1. The Sustainability Imperative in Massive IoT
The global proliferation of the Internet of Things is accelerating toward an estimated 30 to 50 billion connected devices by 2030. From smart agriculture sensor fields and structural health monitoring on bridges to industrial telemetry and biomedical implants, computing is permeating every facet of the physical world.
However, this massive expansion faces three existential engineering crises:
- The Battery Replacement Crisis: Powering billions of scattered IoT nodes with conventional chemical batteries (e.g., lithium coin cells) is physically impossible and ecologically disastrous. Disposing of hundreds of millions of depleted batteries annually creates severe environmental toxicity, while manually replacing batteries embedded inside concrete pillars or remote farmland is economically unviable. The solution is Zero-Energy / Self-Powered IoT driven by ambient energy harvesting and ultra-low-power radios.
- The Host-Centric IP Inefficiency: Traditional host-centric TCP/IP networking binds content to static IP addresses. In intermittent, sleeping IoT meshes, trying to establish point-to-point connections to duty-cycled sensors results in massive retransmissions and backhaul waste. Information-Centric Networking (ICN / NDN) replaces IP endpoints with content-name routing and in-network edge caching.
- The Post-Quantum Cryptographic Crisis: With the advent of scalable quantum computers capable of running Shor’s algorithm, legacy public-key encryption (RSA, ECC, ECDSA) will be completely compromised. Migrating constrained IoT devices to NIST Post-Quantum Cryptography (PQC) standards (such as ML-KEM and ML-DSA) introduces unprecedented payload expansion, severely testing low-power wireless links.
Evaluating these interrelated challenges requires an integrated, mathematically rigorous simulation platform. In ns-3, researchers can model the physics of energy harvesting, analyze duty-cycled wake-up radios, evaluate NDN forwarding strategies via ndnSIM, and measure the latency and battery tax of post-quantum handshakes over lossy wireless channels.
2. Energy Harvesting & Wake-Up Radios: Zero-Energy IoT in ns-3
Traditional low-power wide-area networks (LPWANs)—such as LoRaWAN, NB-IoT, and IEEE 802.15.4 / 6LoWPAN—minimize energy consumption through duty-cycling: devices sleep for 99% of the time and wake up periodically. However, even during sleep, internal clocks and leakage currents deplete batteries. Furthermore, periodic wake-up introduces substantial latency for downlink traffic.
2.1 Modeling Ambient Energy Harvesting in ns-3
Green networking shifts the paradigm from fixed battery energy budgets to Energy-Neutral Operation (ENO), where a device’s consumed energy is strictly less than or equal to the energy harvested from the environment over an operational window:
ns-3 provides a comprehensive, modular Energy Framework consisting of three interconnected class hierarchies:
EnergySource: Represents the energy storage reservoir (such as a rechargeable Li-Ion battery viaLiIonEnergySourceor a high-cycle supercapacitor viaBasicEnergySource). It models real-world non-linear effects including voltage decay, self-discharge leakage, and capacity degradation.DeviceEnergyModel: Installed on network devices (e.g.,LrWpanRadioEnergyModelorLoraRadioEnergyModel). It dynamically tracks the transceiver state machine (Sleep, Idle, Rx, Tx) and draws current from the associatedEnergySource:I_{text{total}}(t) = I_{text{sleep}} cdot mathbb{I}_{text{sleep}} + I_{text{rx}} cdot mathbb{I}_{text{rx}} + I_{text{tx}} cdot mathbb{I}_{text{tx}}EnergyHarvester: Models the stochastic ambient energy influx (e.g.,BasicEnergyHarvester). Researchers can implement custom harvesting models representing:
1. Solar Photovoltaic: Diurnal sinusoidal irradiance profiles ($10text{–}100text{ mW/cm}^2$ outdoors, $10text{–}100 mutext{W/cm}^2$ indoors under ambient LED lighting).
2. RF Electromagnetic Harvesting: Rectifying ambient RF signals from Wi-Fi routers and cellular towers ($0.1text{–}10 mutext{W/cm}^2$).
3. Thermoelectric (TEG): Harvesting Seebeck voltage from industrial machinery temperature gradients.
2.2 Wake-Up Radios (WuR / IEEE 802.11ba): Eliminating Idle Listening
In classical duty-cycled MAC protocols, idle listening (waking up to check for incoming preambles when no data is being sent) accounts for up to 70% to 90% of total energy wasted.
Wake-Up Radio (WuR) architecture introduces an ultra-low-power, passive or near-passive secondary receiver alongside the primary high-speed transceiver:
When an edge gateway needs to contact a sleeping sensor, it emits a short, Manchester-coded Wake-Up Packet (WUP) containing the target node’s hardware address. The WuR receiver decodes the WUP at nanowatt power, triggers a hardware interrupt line, wakes the primary radio from deep sleep, and exchanges data immediately. In ns-3, this completely decouples transmission latency from energy conservation, enabling perpetual battery-free operation on small ambient solar panels.
3. Information-Centric Networking (ICN / NDN) in Constrained IoT
Traditional Internet architectures rely on the host-centric IP protocol, which requires establishing point-to-point connections between endpoints. In resource-constrained, multi-hop wireless sensor networks, this model is fundamentally mismatched with application needs:
- Users care about the data itself (e.g., “What is the temperature in Greenhouse 4?”), not which physical device produced it.
- If 20 neighboring smart home controllers simultaneously request the same weather telemetry, an IP server must dispatch 20 separate unicast packets, flooding the wireless medium.
3.1 Named Data Networking (NDN) Architecture
Named Data Networking (NDN) replaces host IP addresses with hierarchically structured, human-readable content names (e.g., /agri/zone1/soil/moisture). Communication is entirely consumer-driven via two packet types:
- Interest Packet: Dispatched by a consumer querying for named content.
- Data Packet: Returned by any node that holds the requested content, containing the content name, payload, and a cryptographic signature.
The Three Core NDN Node Data Structures
Every NDN node (including constrained edge routers) maintains three internal state tables:
1. Content Store (CS): In-network memory cache. When an Interest arrives, the node checks its CS. If the named data is cached, it immediately returns the Data packet without forwarding the Interest.
2. Pending Interest Table (PIT): Records outstanding Interests awaiting data, mapping the requested name to incoming network interfaces. If multiple consumers request the same content before it returns, the PIT aggregates them into a single entry, suppressing redundant upstream queries.
3. Forwarding Information Base (FIB): Name-based routing prefix table populated by routing protocols, guiding Interests toward authoritative producers.
3.2 In-Network Edge Caching and Simulation via `ndnSIM`
In ns-3, NDN research is executed via ndnSIM, the official NS-3-based simulator developed by UCLA. In constrained edge topologies:
- Edge Caching Strategies: Constrained routers implement replacement algorithms (LRU, LFU, Freshness-Aware Caching) tailored to small RAM limits (e.g., 64 KB cache).
- Interest Aggregation & Multicast: When 50 nodes query the same content within a short interval, only a single Interest traverses the uplink to the cloud edge. The returning Data packet travels back down the reverse PIT trail, satisfying all 50 consumers in a single broadcast transmission.
- Energy & Bandwidth Savings: In simulated smart grid sensor networks, in-network caching reduces average latency by 60–80% and slashes wireless radio transmissions by up to 75%, directly extending the lifespan of energy-harvesting nodes.
4. Architectural Blueprint: Green IoT, NDN & PQC Integration in ns-3
The diagrammatic layout below illustrates how renewable energy harvesting, Wake-Up Radios, Information-Centric Networking (ndnSIM), and Post-Quantum Cryptography handshakes interface within a complete ns-3 simulation:
Green IoT, Edge NDN Caching & Post-Quantum Security Pipeline in ns-3
Hardware Tier
Network Tier
Security Tier
sequenceDiagram
autonumber
participant Gateway as Edge IoT Gateway / Consumer
participant WuR as Sensor Wake-Up Radio (1 μW)
participant Sensor as Sensor Main MCU & Radio (802.15.4)
participant Harvester as Solar Energy Harvester (ns-3)
Harvester->>Sensor: Harvest ambient energy & charge supercapacitor
Note over Sensor: Primary radio in deep sleep (0.01% duty cycle)
Gateway->>WuR: Emit Wake-Up Packet (WUP with node ID)
WuR->>Sensor: Trigger hardware interrupt pin (Wake MCU!)
Sensor->>Sensor: Power up primary transceiver
Gateway->>Sensor: Send NDN Interest Packet ("/sensor/data")
Note over Sensor: Content Store miss → Sample fresh reading
Sensor->>Sensor: Generate ML-DSA (Dilithium) Quantum Signature
Note over Sensor: Signature is 2,420 bytes → Fragment into 25x 6LoWPAN frames!
Sensor->>Gateway: Transmit multi-frame PQC Data Packet
Gateway->>Gateway: Verify PQC signature & cache in Edge Content Store (CS)
Sensor->>Sensor: Primary transceiver returns to Deep Sleep
Note over Sensor: WuR remains listening at nanowatt standby
5. Post-Quantum Cryptography (PQC) & Security in Constrained Networks
The advent of fault-tolerant quantum computers represents an existential threat to the Internet of Things. Shor’s algorithm will effortlessly factor large integers and solve discrete logarithms in polynomial time, completely destroying classical asymmetric cryptography: RSA, Diffie-Hellman, ECDH, and ECDSA will offer zero security.
Because infrastructure IoT devices (smart electric grids, municipal water control valves, cardiac implants) are deployed with 10 to 20-year operational lifecycles, they are actively vulnerable today to “Harvest Now, Decrypt Later” adversarial attacks.
5.1 The NIST-Standardized PQC Algorithms
In August 2024, the National Institute of Standards and Technology (NIST) finalized its premier post-quantum standards based on hard lattice mathematical problems:
- FIPS 203: ML-KEM (Module-Lattice-Based Key-Encapsulation Mechanism – derived from CRYSTALS-Kyber): Primary standard for general encryption and key establishment.
- FIPS 204: ML-DSA (Module-Lattice-Based Digital Signature Algorithm – derived from CRYSTALS-Dilithium): Primary standard for digital authentication and identity certificates.
- FIPS 205: SLH-DSA (Stateless Hash-Based Digital Signature Algorithm – derived from SPHINCS+): Backup digital signature standard relying strictly on hash security.
5.2 The “PQC Tax”: Key and Ciphertext Inflation
While lattice-based algorithms execute rapidly in software (relying on Number Theoretic Transforms – NTT), they impose an enormous bandwidth and memory tax compared to classical Elliptic Curve Cryptography (ECC):
5.3 The Fragmentation and Battery Depletion Crisis in ns-3
When researchers simulate PQC handshakes (e.g., DTLS 1.3 or TLS 1.3 over 6LoWPAN, BLE, or LoRaWAN) in ns-3, the severe impact of this size inflation becomes immediately visible:
1. The 6LoWPAN Fragmentation Avalanche
The maximum physical payload of an IEEE 802.15.4 frame is strictly 127 bytes. After deducting 802.15.4 MAC headers and 6LoWPAN encapsulation headers, the effective MTU available for upper-layer data is roughly 80 to 95 bytes per frame.
Transmitting a single ML-DSA-44 signature (2,420 bytes) requires 26 consecutive fragmented frames! Over a wireless sensor link with a modest 5% packet error rate ($PER = 0.05$), the probability of successfully delivering the entire signature without fragment loss drops precipitously:
$$P_{text{success}} = (1 – PER)^{26} = (0.95)^{26} approx 0.263 (26.3%)$$
More than 73% of signature handshakes fail on the first attempt, triggering catastrophic end-to-end retransmission storms that choke the constrained wireless channel.
2. The RF Transmission Energy Penalty
While software benchmark tests often focus on CPU clock cycles, in wireless IoT systems, RF transmission energy dwarfs MCU compute energy. In an 802.15.4 transceiver, transmitting 1 byte consumes roughly 1,000x more microjoules than computing a modular addition in software.
Executing an ML-KEM + ML-DSA authenticated handshake transmits over 5.3 KB of cryptographic material across the air, consuming over 18 to 25 milli-Joules of energy per handshake—an 8.5x energy surge over classical ECDSA. On an energy-harvesting node, a single PQC handshake can completely drain the supercapacitor reservoir, forcing the node into a multi-hour reboot and recharge blackout.
6. Complete C++ Simulation Blueprint in ns-3
Below is a production-grade C++ simulation script demonstrating how to configure energy-harvesting IoT nodes in ns-3, attaching a solar energy harvester, supercapacitor energy source, and 802.15.4 radio energy model to track power levels over time:
#include “ns3/core-module.h”
#include “ns3/network-module.h”
#include “ns3/mobility-module.h”
#include “ns3/lr-wpan-module.h”
#include “ns3/energy-module.h”
#include “ns3/internet-module.h”
using namespace ns3;
void RemainingEnergyTrace(Ptr
*stream->GetStream() << Simulator::Now().GetSeconds() << “t” << newValue << std::endl;
}
int main(int argc, char *argv[]) {
CommandLine cmd(__FILE__);
cmd.Parse(argc, argv);
// 1. Create IoT Sensor Nodes
NodeContainer iotNodes;
iotNodes.Create(5);
// 2. Configure Mobility
MobilityHelper mobility;
mobility.SetMobilityModel(“ns3::ConstantPositionMobilityModel”);
mobility.Install(iotNodes);
// 3. Configure IEEE 802.15.4 PHY & MAC
LrWpanHelper lrWpanHelper;
NetDeviceContainer devContainer = lrWpanHelper.Install(iotNodes);
lrWpanHelper.AssociateToPan(devContainer, 10);
// 4. Configure Energy Source (Supercapacitor: 3.3V, Initial 50 Joules)
BasicEnergySourceHelper basicSourceHelper;
basicSourceHelper.Set(“BasicEnergySourceInitialEnergyJ”, DoubleValue(50.0));
basicSourceHelper.Set(“BasicEnergySupplyVoltageV”, DoubleValue(3.3));
EnergySourceContainer sources = basicSourceHelper.Install(iotNodes);
// 5. Configure Solar Energy Harvester (Harvesting 15 mW average power)
BasicEnergyHarvesterHelper harvesterHelper;
harvesterHelper.Set(“PeriodicHarvestedPowerUpdateInterval”, TimeValue(Seconds(1.0)));
harvesterHelper.Set(“BasicEnergyHarvesterInitialHarvestedPower”, DoubleValue(0.015)); // 15 mW
EnergyHarvesterContainer harvesters = harvesterHelper.Install(sources);
// 6. Connect Energy Trace Listener
AsciiTraceHelper asciiTraceHelper;
Ptr
sources.Get(0)->TraceConnectWithoutContext(“RemainingEnergy”, MakeBoundCallback(&RemainingEnergyTrace, stream));
Simulator::Stop(Seconds(60.0));
Simulator::Run();
Simulator::Destroy();
return 0;
}
7. Synthesis & Future Outlook: The Sustainable Quantum-Safe Edge
The convergence of Green Networking, Edge Computing, and Quantum-Resistant Security represents the true technological frontier of the Internet of Things. As we transition into the next era of pervasive computing, success will no longer be measured merely by how many billions of chips we manufacture, but by how sustainably they draw power from their environment and how securely they protect human data against future quantum decryption.
Through ns-3 and ndnSIM, researchers possess an unmatched simulation engine to solve these multidimensional challenges: engineering energy harvesting circuits that sustain perpetual operation, deploying Named Data Networking to eliminate backhaul waste via in-network caching, and designing compression and hybrid architectures that tame the severe fragmentation tax of Post-Quantum Cryptography over constrained wireless links.
Written by Charles Pandian
Green networking researcher and systems simulation architect specializing in ns-2, ns-3, ndnSIM, energy harvesting wireless sensor networks, Wake-Up Radios, and Post-Quantum Cryptographic protocol benchmarking. Regular contributor to ProjectGuideline.com academic guides and simulation architectures.
Discuss Through WhatsApp
Take Me to Afarion ns-3 iPlayground




