This example considers two APs and a server connected to a CSMA bridge. More...
#include "ns3/applications-module.h"#include "ns3/bridge-module.h"#include "ns3/core-module.h"#include "ns3/csma-module.h"#include "ns3/internet-module.h"#include "ns3/mobility-module.h"#include "ns3/network-module.h"#include "ns3/propagation-module.h"#include "ns3/spectrum-module.h"#include "ns3/wifi-module.h"#include <algorithm>#include <fstream>#include <iostream>#include <map>#include <vector>Go to the source code of this file.
Classes | |
| struct | anonymous_namespace{wifi-roaming.cc}::DropStats |
| Packet drop statistics. More... | |
| struct | anonymous_namespace{wifi-roaming.cc}::WifiSetupParams |
| Wi-Fi setup parameters. More... | |
Namespaces | |
| namespace | anonymous_namespace{wifi-roaming.cc} |
Functions | |
| std::pair< NetDeviceContainer, NetDeviceContainer > | anonymous_namespace{wifi-roaming.cc}::CreateWifiDevices (const WifiSetupParams &wifiParams) |
| Create Wi-Fi devices. | |
| SpectrumWifiPhyHelper | anonymous_namespace{wifi-roaming.cc}::GetPhyHelper (const std::string &channelsStr, Ptr< SpectrumChannel > channel) |
| Get a SpectrumWifiPhyHelper object configured with the channel settings listed in the given input string and with the given Spectrum channel. | |
| void | anonymous_namespace{wifi-roaming.cc}::PrintThroughput (const Time &start, const Time &end, Ptr< Node > serverNode, Ptr< Node > staNode, uint64_t ulTxBytes, uint64_t dlTxBytes, uint64_t &ulRxBytes, uint64_t &dlRxBytes) |
| Print the average UL and DL throughput over the given time interval. | |
This example considers two APs and a server connected to a CSMA bridge.
A STA is initially associated with AP 1 and can be configured to move closer to and associate with AP 2 at a given point in time. It is possible to configure whether or not the STA notifies the disassociation to AP 1 when roaming. DL and/or UL UDP (or TCP) traffic can be exchanged between STA and the server.
Network (logical) topology
┌─────────────────────┐
│ CSMA bridge │
└┬─────────┬─────────┬┘
│ │ │ <-- CSMA links
AP 1 AP 2 Server
Implementation
CSMA bridge
┌───────────────────────────────────┐
│ Bridge │
├───────────┬───────────┬───────────┤
│CSMA NetDev│CSMA NetDev│CSMA NetDev│
└──┬────────┴──────┬────┴──────┬────┘
│ │ │
┌──────┬──┴───┐ ┌──────┬──┴───┐ ┌──┴───┐
│ WiFi │ CSMA │ │ WiFi │ CSMA │ │ CSMA │
│NetDev│NetDev│ │NetDev│NetDev│ │NetDev│
├──────┴──────┤ ├──────┴──────┤ └──────┘
│ Bridge │ │ Bridge │ Server
└─────────────┘ └─────────────┘
AP 1 AP 2
The association messages and the throughput reports printed before and after the roam are the most interesting output. The time between the disassociation from AP 1 and the association with AP 2 is the roaming interruption. The subsequent block acknowledgment (BA) agreement messages indicate when the link is ready for aggregated QoS data. Compare the throughput on the two sides of the roam, and inspect the final per-device drop statistics and the queue sizes printed at the roam for packets that could not follow the STA.
For example, the command used by the regression tests is:
./ns3 run "wifi-roaming --simulationTime=5s --disassocTime=2.5s --dlLoad=10Mbps --udp=0"
It produces output similar to the following excerpt (exact times can vary):
At time +2.5s, STA disassociated from BSSID 00:00:00:00:00:03 From +1s to +2.5s: Wi-Fi STA received 1858000 bytes, DL throughput = 9909.33 kbps At time +2.50063s, STA completed association with BSSID 00:00:00:00:00:04 At time +2.50135s, AP 2 established BA agreement with 00:00:00:00:00:05 for TID 0 From +2.5s to +6s: Wi-Fi STA received 4374000 bytes, DL throughput = 9997.71 kbps
Thus, in this run the STA moves from AP 1 to AP 2 in less than a millisecond, and TCP downlink throughput remains close to the offered 10 Mbps load after the roam.
The following command-line arguments have particularly visible effects on this output:
Definition in file wifi-roaming.cc.