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.1.tar.gz (20.8 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.1-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mapc_dcf-0.2.1.tar.gz
Algorithm Hash digest
SHA256 1996c82eaa85fc2ea39d3ee560efb96d2c4ec5849c97a7e8e581bc45e378f9d0
MD5 98dc79bf4ed7258d9539da03c12c56a0
BLAKE2b-256 a576eaf8eb79b64f5b9f3023386b21a2fce0a1ac9dfc24ea2d391909e8d22c9f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mapc_dcf-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78ad38ee9a6e3351d52292da4c22f5e395da2891113c1106aee436f94f1a4b99
MD5 80937eaa177df8a6ec70874fb80818c5
BLAKE2b-256 9b9aa58a456844c1bfa5ec978af3f082bcf0e8959af6b81ee7f14d141206b5da

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