Research Projects in NS3

Research Projects in NS3 having the detail of research on MAC network layer. The numbers of routing protocols are present in MAC network layer.

MAC protocols in ad hoc network [ Research Projects in NS3]:

  • MAC protocol is used for Coordination and scheduling of transmissions among competing neighbors
  • Goals of MAC protocols is:
    • Real time support
    • Achieve low latency
    • Good channel utilization
    • Best effort services etc
  • Types of MAC layer protocols:
    • For random access
      • MACA
      • CSMA
      • FAMA (Floor Acquisition Multiple Access)
      • DCF (Distributed coordinated function)
      • PCF (Point Coordinated Function)
  • Channel partition
    • CDMA
    • TDMA
    • FDMA
  • Challenges on MAC protocols:
    • Mobility of nodes
    • Hidden and exposed terminal problems
    • Quality of support
    • Distributed nature/lack of central coordination
    • BANDWIDTH EFFICIENCYAND OVERHEAD
    • Quality of support
    • Error prone shared broadcast channel.

Sample code for adhoc network:
AdhocWifiMac::SetAddress (Mac48Address address)
{
NS_LOG_FUNCTION (this << address);
RegularWifiMac::SetAddress (address);
RegularWifiMac::SetBssid (address);
}
AdhocWifiMac::Enqueue (Ptr packet, Mac48Address to)
{
NS_LOG_FUNCTION (this << packet << to); if (m_stationManager->IsBrandNew (to))
{
m_stationManager->AddAllSupportedModes (to);
m_stationManager->RecordDisassociated (to);
}

if (m_qosSupported)
{
hdr.SetType (WIFI_MAC_QOSDATA);
hdr.SetQosAckPolicy (WifiMacHeader::NORMAL_ACK);
hdr.SetQosNoEosp ();
hdr.SetQosNoAmsdu ();
hdr.SetQosTxopLimit (0);
tid = QosUtilsGetTidForPacket (packet);
if (tid >= 7)
{
tid = 0;
}
hdr.SetQosTid (tid);
}
else
{
hdr.SetTypeData ();
}

hdr.SetAddr1 (to);
hdr.SetAddr2 (m_low->GetAddress ());
hdr.SetAddr3 (GetBssid ());
hdr.SetDsNotFrom ();
hdr.SetDsNotTo ();
AdhocWifiMac::SetLinkUpCallback (Callback linkUp)
{
NS_LOG_FUNCTION (this << &linkUp);
RegularWifiMac::SetLinkUpCallback (linkUp);
linkUp ();
}

WifiMac::Configure80211a (void)
{
SetSifs (MicroSeconds (16));
SetSlot (MicroSeconds (9));
SetEifsNoDifs (MicroSeconds (16 + 44));
SetPifs (MicroSeconds (16 + 9));
SetCtsTimeout (MicroSeconds (16 + 44 + 9 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
SetAckTimeout (MicroSeconds (16 + 44 + 9 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
}

MAC protocols in sensor network: [ Research Projects in NS3]

The main scope of the MAC protocol in sensor network is to reduce the energy waste.

  • Reasons for reducing energy waste are:
    • Collision
    • Idle listening
    • Overhearing
    • Control packet overhead etc.
  • Properties of MAC protocol in WSN:
    • Energy efficiency
    • Scalability and adaptability to changes
      • Node density
      • Network size
      • Network topology
    • Latency
    • Throughput
    • Bandwidth utilization
  • Reasons for considering network property:
    • Limited node life time
    • Addition of new node to the network
    • Varying interference
    • Network topology changes etc
  • Types of MAC protocols:
    • SIFT
    • S-MAC
    • TRAMA
    • WMAC
    • DMAC
    • T-MAC/DSMAC

Sample code for Research Projects in NS3:
for (uint32_t i = 0; i < backboneNodes; ++i)
{
NodeContainer stas;
stas.Create (sensorNodes – 1);
NodeContainer sensor (backbone.Get (i), stas);
WifiHelper wifisensor = WifiHelper::Default ();
NqosWifiMacHelper macsensor = NqosWifiMacHelper::Default ();
wifiPhy.SetChannel (wifiChannel.Create ());
std::string ssidString (“wifi-sensor”);
std::stringstream ss;
ss << i;
ssidString += ss.str ();
Ssid ssid = Ssid (ssidString);
wifisensor.SetRemoteStationManager (“ns3::ArfWifiManager”);

macsensor.SetType (“ns3::StaWifiMac”,
“Ssid”, SsidValue (ssid),
“ActiveProbing”, BooleanValue (false));
NetDeviceContainer staDevices = wifisensor.Install (wifiPhy, macsensor, stas);

macsensor.SetType (“ns3::ApWifiMac”,
“Ssid”, SsidValue (ssid),
“BeaconGeneration”, BooleanValue (true),
“BeaconInterval”, TimeValue(Seconds(2.5)));
NetDeviceContainer apDevices = wifisensor.Install (wifiPhy, macsensor, backbone.Get (i));

NetDeviceContainer sensorDevices (apDevices, staDevices);
internet.Install (stas);
ipAddrs.Assign (sensorDevices);
ipAddrs.NewNetwork ();
Ptr subnetAlloc =
CreateObject ();
for (uint32_t j = 0; j < sensor.GetN (); ++j) { subnetAlloc->Add (Vector (0.0, j, 0.0));
}
mobility.PushReferenceMobilityModel (backbone.Get (i));
mobility.SetPositionAllocator (subnetAlloc);
mobility.SetMobilityModel (“ns3::RandomDirection2dMobilityModel”,
“Bounds”, RectangleValue (Rectangle (-10, 10, -10, 10)),
“Speed”, StringValue (“ns3::ConstantRandomVariable[Constant=3]”),
“Pause”, StringValue (“ns3::ConstantRandomVariable[Constant=0.4]”));
mobility.Install (stas);
}

WifiMac::Configure80211b (void)
{
SetSifs (MicroSeconds (10));
SetSlot (MicroSeconds (20));
SetEifsNoDifs (MicroSeconds (10 + 304));
SetPifs (MicroSeconds (10 + 20));
SetCtsTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
SetAckTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
}
WifiMac::Configure80211g (void)
{
SetSifs (MicroSeconds (10));
// Note no support for Short Slot Time as yet
SetSlot (MicroSeconds (20));
SetEifsNoDifs (MicroSeconds (10 + 304));
SetPifs (MicroSeconds (10 + 20));
SetCtsTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
SetAckTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
}
WifiMac::Configure80211_10Mhz (void)
{
SetSifs (MicroSeconds (32));
SetSlot (MicroSeconds (13));
SetEifsNoDifs (MicroSeconds (32 + 88));
SetPifs (MicroSeconds (32 + 13));
SetCtsTimeout (MicroSeconds (32 + 88 + 13 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
SetAckTimeout (MicroSeconds (32 + 88 + 13 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
}