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.3.tar.gz (20.9 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.3-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mapc_dcf-0.2.3.tar.gz
  • Upload date:
  • Size: 20.9 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.3.tar.gz
Algorithm Hash digest
SHA256 f3c591a428ca7e5d534a6b3d2966ba576ae555b081a52d7f5f5a2438572cabdb
MD5 ac7829594f6b8f098ca469c2205b38d7
BLAKE2b-256 a08ef99c3b5b694e41329e1c05c41333a627c22c18883e715db216289f22f27d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mapc_dcf-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 20.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4309c554880945fcf4bff63d7fcc7a4e7f485713f0d2974faec0d8a055939a95
MD5 dc7798f37011df0ff4e08fce8e2e7ea3
BLAKE2b-256 be56e49c60c9051c1ed5bc887a4fc90f70250928aaf66f641cc4478bf867dc0e

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