marvis.channel.wifi

Wireless channel.

Classes

WiFiChannel

A WiFiChannel is a physical (but of course wireless) connection between two or more wireless devices.


class marvis.channel.wifi.WiFiChannel(network, channel_name, nodes, frequency=None, channel=1, channel_width=40, antennas=1, tx_power=20.0, standard: marvis.channel.wifi.WiFiChannel.WiFiStandard = WiFiStandard.WIFI_802_11b, data_rate: marvis.channel.wifi.WiFiChannel.WiFiDataRate = WiFiDataRate.DSSS_RATE_11Mbps, delay='0ms')[source]

Bases: marvis.channel.channel.Channel

A WiFiChannel is a physical (but of course wireless) connection between two or more wireless devices.

Further information can be found reading the ns-3 source here.

Parameters
  • channel (int) – The WiFi channel to use. This will be ignored if frequency is set.

  • frequency (int) – The frequency of the wireless channel in MHz.

  • channel_width (int) – The width of the channel in MHz. Valid values are 5, 10, 20, 22, 40, 80, 160.

  • antennas (int) – The number of antennas / spatial streams to use.

  • tx_power (float) – The sending power in dBm.

  • standard (WiFiStandard) – The WiFi standard to use.

  • data_rate (WiFiDataRate) – The WiFi data rate to use. Please make sure to pick a valid data rate for your standard.

  • delay (str) – A time for delay in the channel in seconds (10s) or milliseconds (10ms) at 100m distance.

class WiFiStandard(value)[source]

Bases: enum.Enum

All available WiFi standards.

See here for further information: https://en.wikipedia.org/wiki/IEEE_802.11.

WIFI_802_11a = 0

The first WiFi standard from 1999.

WIFI_802_11b = 1

Standard with maximum raw data rate of 11 Mbit/s.

WIFI_802_11g = 2

Standard with maximum raw bitrate of 54 Mbit/s in 2.4GHz band.

WIFI_802_11n = 7

Standard from 2009 in 2.4GHz band.

WIFI_802_11n_5G = 8

Standard from 2009 in 5GHz band.

WIFI_802_11ac = 10

Standard from 2013.

WIFI_802_11ax = 11

“WiFi 6”.

WIFI_802_11p = 3

Wireless Access in Vehicular Environments (WAVE).

class WiFiDataRate(value)[source]

Bases: enum.Enum

All available WiFi data rates.

Choosing the correct and best data rate depends on the standard you are using. The data rate list is incomplete. Please consider reading the ns-3 source here. You can pass another valid string to the channel, too.

OFDM_RATE_6Mbps = 'OfdmRate6Mbps'

Use with WiFiStandard.WIFI_802_11a.

OFDM_RATE_9Mbps = 'OfdmRate9Mbps'

Use with WiFiStandard.WIFI_802_11a.

OFDM_RATE_12Mbps = 'OfdmRate12Mbps'

Use with WiFiStandard.WIFI_802_11a.

OFDM_RATE_18Mbps = 'OfdmRate18Mbps'

Use with WiFiStandard.WIFI_802_11a.

OFDM_RATE_24Mbps = 'OfdmRate24Mbps'

Use with WiFiStandard.WIFI_802_11a.

OFDM_RATE_36Mbps = 'OfdmRate36Mbps'

Use with WiFiStandard.WIFI_802_11a.

OFDM_RATE_48Mbps = 'OfdmRate48Mbps'

Use with WiFiStandard.WIFI_802_11a.

OFDM_RATE_54Mbps = 'OfdmRate54Mbps'

Use with WiFiStandard.WIFI_802_11a.

DSSS_RATE_1Mbps = 'DsssRate1Mbps'

Use with WiFiStandard.WIFI_802_11b, WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

DSSS_RATE_2Mbps = 'DsssRate2Mbps'

Use with WiFiStandard.WIFI_802_11b, WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

DSSS_RATE_5_5Mbps = 'DsssRate5_5Mbps'

Use with WiFiStandard.WIFI_802_11b, WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

DSSS_RATE_11Mbps = 'DsssRate11Mbps'

Use with WiFiStandard.WIFI_802_11b, WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

ERP_OFDM_RATE_6Mbps = 'ErpOfdmRate6Mbps'

Use with WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

ERP_OFDM_RATE_9Mbps = 'ErpOfdmRate9Mbps'

Use with WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

ERP_OFDM_RATE_12Mbps = 'ErpOfdmRate12Mbps'

Use with WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

ERP_OFDM_RATE_18Mbps = 'ErpOfdmRate18Mbps'

Use with WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

ERP_OFDM_RATE_24Mbps = 'ErpOfdmRate24Mbps'

Use with WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

ERP_OFDM_RATE_36Mbps = 'ErpOfdmRate36Mbps'

Use with WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

ERP_OFDM_RATE_48Mbps = 'ErpOfdmRate48Mbps'

Use with WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

ERP_OFDM_RATE_54Mbps = 'ErpOfdmRate54Mbps'

Use with WiFiStandard.WIFI_802_11g, WiFiStandard.WIFI_802_11ac or WiFiStandard.WIFI_802_11ax.

OFDM_RATE_BW_3Mbps = 'OfdmRate3MbpsBW10MHz'

Use with WiFiStandard.WIFI_802_11p.

OFDM_RATE_BW_4_5Mbps = 'OfdmRate4_5MbpsBW10MHz'

Use with WiFiStandard.WIFI_802_11p.

OFDM_RATE_BW_6Mbps = 'OfdmRate6MbpsBW10MHz'

Use with WiFiStandard.WIFI_802_11p.

OFDM_RATE_BW_9Mbps = 'OfdmRate9MbpsBW10MHz'

Use with WiFiStandard.WIFI_802_11p.

OFDM_RATE_BW_12Mbps = 'OfdmRate12MbpsBW10MHz'

Use with WiFiStandard.WIFI_802_11p.

OFDM_RATE_BW_18Mbps = 'OfdmRate18MbpsBW10MHz'

Use with WiFiStandard.WIFI_802_11p.

OFDM_RATE_BW_24Mbps = 'OfdmRate24MbpsBW10MHz'

Use with WiFiStandard.WIFI_802_11p.

OFDM_RATE_BW_27Mbps = 'OfdmRate27MbpsBW10MHz'

Use with WiFiStandard.WIFI_802_11p.

channel

The channel to use.

frequency

The frequency to use.

This could collide with other WiFi channels.

channel_width

The width of the channel in MHz.

antennas

The number of antennas to use.

tx_power

The sending power in dBm.

standard

The WiFi standard to use.

data_rate

The data rate to use.

delay

The delay for the channel

wifi

Helper for creating the WiFi channel.

property nodes

Return all nodes of this channel.

Returns

The list of nodes in this channel.

Return type

list of Node

wifi_mac_helper

Helper for creating MAC layers.

network

The network the channel belongs to.

channel_name

The name of the channel

interfaces

All Interfaces (~network cards) on this channel.

ns3_nodes_container

A container with all ns-3 internal nodes.

devices_container

All ns-3 devices on this channel.

prepare(simulation)[source]

Prepare the channel (for logging).

Parameters

simulation (Simulation) – The simulation to prepare the channel for.

set_delay(delay)[source]
set_data_rate(data_rate)[source]

Inheritance Diagramm

Inheritance diagram of marvis.channel.wifi