Over the last weeks, I was very happy to work with a talented student of UCLA on building some nice simulation framework for my GNU Radio WiFi module. The code is already merged and you can find it in the utils/simulations/awgn/ folder.

On a very high level, it suggests a methodology to study WiFi or IEEE 802.11p that we sketched as follows.

The idea is to extract parameters that describe the channel from the various channel sounding experiments available in literature and plug them into GNU Radio’s channel models.

The simulation flow graph is a non-GUI flow graph, build with GNU Radio Companion that can be started with different parameters. Each simulation run produces a PCAP file containing the received frames. PCAP is a binary packet capture format that is understood by all packet capture applications like Wireshark and tcpdump.

After the simulations are run, we use tshark (a command line tool to parse PCAP files) to determine how many packets were received and create a CSV with the results.

This CSV file is then plotted by a Python script to produce a graph showing the packet delivery ratio. Running the simulations with 435 byte frames, we get something like this.

The whole process is orchestrated by a Makefile, which is

• building the simulation script from the GRC flow graph
• starting the simulation flow graph with different input parameter combinations
• parsing the PCAP file into a CSV
• generating the plot based on the CSV

Since we use a Makefile we get some cool stuff for free

• it can be parallelized with the -j option
• it keeps track of dependencies, i.e., if the flow graph is changed, the Python script is rebuild and the simulations are rerun.
• it is fault tolerant. If, for example, a run segfaults it deletes the PCAP file automatically and is, thus, not leaving corrupted logs behind.

If you want to check it out, just type make -j 4 in the simulations folder and wait for the graph.