Skip to main content

IEEE 802.11 DCF Simulator

Project description

IEEE 802.11 Multi-AP Distributed Coordination Function (DCF) Simulator

mapc-dcf is an implementation of the IEEE 802.11 Distributed Coordination Function (DCF) with support for Multi-Access Point operation. It is a SimPy-based Discrete Event Simulator (DES) that models the channel and frame exchange.

Features and Assumptions

  • Supports Multi-AP operation.
  • Supports the Spatial Reuse (SR) mechanism introduced in the IEEE 802.11ax standard.
  • Supports the AMPDU aggregation mechanism.
  • Models collision probability by calculating the interference matrix for each device.
  • Monitors and logs the history of frame exchanges.
  • Outputs a summary of the simulation.
  • Supports scenarios with walls.
  • Assumes instantaneous and error-free acknowledgments.
  • Assumes an ideal MCS selection mechanism.

Installation

The package can be installed using pip:

pip install mapc-dcf

Usage

It is best to be used with scenarios defined as in our other repository. In the following example, we show how to use the simulator with a small_office_scenario defined in the mapc_research package.

from typing import Dict

import simpy
import jax
import jax.numpy as jnp
from mapc_research.envs.scenario_impl import *

from mapc_dcf import AccessPoint, Channel, Logger

# Define the simulation parameters
SIMULATION_LENGTH = 0.1     # seconds
WARMUP_LENGTH = 0.1         # seconds
RESULTS_PATH = "./results"  # Path to save the results (without extension!)
SEED = 42

# Set the random seed
key = jax.random.PRNGKey(SEED)

# Create the SimPy environment
des_env = simpy.Environment()

# Create the logger
logger = Logger(SIMULATION_LENGTH, WARMUP_LENGTH, RESULTS_PATH)

# Define the scenario
scenario = small_office_scenario(d_ap=20, d_sta=2, n_steps=1000)

# Create the channel
key, key_channel = jax.random.split(key)
channel = Channel(
    key=key_channel,
    sr=True,                # Spatial reuse enabled
    pos=scenario.pos,
    walls=scenario.walls    # Scenario with walls
)

# Define the access points
aps: Dict[int, AccessPoint] = {}
for ap_id in scenario.associations:
    key, key_ap = jax.random.split(key)
    clients = jnp.array(scenario.associations[ap_id])
    tx_power = scenario.tx_power[ap_id].item()
    aps[ap_id] = AccessPoint(
        key=key_ap,
        id=ap_id,
        position=scenario.pos,
        tx_power=tx_power,
        mcs=11, # MCS 11, this is legacy, it does not affect
        # the simulation as the MCS is selected ideally inside the DCF
        clients=clients,
        channel=channel,
        des_env=des_env,
        logger=logger
    )

# Start the simulation
for ap_id in aps:
    aps[ap_id].start_operation(run_number=1)   # Run number can be convenient in case of multiple runs
des_env.run(until=WARMUP_LENGTH + SIMULATION_LENGTH)

# Dump the results to the results file
logger.dump_accumulators(run_number=1)
logger.shutdown(config={"scenario": "Optional JSON description of the scenario"})

# Clean up the environment
del des_env

Repository Structure

The repository is structured as follows:

  • mapc_dcf/: The main package of the tool.
    • channel.py: Implementation of the Channel class with the moset important methods: is_idle(), send_frame() and is_tx_successful().
    • constants.py: Physical and MAC layer constants used in the simulator.
    • dcf.py: Logic of the DCF schema which uses the simpy interface to manage time intervals.
    • logger.py: Logging module that monitors the frame exchange, dumps results to the output CSV files and summarizes loggs in a compact JSON format.
    • nodes.py: Access Point abstraction and traffic generation.
    • utils.py: Utility functions, including the function for calculation of the path loss from node positions using the TGax channel model.

How to reference MAPC-DCF?

@article{wojnar2025coordinated,
  author={Wojnar, Maksymilian and Ciężobka, Wojciech and Tomaszewski, Artur and Chołda, Piotr and Rusek, Krzysztof and Kosek-Szott, Katarzyna and Haxhibeqiri, Jetmir and Hoebeke, Jeroen and Bellalta, Boris and Zubow, Anatolij and Dressler, Falko and Szott, Szymon},
  title={{Coordinated Spatial Reuse Scheduling With Machine Learning in IEEE 802.11 MAPC Networks}}, 
  year={2025},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mapc_dcf-0.2.4.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mapc_dcf-0.2.4-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file mapc_dcf-0.2.4.tar.gz.

File metadata

  • Download URL: mapc_dcf-0.2.4.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mapc_dcf-0.2.4.tar.gz
Algorithm Hash digest
SHA256 1e8f2287b9556885a4dbbe0ea7785cd538bcf6bd37b9a9509ab78973a132061d
MD5 05cf80176f2c5907b7d65e334a8392b4
BLAKE2b-256 d977a33754086a595014ddeed8a07fa40c2229cf07805d5ecde870860df24a20

See more details on using hashes here.

File details

Details for the file mapc_dcf-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: mapc_dcf-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mapc_dcf-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3a2230e0cd11f8e6eace6daeff9ca049f431d5793a122f8d0479660f5faab7ff
MD5 5fc18c779b35d0aeba1e32338632e010
BLAKE2b-256 432fb957a2e4d85d61814a2c03721235b5097493bec7c3574ad19c32b5f0eebf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page