ESP32 Network Performance Lab
Use the ESP32 packet simulator to compare bandwidth, throughput, goodput, latency, jitter, congestion, and packet loss with the browser workbench.

Packet Pete
Packet Pete here: try the browser workbench first, then use the LEDs and serial record to explain what each simulated test shows.
Predict the reading, then compare it with the measurement.
Wokwi ESP32
Third party ToolOpen the ESP32 editor, paste diagram.json, then paste sketch.ino.
Open Wokwi to paste in the files (new tab)Get the files
Use both prepared files. This is a paste-in setup; saving a project requires a Wokwi account.
sketch.ino
- Use the launch button above to open the ESP32 editor in Wokwi.
- Select the editor’s diagram.json tab and replace all its text with the supplied diagram.json.
- Select the sketch.ino tab, replace all its text with the supplied sketch.ino, then click Start Simulation.
Steps
Step 1
- Do
- In the Wokwi editor, open the supplied diagram.json and sketch.ino as the ESP32 project.
- You will see
- The project contains an ESP32 DevKit and the packet simulator sketch.
- Why it matters
- The ESP32 runs a network model so its results describe simulated performance.
Step 2
- Do
- On the Wokwi canvas, inspect the four LED connections.
- You will see
- Red connects to GPIO 2 for high latency, green to GPIO 4 for low latency, yellow to GPIO 5 for transmission, and blue to GPIO 18 for congestion; each LED has a 220 ohm series resistor and its cathode connected to GND.
- Why it matters
- The four indicators make latency, transmission, and congestion visible while the resistors limit LED current.
Step 3
- Do
- On the Wokwi canvas, inspect the push button wiring.
- You will see
- One button leg connects to 3.3 V and the other to GPIO 15 with a 10K ohm pull-down to GND.
- Why it matters
- The button provides the input that triggers a network performance test.
Step 4
- Do
- In the Wokwi editor, trace the supplied sketch in this feature order: latency LED, throughput counter, jitter samples, congestion flag, then packet loss.
- You will see
- The sketch contains separate performance behaviours and their serial reports.
- Why it matters
- Examining one feature at a time connects each performance idea with its observable result.
Step 5
- Do
- In the Wokwi toolbar, start the simulation.
- You will see
- Startup reports the lab title, GPIO setup, and LED self-test status as each LED blinks.
- Why it matters
- The self-test makes the indicator operation visible before performance testing.
Step 6
- Do
- In the Serial Monitor, use 115200 baud to read the network setup and ready prompt.
- You will see
- The setup reports simulated bandwidth, base latency, queue size, and packet loss before the prompt to press the button or wait for automatic cycles; the LEDs turn off and remain idle at ready.
- Why it matters
- The setup values state the model assumptions needed to interpret the results.
Step 7
- Do
- In the Serial Monitor, follow the automatic demonstration cycle.
- You will see
- Bandwidth versus throughput explains why modeled delivered rate differs from configured link rate; latency concepts show round-trip time components; jitter analysis shows timing variation effects; congestion effects simulate network overload; the full performance test runs a complete simulation cycle, with LED color matching the simulated condition.
- Why it matters
- The automatic sequence demonstrates distinct performance concepts before combining them in a complete test.
Step 8
- Do
- Press the push button on the Wokwi canvas to trigger a full network performance test.
- You will see
- The test sends 20 simulated packets, measures latency for each packet, calculates jitter as standard deviation, simulates varying congestion levels, and reports comprehensive statistics including packet count, RTT samples, goodput, retransmissions, and packet loss; the blue LED turns on if congestion is detected.
- Why it matters
- The manual test links a button-triggered traffic burst to delay variation, delivery, and congestion evidence.
Step 9
- Do
- In the Serial Monitor, read the completed test result.
- You will see
- The result gives a performance rating and recommended tuning action, and the LEDs reset before the next cycle.
- Why it matters
- The final report turns the simulated measurements into a tuning recommendation.
Chapter checks
These questions refer to the chapter’s examples. Use the return links to review their answers.
A packet has 80 payload bytes and 20 header bytes. The link sends at 1 Mb/s. How long does serialization take, ignoring other delays?
Return to the chapter’s knowledge checkA factory Wi-Fi link has a stated 54 Mbps PHY rate, while sensors measure 12 Mbps of delivered data during peak hours. What do these two figures establish?
Return to the chapter’s knowledge checkAn industrial IoT system monitors a robotic arm using sensors that send position data every 10 ms. One-way delay ranges from 5 ms to 45 ms despite a 15 ms average, and control logs show late updates coincide with unstable motion. Which reported metric should the team investigate first and why?
Return to the chapter’s knowledge check
Caution
Before you start
Read this before you start.
The ESP32 runs a packet simulator rather than measuring a real network; compare model assumptions before making claims about real Wi-Fi. The sketch has not yet been compiled in the Wokwi gate.
Technical details
- Version tested
- Version tested: Not yet compiled in the Wokwi gate (authored 2026-11-10 from the chapter's original ESP32 build; awaiting Wokwi CI). Date: 2026-11-10.
https://iotclass.org/labs/network-performance-esp32.htmlReturn to Network Performance: Calculations and Experiments · Browse Labs