Ns3-wifi-edcatest

Table of Contents:

  1. How to use this code
  2. Main change in src file
  3. Result analysis
  4. Model1.0
  5. Model2.0

1)How to use this code

This code is to simulate the relationship between contention window and transmitting performance

This code is based on ns-3.33,so you are recommended to download soure file from https://www.nsnam.org/releases/ns-3-33/

Some videos in youtube shows how to build and config ns3-platform. After you have compiled the file, copy the file to src and scartch, recomplie

./waf --build ./waf --config

Some files use absolute path, you should change them to your own path 1.myonoffapplication.cc in src/applications
2.cwshow.py
3.count.py

Then you can run the simulation by

cd ns3/ns-allinone-3.33/ns-3.33/
sudo ./waf --run scratch/'filename -parametername=parametervalue' >savefilename.dat (--vis)
(--vis) will show the figure by using pyviz.

demo.cc still needs further changes.

Also you can run

cd ns3/ns-allinone-3.33/ns-3.33/

./prob.sh

This command will run different situations,save them into different .dat file.

To analyse these results,we will use python to read these files. Than run cwshow.py,you will get the figure like .

97efa123e7ecf21a80c7c066fc4b91e

2)Main change in src file

The main change concludes:
1)myonfoff application: Using a time list and packetsizelist to control the transmitting rhythm.
myonoffapplication

2)poisson application: Using ns3::ExponentialRandomVariable to simulate the packet which follows a poisson distribution by adding attribute interval, this part referees

https://blog.csdn.net/u014565333/article/details/52761589?tdsourcetag=s_pctim_aiomsg

2)Cancel the cw changes is sta-wifi-mac.cc

3)Use mytag to sign special packet.

3)(Unfinished) Control algorithms in channel-access-manager.cc

3)Result analysis

2648cba2813fbe4e80d2ce527765dc3

For UDP,only 2 nodes contention

ea3ed140adf00b6b85e250ab0ce1321

For TCP,the ack packet will influence the result.

4)Model 1.0

This model contains three part to verify the model for CWvalue and transmitting opportunity.

The code model10 changes CW value for different STAs.

The code model11 tries to get the result for different AC in the same STA.

The code model12 tries to get the result which combines different AC and AP, in this part, we capture the packet via different port number.

5)Model 2.0

Model 2 is used to verify the delay by using Pollaczek–Khintchine (PK) formula. Figure_2