A Discrete-Event Network Simulator
API
uan-cw-example.cc File Reference

This example showcases the "CW-MAC" described in System Design Considerations for Undersea Networks article in the IEEE Journal on Selected Areas of Communications 2008 by Nathan Parrish, Leonard Tracy and Sumit Roy. More...

#include "uan-cw-example.h"
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/mobility-module.h"
#include "ns3/stats-module.h"
#include "ns3/applications-module.h"
#include <fstream>
+ Include dependency graph for uan-cw-example.cc:

Go to the source code of this file.

Detailed Description

This example showcases the "CW-MAC" described in System Design Considerations for Undersea Networks article in the IEEE Journal on Selected Areas of Communications 2008 by Nathan Parrish, Leonard Tracy and Sumit Roy.

The MAC protocol is implemented in the class UanMacCw. CW-MAC is similar in nature to the IEEE 802.11 DCF with a constant backoff window. It requires two parameters to be set, the slot time and the contention window size. The contention window size is the backoff window size in slots, and the slot time is the duration of each slot. These parameters should be set according to the overall network size, internode spacing and the number of nodes in the network.

This example deploys nodes randomly (according to RNG seed of course) in a finite square region with the X and Y coordinates of the nodes distributed uniformly. The CW parameter is varied throughout the simulation in order to show the variation in throughput with respect to changes in CW.

Usage

$ ./ns3 run "uan-cw-example [Program Options]"

Program Options

–NumNodes
Number of transmitting nodes [15]
–Depth
Depth of transmitting and sink nodes [70]
–RegionSize
Size of boundary in meters [500]
–PacketSize
Generated packet size in bytes [32]
–DataRate
DataRate in bps [80]
–CwMin
Min CW to simulate [10]
–CwMax
Max CW to simulate [400]
–SlotTime
Slot time duration [+200ms]
–Averages
Number of topologies to test for each cw point [3]
–GnuFile
Name for GNU Plot output [uan-cw-example.gpl]
–PerModel
PER model name [ns3::UanPhyPerGenDefault]
–SinrModel
SINR model name [ns3::UanPhyCalcSinrDefault]
–Quiet
Run in quiet mode (disable logging) [false]

Definition in file uan-cw-example.cc.