doc: update ns3 API

This commit is contained in:
Gabriel Ferreira
2022-01-13 23:59:59 -03:00
parent 330ffb75b6
commit 33f2ee841b
96 changed files with 281 additions and 298 deletions

View File

@@ -44,7 +44,7 @@ do
for distance in $DISTANCES
do
echo Trial $trial, distance $distance
../../ns3 --run "wifi-example-sim --format=db --distance=$distance --run=run-$distance-$trial"
../../ns3 run "wifi-example-sim --format=db --distance=$distance --run=run-$distance-$trial"
done
done

View File

@@ -27,7 +27,7 @@
// - pcap traces also generated in the following files
// "tcp-large-transfer-$n-$i.pcap" where n and i represent node and interface
// numbers respectively
// Usage (e.g.): ./ns3 --run tcp-large-transfer
// Usage (e.g.): ./ns3 run tcp-large-transfer
#include <iostream>
#include <fstream>

View File

@@ -62,7 +62,7 @@
// an RTT. The size of initial congestion window is set to 10, and pacing
// of the initial window is enabled. The available command-line options and
// their default values can be observed in the usual way by running the
// program to print the help info; i.e.: ./ns3 --run 'tcp-pacing --PrintHelp'
// program to print the help info; i.e.: ./ns3 run 'tcp-pacing --PrintHelp'
//
// When pacing is disabled, TCP sends eligible packets back-to-back. The
// differences in behaviour when pacing is disabled can be observed from the

View File

@@ -33,10 +33,10 @@
// "tcp-star-server-$n-$i.pcap" where n and i represent node and interface
// numbers respectively
// Usage examples for things you might want to tweak:
// ./ns3 --run="tcp-star-server"
// ./ns3 --run="tcp-star-server --nNodes=25"
// ./ns3 --run="tcp-star-server --ns3::OnOffApplication::DataRate=10000"
// ./ns3 --run="tcp-star-server --ns3::OnOffApplication::PacketSize=500"
// ./ns3 run="tcp-star-server"
// ./ns3 run="tcp-star-server --nNodes=25"
// ./ns3 run="tcp-star-server --ns3::OnOffApplication::DataRate=10000"
// ./ns3 run="tcp-star-server --ns3::OnOffApplication::PacketSize=500"
// See the ns-3 tutorial for more info on the command line:
// http://www.nsnam.org/tutorials.html

View File

@@ -113,13 +113,13 @@
// validation cases (and syntax of how to run):
// ------------
// Case 'dctcp-10ms': DCTCP single flow, 10ms base RTT, 50 Mbps link, ECN enabled, CoDel:
// ./ns3 --run 'tcp-validation --firstTcpType=dctcp --linkRate=50Mbps --baseRtt=10ms --queueUseEcn=1 --stopTime=15s --validate=1 --validation=dctcp-10ms'
// ./ns3 run 'tcp-validation --firstTcpType=dctcp --linkRate=50Mbps --baseRtt=10ms --queueUseEcn=1 --stopTime=15s --validate=1 --validation=dctcp-10ms'
// - Throughput between 48 Mbps and 49 Mbps for time greater than 5.6s
// - DCTCP alpha below 0.1 for time greater than 5.4s
// - DCTCP alpha between 0.06 and 0.085 for time greater than 7s
//
// Case 'dctcp-80ms': DCTCP single flow, 80ms base RTT, 50 Mbps link, ECN enabled, CoDel:
// ./ns3 --run 'tcp-validation --firstTcpType=dctcp --linkRate=50Mbps --baseRtt=80ms --queueUseEcn=1 --stopTime=40s --validate=1 --validation=dctcp-80ms'
// ./ns3 run 'tcp-validation --firstTcpType=dctcp --linkRate=50Mbps --baseRtt=80ms --queueUseEcn=1 --stopTime=40s --validate=1 --validation=dctcp-80ms'
// - Throughput less than 20 Mbps for time less than 14s
// - Throughput less than 48 Mbps for time less than 30s
// - Throughput between 47.5 Mbps and 48.5 for time greater than 32s
@@ -128,14 +128,14 @@
// - DCTCP alpha between 0.015 and 0.025 for time greater than 34
//
// Case 'cubic-50ms-no-ecn': CUBIC single flow, 50ms base RTT, 50 Mbps link, ECN disabled, CoDel:
// ./ns3 --run 'tcp-validation --firstTcpType=cubic --linkRate=50Mbps --baseRtt=50ms --queueUseEcn=0 --stopTime=20s --validate=1 --validation=cubic-50ms-no-ecn'
// ./ns3 run 'tcp-validation --firstTcpType=cubic --linkRate=50Mbps --baseRtt=50ms --queueUseEcn=0 --stopTime=20s --validate=1 --validation=cubic-50ms-no-ecn'
// - Maximum value of cwnd is 511 segments at 5.4593 seconds
// - cwnd decreases to 173 segments at 5.80304 seconds
// - cwnd reaches another local maxima around 14.2815 seconds of 236 segments
// - cwnd reaches a second maximum around 18.048 seconds of 234 segments
//
// Case 'cubic-50ms-ecn': CUBIC single flow, 50ms base RTT, 50 Mbps link, ECN enabled, CoDel:
// ./ns3 --run 'tcp-validation --firstTcpType=cubic --linkRate=50Mbps --baseRtt=50ms --queueUseEcn=0 --stopTime=20s --validate=1 --validation=cubic-50ms-no-ecn'
// ./ns3 run 'tcp-validation --firstTcpType=cubic --linkRate=50Mbps --baseRtt=50ms --queueUseEcn=0 --stopTime=20s --validate=1 --validation=cubic-50ms-no-ecn'
// - Maximum value of cwnd is 511 segments at 5.4593 seconds
// - cwnd decreases to 173 segments at 5.7939 seconds
// - cwnd reaches another local maxima around 14.3477 seconds of 236 segments

View File

@@ -55,7 +55,7 @@
//
// The user can select the distance between the stations and the APs, can enable/disable the RTS/CTS mechanism
// and can choose the payload size and the simulation duration.
// Example: ./ns3 --run "wifi-80211e-txop --distance=10 --simulationTime=20 --payloadSize=1000"
// Example: ./ns3 run "wifi-80211e-txop --distance=10 --simulationTime=20 --payloadSize=1000"
//
// The output prints the throughput measured for the 4 cases/networks described above. When TXOP is enabled, results show
// increased throughput since the channel is granted for a longer duration. TXOP is enabled by default for AC_VI and AC_VO,

View File

@@ -56,7 +56,7 @@
//Packets in this simulation belong to BestEffort Access Class (AC_BE).
//
// The user can select the distance between the stations and the APs and can enable/disable the RTS/CTS mechanism.
// Example: ./ns3 --run "wifi-aggregation --distance=10 --enableRts=0 --simulationTime=20"
// Example: ./ns3 run "wifi-aggregation --distance=10 --enableRts=0 --simulationTime=20"
//
// The output prints the throughput measured for the 4 cases/networks described above. When default aggregation parameters are enabled, the
// maximum A-MPDU size is 65 kB and the throughput is maximal. When aggregation is disabled, the throughput is about the half of the physical

View File

@@ -44,7 +44,7 @@
// the AP or both has/have traffic to send.
//
// Example for an IEEE 802.11ac station sending traffic to an 802.11a AP using Ideal rate adaptation algorithm:
// ./ns3 --run "wifi-backward-compatibility --apVersion=80211a --staVersion=80211ac --staRaa=Ideal"
// ./ns3 run "wifi-backward-compatibility --apVersion=80211a --staVersion=80211ac --staRaa=Ideal"
using namespace ns3;

View File

@@ -55,7 +55,7 @@
// short slot time are only observed in a g only configuration.
//
// The user can also select the payload size and can choose either an UDP or a TCP connection.
// Example: ./ns3 --run "wifi-mixed-network --isUdp=1"
// Example: ./ns3 run "wifi-mixed-network --isUdp=1"
using namespace ns3;

View File

@@ -23,21 +23,21 @@
* QUICK INSTRUCTIONS:
*
* To optimize build:
* ./ns3 -d optimized configure
* ./ns3 configure -d optimized
* ./ns3
*
* To compile:
* ./ns3 --run wifi-multirate
* ./ns3 run wifi-multirate
*
* To compile with command line(useful for varying parameters):
* ./ns3 --run "wifi-multirate --totalTime=0.3s --rateManager=ns3::MinstrelWifiManager"
* ./ns3 run "wifi-multirate --totalTime=0.3s --rateManager=ns3::MinstrelWifiManager"
*
* To turn on NS_LOG:
* export NS_LOG=multirate=level_all
* (can only view log if built with ./ns3 -d debug configure)
* (can only view log if built with ./ns3 configure -d debug)
*
* To debug:
* ./ns3 --shell
* ./ns3 shell
* gdb ./build/debug/examples/wireless/wifi-multirate
*
* To view pcap files:

View File

@@ -66,17 +66,17 @@
*
* To display all the possible arguments and their defaults:
* \code{.sh}
* ./ns3 --run "wifi-power-adaptation-distance --help"
* ./ns3 run "wifi-power-adaptation-distance --help"
* \endcode
*
* Example usage (selecting Aparf rather than Parf):
* \code{.sh}
* ./ns3 --run "wifi-power-adaptation-distance --manager=ns3::AparfWifiManager --outputFileName=aparf"
* ./ns3 run "wifi-power-adaptation-distance --manager=ns3::AparfWifiManager --outputFileName=aparf"
* \endcode
*
* Another example (moving towards the AP):
* \code{.sh}
* ./ns3 --run "wifi-power-adaptation-distance --manager=ns3::AparfWifiManager --outputFileName=aparf --stepsSize=-1 --STA1_x=200"
* ./ns3 run "wifi-power-adaptation-distance --manager=ns3::AparfWifiManager --outputFileName=aparf --stepsSize=-1 --STA1_x=200"
* \endcode
*
* To enable the log of rate and power changes:

View File

@@ -41,12 +41,12 @@
*
* Example usage:
* \code{.sh}
* ./ns3 --run "wifi-power-adaptation-interference --manager=ns3::AparfWifiManager --outputFileName=aparf"
* ./ns3 run "wifi-power-adaptation-interference --manager=ns3::AparfWifiManager --outputFileName=aparf"
* \endcode
*
* Another example (changing STAs position):
* \code{.sh}
* ./ns3 --run "wifi-power-adaptation-interference --manager=ns3::AparfWifiManager --outputFileName=aparf --STA1_x=5 --STA2_x=205"
* ./ns3 run "wifi-power-adaptation-interference --manager=ns3::AparfWifiManager --outputFileName=aparf --STA1_x=5 --STA2_x=205"
* \endcode
*
* To enable the log of rate and power changes:

View File

@@ -38,13 +38,13 @@
* - (if logging is enabled) the changes of rate to standard output.
*
* Example usage:
* ./ns3 --run "wifi-rate-adaptation-distance --standard=802.11a --staManager=ns3::MinstrelWifiManager --apManager=ns3::MinstrelWifiManager --outputFileName=minstrel"
* ./ns3 run "wifi-rate-adaptation-distance --standard=802.11a --staManager=ns3::MinstrelWifiManager --apManager=ns3::MinstrelWifiManager --outputFileName=minstrel"
*
* Another example (moving towards the AP):
* ./ns3 --run "wifi-rate-adaptation-distance --standard=802.11a --staManager=ns3::MinstrelWifiManager --apManager=ns3::MinstrelWifiManager --outputFileName=minstrel --stepsSize=1 --STA1_x=-200"
* ./ns3 run "wifi-rate-adaptation-distance --standard=802.11a --staManager=ns3::MinstrelWifiManager --apManager=ns3::MinstrelWifiManager --outputFileName=minstrel --stepsSize=1 --STA1_x=-200"
*
* Example for HT rates with SGI and channel width of 40MHz:
* ./ns3 --run "wifi-rate-adaptation-distance --staManager=ns3::MinstrelHtWifiManager --apManager=ns3::MinstrelHtWifiManager --outputFileName=minstrelHt --shortGuardInterval=true --channelWidth=40"
* ./ns3 run "wifi-rate-adaptation-distance --staManager=ns3::MinstrelHtWifiManager --apManager=ns3::MinstrelHtWifiManager --outputFileName=minstrelHt --shortGuardInterval=true --channelWidth=40"
*
* To enable the log of rate changes:
* export NS_LOG=RateAdaptationDistance=level_info

View File

@@ -37,7 +37,7 @@
// There are a number of command-line options available to control
// the default behavior. The list of available command-line options
// can be listed with the following command:
// ./ns3 --run "wifi-simple-adhoc-grid --help"
// ./ns3 run "wifi-simple-adhoc-grid --help"
//
// Note that all ns-3 attributes (not just the ones exposed in the below
// script) can be changed at command line; see the ns-3 documentation.
@@ -47,21 +47,21 @@
// the default of 500m.
// To see this effect, try running:
//
// ./ns3 --run "wifi-simple-adhoc-grid --distance=500"
// ./ns3 --run "wifi-simple-adhoc-grid --distance=1000"
// ./ns3 --run "wifi-simple-adhoc-grid --distance=1500"
// ./ns3 run "wifi-simple-adhoc-grid --distance=500"
// ./ns3 run "wifi-simple-adhoc-grid --distance=1000"
// ./ns3 run "wifi-simple-adhoc-grid --distance=1500"
//
// The source node and sink node can be changed like this:
//
// ./ns3 --run "wifi-simple-adhoc-grid --sourceNode=20 --sinkNode=10"
// ./ns3 run "wifi-simple-adhoc-grid --sourceNode=20 --sinkNode=10"
//
// This script can also be helpful to put the Wifi layer into verbose
// logging mode; this command will turn on all wifi logging:
//
// ./ns3 --run "wifi-simple-adhoc-grid --verbose=1"
// ./ns3 run "wifi-simple-adhoc-grid --verbose=1"
//
// By default, trace file writing is off-- to enable it, try:
// ./ns3 --run "wifi-simple-adhoc-grid --tracing=1"
// ./ns3 run "wifi-simple-adhoc-grid --tracing=1"
//
// When you are done tracing, you will notice many pcap trace files
// in your directory. If you have tcpdump installed, you can try this:

View File

@@ -26,15 +26,15 @@
// There are a number of command-line options available to control
// the default behavior. The list of available command-line options
// can be listed with the following command:
// ./ns3 --run "wifi-simple-adhoc --help"
// ./ns3 run "wifi-simple-adhoc --help"
//
// For instance, for this configuration, the physical layer will
// stop successfully receiving packets when rss drops below -97 dBm.
// To see this effect, try running:
//
// ./ns3 --run "wifi-simple-adhoc --rss=-97 --numPackets=20"
// ./ns3 --run "wifi-simple-adhoc --rss=-98 --numPackets=20"
// ./ns3 --run "wifi-simple-adhoc --rss=-99 --numPackets=20"
// ./ns3 run "wifi-simple-adhoc --rss=-97 --numPackets=20"
// ./ns3 run "wifi-simple-adhoc --rss=-98 --numPackets=20"
// ./ns3 run "wifi-simple-adhoc --rss=-99 --numPackets=20"
//
// Note that all ns-3 attributes (not just the ones exposed in the below
// script) can be changed at command line; see the documentation.
@@ -42,7 +42,7 @@
// This script can also be helpful to put the Wifi layer into verbose
// logging mode; this command will turn on all wifi logging:
//
// ./ns3 --run "wifi-simple-adhoc --verbose=1"
// ./ns3 run "wifi-simple-adhoc --verbose=1"
//
// When you are done, you will notice two pcap trace files in your directory.
// If you have tcpdump installed, you can try this:

View File

@@ -36,7 +36,7 @@
// This example considers two hidden stations in an 802.11n network which supports MPDU aggregation.
// The user can specify whether RTS/CTS is used and can set the number of aggregated MPDUs.
//
// Example: ./ns3 --run "wifi-simple-ht-hidden-stations --enableRts=1 --nMpdus=8"
// Example: ./ns3 run "wifi-simple-ht-hidden-stations --enableRts=1 --nMpdus=8"
//
// Network topology:
//

View File

@@ -27,15 +27,15 @@
// There are a number of command-line options available to control
// the default behavior. The list of available command-line options
// can be listed with the following command:
// ./ns3 --run "wifi-simple-infra --help"
// ./ns3 run "wifi-simple-infra --help"
//
// For instance, for this configuration, the physical layer will
// stop successfully receiving packets when rss drops below -97 dBm.
// To see this effect, try running:
//
// ./ns3 --run "wifi-simple-infra --rss=-97 --numPackets=20"
// ./ns3 --run "wifi-simple-infra --rss=-98 --numPackets=20"
// ./ns3 --run "wifi-simple-infra --rss=-99 --numPackets=20"
// ./ns3 run "wifi-simple-infra --rss=-97 --numPackets=20"
// ./ns3 run "wifi-simple-infra --rss=-98 --numPackets=20"
// ./ns3 run "wifi-simple-infra --rss=-99 --numPackets=20"
//
// Note that all ns-3 attributes (not just the ones exposed in the below
// script) can be changed at command line; see the documentation.
@@ -43,7 +43,7 @@
// This script can also be helpful to put the Wifi layer into verbose
// logging mode; this command will turn on all wifi logging:
//
// ./ns3 --run "wifi-simple-infra --verbose=1"
// ./ns3 run "wifi-simple-infra --verbose=1"
//
// When you are done, you will notice two pcap trace files in your directory.
// If you have tcpdump installed, you can try this:

View File

@@ -58,7 +58,7 @@
// For instance, for this configuration, the interfering frame arrives
// at -90 dBm with a time offset of 3.2 microseconds:
//
// ./ns3 --run "wifi-simple-interference --Irss=-90 --delta=3.2"
// ./ns3 run "wifi-simple-interference --Irss=-90 --delta=3.2"
//
// Note that all ns-3 attributes (not just the ones exposed in the below
// script) can be changed at command line; see the documentation.
@@ -66,7 +66,7 @@
// This script can also be helpful to put the Wifi layer into verbose
// logging mode; this command will turn on all wifi logging:
//
// ./ns3 --run "wifi-simple-interference --verbose=1"
// ./ns3 run "wifi-simple-interference --verbose=1"
//
// When you are done, you will notice a pcap trace file in your directory.
// If you have tcpdump installed, you can try this:
@@ -77,7 +77,7 @@
//
// Next, try this command and look at the tcpdump-- you should see two packets
// that are no longer interfering:
// ./ns3 --run "wifi-simple-interference --delta=30000"
// ./ns3 run "wifi-simple-interference --delta=30000"
#include "ns3/command-line.h"
#include "ns3/config.h"

View File

@@ -31,7 +31,7 @@
// There are a number of command-line options available to control
// the default behavior. The list of available command-line options
// can be listed with the following command:
// ./ns3 --run "wifi-sleep --help"
// ./ns3 run "wifi-sleep --help"
//
// Note that all ns-3 attributes (not just the ones exposed in the below
// script) can be changed at command line; see the documentation.
@@ -39,7 +39,7 @@
// This script can also be helpful to put the Wifi layer into verbose
// logging mode; this command will turn on all wifi logging:
//
// ./ns3 --run "wifi-sleep --verbose=1"
// ./ns3 run "wifi-sleep --verbose=1"
//
// When you are done, you will notice four trace files in your directory:
// two for the remaining energy on each node and two for the state transitions

View File

@@ -42,15 +42,15 @@
//
// In general, the program can be configured at run-time by passing command-line arguments.
// The following command will display all of the available run-time help options:
// ./ns3 --run "wifi-spatial-reuse --help"
// ./ns3 run "wifi-spatial-reuse --help"
//
// By default, the script shows the benefit of the OBSS_PD spatial reuse script:
// ./ns3 --run wifi-spatial-reuse
// ./ns3 run wifi-spatial-reuse
// Throughput for BSS 1: 6.6468 Mbit/s
// Throughput for BSS 2: 6.6672 Mbit/s
//
// If one disables the OBSS_PD feature, a lower throughput is obtained per BSS:
// ./ns3 --run "wifi-spatial-reuse --enableObssPd=0"
// ./ns3 run "wifi-spatial-reuse --enableObssPd=0"
// Throughput for BSS 1: 5.8692 Mbit/s
// Throughput for BSS 2: 5.9364 Mbit/
//

View File

@@ -38,7 +38,7 @@
//
// Example: set slot time to 20 microseconds, while keeping other values as defined in the simulation script:
//
// ./ns3 --run "wifi-timing-attributes --slot=20"
// ./ns3 run "wifi-timing-attributes --slot=20"
//
// Network topology:
//

View File

@@ -57,7 +57,7 @@
//
// The user can select the distance between the stations and the APs, can enable/disable the RTS/CTS mechanism
// and can modify the duration of a TXOP.
// Example: ./ns3 --run "wifi-txop-aggregation --distance=10 --enableRts=0 --simulationTime=20"
// Example: ./ns3 run "wifi-txop-aggregation --distance=10 --enableRts=0 --simulationTime=20"
//
// The output prints the throughput and the maximum TXOP duration measured for the 4 cases/networks
// described above. When default aggregation parameters are enabled, the