This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import system | |
import os, glob | |
path = "./sys/kernel/debug/ieee80211/" | |
path += os.listdir(path)[0]+"/" # Add single 'phy' directory | |
path += glob.glob('*wl*',root_dir=path)[0]+"/stations/" # Add 'netdev\:wl*' directory | |
path += os.listdir(path)[0]+"/rate_scale_table" # Add single MAC directory | |
filePath_Intel8260 = path | |
print(filePath_Intel8260) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
Nsta=3 #Number of Wi-Fi stations | |
export 'NS_LOG=HeFrameExchangeManager'; #Enable logging (change FrameExchangeManager accordingly) | |
./waf --run "scratch/skrypt --Nsta=$Nsta" &> output.log #Run simulation | |
cat output.log | grep StartFrameExchange > output-tx.log #Store log of all TX attempts | |
cat output.log | grep "receive ack" > output-rx.log #Store log of all successful TXs #TODO: update this line to latest ns-3 | |
# Calculate per-station statistics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to populate ARP cache of all nodes in ns-3, prevents ARP blocking in Wi-Fi networks | |
// Execute after assigning IP addresses | |
// Author: Pavel Boyko? | |
// https://groups.google.com/d/msg/ns-3-users/L_ZfZ9L1_b0/dCuzc859ENcJ | |
void PopulateARPcache () { | |
Ptr<ArpCache> arp = CreateObject<ArpCache> (); | |
arp->SetAliveTimeout (Seconds (3600 * 24 * 365) ); | |
for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); ++i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void installTrafficGenerator(Ptr<ns3::Node> fromNode, Ptr<ns3::Node> toNode, int port, std::string offeredLoad, int packetSize, int simulationTime, int warmupTime ) { | |
Ptr<Ipv4> ipv4 = toNode->GetObject<Ipv4> (); // Get Ipv4 instance of the node | |
Ipv4Address addr = ipv4->GetAddress (1, 0).GetLocal (); // Get Ipv4InterfaceAddress of xth interface. | |
ApplicationContainer sourceApplications, sinkApplications; | |
uint8_t tosValue = 0x70; //AC_BE | |
//Add random fuzz to app start time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NodeContainer c; | |
c.Create (numNodes); | |
/*...*/ | |
for(NodeContainer::Iterator n = c.Begin (); n != c.End (); n++) | |
{ | |
Ptr<Node> object = *n; | |
uint32_t id = object->GetId(); | |
std::cout <<"Node Number "<< id << std::endl; | |
} |