├── mininet-wifi ├── WCNC-2018 │ ├── poster.pdf │ ├── README.md │ └── krack-mininet-wifi.py ├── V2X-Slicing │ ├── arq-multi-c.png │ ├── run.sh │ ├── README.md │ ├── car1.py │ ├── multi-c-approach.py │ └── single-c-approach.py ├── scalabilityTest │ ├── mem_ovs_linear.txt │ ├── mem_ovs_single.txt │ ├── mem_user_linear.txt │ ├── mem_user_single.txt │ ├── icmp-User-LinearTopo-benchmark.txt │ ├── icmp-OVS-LinearTopo-benchmark.txt │ ├── icmp-OVS-SingleTopo-benchmark.txt │ ├── icmp-User-SingleTopo-benchmark.txt │ ├── OVS-SingleTopo-benchmark.txt │ ├── User-SingleTopo-benchmark.txt │ ├── OVS-LinearTopo-benchmark.txt │ ├── User-LinearTopo-benchmark.txt │ ├── README.md │ ├── code.py │ └── report_ICMP_Linear.eps ├── UNICAMP-2017 │ ├── data.txt │ ├── propagation_model.py │ ├── gnuplot.py │ ├── adhoc_mesh.py │ └── handover.py ├── SBRC-2016 │ ├── README.md │ ├── wifiStationsAndHosts.py │ └── sbrc.py ├── SIGCOMM-2016 │ ├── rule.hybridVirtualPhysical │ ├── README.md │ └── hybridVirtualPhysical.py ├── The-Computer-Journal-2017 │ ├── rule.hybridVirtualPhysical │ ├── Readme.md │ ├── replayingNetwork │ │ ├── ieee80211g │ │ │ ├── serverTrace.txt │ │ │ ├── clientTrace.txt │ │ │ └── replayingNetwork.py │ │ └── ieee80211b │ │ │ ├── replayingNetwork.py │ │ │ ├── serverTrace.txt │ │ │ └── clientTrace.txt │ ├── propagationModelCase.py │ ├── ncasting.py │ ├── fileTransferring.py │ ├── forwardingBySSID.py │ ├── ncasting-controller.py │ ├── mptcp.py │ ├── README.md │ ├── hybridVirtualPhysical.py │ └── fileTransferring.cc ├── SWITCHON-2015 │ ├── README.md │ └── allWirelessNetworksAroundUs.py ├── CNSM2015 │ ├── README.md │ ├── ncasting.py │ └── ncasting-controller.py ├── IEEE-Access-2017 │ ├── README.md │ └── vanet.py ├── ACROSS-Sweden-2017 │ ├── handover.py │ └── tc_wmediumd.py ├── README.md ├── others │ └── openflowPacketFiltering.py └── mininet-wifi-sflow-rt.py └── README.md /mininet-wifi/WCNC-2018/poster.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramonfontes/reproducible-research/HEAD/mininet-wifi/WCNC-2018/poster.pdf -------------------------------------------------------------------------------- /mininet-wifi/V2X-Slicing/arq-multi-c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramonfontes/reproducible-research/HEAD/mininet-wifi/V2X-Slicing/arq-multi-c.png -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/mem_ovs_linear.txt: -------------------------------------------------------------------------------- 1 | 313 2 | 358 3 | 368 4 | 373 5 | 380 6 | 384 7 | 392 8 | 399 9 | 407 10 | 414 11 | 415 12 | 436 13 | 436 14 | 441 15 | 453 16 | 441 17 | 459 18 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/mem_ovs_single.txt: -------------------------------------------------------------------------------- 1 | 459 2 | 457 3 | 430 4 | 431 5 | 430 6 | 431 7 | 430 8 | 431 9 | 430 10 | 427 11 | 428 12 | 426 13 | 426 14 | 427 15 | 429 16 | 426 17 | 426 18 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/mem_user_linear.txt: -------------------------------------------------------------------------------- 1 | 463 2 | 463 3 | 463 4 | 465 5 | 463 6 | 470 7 | 465 8 | 464 9 | 464 10 | 465 11 | 463 12 | 470 13 | 467 14 | 465 15 | 457 16 | 461 17 | 462 18 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/mem_user_single.txt: -------------------------------------------------------------------------------- 1 | 427 2 | 427 3 | 428 4 | 428 5 | 427 6 | 427 7 | 428 8 | 427 9 | 428 10 | 428 11 | 428 12 | 429 13 | 427 14 | 428 15 | 428 16 | 426 17 | 429 18 | -------------------------------------------------------------------------------- /mininet-wifi/UNICAMP-2017/data.txt: -------------------------------------------------------------------------------- 1 | -46 5 7.11 2 | -73 105 7.11 3 | -78 205 7.04 4 | -82 305 6.92 5 | -84 405 6.91 6 | -86 505 6.90 7 | -88 605 5.90 8 | -89 705 5.81 9 | -90 805 4.11 10 | -91 905 2.25 11 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/icmp-User-LinearTopo-benchmark.txt: -------------------------------------------------------------------------------- 1 | 0.188 2 | 0.241 3 | 0.755 4 | 0.748 5 | 0.604 6 | 0.938 7 | 25.0 8 | 22.1 9 | 28.9 10 | 193 11 | 1.41 12 | 6.51 13 | 6.63 14 | 2947 15 | 78.3 16 | 548 17 | 517 18 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/icmp-OVS-LinearTopo-benchmark.txt: -------------------------------------------------------------------------------- 1 | 0.052 2 | 0.115 3 | 0.231 4 | 0.366 5 | 0.414 6 | 0.514 7 | 0.731 8 | 1.12 9 | 0.748 10 | 161 11 | 0.858 12 | 0.943 13 | 1.52 14 | 1.34 15 | 168 16 | 1.53 17 | 1.78 18 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/icmp-OVS-SingleTopo-benchmark.txt: -------------------------------------------------------------------------------- 1 | 0.049 2 | 0.084 3 | 0.131 4 | 0.167 5 | 0.276 6 | 0.243 7 | 0.343 8 | 0.357 9 | 0.408 10 | 0.466 11 | 0.496 12 | 0.541 13 | 0.564 14 | 0.622 15 | 0.675 16 | 0.740 17 | 0.771 18 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/icmp-User-SingleTopo-benchmark.txt: -------------------------------------------------------------------------------- 1 | 0.069 2 | 0.092 3 | 0.131 4 | 0.194 5 | 0.235 6 | 0.281 7 | 0.331 8 | 0.363 9 | 0.416 10 | 0.446 11 | 0.524 12 | 0.510 13 | 0.607 14 | 0.626 15 | 0.700 16 | 0.759 17 | 0.815 18 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/OVS-SingleTopo-benchmark.txt: -------------------------------------------------------------------------------- 1 | 2.883,489 2 | 5.950,506 3 | 9.119,517 4 | 13.073,530 5 | 17.396,542 6 | 21.393,554 7 | 24.983,565 8 | 29.096,578 9 | 34.703,590 10 | 39.736,600 11 | 43.309,614 12 | 46.718,626 13 | 48.696,638 14 | 52.680,651 15 | 55.318,665 16 | 64.926,677 17 | 69.416,689 18 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/User-SingleTopo-benchmark.txt: -------------------------------------------------------------------------------- 1 | 2.752,476 2 | 5.851,486 3 | 9.083,498 4 | 13.653,510 5 | 17.392,521 6 | 21.315,534 7 | 25.010,546 8 | 28.705,558 9 | 34.651,570 10 | 39.162,584 11 | 42.980,597 12 | 46.981,609 13 | 49.666,623 14 | 51.963,635 15 | 55.822,647 16 | 60.381,662 17 | 69.229,677 18 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/OVS-LinearTopo-benchmark.txt: -------------------------------------------------------------------------------- 1 | 3.007,422 2 | 10.011,463 3 | 17.347,503 4 | 26.657,540 5 | 35.886,580 6 | 45.103,616 7 | 55.964,657 8 | 66.956,698 9 | 78.740,743 10 | 96.532,790 11 | 112.521,830 12 | 143.911,871 13 | 443.444,910 14 | 794.280,965 15 | 1815.123,1017 16 | 2363.985,1048 17 | 2601.378,1073 18 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/User-LinearTopo-benchmark.txt: -------------------------------------------------------------------------------- 1 | 2.790,510 2 | 9.730,545 3 | 16.861,587 4 | 24.032,637 5 | 31.938,676 6 | 40.504,727 7 | 49.590,753 8 | 59.931,805 9 | 71.857,845 10 | 84.436,891 11 | 99.980,932 12 | 115.706,977 13 | 135.168,1015 14 | 522.576,1057 15 | 1687.939,1097 16 | 2280.674,1141 17 | 2751.061,1186 18 | -------------------------------------------------------------------------------- /mininet-wifi/SBRC-2016/README.md: -------------------------------------------------------------------------------- 1 | ### Please refer to the manual of Mininet-WiFi to reproduce this paper. 2 | 3 | Ramon dos Reis Fontes and Christian Esteve Rothenberg. Mininet-WiFi: Emulação de Redes Sem Fio Definidas por Software com suporte a Mobilidade. In Simpósio Brasileiro de Redes de 4 | Computadores e Sistemas Distribuídos (SBRC 2016) - Salão de Ferramentas, 2016, Salvador - BA - Brazil. 5 | -------------------------------------------------------------------------------- /mininet-wifi/SIGCOMM-2016/rule.hybridVirtualPhysical: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dpctl unix:/tmp/ap3 meter-mod cmd=add,flags=1,meter=1 drop:rate=700 4 | 5 | for i in {50..80} 6 | do 7 | dpctl unix:/tmp/ap3 flow-mod table=0,cmd=add in_port=4,eth_type=0x800,ip_dst=10.0.0.$i meter:1 apply:output=flood 8 | done 9 | 10 | dpctl unix:/tmp/phyap1 flow-mod table=0,cmd=add in_port=2,ip_dst=10.0.0.109,eth_type=0x800,ip_proto=6,tcp_dst=80 apply:set_field=tcp_dst:80,set_field=ip_dst:10.0.0.111,output=5 11 | dpctl unix:/tmp/phyap1 flow-mod table=0,cmd=add in_port=1,eth_type=0x800,ip_proto=6,tcp_src=80 apply:set_field=ip_src:10.0.0.109,output=2 12 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/rule.hybridVirtualPhysical: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dpctl unix:/tmp/ap3 meter-mod cmd=add,flags=1,meter=1 drop:rate=700 4 | 5 | for i in {50..80} 6 | do 7 | dpctl unix:/tmp/ap3 flow-mod table=0,cmd=add in_port=4,eth_type=0x800,ip_dst=10.0.0.$i meter:1 apply:output=flood 8 | done 9 | 10 | dpctl unix:/tmp/phyap1 flow-mod table=0,cmd=add in_port=2,ip_dst=10.0.0.109,eth_type=0x800,ip_proto=6,tcp_dst=80 apply:set_field=tcp_dst:80,set_field=ip_dst:10.0.0.111,output=5 11 | dpctl unix:/tmp/phyap1 flow-mod table=0,cmd=add in_port=1,eth_type=0x800,ip_proto=6,tcp_src=80 apply:set_field=ip_src:10.0.0.109,output=2 12 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/Readme.md: -------------------------------------------------------------------------------- 1 | ### Please refer to the manual of Mininet-WiFi to reproduce this paper. 2 | 3 | ### Bibtex: 4 | 5 | @article{Fontes2017, 6 | doi = {10.1093/comjnl/bxx023}, 7 | url = {https://doi.org/10.1093%2Fcomjnl%2Fbxx023}, 8 | year = {2017}, 9 | month = {mar}, 10 | publisher = {Oxford University Press ({OUP})}, 11 | pages = {1--14}, 12 | author = {Ramon dos Reis Fontes and Mohamed Mahfoudi and Walid Dabbous and Thierry Turletti and Christian Rothenberg}, 13 | title = {How Far Can We Go? Towards Realistic Software-Defined Wireless Networking Experiments}, 14 | journal = {The Computer Journal} 15 | } 16 | -------------------------------------------------------------------------------- /mininet-wifi/V2X-Slicing/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$1" == "h1" ]; then 4 | echo "running h1 on port 6690..." 5 | PYTHONPATH=. ./bin/ryu-manager --ofp-tcp-listen-port 6690 ryu/app/wifi.py 6 | elif [ "$1" == "h2" ]; then 7 | echo "running h2 on port 6691..." 8 | PYTHONPATH=. ./bin/ryu-manager --ofp-tcp-listen-port 6691 ryu/app/wifi.py 9 | elif [ "$1" == "h3" ]; then 10 | echo "running h3 on port 6692..." 11 | PYTHONPATH=. ./bin/ryu-manager --ofp-tcp-listen-port 6692 ryu/app/wifi.py 12 | elif [ "$1" == "h4" ]; then 13 | echo "running h4 on port 6693..." 14 | PYTHONPATH=. ./bin/ryu-manager --ofp-tcp-listen-port 6693 ryu/app/simple_switch_13.py 15 | fi 16 | -------------------------------------------------------------------------------- /mininet-wifi/SWITCHON-2015/README.md: -------------------------------------------------------------------------------- 1 | ### Requirements 2 | - Mininet-WiFi 3 | - VLC 4 | 5 | ### Reproducibility Steps 6 | 7 | ``` 8 | sudo python allWirelessNetworksAroundUs.py 9 | mininet-wifi> xterm sta1 h1 10 | ``` 11 | 12 | **sta1 terminal:** 13 | ``` 14 | cvlc -vvv v4l2:///dev/video0 --input-slave=alsa://hw:1,0 --mtu 1000 --sout'#transcode{vcodec=mp4v,vb=800,scale=1,acodec=mpga,ab=128,channels=1}: duplicate{dst=display,dst=rtp{sdp=rtsp://10.0.0.10:8080/helmet.sdp}' 15 | ``` 16 | 17 | **h1 terminal:** 18 | ``` 19 | cvlc rtsp://10.0.0.10:8080/helmet.sdp 20 | ``` 21 | 22 | Fontes, R. R., Rothenberg, C. E. Towards an Emulator for Software-Defined Wireless Networks. In: SwitchOn 2015, São Paulo – SP – Brazil. 23 | -------------------------------------------------------------------------------- /mininet-wifi/CNSM2015/README.md: -------------------------------------------------------------------------------- 1 | ### Requirements 2 | - Mininet-WiFi 3 | - Floodlight 4 | 5 | ### Reproducibility Steps 6 | 7 | **Terminal 1** 8 | ``` 9 | ~/floodlight$ sudo java -jar target/floodlight.jar 10 | ``` 11 | 12 | **Terminal 2** 13 | ``` 14 | sudo python ncasting.py 15 | mininet-wifi> sh python ncasting-controller.py 16 | ``` 17 | 18 | ### bibtex 19 | @inproceedings{fontes2015mininet, 20 | title={Mininet-WiFi: Emulating software-defined wireless networks}, 21 | author={Fontes, Ramon R and Afzal, Samira and Brito, Samuel HB and Santos, Mateus AS and Rothenberg, Christian Esteve}, 22 | booktitle={Network and Service Management (CNSM), 2015 11th International Conference on}, 23 | pages={384--389}, 24 | year={2015}, 25 | organization={IEEE} 26 | } 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Reproducible Research 2 | 3 | Access my *reproducible research* in this repository, which includes both the essential codes and comprehensive instructions needed to replicate my research papers. The current offerings in the repository are specifically focused on Mininet-WiFi. 4 | 5 | Within this repository, you will find: 6 | 7 | Codebase: The repository houses all the necessary code related to my research, ensuring transparency and accessibility. 8 | 9 | Reproducibility Guidelines: I've provided clear, step-by-step instructions that guide you through the process of replicating my research. These guidelines are designed to make the replication process as straightforward as possible. 10 | 11 | By sharing these resources, my goal is to facilitate collaboration, knowledge sharing, and the ability for others to build upon my work with confidence. 12 | -------------------------------------------------------------------------------- /mininet-wifi/WCNC-2018/README.md: -------------------------------------------------------------------------------- 1 | ### Requirements ### 2 | * python-scapy 3 | * ryu 4 | * ofsoftswitch13 5 | 6 | ### Reproducibility Steps ### 7 | 8 | ##### Terminal 1: ##### 9 | ``` 10 | sudo python krack-mininet-wifi.py 11 | ``` 12 | 13 | ##### Terminal 2: ##### 14 | ``` 15 | git clone https://github.com/ramonfontes/ryu -b dev 16 | ~/ryu$ sudo PYTHONPATH=. ./bin/ryu-manager ryu/app/krack_code.py ryu/app/krack_app.py 17 | ``` 18 | 19 | ##### Terminal 1: ##### 20 | ``` 21 | mininet-wifi>py sta1.setPosition('150,100,0') 22 | mininet-wifi>sta1 ping 10.0.0.102 23 | ``` 24 | 25 | #### bibtex: 26 | @article{fontesonthekrackattack, 27 | title={On the Krack Attack: Reproducing Vulnerability and a Software-Defined Mitigation Approach}, 28 | author={Fontes, Ramon dos Reis and Rothenberg, Christian Esteve}, 29 | year={2017}, 30 | organization={WCNC} 31 | } 32 | -------------------------------------------------------------------------------- /mininet-wifi/IEEE-Access-2017/README.md: -------------------------------------------------------------------------------- 1 | ### Requirements 2 | ``` 3 | - Mininet-WiFi 4 | - VLC 5 | ``` 6 | 7 | ### Reproducibility steps 8 | ``` 9 | - ~/mininet-wifi$ git clone https://github.com/ramonfontes/reproducible-research 10 | - ~/mininet-wifi$ sudo rm -r /usr/local/lib/python2.7/dist-packages/mininet* 11 | - ~/mininet-wifi$ git reset --hard b43af65 12 | - ~/mininet-wifi$ sudo make install 13 | - ~/mininet-wifi$ cd reproducible-research/mininet-wifi/IEEE-Access-2017 14 | - ~/mininet-wifi/reproducible-research/mininet-wifi/IEEE-Access-2017$ sudo python vanet.py 15 | ``` 16 | 17 | ### Bibtex: 18 | @article{DosReisFontes2017, 19 | doi = {10.1109/access.2017.2671030}, 20 | url = {https://doi.org/10.1109%2Faccess.2017.2671030}, 21 | year = {2017}, 22 | publisher = {Institute of Electrical and Electronics Engineers ({IEEE})}, 23 | volume = {5}, 24 | pages = {3069--3076}, 25 | author = {Ramon Dos Reis Fontes and Claudia Campolo and Christian Esteve Rothenberg and Antonella Molinaro}, 26 | title = {From Theory to Experimental Evaluation: Resource Management in Software-Defined Vehicular Networks}, 27 | journal = {{IEEE} Access} 28 | } 29 | 30 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/replayingNetwork/ieee80211g/serverTrace.txt: -------------------------------------------------------------------------------- 1 | 0 0 0 0 0.719447 2 | 1 2025908 0 0 0.980924 3 | 2 3339557 0 0 0.99843 4 | 3 3027147 0 0 0.999795 5 | 4 3338112 0 0 0.99861 6 | 5 3248741 0 0 0.998815 7 | 6 3135533 0 0 0.998874 8 | 7 3167932 0 0 0.999527 9 | 8 3340880 0 0 0.999 10 | 9 3099055 0 0 0.999738 11 | 10 3208066 0 0 0.999157 12 | 11 3235881 0 0 0.998524 13 | 12 3101028 0 0 0.980029 14 | 13 3259126 0 0 0.997975 15 | 14 3323429 0 0 0.998732 16 | 15 3111584 0 0 0.996949 17 | 16 3283853 0 0 0.999298 18 | 17 3097571 0 0 0.996643 19 | 18 3256052 0 0 0.998672 20 | 19 3309242 0 0 0.998609 21 | 20 3100830 0 0 0.999639 22 | 21 3285310 0 0 0.999672 23 | 22 3315237 0 0 0.99933 24 | 23 3062580 0 0 0.999155 25 | 24 3187553 0 0 0.999207 26 | 25 3294084 0 0 0.997781 27 | 26 3203150 0 0 0.999735 28 | 27 3318909 0 0 0.999017 29 | 28 3151911 0 0 0.999687 30 | 29 3282695 0 0 0.999268 31 | 30 3255924 0 0 0.998311 32 | 31 3110961 0 0 0.999803 33 | 32 3264288 0 0 0.998938 34 | 33 3235827 0 0 0.997293 35 | 34 3212848 0 0 0.999285 36 | 35 3193445 0 0 0.998181 37 | 36 3260257 0 0 0.99909 38 | 37 3255568 0 0 0.984039 39 | 38 3268249 0 0 0.998089 40 | 39 3220446 0 0 0.998108 41 | 40 3079554 0 0 0.999079 42 | 41 3261055 0 0 0.999592 43 | 42 3313526 0 0 0.99327 44 | 43 3080927 0 0 0.992444 45 | 44 3329531 0 0 0 46 | -------------------------------------------------------------------------------- /mininet-wifi/SBRC-2016/wifiStationsAndHosts.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | "This example shows how work with wireless and wired media" 4 | 5 | from mininet.log import setLogLevel, info 6 | from mininet.node import Controller 7 | from mn_wifi.cli import CLI 8 | from mn_wifi.net import Mininet_wifi 9 | 10 | 11 | def topology(): 12 | "Create a network." 13 | net = Mininet_wifi( controller=Controller ) 14 | 15 | info("*** Creating nodes\n") 16 | ap1 = net.addAccessPoint( 'ap1', ssid="simplewifi", mode="g", channel="5" ) 17 | sta1 = net.addStation( 'sta1', ip='192.168.0.1/24' ) 18 | sta2 = net.addStation( 'sta2', ip='192.168.0.2/24' ) 19 | h3 = net.addHost( 'h3', ip='192.168.0.3/24' ) 20 | h4 = net.addHost( 'h4', ip='192.168.0.4/24' ) 21 | c0 = net.addController('c0') 22 | 23 | net.configureWifiNodes() 24 | 25 | info("*** Adding Link\n") 26 | net.addLink(sta1, ap1) 27 | net.addLink(sta2, ap1) 28 | net.addLink(h3, ap1) 29 | net.addLink(h4, ap1) 30 | 31 | info("*** Starting network\n") 32 | net.build() 33 | c0.start() 34 | ap1.start( [c0] ) 35 | 36 | info("*** Running CLI\n") 37 | CLI( net ) 38 | 39 | info("*** Stopping network\n") 40 | net.stop() 41 | 42 | if __name__ == '__main__': 43 | setLogLevel( 'info' ) 44 | topology() 45 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/replayingNetwork/ieee80211g/clientTrace.txt: -------------------------------------------------------------------------------- 1 | 0 0 0 0 0.005518 2 | 1 2025908 0 0 0.999753 3 | 2 3339557 0 0 0.999731 4 | 3 3027147 0 0 0.998137 5 | 4 3338112 0 0 0.997007 6 | 5 3248741 0 0 0.992928 7 | 6 3135533 0 0 0.998179 8 | 7 3167932 0 0 0.998589 9 | 8 3340880 0 0 0.998032 10 | 9 3099055 0 0 0.999461 11 | 10 3208066 0 0 0.99414 12 | 11 3235881 0 0 0.972299 13 | 12 3101028 0 0 0.99601 14 | 13 3259126 0 0 0.998402 15 | 14 3323429 0 0 0.998603 16 | 15 3111584 0 0 0.997586 17 | 16 3283853 0 0 0.99877 18 | 17 3097571 0 0 0.998192 19 | 18 3256052 0 0 0.999225 20 | 19 3309242 0 0 0.997875 21 | 20 3100830 0 0 0.99778 22 | 21 3285310 0 0 0.998379 23 | 22 3315237 0 0 0.998741 24 | 23 3062580 0 0 0.998333 25 | 24 3187553 0 0 0.995722 26 | 25 3294084 0 0 0.998257 27 | 26 3203150 0 0 0.998466 28 | 27 3318909 0 0 0.997319 29 | 28 3151911 0 0 0.998867 30 | 29 3282695 0 0 0.998144 31 | 30 3255924 0 0 0.998451 32 | 31 3110961 0 0 0.999005 33 | 32 3264288 0 0 0.997952 34 | 33 3235827 0 0 0.997563 35 | 34 3212848 0 0 0.99884 36 | 35 3193445 0 0 0.997473 37 | 36 3260257 0 0 0.999835 38 | 37 3255568 0 0 0.999696 39 | 38 3268249 0 0 0.999426 40 | 39 3220446 0 0 0.998454 41 | 40 3079554 0 0 0.997704 42 | 41 3261055 0 0 0.998926 43 | 42 3313526 0 0 0.999808 44 | 43 3080927 0 0 0.997815 45 | 44 3329531 0 0 0 46 | -------------------------------------------------------------------------------- /mininet-wifi/UNICAMP-2017/propagation_model.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 'This example creates a simple network topology with 1 AP and 3 stations' 4 | 5 | from mininet.log import setLogLevel, info 6 | from mn_wifi.net import Mininet_wifi 7 | from mn_wifi.cli import CLI 8 | from mn_wifi.link import wmediumd 9 | from mn_wifi.wmediumdConnector import interference 10 | 11 | 12 | def topology(): 13 | "Create a network." 14 | net = Mininet_wifi(link=wmediumd, wmediumd_mode=interference) 15 | 16 | info("*** Creating nodes\n") 17 | net.addStation('sta1', position='10,20,0') 18 | net.addStation('sta2', position='40,30,0') 19 | net.addStation('sta3', position='60,20,0') 20 | net.addAccessPoint('ap1', ssid="my-ssid", mode="a", channel="36", 21 | failMode='standalone', position='10,10,0') 22 | 23 | info("*** Configuring Propagation Model\n") 24 | net.setPropagationModel(model="logDistance", exp=4) 25 | 26 | net.plotGraph(max_x=100, max_y=100) 27 | 28 | info("*** Configuring wifi nodes\n") 29 | net.configureWifiNodes() 30 | 31 | info("*** Starting network\n") 32 | net.build() 33 | 34 | info("*** Running CLI\n") 35 | CLI(net) 36 | 37 | info("*** Stopping network\n") 38 | net.stop() 39 | 40 | if __name__ == '__main__': 41 | setLogLevel('info') 42 | topology() 43 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/README.md: -------------------------------------------------------------------------------- 1 | ### Requirements to reproduce the results of this work: 2 | * Mininet-WiFi 3 | * Further requirements are installed when you install Mininet-WiFi. 4 | 5 | ### How to reproduce this work: 6 | * Run the code with **python code.py** 7 | 8 | ### You might be interested in define different number of nodes for single and linear topos: 9 | * If so, please define the number of nodes in **nr_nodes_single** and **nr_nodes_linear** 10 | 11 | ### You might be interested in define the number of repetitions: 12 | * If so, please define the number of repetitions in **repetitions** 13 | 14 | ### Server and software specifications of the deployment environment (it refers the results presented into the eps files): 15 | 16 | * **Server**: Lenovo ThinkServer RD640 17 | * **Memory**: 24 GB 18 | * **CPU**: 12-core 2.10GHz Intel Xeon E5-2620 v2 19 | * **OS**: Ubuntu 16.04 x86-64 20 | * **Kernel**: 4.8.0-41-generic 21 | * **Mininet-WiFi**: 2.0r2 22 | * **Open vSwitch**: 2.5.0 23 | * **OpenFlow Reference Implementation**: 1.0.0 24 | 25 | ### Please note that the code available at this page includes an extra test: 26 | The extra test is about sending data over ICMP with ping between two nodes, where the nodes (sta1 and sta2) are associated to the first two access points. The idea is to identify the impact of the consumed memory in the final results of the ping response time. 27 | 28 | -------------------------------------------------------------------------------- /mininet-wifi/UNICAMP-2017/gnuplot.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import matplotlib 4 | matplotlib.use('Agg') 5 | import matplotlib.pyplot as plt 6 | import glob 7 | 8 | #Caminho dos arquivos de Path a serem lidos 9 | myPath="./" 10 | #Contador da quantidade de arquivos de Path 11 | pttPathCounter = len(glob.glob1(myPath,"data.txt")) 12 | #Armazena em Array o nome dos arquivos de Path 13 | files=glob.glob1(myPath,"data.txt") 14 | 15 | f2 = open(myPath+'data.txt', 'r') 16 | newlines = f2.readlines() 17 | f2.close() 18 | 19 | # initialize some variable to be lists: 20 | rss = [] 21 | dist = [] 22 | bw = [] 23 | 24 | # scan the rows of the file stored in lines, and put the values into some variables: 25 | for newline in newlines: 26 | p = newline.split() 27 | rss.append(float(p[0])) 28 | dist.append(float(p[1])) 29 | bw.append(float(p[2])) 30 | 31 | fig, ax1 = plt.subplots() 32 | ax2 = ax1.twinx() 33 | 34 | ax1.plot(dist, rss, color='green', marker='+', markevery=1, linewidth=2, label="Sinal") 35 | ax2.plot(dist, bw, color='black', marker='.', markevery=1, linewidth=2, label="Largura de Banda") 36 | 37 | ax1.set_ylabel("Sinal (dBm)") 38 | ax1.set_xlabel("Distancia (m)") 39 | ax2.set_ylabel("Largura de Banda (Mbps)") 40 | 41 | ax2.legend(loc=1, borderaxespad=0.) 42 | ax1.legend(loc=2, borderaxespad=0.) 43 | 44 | #plt.ylim([-10,100]) 45 | plt.margins(0.02, 0.0) 46 | plt.savefig("graph1.eps") 47 | plt.clf() 48 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/propagationModelCase.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | "Propagation Model Demo" 4 | 5 | from mininet.log import setLogLevel, info 6 | from mn_wifi.net import Mininet_wifi 7 | from mn_wifi.cli import CLI 8 | 9 | 10 | def topology(): 11 | "Create a network." 12 | net = Mininet_wifi() 13 | 14 | info("*** Creating nodes\n") 15 | ap1 = net.addAccessPoint( 'ap1', ssid="ssid_ap1", 16 | txpower=15, mode="g", channel=1, position="10,10,0" ) 17 | sta1 = net.addStation( 'sta1', ip='192.168.0.1/24', txpower=15, 18 | position='10,10,0' ) 19 | sta2 = net.addStation( 'sta2', ip='192.168.0.2/24', txpower=15, 20 | position='11.36,10,0' ) 21 | 22 | net.setPropagationModel(model='logDistance', exp=3, sL=1) 23 | # net.propagationModel('ITUPropagationLossModel', pL=50) 24 | # net.propagationModel('twoRayGroundPropagationLossModel') 25 | # net.propagationModel('friisPropagationLossModel', sL=2) 26 | 27 | info("*** Configuring wifi nodes\n") 28 | net.configureWifiNodes() 29 | 30 | info("*** Adding Link\n") 31 | net.addLink(sta1, ap1) 32 | net.addLink(sta2, ap1) 33 | 34 | info("*** Starting network\n") 35 | net.build() 36 | 37 | for i in range(1,8): 38 | x = 10+i*1.36 39 | y = 10 40 | z = 0 41 | pos = '%s,%s,%s' % (x,y,z) 42 | sta1.setPosition(pos) 43 | info(sta1.params['rssi'][0]) 44 | 45 | info("*** Running CLI\n") 46 | CLI( net ) 47 | 48 | info("*** Stopping network\n") 49 | net.stop() 50 | 51 | if __name__ == '__main__': 52 | setLogLevel( 'info' ) 53 | topology() 54 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/ncasting.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | "ncasting" 4 | 5 | from mininet.log import setLogLevel, info 6 | from mininet.node import RemoteController 7 | from mn_wifi.net import Mininet_wifi 8 | from mn_wifi.cli import CLI 9 | 10 | """ ap1. 11 | / . 12 | / . 13 | h1----s1 sta1 14 | \ . 15 | \ . 16 | ap2.""" 17 | 18 | 19 | def topology(): 20 | "Create a network." 21 | net = Mininet_wifi(controller=RemoteController) 22 | 23 | info("*** Creating nodes\n") 24 | ap1 = net.addAccessPoint( 'ap1', ssid="ssid_1", mode="g", channel="5" ) 25 | ap2 = net.addAccessPoint( 'ap2', ssid="ssid_2", mode="g", channel="11" ) 26 | sta3 = net.addStation( 'sta3', ip="192.168.0.100/24", wlans=2 ) 27 | h4 = net.addHost( 'h4', ip="192.168.0.1/24", mac="00:00:00:00:00:04" ) 28 | s5 = net.addSwitch( 's5' ) 29 | c0 = net.addController('c0', controller=RemoteController, ip='127.0.0.1', port=6653 ) 30 | 31 | info("*** Configuring wifi nodes\n") 32 | net.configureWifiNodes() 33 | 34 | info("*** Adding Link\n") 35 | net.addLink(h4, s5, bw=1000) 36 | net.addLink(ap1, s5, bw=1000) 37 | net.addLink(ap2, s5, bw=1000) 38 | net.addLink(ap1, sta3) 39 | net.addLink(sta3, ap2) 40 | 41 | info("*** Starting network\n") 42 | net.build() 43 | c0.start() 44 | s5.start( [c0] ) 45 | ap1.start( [c0] ) 46 | ap2.start( [c0] ) 47 | 48 | sta3.cmd("ifconfig sta3-wlan1 192.168.1.100/24 up") 49 | h4.cmd("ifconfig h4-eth0:0 192.168.1.1/24") 50 | 51 | info("*** Running CLI\n") 52 | CLI( net ) 53 | 54 | info("*** Stopping network\n") 55 | net.stop() 56 | 57 | if __name__ == '__main__': 58 | setLogLevel( 'info' ) 59 | topology() 60 | -------------------------------------------------------------------------------- /mininet-wifi/ACROSS-Sweden-2017/handover.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 'Example for handover' 4 | 5 | from mininet.log import setLogLevel, info 6 | from mininet.node import Controller 7 | from mn_wifi.cli import CLI 8 | from mn_wifi.net import Mininet_wifi 9 | 10 | 11 | def topology(): 12 | 13 | "Create a network." 14 | net = Mininet_wifi(controller=Controller) 15 | 16 | info("*** Creating nodes\n") 17 | sta1 = net.addStation('sta1', mac='00:00:00:00:00:01', ip='10.0.0.1/8') 18 | ap1 = net.addAccessPoint('ap1', ssid='new-ssid1', mode='g', channel='1', position='15,30,0') 19 | ap2 = net.addAccessPoint('ap2', ssid='new-ssid1', mode='g', channel='6', position='55,30,0') 20 | s3 = net.addSwitch('s3') 21 | h1 = net.addHost('h1', mac='00:00:00:00:00:02', ip='10.0.0.2/8') 22 | c1 = net.addController('c1') 23 | 24 | net.setPropagationModel(model="logDistance", exp=4.3) 25 | 26 | info("*** Configuring WiFi Nodes\n") 27 | net.configureWifiNodes() 28 | 29 | h1.plot(position='35,90,0') 30 | s3.plot(position='35,80,0') 31 | 32 | info("*** Creating links\n") 33 | net.addLink(ap1, s3) 34 | net.addLink(ap2, s3) 35 | net.addLink(h1, s3) 36 | 37 | net.plotGraph(max_x=100, max_y=100) 38 | 39 | net.startMobility(time=0) 40 | net.mobility(sta1, 'start', time=1, position='10,30,0') 41 | net.mobility(sta1, 'stop', time=80, position='60,30,0') 42 | net.stopMobility(time=80) 43 | 44 | info("*** Starting network\n") 45 | net.build() 46 | c1.start() 47 | ap1.start([c1]) 48 | ap2.start([c1]) 49 | s3.start([c1]) 50 | 51 | info("*** Running CLI\n") 52 | CLI(net) 53 | 54 | info("*** Stopping network\n") 55 | net.stop() 56 | 57 | if __name__ == '__main__': 58 | setLogLevel('info') 59 | topology() 60 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/fileTransferring.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """Code created to be presented with the paper titled: 4 | "How far can we go? Towards Realistic Software-Defined Wireless Networking Experiments" 5 | authors: Ramon dos Reis Fontes and Christian Esteve Rothenberg""" 6 | 7 | """Topology 8 | 9 | Nodes: sta1------ap3---------sta2 10 | Distance: |--2.72m--|---4.08m---|""" 11 | 12 | 13 | from mininet.log import setLogLevel, info 14 | from mininet.node import Controller 15 | from mn_wifi.net import Mininet_wifi 16 | from mn_wifi.cli import CLI 17 | 18 | 19 | def topology(): 20 | 21 | "Create a network." 22 | net = Mininet_wifi( controller=Controller ) 23 | 24 | info("*** Creating nodes\n") 25 | sta1 = net.addStation( 'sta1', mac='00:00:00:00:00:01', 26 | ip='192.168.0.1/24', position='47.28,50,0' ) 27 | sta2 = net.addStation( 'sta2', mac='00:00:00:00:00:02', 28 | ip='192.168.0.2/24', position='54.08,50,0' ) 29 | ap1 = net.addAccessPoint( 'ap3', ssid='ap-ssid', mode='b', channel='1', 30 | position='50,50,0' ) 31 | c1 = net.addController( 'c1' ) 32 | 33 | info("*** Configuring wifi nodes\n") 34 | net.configureWifiNodes() 35 | 36 | net.plotGraph(max_x=100, max_y=100) 37 | 38 | info("*** Associating and Creating links\n") 39 | net.addLink(sta1, ap1) 40 | net.addLink(sta2, ap1) 41 | 42 | info("*** Starting network\n") 43 | net.build() 44 | c1.start() 45 | ap1.start( [c1] ) 46 | 47 | sta2.cmd('pushd /home/alpha/Downloads; python3 -m http.server 80 &') 48 | 49 | info("*** Running CLI\n") 50 | CLI( net ) 51 | 52 | info("*** Stopping network\n") 53 | net.stop() 54 | 55 | if __name__ == '__main__': 56 | setLogLevel( 'info' ) 57 | topology() 58 | -------------------------------------------------------------------------------- /mininet-wifi/UNICAMP-2017/adhoc_mesh.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 'This example shows how to work with both wireless adhoc and wireless mesh' 4 | 5 | from mn_wifi.net import Mininet_wifi 6 | from mn_wifi.cli import CLI 7 | from mn_wifi.link import wmediumd, adhoc, mesh 8 | from mn_wifi.wmediumdConnector import interference 9 | from mininet.log import setLogLevel, info 10 | 11 | 12 | def topology(): 13 | "Create a network." 14 | net = Mininet_wifi(link=wmediumd, wmediumd_mode=interference) 15 | 16 | info("*** Creating nodes\n") 17 | sta1 = net.addStation('sta1', position='10,10,0') 18 | sta2 = net.addStation('sta2', position='60,10,0') 19 | sta3 = net.addStation('sta3', position='100,10,0') 20 | sta4 = net.addStation('sta4', position='10,140,0') 21 | sta5 = net.addStation('sta5', position='60,140,0') 22 | sta6 = net.addStation('sta6', position='100,140,0') 23 | 24 | info("*** Configuring Propagation Model\n") 25 | net.setPropagationModel(model="logDistance", exp=4) 26 | 27 | info("*** Configuring wifi nodes\n") 28 | net.configureWifiNodes() 29 | 30 | info("*** Creating links\n") 31 | net.addLink(sta1, cls=mesh, intf='sta1-wlan0', ssid='meshNet') 32 | net.addLink(sta2, cls=mesh, intf='sta2-wlan0', ssid='meshNet') 33 | net.addLink(sta3, cls=mesh, intf='sta3-wlan0', ssid='meshNet') 34 | net.addLink(sta4, cls=adhoc, intf='sta4-wlan0', ssid='adhocNet') 35 | net.addLink(sta5, cls=adhoc, intf='sta5-wlan0', ssid='adhocNet') 36 | net.addLink(sta6, cls=adhoc, intf='sta6-wlan0', ssid='adhocNet') 37 | 38 | net.plotGraph(max_x=200, max_y=200) 39 | 40 | info("*** Starting network\n") 41 | net.build() 42 | 43 | info("*** Running CLI\n") 44 | CLI(net) 45 | 46 | info("*** Stopping network\n") 47 | net.stop() 48 | 49 | if __name__ == '__main__': 50 | setLogLevel('info') 51 | topology() 52 | -------------------------------------------------------------------------------- /mininet-wifi/UNICAMP-2017/handover.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 'Example for Handover' 4 | 5 | from mininet.node import Controller 6 | from mininet.log import setLogLevel, info 7 | from mn_wifi.cli import CLI 8 | from mn_wifi.net import Mininet_wifi 9 | 10 | 11 | def topology(): 12 | "Create a network." 13 | net = Mininet_wifi(controller=Controller) 14 | 15 | info("*** Creating nodes\n") 16 | sta1 = net.addStation('sta1', mac='00:00:00:00:00:02', ip='10.0.0.2/8', 17 | range=20) 18 | sta2 = net.addStation('sta2', mac='00:00:00:00:00:03', ip='10.0.0.3/8', 19 | range=20) 20 | ap1 = net.addAccessPoint('ap1', ssid='ssid-ap1', mode='g', channel='1', 21 | position='15,30,0', range=30) 22 | ap2 = net.addAccessPoint('ap2', ssid='ssid-ap2', mode='g', channel='6', 23 | position='55,30,0', range=30) 24 | c1 = net.addController('c1') 25 | 26 | net.setPropagationModel(model="logDistance", exp=5) 27 | 28 | info("*** Configuring wifi nodes\n") 29 | net.configureWifiNodes() 30 | 31 | info("*** Creating links\n") 32 | net.addLink(ap1, ap2) 33 | 34 | net.plotGraph(max_x=100, max_y=100) 35 | 36 | net.startMobility(time=0) 37 | net.mobility(sta1, 'start', time=1, position='10,30,0') 38 | net.mobility(sta2, 'start', time=2, position='10,40,0') 39 | net.mobility(sta1, 'stop', time=10, position='60,30,0') 40 | net.mobility(sta2, 'stop', time=10, position='25,40,0') 41 | net.stopMobility(time=11) 42 | 43 | info("*** Starting network\n") 44 | net.build() 45 | c1.start() 46 | ap1.start([c1]) 47 | ap2.start([c1]) 48 | 49 | info("*** Running CLI\n") 50 | CLI(net) 51 | 52 | info("*** Stopping network\n") 53 | net.stop() 54 | 55 | 56 | if __name__ == '__main__': 57 | setLogLevel('info') 58 | topology() 59 | -------------------------------------------------------------------------------- /mininet-wifi/CNSM2015/ncasting.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 4 | import subprocess 5 | import os 6 | 7 | from mininet.node import RemoteController, OVSKernelSwitch 8 | from mininet.log import setLogLevel, info 9 | from mininet.link import TCLink 10 | from mn_wifi.node import OVSKernelAP 11 | from mn_wifi.cli import CLI 12 | from mn_wifi.net import Mininet_wifi 13 | 14 | """ ap1. 15 | / . 16 | / . 17 | h1----s1 sta1 18 | \ . 19 | \ . 20 | ap2.""" 21 | 22 | def topology(): 23 | "Create a network." 24 | net = Mininet_wifi( controller=RemoteController, link=TCLink ) 25 | 26 | info("*** Creating nodes\n") 27 | ap1 = net.addAccessPoint( 'ap1', ssid="ssid_1", mode="g", channel="5" ) 28 | ap2 = net.addAccessPoint( 'ap2', ssid="ssid_2", mode="g", channel="11" ) 29 | sta3 = net.addStation( 'sta3', ip="192.168.0.100/24", wlans=2 ) 30 | h4 = net.addHost( 'h4', ip="192.168.0.1/24", mac="00:00:00:00:00:04" ) 31 | s5 = net.addSwitch( 's5' ) 32 | c0 = net.addController('c0', controller=RemoteController, ip='127.0.0.1', port=6653 ) 33 | 34 | info("*** Configuring wifi nodes\n") 35 | net.configureWifiNodes() 36 | 37 | info("*** Adding Link\n") 38 | net.addLink(h4, s5, bw=1000) 39 | net.addLink(ap1, s5, bw=1000) 40 | net.addLink(ap2, s5, bw=1000) 41 | net.addLink(ap1, sta3) 42 | net.addLink(sta3, ap2) 43 | 44 | info("*** Starting network\n") 45 | net.build() 46 | c0.start() 47 | s5.start( [c0] ) 48 | ap1.start( [c0] ) 49 | ap2.start( [c0] ) 50 | 51 | sta3.cmd("ifconfig sta3-wlan1 192.168.1.100/24 up") 52 | h4.cmd("ifconfig h4-eth0:0 192.168.1.1/24") 53 | 54 | info("*** Running CLI\n") 55 | CLI( net ) 56 | 57 | info("*** Stopping network\n") 58 | net.stop() 59 | 60 | if __name__ == '__main__': 61 | setLogLevel( 'info' ) 62 | topology() 63 | -------------------------------------------------------------------------------- /mininet-wifi/README.md: -------------------------------------------------------------------------------- 1 | ![](https://github.com/ramonfontes/miscellaneous/blob/master/mininet-wifi/mininet-wifi-logo.png) 2 | 3 | ### About Mininet-WiFi 4 | Mininet-WiFi is a fork of Mininet (http://mininet.org/) which allows the using of both WiFi Stations and Access Points. Mininet-WiFi only add wifi features and you can work with it like you were working with Mininet. 5 | 6 | [![Build Status](https://travis-ci.org/intrig-unicamp/mininet-wifi.svg?branch=master)](https://travis-ci.org/intrig-unicamp/mininet-wifi) 7 | 8 | 9 | ### User Manual 10 | [Access the User Manual](https://www.dropbox.com/s/jgkhsdrz736e4q2/mininet-wifi-draft-manual.pdf?dl=0) 11 | 12 | ### Mailing List 13 | [https://groups.google.com/forum/#!forum/mininet-wifi-discuss](https://groups.google.com/forum/#!forum/mininet-wifi-discuss) 14 | 15 | ## Installation 16 | step 1: $ sudo apt-get install git 17 | step 2: $ git clone https://github.com/intrig-unicamp/mininet-wifi 18 | step 3: $ cd mininet-wifi 19 | step 4: $ sudo util/install.sh -Wnfv 20 | #### install.sh options: 21 | -W: wireless dependencies 22 | -n: mininet-wifi dependencies 23 | -f: OpenFlow 24 | -v: OpenvSwitch 25 | -l: wmediumd (optional) 26 | 27 | ## Virtual Machine 28 | [Ubuntu 14.04 x64](https://www.dropbox.com/s/0u4o1wmmooq81yi/mn-wifi.ova?dl=0) 29 | user: wifi 30 | pass: wifi 31 | 32 | ## Note 33 | Mininet-WiFi should work fine in any Ubuntu distribution from 14.04, but in some cases (only if you have problems when start it) you have to stop NetworkManager with `stop network-manager` (you can also use `sudo systemctl stop network-manager` or `sudo service network-manager stop`). 34 | 35 | ### Team 36 | Ramon dos Reis Fontes (ramonrf@dca.fee.unicamp.br) 37 | Christian Rodolfo Esteve Rothenberg (chesteve@dca.fee.unicamp.br) 38 | 39 | We are members of [INTRIG (Information & Networking Technologies Research & Innovation Group)](http://intrig.dca.fee.unicamp.br) at University of Campinas - Unicamp, SP, Brazil. 40 | -------------------------------------------------------------------------------- /mininet-wifi/SIGCOMM-2016/README.md: -------------------------------------------------------------------------------- 1 | ## Reproducibility Steps 2 | 3 | ### Requirements 4 | - Mininet-WiFi 5 | - WiFi interface + (second WiFi or ethernet interface) 6 | - Floodlight 7 | - ofsoftswitch13 8 | - speedtest-cli 9 | 10 | **Note** - You may want to set both Internet and wlan interfaces in `hybridVirtualPhysical.py`. 11 | 12 | ``` 13 | internetIface ='eth0'# wired/wireless card. 14 | usbDongleIface ='wlan0'# wifi interface. 15 | ``` 16 | 17 | Now, run the Floodlight controller 18 | 19 | ``` 20 | sudo java -jar target/floodlight.jar 21 | ``` 22 | 23 | Then, run the network topology in a 2nd terminal: 24 | 25 | ``` 26 | sudo py hybridVirtualPhysical.py 27 | mininet-wifi> sh ./rule.hybridVirtualPhysical 28 | ``` 29 | 30 | Despite the content of `rule.hybridVirtualPhysical` is included in `hybridVirtualPhysical.py`, we have faced some problems with floodlight. Thus, probably you have to run `rule.hybridVirtualPhysical` after running `hybridVirtualPhysical.py`. 31 | 32 | 33 | Now, stations should be able to communicate with to each other as well as to the Internet. Now, you may consider to use any station and run `speedtest-cli`: 34 | 35 | ``` 36 | mininet-wifi>xterm sta1 37 | ``` 38 | 39 | sta1's terminal: 40 | ``` 41 | speedtest-cli 42 | ``` 43 | 44 | There is a web server accessible at 10.0.0.111 and according rules added in `rule.hybridVirtualPhysical` if you access 10.0.0.109 the traffic will be redirect to 10.0.0.111. 45 | 46 | 47 | **Useful commands** 48 | ``` 49 | sta1 iw dev sta1-wlan0 mpath dump #verify mesh routing information 50 | dpctl unix:/tmp/ap3 stats-flow 51 | dpctl unix:/tmp/ap3 stats-meter 52 | dpctl unix:/tmp/ap3 meter-config 53 | ``` 54 | 55 | ### bibtex: 56 | @inproceedings{fontes2016mininet, 57 | title={Mininet-WiFi: A Platform for Hybrid Physical-Virtual Software-Defined Wireless Networking Research}, 58 | author={Fontes, Ramon dos Reis and Rothenberg, Christian Esteve}, 59 | booktitle={Proceedings of the 2016 conference on ACM SIGCOMM 2016 Conference}, 60 | pages={607--608}, 61 | year={2016}, 62 | organization={ACM} 63 | } 64 | -------------------------------------------------------------------------------- /mininet-wifi/ACROSS-Sweden-2017/tc_wmediumd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 'Starting a topology with and without wmediumd' 4 | 5 | from mininet.log import setLogLevel, info 6 | from mininet.node import Controller 7 | from mn_wifi.net import Mininet_wifi 8 | from mn_wifi.node import UserAP 9 | from mn_wifi.cli import CLI 10 | from mn_wifi.wmediumdConnector import interference 11 | from mn_wifi.link import wmediumd 12 | import sys 13 | 14 | 15 | def topology(wmediumd): 16 | 17 | "Create a network." 18 | if wmediumd: 19 | net = Mininet_wifi(controller=Controller, accessPoint=UserAP, 20 | link=wmediumd, wmediumd_mode=interference) 21 | else: 22 | net = Mininet_wifi(controller=Controller, accessPoint=UserAP) 23 | 24 | info("*** Creating nodes\n") 25 | net.addStation('sta1', mac='00:00:00:00:00:01', ip='10.0.0.1/8', 26 | position='120,140,0') 27 | net.addStation('sta2', mac='00:00:00:00:00:02', ip='10.0.0.2/8', 28 | position='10,30,0') 29 | net.addStation('sta3', mac='00:00:00:00:00:03', ip='10.0.0.3/8', 30 | position='10,50,0') 31 | ap1 = net.addAccessPoint('ap1', ssid='new-ssid', mode='g', channel='1', 32 | position='15,30,0', ieee80211r='yes', 33 | mobility_domain='a1b2', passwd='123456789a', 34 | encrypt='wpa2') 35 | c1 = net.addController('c1', controller=Controller) 36 | 37 | info("*** Configuring Propagation Model\n") 38 | net.setPropagationModel(model="logDistance", exp = 4.2) 39 | 40 | info("*** Configuring wifi nodes\n") 41 | net.configureWifiNodes() 42 | 43 | 'plotting graph' 44 | net.plotGraph(max_x=150, max_y=150) 45 | 46 | info("*** Starting network\n") 47 | net.build() 48 | c1.start() 49 | ap1.start([c1]) 50 | 51 | info("*** Running CLI\n") 52 | CLI(net) 53 | 54 | info("*** Stopping network\n") 55 | net.stop() 56 | 57 | if __name__ == '__main__': 58 | setLogLevel('info') 59 | wmediumd = True if '-w' in sys.argv else False 60 | topology(wmediumd) 61 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/replayingNetwork/ieee80211g/replayingNetwork.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | "Replaying Network Conditions" 4 | 5 | from mininet.log import setLogLevel, info 6 | from mininet.node import Controller 7 | from mn_wifi.net import Mininet_wifi 8 | from mn_wifi.cli import CLI_wifi 9 | from mn_wifi.replaying import replayingNetworkConditions 10 | 11 | 12 | def topology(): 13 | 14 | "Create a network." 15 | net = Mininet_wifi( controller=Controller ) 16 | 17 | info("*** Creating nodes\n") 18 | sta1 = net.addStation( 'sta1', mac='00:00:00:00:00:01', ip='192.168.0.1/24', 19 | position='47.28,50,0' ) 20 | sta2 = net.addStation( 'sta2', mac='00:00:00:00:00:02', ip='192.168.0.2/24', 21 | position='54.08,50,0' ) 22 | ap1 = net.addAccessPoint( 'ap1', ssid='ap-ssid', mode='g', channel='1', 23 | position='50,50,0' ) 24 | c0 = net.addController( 'c0', controller=Controller, port=6653 ) 25 | 26 | info("*** Configuring wifi nodes\n") 27 | net.configureWifiNodes() 28 | 29 | info("*** Starting network\n") 30 | net.build() 31 | c0.start() 32 | ap1.start( [c0] ) 33 | 34 | sta1.cmd('iw dev sta1-wlan0 interface add mon0 type monitor &') 35 | sta1.cmd('ifconfig mon0 up &') 36 | sta2.cmd('iw dev sta2-wlan0 interface add mon0 type monitor &') 37 | sta2.cmd('ifconfig mon0 up &') 38 | sta2.cmd('pushd /home/alpha/Downloads; python3 -m http.server 80 &') 39 | 40 | getTrace(sta1, 'clientTrace.txt') 41 | getTrace(sta2, 'serverTrace.txt') 42 | 43 | replayingNetworkConditions.addNode(sta1) 44 | replayingNetworkConditions.addNode(sta2) 45 | replayingNetworkConditions(net) 46 | 47 | info("*** Running CLI\n") 48 | CLI_wifi( net ) 49 | 50 | info("*** Stopping network\n") 51 | net.stop() 52 | 53 | def getTrace(sta, file): 54 | 55 | file = open(file, 'r') 56 | raw_data = file.readlines() 57 | file.close() 58 | 59 | sta.time = [] 60 | sta.bw = [] 61 | sta.loss = [] 62 | sta.delay = [] 63 | sta.latency = [] 64 | 65 | for data in raw_data: 66 | line = data.split() 67 | sta.time.append(float(line[0])) #First Column = Time 68 | sta.bw.append(((float(line[1]))/1000000)/2) #Second Column = BW 69 | #sta.loss.append(1) #Second Column = LOSS 70 | sta.loss.append(float(line[2])) #second Column = LOSS 71 | sta.delay.append(float(line[4])) #Second Column = DELAY 72 | sta.latency.append(float(line[3])) #Second Column = LATENCY 73 | 74 | if __name__ == '__main__': 75 | setLogLevel( 'info' ) 76 | topology() 77 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/replayingNetwork/ieee80211b/replayingNetwork.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | "Replaying Network Conditions" 4 | 5 | from mininet.log import setLogLevel, info 6 | from mininet.node import Controller 7 | from mn_wifi.net import Mininet_wifi 8 | from mn_wifi.cli import CLI_wifi 9 | from mn_wifi.replaying import replayingNetworkConditions 10 | 11 | 12 | def topology(): 13 | 14 | "Create a network." 15 | net = Mininet_wifi( controller=Controller ) 16 | 17 | info("*** Creating nodes\n") 18 | sta1 = net.addStation( 'sta1', mac='00:00:00:00:00:01', ip='192.168.0.1/24', 19 | position='47.28,50,0' ) 20 | sta2 = net.addStation( 'sta2', mac='00:00:00:00:00:02', ip='192.168.0.2/24', 21 | position='54.08,50,0' ) 22 | ap1 = net.addAccessPoint( 'ap1', ssid='ap-ssid1', mode='b', channel='1', 23 | position='50,50,0' ) 24 | c0 = net.addController( 'c0', controller=Controller, port=6653 ) 25 | 26 | info("*** Configuring wifi nodes\n") 27 | net.configureWifiNodes() 28 | 29 | info("*** Starting network\n") 30 | net.build() 31 | c0.start() 32 | ap1.start( [c0] ) 33 | 34 | sta1.cmd('iw dev sta1-wlan0 interface add mon0 type monitor &') 35 | sta1.cmd('ifconfig mon0 up &') 36 | sta2.cmd('iw dev sta2-wlan0 interface add mon0 type monitor &') 37 | sta2.cmd('ifconfig mon0 up &') 38 | sta2.cmd('pushd /home/alpha/Downloads; python3 -m http.server 80 &') 39 | 40 | getTrace(sta1, 'clientTrace.txt') 41 | getTrace(sta2, 'serverTrace.txt') 42 | 43 | replayingNetworkConditions.addNode(sta1) 44 | replayingNetworkConditions.addNode(sta2) 45 | replayingNetworkConditions(net) 46 | 47 | info("*** Running CLI\n") 48 | CLI_wifi( net ) 49 | 50 | info("*** Stopping network\n") 51 | net.stop() 52 | 53 | def getTrace(sta, file): 54 | 55 | file = open(file, 'r') 56 | raw_data = file.readlines() 57 | file.close() 58 | 59 | sta.time = [] 60 | sta.bw = [] 61 | sta.loss = [] 62 | sta.delay = [] 63 | sta.latency = [] 64 | 65 | for data in raw_data: 66 | line = data.split() 67 | sta.time.append(float(line[0])) #First Column = Time 68 | sta.bw.append(((float(line[1]))/1000000)/2) #Second Column = BW 69 | #sta.loss.append(1) #Second Column = LOSS 70 | sta.loss.append(float(line[2])) #second Column = LOSS 71 | sta.latency.append(float(line[3])) #Second Column = LATENCY 72 | sta.delay.append(float(line[4])) #Second Column = DELAY 73 | 74 | if __name__ == '__main__': 75 | setLogLevel( 'info' ) 76 | topology() 77 | -------------------------------------------------------------------------------- /mininet-wifi/V2X-Slicing/README.md: -------------------------------------------------------------------------------- 1 | ### Bibtex: 2 | 3 | @article{Campolo2018, 4 | doi = {10.3390/s18124435}, 5 | url = {https://doi.org/10.3390/s18124435}, 6 | year = {2018}, 7 | month = {dec}, 8 | publisher = {{MDPI} {AG}}, 9 | volume = {18}, 10 | number = {12}, 11 | pages = {4435}, 12 | author = {Claudia Campolo and Ramon Fontes and Antonella Molinaro and Christian Esteve Rothenberg and Antonio Iera}, 13 | title = {Slicing on the Road: Enabling the Automotive Vertical through 5G Network Softwarization}, 14 | journal = {Sensors} 15 | } 16 | 17 | 18 | ## Single controller approach 19 | 20 | **Requirements:** 21 | * Ryu 22 | * FreeRadius 23 | 24 | #### FreeRadius (Consider the following setup) 25 | 26 | **clients.conf** 27 | `client 192.168.0.201 { 28 | secret=secret 29 | shortname=sdn_ap 30 | }` 31 | 32 | `client 192.168.0.202 { 33 | secret=secret 34 | shortname=sdn_ap 35 | }` 36 | 37 | `client 172.16.0.203 { 38 | secret=secret 39 | shortname=sdn_ap 40 | }` 41 | 42 | `client 192.168.0.204 { 43 | secret=secret 44 | shortname=sdn_ap 45 | }` 46 | 47 | **users** 48 | `bob Cleartext-Password := "hello"` 49 | `joe Cleartext-Password := "sdnteam"` 50 | 51 | 52 | **Terminal 1** 53 | * `sudo python single-c-approach.py` 54 | 55 | **Terminal 2** 56 | * `git clone https://github.com/ramonfontes/ryu -b dev` 57 | * `cd ryu` 58 | * ~/ryu$ `PYTHONPATH=. ./bin/ryu-manager ryu/app/vanet_run.py ryu/app/simple_switch_13.py` 59 | 60 | **Extract dataset from data-log/sta1.log** 61 | **>> you have to modify [vanet_run.py](https://github.com/ramonfontes/ryu/blob/dev/ryu/app/vanet_run.py#L134) in order to run the correct case.** 62 | 63 | ## Multiple controller approach 64 | 65 | **Requirements:** 66 | * Ryu 67 | * python-scapy 68 | 69 | **Terminal 1** 70 | * ~$ `cd reproducible-research/mininet-wifi/V2X-Slicing` 71 | * ~/reproducible-research/mininet-wifi/V2X-Slicing$ `git clone https://github.com/ramonfontes/ryu -b book` 72 | * ~/reproducible-research/mininet-wifi/V2X-Slicing$ `cp run.sh ryu` 73 | * ~/reproducible-research/mininet-wifi/V2X-Slicing$ `sudo python multi-c-approach.py` 74 | 75 | **Extract dataset from ping.txt (slicing federation is the default one)** 76 | **>> in order to test no-slicing federation case, a minor change in [wifi.py](https://github.com/ramonfontes/ryu/blob/book/ryu/app/wifi.py) is required (specially the [slicing variable](https://github.com/ramonfontes/ryu/blob/book/ryu/app/wifi.py#L109)).** 77 | 78 | ![](https://github.com/ramonfontes/reproducible-research/blob/master/mininet-wifi/V2X-Slicing/arq-multi-c.png) 79 | Figure 1. Proposed prototype for multiple controller approach 80 | -------------------------------------------------------------------------------- /mininet-wifi/SBRC-2016/sbrc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """Code created to be presented with the paper titled: 4 | "Rich Experimentation through Hybrid Physical-Virtual Software-Defined Wireless 5 | Networking Emulation" 6 | authors: Ramon dos Reis Fontes and Christian Esteve Rothenberg""" 7 | 8 | from mininet.log import setLogLevel, info 9 | from mininet.node import Controller, Node 10 | from mn_wifi.net import Mininet_wifi 11 | from mn_wifi.cli import CLI 12 | from mn_wifi.wmediumdConnector import interference 13 | from mn_wifi.link import wmediumd, mesh 14 | 15 | 16 | def topology(): 17 | 18 | "Create a network." 19 | net = Mininet_wifi( controller=Controller, link=wmediumd, 20 | wmediumd_mode=interference) 21 | staList = [] 22 | 23 | info("*** Creating nodes\n") 24 | for n in range(10): 25 | staList.append(n) 26 | staList[n] = net.addStation( 27 | 'sta%s' % (n+1), wlans=2, mac='00:00:00:00:00:' + '%02x' % (n+1), 28 | ip='192.168.0.%s/24' % (n+1)) 29 | phyap1 = net.addPhysicalBaseStation( 30 | 'phyap1', ssid='SBRC16-MininetWiFi,SBRC16-MininetWiFi', mode='g', channel='1', 31 | wlans=2, position='50,115,0', phywlan='wlan2') 32 | net.addStation( 'sta11', ip='10.0.0.111/8', position='120,200,0') 33 | ap2 = net.addAccessPoint( 'ap2', ssid='ap2', mode='g', channel='11', position='100,175,0' ) 34 | ap3 = net.addAccessPoint( 'ap3', ssid='ap3', mode='g', channel='6', position='150,50,0' ) 35 | ap4 = net.addAccessPoint( 'ap4', ssid='ap4', mode='g', channel='1', position='175,150,0' ) 36 | c1 = net.addController('c1') 37 | Node( 'root', inNamespace=False ) 38 | 39 | net.setPropagationModel(model="logDistance", exp=4) 40 | 41 | info("*** Configuring wifi nodes") 42 | net.configureWifiNodes() 43 | 44 | 'plotting graph' 45 | net.plotGraph(max_x=220, max_y=220) 46 | 47 | 'Seed' 48 | net.seed(20) 49 | 50 | info("*** Associating and Creating links\n") 51 | for sta in staList: 52 | net.addLink(sta, cls=mesh, ssid='meshNet') 53 | net.addLink(phyap1, ap2) 54 | net.addLink(ap2, ap3) 55 | net.addLink(ap3, ap4) 56 | 57 | net.startMobility(time=0, model='RandomWalk', max_x=220, max_y=220, min_v=0.1, max_v=0.2) 58 | 59 | info("*** Starting network\n") 60 | net.build() 61 | c1.start() 62 | phyap1.start( [c1] ) 63 | ap2.start( [c1] ) 64 | ap3.start( [c1] ) 65 | ap4.start( [c1] ) 66 | 67 | ip = 201 68 | for sta in staList: 69 | sta.setIP('10.0.0.%s/8' % ip, intf="%s-wlan1" % sta) 70 | ip+=1 71 | 72 | info("*** Running CLI\n") 73 | CLI( net ) 74 | 75 | info("*** Stopping network\n") 76 | net.stop() 77 | 78 | 79 | if __name__ == '__main__': 80 | setLogLevel( 'info' ) 81 | topology() 82 | -------------------------------------------------------------------------------- /mininet-wifi/WCNC-2018/krack-mininet-wifi.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """This code tests if APs are affected by CVE-2017-13082 (KRACK attack) and 4 | determine whether an implementation is vulnerable to attacks.""" 5 | 6 | __author__ = "Ramon Fontes, Hedertone Almeida, and Christian Rothenberg" 7 | __credits__ = ["https://github.com/vanhoefm/krackattacks-test-ap-ft"] 8 | 9 | from mininet.node import RemoteController 10 | from mininet.log import setLogLevel, info 11 | from mn_wifi.net import MininetWithControlWNet 12 | from mn_wifi.node import UserAP 13 | from mn_wifi.cli import CLI 14 | from mn_wifi.link import wmediumd 15 | from mn_wifi.wmediumdConnector import interference 16 | import os 17 | 18 | 19 | def topology(): 20 | 21 | info("*** Shutting down any controller running on port 6653\n") 22 | os.system('sudo fuser -k 6653/tcp') 23 | 24 | "Create a network." 25 | net = MininetWithControlWNet(controller=RemoteController, 26 | link=wmediumd, wmediumd_mode=interference) 27 | 28 | info("*** Creating nodes\n") 29 | net.addStation('sta1', ip='10.0.0.1/8', position='20,0,0', inNamespace=False, 30 | #scan_freq='2412', freq_list='2412', 31 | bgscan_threshold=-60, s_inverval=5, l_interval=10) 32 | ap1 = net.addAccessPoint('ap1', mac='02:00:00:00:00:01', 33 | ssid='handover', mode='g', channel='1', ieee80211r='yes', 34 | mobility_domain='a1b2', passwd='123456789a', encrypt='wpa2', 35 | position='10,30,0', datapath='user') 36 | ap2 = net.addAccessPoint('ap2', mac='02:00:00:00:00:02', 37 | ssid='handover', mode='g', channel='6', ieee80211r='yes', 38 | mobility_domain='a1b2', passwd='123456789a', encrypt='wpa2', 39 | position='100,30,0', datapath='user') 40 | c1 = net.addController('c1', controller=RemoteController, port=6653) 41 | 42 | info("*** Configuring Propagation Model\n") 43 | net.setPropagationModel(model="logDistance", exp=3.5) 44 | 45 | info("*** Configuring wifi nodes\n") 46 | net.configureWifiNodes() 47 | 48 | info("*** Linking nodes\n") 49 | net.addLink(ap1, ap2) 50 | 51 | 'plotting graph' 52 | net.plotGraph(min_x=-100, min_y=-100, max_x=200, max_y=200) 53 | 54 | info("*** Starting network\n") 55 | net.build() 56 | c1.start() 57 | ap1.start([c1]) 58 | ap2.start([c1]) 59 | 60 | ap1.setIP('10.0.0.101/8', intf='ap1-wlan1') 61 | ap2.setIP('10.0.0.102/8', intf='ap2-wlan1') 62 | os.system('ip link set hwsim0 up') 63 | 64 | info("*** Running CLI\n") 65 | CLI(net) 66 | 67 | info("*** Stopping network\n") 68 | net.stop() 69 | 70 | if __name__ == '__main__': 71 | setLogLevel('debug') 72 | topology() 73 | -------------------------------------------------------------------------------- /mininet-wifi/SWITCHON-2015/allWirelessNetworksAroundUs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | "This example is based on this video: https://www.youtube.com/watch?v=_C4H2gBdyQY" 4 | 5 | from mininet.node import Controller, OVSKernelSwitch 6 | from mininet.log import setLogLevel, info 7 | from mn_wifi.node import OVSKernelAP 8 | from mn_wifi.cli import CLI 9 | from mn_wifi.net import Mininet_wifi 10 | import os 11 | 12 | 13 | def topology(): 14 | "Create a network." 15 | net = Mininet_wifi( controller=Controller, switch=OVSKernelSwitch, 16 | accessPoint=OVSKernelAP ) 17 | 18 | info("*** Creating nodes\n") 19 | sta1 = net.addStation('sta1', wlans=2, ip='10.0.0.2/8', max_x=120, max_y=50, 20 | min_v=1.4, max_v=1.6) 21 | h1 = net.addHost( 'h1', mac='00:00:00:00:00:01', ip='10.0.0.1/8' ) 22 | ap1 = net.addAccessPoint( 'ap1', ssid='ssid_ap1', mode='g', 23 | channel=6, position='70,25,0' ) 24 | ap2 = net.addAccessPoint( 'ap2', ssid='ssid_ap2', mode='g', 25 | channel=1, position='30,25,0' ) 26 | ap3 = net.addAccessPoint( 'ap3', ssid='ssid_ap3', mode='g', 27 | channel=11, position='110,25,0' ) 28 | s4 = net.addSwitch( 's4', mac='00:00:00:00:00:10' ) 29 | c1 = net.addController( 'c1', controller=Controller ) 30 | 31 | net.setPropagationModel(model="logDistance", exp=4.3) 32 | 33 | info("*** Configuring wifi nodes\n") 34 | net.configureWifiNodes() 35 | 36 | info("*** Associating and Creating links\n") 37 | net.addLink(ap1, s4) 38 | net.addLink(ap2, s4) 39 | net.addLink(ap3, s4) 40 | net.addLink(s4, h1) 41 | 42 | sta1.cmd('modprobe bonding mode=3') 43 | sta1.cmd('ip link add bond0 type bond') 44 | sta1.cmd('ip link set bond0 address 02:01:02:03:04:08') 45 | sta1.cmd('ip link set sta1-wlan0 down') 46 | sta1.cmd('ip link set sta1-wlan0 address 00:00:00:00:00:11') 47 | sta1.cmd('ip link set sta1-wlan0 master bond0') 48 | sta1.cmd('ip link set sta1-wlan1 down') 49 | sta1.cmd('ip link set sta1-wlan1 address 00:00:00:00:00:12') 50 | sta1.cmd('ip link set sta1-wlan1 master bond0') 51 | sta1.cmd('ip addr add 10.0.0.10/8 dev bond0') 52 | sta1.cmd('ip link set bond0 up') 53 | 54 | 'plotting graph' 55 | net.plotGraph(max_x=140, max_y=140) 56 | 57 | net.startMobility(time=0, seed=1, model='RandomDirection') 58 | 59 | info("*** Starting network\n") 60 | net.build() 61 | c1.start() 62 | s4.start( [c1] ) 63 | ap1.start( [c1] ) 64 | ap2.start( [c1] ) 65 | ap3.start( [c1] ) 66 | 67 | sta1.cmd('ip addr del 10.0.0.2/8 dev sta1-wlan0') 68 | os.system('ovs-ofctl add-flow s4 actions=normal') 69 | 70 | info("*** Running CLI\n") 71 | CLI( net ) 72 | 73 | info("*** Stopping network\n") 74 | net.stop() 75 | 76 | if __name__ == '__main__': 77 | setLogLevel( 'info' ) 78 | topology() 79 | -------------------------------------------------------------------------------- /mininet-wifi/others/openflowPacketFiltering.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """Author: Chih-Heng Ke, smallko@gmail.com 4 | 5 | This code serves as alternative if you want to filter OpenFlow Packets when 6 | transmitter and receives are associated to the same AP.""" 7 | 8 | from mininet.node import RemoteController 9 | from mn_wifi.net import Mininet_wifi 10 | from mn_wifi.cli import CLI 11 | from mininet.log import setLogLevel, info 12 | 13 | 14 | def topology(): 15 | 16 | "Create a network." 17 | net = Mininet_wifi( controller=RemoteController ) 18 | 19 | info ("*** Creating nodes\n") 20 | ap1 = net.addAccessPoint( 'ap1', ssid='new-ssid', mode='g', channel='1' ) 21 | sta2 = net.addStation( 'sta2', wlans=1, mac='00:02:00:00:00:02', ip='10.0.0.2/8' ) 22 | sta3 = net.addStation( 'sta3', wlans=1, mac='00:02:00:00:00:03', ip='10.0.0.3/8' ) 23 | sta4 = net.addStation( 'sta4', wlans=1, mac='00:02:00:00:00:04', ip='10.0.0.4/8' ) 24 | c5 = net.addController( 'c5', ip='127.0.0.1', port=6633 ) 25 | h7 = net.addHost( 'h7', mac='00:00:00:00:00:07', ip='10.0.0.7/8' ) 26 | 27 | info("*** Configuring wifi nodes\n") 28 | net.configureWifiNodes() 29 | 30 | info("*** Creating links\n") 31 | net.addLink(sta4, ap1) 32 | net.addLink(sta3, ap1) 33 | net.addLink(sta2, ap1) 34 | net.addLink(ap1, h7) 35 | 36 | info("*** Starting network\n") 37 | net.build() 38 | c5.start() 39 | ap1.start( [c5] ) 40 | 41 | ap1.cmd("iw dev ap1-wlan0 interface add vwlan1 type managed") 42 | ap1.cmd("iw dev ap1-wlan0 interface add vwlan2 type managed") 43 | ap1.cmd("ifconfig vwlan1 hw ether 00:00:00:aa:bb:11") 44 | ap1.cmd("ifconfig vwlan2 hw ether 00:00:00:aa:bb:22") 45 | ap1.cmd("ifconfig vwlan1 up") 46 | ap1.cmd("ifconfig vwlan2 up") 47 | ap1.cmd("ovs-vsctl add-port ap1 vwlan1") 48 | ap1.cmd("ovs-vsctl add-port ap1 vwlan2") 49 | ap1.cmd("echo -e 'interface=vwlan1\ndriver=nl80211\nssid=vwlan1\nhw_mode=g\nchannel=1\nwme_enabled=1\nwmm_enabled=1' > vwlan1.conf") 50 | ap1.cmd("hostapd -B vwlan1.conf &") 51 | ap1.cmd("echo -e 'interface=vwlan2\ndriver=nl80211\nssid=vwlan2\nhw_mode=g\nchannel=1\nwme_enabled=1\nwmm_enabled=1' > vwlan2.conf") 52 | ap1.cmd("hostapd -B vwlan2.conf &") 53 | 54 | sta2.cmd("ifconfig sta2-wlan0 down") 55 | sta2.cmd("iwconfig sta2-wlan0 essid 'vwlan1'") 56 | sta2.cmd("ifconfig sta2-wlan0 up") 57 | 58 | sta3.cmd("ifconfig sta3-wlan0 down") 59 | sta3.cmd("iwconfig sta3-wlan0 essid 'vwlan2'") 60 | sta3.cmd("ifconfig sta3-wlan0 up") 61 | 62 | ### after the above setting, sta2( sta3, or sta4) can ping h7. sta2 can also ping sta3/sta4. 63 | 64 | #the following rule can block sta2 from communicating with other host or station 65 | ap1.cmd("ovs-ofctl add-flow ap1 priority=65535,ip,nw_dst=10.0.0.2,actions=drop") 66 | 67 | info("*** Running CLI\n") 68 | CLI( net ) 69 | 70 | info("*** Stopping network\n") 71 | net.stop() 72 | 73 | if __name__ == '__main__': 74 | setLogLevel( 'info' ) 75 | topology() 76 | -------------------------------------------------------------------------------- /mininet-wifi/V2X-Slicing/car1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from scapy.all import * 4 | import os 5 | 6 | 7 | NODE_ID = 1 8 | CLIENT = '02:00:00:00:00:%02d' % NODE_ID 9 | MININET_WIFI_DIR = '~/mininet-wifi/util/m' 10 | 11 | rssi = 0 12 | t = 0 13 | 14 | def pkt_callback(pkt): 15 | global t 16 | t += 1 17 | if t >= 10: 18 | if pkt.haslayer(Dot11): 19 | ssid = None 20 | try: 21 | extra = pkt.notdecoded 22 | _rssi = -(256 - ord(extra[-4:-3])) 23 | except: 24 | _rssi = None 25 | 26 | if pkt.type == 0 and pkt.subtype == 8: 27 | ssid = pkt.info 28 | 29 | cmd = ["%s car%s iw dev " 30 | "car%s-wlan0 link | grep Connected | " 31 | "awk 'NR==1{print $3}'" % (MININET_WIFI_DIR, NODE_ID, NODE_ID)] 32 | address = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) 33 | (out, err) = address.communicate() 34 | bssid = str(out).split('\n')[0] 35 | if str(pkt.addr1) == "ff:ff:ff:ff:ff:ff": 36 | global rssi 37 | target_bssid = '' 38 | target_signal = -100 39 | target_n_clients = 0 40 | if bssid != pkt.addr2: 41 | target_bssid = pkt.addr2 42 | target_signal = _rssi 43 | ap_id = "%01d" % (int(target_bssid[-2:]),) 44 | target_n_clients = \ 45 | int(subprocess.check_output('%s enb%s ' 46 | 'hostapd_cli -i enb%s-wlan1 ' 47 | 'list_sta | wc -l' 48 | % (MININET_WIFI_DIR, ap_id, ap_id), 49 | shell=True)) 50 | else: 51 | rssi = _rssi 52 | 53 | if bssid: 54 | bssid_id = "%01d" % (int(bssid[-2:]),) 55 | n_clients = \ 56 | int(subprocess.check_output('%s enb%s ' 57 | 'hostapd_cli -i enb%s-wlan1 ' 58 | 'list_sta | wc -l' 59 | % (MININET_WIFI_DIR, bssid_id, bssid_id), 60 | shell=True)) 61 | 62 | if target_bssid: 63 | msg = "%s,%s,%s,%s,%s,%s,%s,%s" % ( 64 | CLIENT,bssid,ssid,rssi,target_bssid, 65 | target_signal,n_clients,target_n_clients) 66 | packet = IP(src="10.0.0.%s" % NODE_ID, 67 | dst="10.0.0.10%s" 68 | % (bssid_id))/UDP(sport=8000, dport=8002)/msg 69 | send(packet, verbose=0, iface="car%s-wlan0" % NODE_ID) 70 | t = 0 71 | 72 | 73 | sniff(iface="car%s-mon0" % NODE_ID, prn=pkt_callback, store=0) 74 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/forwardingBySSID.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Before running this script please stop network-manager: 5 | service network-manager stop 6 | This example shows how to create multiple SSID at the same AP and ideas 7 | around SSID-based packet forwarding 8 | -------- 9 | ssid-4 10 | -------- 11 | | 12 | | 13 | ------ (5) ------- 14 | ssid-1---(2)ap1(4)---ssid-3 15 | ------ (3) ------- 16 | | 17 | | 18 | -------- 19 | ssid-2 20 | -------- 21 | """ 22 | 23 | from mn_wifi.net import Mininet_wifi 24 | from mn_wifi.node import UserAP 25 | from mn_wifi.cli import CLI 26 | from mininet.node import Controller 27 | from mininet.log import setLogLevel, info 28 | 29 | 30 | def topology(): 31 | "Create a network." 32 | net = Mininet_wifi( controller=Controller, accessPoint=UserAP, 33 | autoAssociation=False ) 34 | 35 | info("*** Creating nodes\n") 36 | sta1 = net.addStation( 'sta1', position='10,60,0' ) 37 | sta2 = net.addStation( 'sta2', position='20,15,0' ) 38 | sta3 = net.addStation( 'sta3', position='10,25,0' ) 39 | sta4 = net.addStation( 'sta4', position='50,30,0' ) 40 | sta5 = net.addStation( 'sta5', position='45,65,0' ) 41 | ap1 = net.addAccessPoint( 'ap1', vssids=4, ssid="ssid,ssid1,ssid2,ssid3,ssid4", 42 | mode="g", channel="1", position='30,40,0' ) 43 | c0 = net.addController('c0' ) 44 | 45 | net.setPropagationModel(model='logDistance', exp=5) 46 | 47 | info("*** Configuring wifi nodes\n") 48 | net.configureWifiNodes() 49 | 50 | "plotting graph" 51 | net.plotGraph(max_x=100, max_y=100) 52 | 53 | info("*** Starting network\n") 54 | net.build() 55 | c0.start() 56 | ap1.start( [c0] ) 57 | 58 | sta1.setRange(15) 59 | sta2.setRange(15) 60 | sta3.setRange(15) 61 | sta4.setRange(15) 62 | sta5.setRange(15) 63 | 64 | sta1.cmd('iwconfig sta1-wlan0 essid %s ap %s' % (ap1.params['ssid'][1], ap1.params['mac'][1])) 65 | sta2.cmd('iwconfig sta2-wlan0 essid %s ap %s' % (ap1.params['ssid'][2], ap1.params['mac'][2])) 66 | sta3.cmd('iwconfig sta3-wlan0 essid %s ap %s' % (ap1.params['ssid'][2], ap1.params['mac'][2])) 67 | sta4.cmd('iwconfig sta4-wlan0 essid %s ap %s' % (ap1.params['ssid'][3], ap1.params['mac'][3])) 68 | sta5.cmd('iwconfig sta5-wlan0 essid %s ap %s' % (ap1.params['ssid'][4], ap1.params['mac'][4])) 69 | 70 | ap1.cmd('dpctl unix:/tmp/ap1 meter-mod cmd=add,flags=1,meter=1 drop:rate=100') 71 | ap1.cmd('dpctl unix:/tmp/ap1 meter-mod cmd=add,flags=1,meter=2 drop:rate=200') 72 | ap1.cmd('dpctl unix:/tmp/ap1 meter-mod cmd=add,flags=1,meter=3 drop:rate=300') 73 | ap1.cmd('dpctl unix:/tmp/ap1 meter-mod cmd=add,flags=1,meter=4 drop:rate=400') 74 | ap1.cmd('dpctl unix:/tmp/ap1 flow-mod table=0,cmd=add in_port=2 meter:1 apply:output=flood') 75 | ap1.cmd('dpctl unix:/tmp/ap1 flow-mod table=0,cmd=add in_port=3 meter:2 apply:output=flood') 76 | ap1.cmd('dpctl unix:/tmp/ap1 flow-mod table=0,cmd=add in_port=4 meter:3 apply:output=flood') 77 | ap1.cmd('dpctl unix:/tmp/ap1 flow-mod table=0,cmd=add in_port=5 meter:4 apply:output=flood') 78 | 79 | info("*** Running CLI\n") 80 | CLI( net ) 81 | 82 | info("*** Stopping network\n") 83 | net.stop() 84 | 85 | if __name__ == '__main__': 86 | setLogLevel( 'info' ) 87 | topology() 88 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/ncasting-controller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | #Script created by VND - Visual Network Description (SDN version) 3 | #You can start floodlight controller with command: java -jar target/floodlight.jar 4 | 5 | import httplib 6 | import json 7 | class StaticFlowPusher(object): 8 | def __init__(self, server): 9 | self.server = server 10 | def get(self, data): 11 | ret = self.rest_call({}, 'GET') 12 | return json.loads(ret[2]) 13 | def set(self, data): 14 | ret = self.rest_call(data, 'POST') 15 | return ret[0] == 200 16 | def remove(self, objtype, data): 17 | ret = self.rest_call(data, 'DELETE') 18 | return ret[0] == 200 19 | def rest_call(self, data, action): 20 | path = '/wm/staticflowentrypusher/json' 21 | headers = { 22 | 'Content-type': 'application/json', 23 | 'Accept': 'application/json', 24 | } 25 | body = json.dumps(data) 26 | conn = httplib.HTTPConnection(self.server, 8080) 27 | conn.request(action, path, body, headers) 28 | response = conn.getresponse() 29 | ret = (response.status, response.reason, response.read()) 30 | conn.close() 31 | return ret 32 | pusher = StaticFlowPusher('127.0.0.1') 33 | 34 | flow_0 = { 35 | 'switch':"00:00:00:00:00:00:00:01", 36 | "name":"Flow_flow1", 37 | "cookie":"0", 38 | "dst-mac":"00:00:00:00:00:04", 39 | "ingress-port":"2", 40 | "active":"true", 41 | "actions":"output=1" 42 | # "actions":"set-dst-ip=192.168.0.1,output=1" 43 | } 44 | pusher.set(flow_0) 45 | 46 | flow_1 = { 47 | 'switch':"00:00:00:00:00:00:00:01", 48 | "name":"Flow_flow2", 49 | "cookie":"0", 50 | "ingress-port":"1", 51 | "src-mac":"00:00:00:00:00:04", 52 | "active":"true", 53 | "actions":"set-dst-ip=192.168.0.100,output=2" 54 | } 55 | pusher.set(flow_1) 56 | 57 | flow_2 = { 58 | 'switch':"00:00:00:00:00:00:00:05", 59 | "name":"Flow_flow3", 60 | "cookie":"0", 61 | "dst-mac":"02:00:00:00:02:00", 62 | "ingress-port":"1", 63 | "active":"true", 64 | "actions":"set-dst-ip=192.168.0.100,output=2" 65 | } 66 | pusher.set(flow_2) 67 | 68 | flow_3 = { 69 | 'switch':"00:00:00:00:00:00:00:05", 70 | "name":"Flow_flow4", 71 | "cookie":"0", 72 | "src-mac":"02:00:00:00:02:00", 73 | "ingress-port":"2", 74 | "active":"true", 75 | "actions":"set-dst-ip=192.168.0.1,output=1" 76 | } 77 | pusher.set(flow_3) 78 | 79 | 80 | flow_4 = { 81 | 'switch':"00:00:00:00:00:00:00:02", 82 | "name":"Flow_flow5", 83 | "cookie":"0", 84 | "dst-mac":"00:00:00:00:00:04", 85 | "ingress-port":"2", 86 | "active":"true", 87 | "actions":"output=1" 88 | # "actions":"set-dst-ip=192.168.1.1,output=1" 89 | } 90 | pusher.set(flow_4) 91 | 92 | flow_5 = { 93 | 'switch':"00:00:00:00:00:00:00:02", 94 | "name":"Flow_flow6", 95 | "cookie":"0", 96 | "ingress-port":"1", 97 | "src-mac":"00:00:00:00:00:04", 98 | "active":"true", 99 | "actions":"set-dst-ip=192.168.1.100,output=2" 100 | } 101 | pusher.set(flow_5) 102 | 103 | flow_6 = { 104 | 'switch':"00:00:00:00:00:00:00:05", 105 | "name":"Flow_flow7", 106 | "cookie":"0", 107 | "dst-mac":"02:00:00:00:03:00", 108 | "ingress-port":"1", 109 | "active":"true", 110 | "actions":"set-dst-ip=192.168.1.100,output=3", 111 | } 112 | pusher.set(flow_6) 113 | 114 | flow_7 = { 115 | 'switch':"00:00:00:00:00:00:00:05", 116 | "name":"Flow_flow8", 117 | "cookie":"0", 118 | "src-mac":"02:00:00:00:03:00", 119 | "ingress-port":"3", 120 | "active":"true", 121 | "actions":"output=1" 122 | # "actions":"set-dst-ip=192.168.0.1,output=1" 123 | } 124 | pusher.set(flow_7) 125 | 126 | -------------------------------------------------------------------------------- /mininet-wifi/CNSM2015/ncasting-controller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | #Script created by VND - Visual Network Description (SDN version) 3 | #You can start floodlight controller with command: java -jar target/floodlight.jar 4 | 5 | import httplib 6 | import json 7 | 8 | 9 | class StaticFlowPusher(object): 10 | def __init__(self, server): 11 | self.server = server 12 | def get(self, data): 13 | ret = self.rest_call({}, 'GET') 14 | return json.loads(ret[2]) 15 | def set(self, data): 16 | ret = self.rest_call(data, 'POST') 17 | return ret[0] == 200 18 | def remove(self, objtype, data): 19 | ret = self.rest_call(data, 'DELETE') 20 | return ret[0] == 200 21 | def rest_call(self, data, action): 22 | path = '/wm/staticflowentrypusher/json' 23 | headers = { 24 | 'Content-type': 'application/json', 25 | 'Accept': 'application/json', 26 | } 27 | body = json.dumps(data) 28 | conn = httplib.HTTPConnection(self.server, 8080) 29 | conn.request(action, path, body, headers) 30 | response = conn.getresponse() 31 | ret = (response.status, response.reason, response.read()) 32 | conn.close() 33 | return ret 34 | 35 | pusher = StaticFlowPusher('127.0.0.1') 36 | 37 | flow_0 = { 38 | 'switch':"00:00:00:00:00:00:00:01", 39 | "name":"Flow_flow1", 40 | "cookie":"0", 41 | "dst-mac":"00:00:00:00:00:04", 42 | "ingress-port":"2", 43 | "active":"true", 44 | "actions":"output=1" 45 | # "actions":"set-dst-ip=192.168.0.1,output=1" 46 | } 47 | pusher.set(flow_0) 48 | 49 | flow_1 = { 50 | 'switch':"00:00:00:00:00:00:00:01", 51 | "name":"Flow_flow2", 52 | "cookie":"0", 53 | "ingress-port":"1", 54 | "src-mac":"00:00:00:00:00:04", 55 | "active":"true", 56 | "actions":"set-dst-ip=192.168.0.100,output=2" 57 | } 58 | pusher.set(flow_1) 59 | 60 | flow_2 = { 61 | 'switch':"00:00:00:00:00:00:00:05", 62 | "name":"Flow_flow3", 63 | "cookie":"0", 64 | "dst-mac":"02:00:00:00:02:00", 65 | "ingress-port":"1", 66 | "active":"true", 67 | "actions":"set-dst-ip=192.168.0.100,output=2" 68 | } 69 | pusher.set(flow_2) 70 | 71 | flow_3 = { 72 | 'switch':"00:00:00:00:00:00:00:05", 73 | "name":"Flow_flow4", 74 | "cookie":"0", 75 | "src-mac":"02:00:00:00:02:00", 76 | "ingress-port":"2", 77 | "active":"true", 78 | "actions":"set-dst-ip=192.168.0.1,output=1" 79 | } 80 | pusher.set(flow_3) 81 | 82 | 83 | flow_4 = { 84 | 'switch':"00:00:00:00:00:00:00:02", 85 | "name":"Flow_flow5", 86 | "cookie":"0", 87 | "dst-mac":"00:00:00:00:00:04", 88 | "ingress-port":"2", 89 | "active":"true", 90 | "actions":"output=1" 91 | # "actions":"set-dst-ip=192.168.1.1,output=1" 92 | } 93 | pusher.set(flow_4) 94 | 95 | flow_5 = { 96 | 'switch':"00:00:00:00:00:00:00:02", 97 | "name":"Flow_flow6", 98 | "cookie":"0", 99 | "ingress-port":"1", 100 | "src-mac":"00:00:00:00:00:04", 101 | "active":"true", 102 | "actions":"set-dst-ip=192.168.1.100,output=2" 103 | } 104 | pusher.set(flow_5) 105 | 106 | flow_6 = { 107 | 'switch':"00:00:00:00:00:00:00:05", 108 | "name":"Flow_flow7", 109 | "cookie":"0", 110 | "dst-mac":"02:00:00:00:03:00", 111 | "ingress-port":"1", 112 | "active":"true", 113 | "actions":"set-dst-ip=192.168.1.100,output=3", 114 | } 115 | pusher.set(flow_6) 116 | 117 | flow_7 = { 118 | 'switch':"00:00:00:00:00:00:00:05", 119 | "name":"Flow_flow8", 120 | "cookie":"0", 121 | "src-mac":"02:00:00:00:03:00", 122 | "ingress-port":"3", 123 | "active":"true", 124 | "actions":"output=1" 125 | # "actions":"set-dst-ip=192.168.0.1,output=1" 126 | } 127 | pusher.set(flow_7) 128 | 129 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/mptcp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """MPTCP Demo""" 4 | 5 | from mininet.log import setLogLevel, info 6 | from mininet.node import RemoteController 7 | from mn_wifi.net import Mininet_wifi 8 | from mn_wifi.cli import CLI 9 | 10 | 11 | def topology(): 12 | 13 | """ 14 | *ap2--h4. .s7. 15 | * . . . 16 | sta1* s6-- s9--h10 17 | * . . . 18 | * . . . 19 | *ap3--h5 s8 20 | """ 21 | 22 | 23 | "Create a network." 24 | net = Mininet_wifi() 25 | 26 | info("*** Creating nodes\n") 27 | sta1 = net.addStation( 28 | 'sta1', wlans=2, ip='10.0.0.10/8', position='51,10,0' ) 29 | ap2 = net.addAccessPoint( 30 | 'ap2', mac='00:00:00:00:00:02', equipmentModel='TLWR740N', 31 | protocols='OpenFlow10', ssid= 'ssid_ap2', mode= 'g', 32 | channel= '6', position='55,17,0' ) 33 | ap3 = net.addAccessPoint( 34 | 'ap3', mac='00:00:00:00:00:03', equipmentModel='TLWR740N', 35 | protocols='OpenFlow10', ssid= 'ssid_ap3', mode= 'n', 36 | channel= '1', position='50,11,0' ) 37 | h4 = net.addHost( 'h4', mac='00:00:00:00:00:04', ip='10.0.0.254/8' ) 38 | h5 = net.addHost( 'h5', mac='00:00:00:00:00:05', ip='192.168.0.254/24' ) 39 | s6 = net.addSwitch( 's6', mac='00:00:00:00:00:06', protocols='OpenFlow10' ) 40 | s7 = net.addSwitch( 's7', mac='00:00:00:00:00:07', protocols='OpenFlow10' ) 41 | s8 = net.addSwitch( 's8', mac='00:00:00:00:00:08', protocols='OpenFlow10' ) 42 | s9 = net.addSwitch( 's9', mac='00:00:00:00:00:09', protocols='OpenFlow10' ) 43 | h10 = net.addHost( 'h10', mac='00:00:00:00:00:10', ip='192.168.1.254/24' ) 44 | c1 = net.addController( 'c1', controller=RemoteController, ip='127.0.0.1' ) 45 | 46 | info("*** Configuring wifi nodes\n") 47 | net.configureWifiNodes() 48 | 49 | info("*** Associating and Creating links\n") 50 | net.addLink(ap2, sta1, 0, 0) 51 | net.addLink(ap3, sta1, 0, 1) 52 | net.addLink(ap2, h4, bw=1000) 53 | net.addLink(ap3, h5, bw=1000) 54 | net.addLink(s6, h4, bw=1000) 55 | net.addLink(s6, h5, bw=1000) 56 | net.addLink(s6, s7, bw=1000) 57 | net.addLink(s6, s8, bw=1000) 58 | net.addLink(s7, s9, bw=1000) 59 | net.addLink(s8, s9, bw=1000) 60 | net.addLink(s9, h10, bw=1000) 61 | 62 | h4.cmd('ifconfig h4-eth1 192.168.1.1/24') 63 | h5.cmd('ifconfig h5-eth1 192.168.1.2/24') 64 | 65 | sta1.cmd('ifconfig sta1-wlan0 10.0.0.10/8') 66 | sta1.cmd('ifconfig sta1-wlan1 192.168.0.10/24') 67 | 68 | sta1.cmd('ip route add default 10.0.0.254/8 via sta1-wlan0') 69 | sta1.cmd('ip route add default 192.168.0.254/24 via sta1-wlan1') 70 | 71 | sta1.cmd('ip rule add from 10.0.0.10 table 1') 72 | sta1.cmd('ip rule add from 192.168.0.10 table 2') 73 | 74 | sta1.cmd('ip route add 10.0.0.0 dev sta1-wlan0 scope link table 1') 75 | sta1.cmd('ip route add default via 10.0.0.254 dev sta1-wlan0 table 1') 76 | 77 | sta1.cmd('ip route add 192.168.0.0 dev sta1-wlan1 scope link table 2') 78 | sta1.cmd('ip route add default via 192.168.0.254 dev sta1-wlan1 table 2') 79 | 80 | sta1.cmd('ip route add default scope global nexthop via 10.0.0.254 dev sta1-wlan0') 81 | 82 | info("*** Starting network\n") 83 | net.build() 84 | c1.start() 85 | s6.start( [c1] ) 86 | s7.start( [c1] ) 87 | s8.start( [c1] ) 88 | s9.start( [c1] ) 89 | ap2.start( [c1] ) 90 | ap3.start( [c1] ) 91 | 92 | h10.cmd('ip route add 10.0.0.0/8 via 192.168.1.1') 93 | h10.cmd('ip route add 192.168.0.0/24 via 192.168.1.2') 94 | 95 | h4.cmd('sysctl -w net.ipv4.ip_forward=1') 96 | h5.cmd('sysctl -w net.ipv4.ip_forward=1') 97 | 98 | info("*** Running CLI\n") 99 | CLI( net ) 100 | 101 | info("*** Stopping network\n") 102 | net.stop() 103 | 104 | if __name__ == '__main__': 105 | setLogLevel( 'info' ) 106 | topology() 107 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/README.md: -------------------------------------------------------------------------------- 1 | ## Reproducibility Steps - Wireless n-Casting 2 | 3 | ### Requirements 4 | - Mininet-WiFi 5 | - Floodlight Controller 6 | 7 | 8 | To reproduce this case please follow the instructions below: 9 | 10 | Firstly, run the controller: 11 | 12 | ``` 13 | sudo java -jar target/floodlight.jar 14 | ``` 15 | 16 | Then, start the network topology Then, start the network topology in a new terminal:in a new terminal 17 | ``` 18 | sudo python ncasting.py 19 | ``` 20 | 21 | and install the rules from a 3rd terminal: 22 | ``` 23 | sudo python ncasting-controller.py 24 | ``` 25 | 26 | 27 | ## Reproducibility Steps - MPTCP case 28 | 29 | ### Requirements 30 | - Mininet-WiFi 31 | - MPTCP 32 | - ifstat 33 | - Pox 34 | 35 | In order to allow the communication we use pox controller with spanning tree enabled. The command below can be used to enable spanning tree: 36 | ``` 37 | ./pox.py forwarding.l2_learning openflow.spanning_tree --hold-down log.level --DEBUG samples.pretty_log openflow.discovery host_tracker info.packet_dump 38 | 39 | ``` 40 | Then, start the network topology in a new terminal: 41 | ``` 42 | sudo python mptcp.py 43 | ``` 44 | 45 | and open 4 new terminals with xterm: 46 | ``` 47 | mininet-wifi>xterm sta1 sta1 h10 h10 48 | ``` 49 | 50 | and run some commands with xterm: 51 | 52 | h10`s terminal #1 53 | ``` 54 | ifstat 55 | ``` 56 | 57 | h10`s terminal #2 58 | ``` 59 | iperf -s 60 | ``` 61 | 62 | sta1`s terminal #1 63 | ``` 64 | ifstat 65 | ``` 66 | 67 | sta1`s terminal #2 68 | ``` 69 | iperf -c 192.168.1.254 70 | ``` 71 | 72 | ## Reproducibility Steps - Hybrid Physical-Virtual Environment 73 | 74 | ### Requirements 75 | - Mininet-WiFi 76 | - WiFi interface + (second WiFi or ethernet interface) 77 | - Floodlight 78 | - ofsoftswitch13 79 | - speedtest-cli 80 | 81 | **Note** - You may want to set both Internet and wlan interfaces in `hybridVirtualPhysical.py`. 82 | 83 | ``` 84 | internetIface ='eth0' # wired/wireless card 85 | usbDongleIface ='wlan0' # wifi interface 86 | ``` 87 | 88 | Now, run the Floodlight controller 89 | 90 | ``` 91 | sudo java -jar target/floodlight.jar 92 | ``` 93 | 94 | Then, run the network topology in a 2nd terminal: 95 | 96 | ``` 97 | sudo py hybridVirtualPhysical.py 98 | mininet-wifi> sh ./rule.hybridVirtualPhysical 99 | ``` 100 | 101 | Despite the content of `rule.hybridVirtualPhysical` is included in `hybridVirtualPhysical.py`, we have faced some problems with floodlight. Thus, probably you have to run `rule.hybridVirtualPhysical` after running `hybridVirtualPhysical.py`. 102 | 103 | 104 | Now, stations should be able to communicate with to each other as well as to the Internet. Now, you may consider to use any station and run `speedtest-cli`: 105 | 106 | ``` 107 | mininet-wifi>xterm sta1 108 | ``` 109 | 110 | sta1's terminal: 111 | ``` 112 | speedtest-cli 113 | ``` 114 | 115 | There is a web server accessible at 10.0.0.111 and according rules added in `rule.hybridVirtualPhysical` if you access 10.0.0.109 the traffic will be redirect to 10.0.0.111. 116 | 117 | 118 | **Useful commands** 119 | ``` 120 | sta1 iw dev sta1-wlan0 mpath dump #verify mesh routing information 121 | dpctl unix:/tmp/ap3 stats-flow 122 | dpctl unix:/tmp/ap3 stats-meter 123 | dpctl unix:/tmp/ap3 meter-config 124 | ``` 125 | 126 | 127 | ## Reproducibility Steps - SSID-based Flow Abstraction 128 | 129 | ### Requirements 130 | - Mininet-WiFi 131 | - ofsoftswitch13 132 | 133 | To reproduce this case you have to run the following script: 134 | 135 | ``` 136 | sudo python forwardingBySSID.py 137 | ``` 138 | 139 | Then, you may run any application (e.g., Iperf) to measure the bandwidth. Alternatively, you may run `dpctl` to check the meter table configuration. 140 | 141 | 142 | ``` 143 | mininet-wifi> sh dpctl unix:/tmp/ap1 meter-config 144 | ``` 145 | 146 | 147 | ## Reproducibility Steps - Propagation Model 148 | 149 | ### Requirements 150 | - Mininet-WiFi 151 | 152 | Consider to run `propagationModelCase.py` if you want to reproduce this case. 153 | 154 | 155 | ## Reproducibility Steps - Simple File Transfer 156 | 157 | ### Requirements 158 | - Mininet-WiFi 159 | 160 | Consider to run `fileTransferring.py` and `fileTransferring.c` if you want to reproduce this case. 161 | 162 | 163 | 164 | ## Reproducibility Steps - Replaying Network Conditions 165 | 166 | ### Requirements 167 | - Mininet-WiFi 168 | 169 | Consider to run files in the `replayingNetwork/` directory if you want to reproduce the results. -------------------------------------------------------------------------------- /mininet-wifi/mininet-wifi-sflow-rt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # autor: Ramon dos Reis Fontes 4 | # sflow-based code 5 | 6 | from mininet.node import Controller 7 | from mininet.log import setLogLevel, info 8 | from mn_wifi.link import wmediumd, mesh 9 | from mn_wifi.cli import CLI 10 | from mn_wifi.net import Mininet_wifi 11 | from mn_wifi.wmediumdConnector import interference 12 | from json import dumps 13 | from requests import put 14 | from mininet.util import quietRun 15 | from os import listdir, environ 16 | import re 17 | 18 | 19 | def topology(): 20 | "Create a network." 21 | net = Mininet_wifi(link=wmediumd, wmediumd_mode=interference) 22 | 23 | info("*** Creating nodes\n") 24 | sta1 = net.addStation('sta1', mac='00:00:00:00:00:11', position='1,1,0') 25 | sta2 = net.addStation('sta2', mac='00:00:00:00:00:12', position='31,11,0') 26 | ap1 = net.addAccessPoint('ap1', wlans=2, ssid=['ssid1','mesh'], position='10,10,0') 27 | ap2 = net.addAccessPoint('ap2', wlans=2, ssid=['ssid2','mesh'], position='30,10,0') 28 | ap3 = net.addAccessPoint('ap3', wlans=2, ssid=['ssid3','mesh'], position='50,10,0') 29 | c0 = net.addController('c0') 30 | 31 | info("*** Configuring wifi nodes\n") 32 | net.configureWifiNodes() 33 | 34 | info("*** Associating Stations\n") 35 | net.addLink(sta1, ap1) 36 | net.addLink(sta2, ap2) 37 | 38 | info("*** Creating mesh links\n") 39 | net.addLink(ap1, intf='ap1-wlan2', cls=mesh, ssid='mesh-ssid', channel=5) 40 | net.addLink(ap2, intf='ap2-wlan2', cls=mesh, ssid='mesh-ssid', channel=5) 41 | net.addLink(ap3, intf='ap3-wlan2', cls=mesh, ssid='mesh-ssid', channel=5) 42 | 43 | info("*** Building network\n") 44 | net.build() 45 | c0.start() 46 | ap1.start([c0]) 47 | ap2.start([c0]) 48 | ap3.start([c0]) 49 | 50 | ap1.cmd('iw dev %s-mp2 interface add %s-mon0 type monitor' % 51 | (ap1.name, ap1.name)) 52 | ap2.cmd('iw dev %s-mp2 interface add %s-mon0 type monitor' % 53 | (ap2.name, ap2.name)) 54 | ap1.cmd('ifconfig %s-mon0 up' % ap1.name) 55 | ap2.cmd('ifconfig %s-mon0 up' % ap2.name) 56 | 57 | ifname='enp2s0' # have to be changed to your own iface! 58 | collector = environ.get('COLLECTOR','127.0.0.1') 59 | sampling = environ.get('SAMPLING','10') 60 | polling = environ.get('POLLING','10') 61 | sflow = 'ovs-vsctl -- --id=@sflow create sflow agent=%s target=%s ' \ 62 | 'sampling=%s polling=%s --' % (ifname,collector,sampling,polling) 63 | 64 | for ap in net.aps: 65 | sflow += ' -- set bridge %s sflow=@sflow' % ap 66 | info(' '.join([ap.name for ap in net.aps])) 67 | quietRun(sflow) 68 | 69 | agent = '127.0.0.1' 70 | topo = {'nodes':{}, 'links':{}} 71 | for ap in net.aps: 72 | topo['nodes'][ap.name] = {'agent':agent, 'ports':{}} 73 | 74 | path = '/sys/devices/virtual/mac80211_hwsim/' 75 | for child in listdir(path): 76 | dir_ = '/sys/devices/virtual/mac80211_hwsim/'+'%s' % child+'/net/' 77 | for child_ in listdir(dir_): 78 | node = child_[:3] 79 | if node in topo['nodes']: 80 | ifindex = open(dir_+child_+'/ifindex').read().split('\n',1)[0] 81 | topo['nodes'][node]['ports'][child_] = {'ifindex': ifindex} 82 | 83 | path = '/sys/devices/virtual/net/' 84 | for child in listdir(path): 85 | parts = re.match('(^.+)-(.+)', child) 86 | if parts is None: continue 87 | if parts.group(1) in topo['nodes']: 88 | ifindex = open(path+child+'/ifindex').read().split('\n',1)[0] 89 | topo['nodes'][parts.group(1)]['ports'][child] = {'ifindex': ifindex} 90 | 91 | linkName = '%s-%s' % (ap1.name, ap2.name) 92 | topo['links'][linkName] = {'node1': ap1.name, 'port1': 'ap1-mp2', 93 | 'node2': ap2.name, 'port2': 'ap2-mp2'} 94 | linkName = '%s-%s' % (ap2.name, ap3.name) 95 | topo['links'][linkName] = {'node1': ap2.name, 'port1': 'ap2-mp2', 96 | 'node2': ap3.name, 'port2': 'ap3-mp2'} 97 | linkName = '%s-%s' % (ap1.name, ap2.name) 98 | topo['links'][linkName] = {'node1': ap1.name, 'port1': ap1.wintfs[0].name, 99 | 'node2': ap2.name, 'port2': ap2.wintfs[0].name} 100 | 101 | put('http://127.0.0.1:8008/topology/json',data=dumps(topo)) 102 | 103 | info("*** Running CLI\n") 104 | CLI(net) 105 | 106 | info("*** Stopping network\n") 107 | net.stop() 108 | 109 | 110 | if __name__ == '__main__': 111 | setLogLevel('info') 112 | topology() 113 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/replayingNetwork/ieee80211b/serverTrace.txt: -------------------------------------------------------------------------------- 1 | 1 626932 0 0 0.810378 2 | 2 811197 0 0 0.995223 3 | 3 805270 0 0 0.99892 4 | 4 811236 0 0 0.99931 5 | 5 796767 0 0 0.997428 6 | 6 795562 0 0 0.998679 7 | 7 799624 0 0 0.998715 8 | 8 791449 0 0 0.99869 9 | 9 809028 0 0 0.996972 10 | 10 787901 0 0 0.999328 11 | 11 775686 0 0 0.998553 12 | 12 787541 0 0 0.997453 13 | 13 796570 0 0 0.996082 14 | 14 779155 0 0 0.998584 15 | 15 795678 0 0 0.999225 16 | 16 782837 0 0 0.998046 17 | 17 740698 0 0 0.999459 18 | 18 750318 0 0 0.996874 19 | 19 789588 0 0 0.998468 20 | 20 763627 0 0 0.996952 21 | 21 749909 0 0 0.999495 22 | 22 811521 0 0 0.996982 23 | 23 794659 0 0 0.997746 24 | 24 782282 0 0 0.999358 25 | 25 783817 0 0 0.99819 26 | 26 799722 0 0 0.998913 27 | 27 825423 0 0 0.998032 28 | 28 778908 0 0 0.998391 29 | 29 784751 0 0 0.998103 30 | 30 815996 0 0 0.997602 31 | 31 805670 0 0 0.998763 32 | 32 787837 0 0 0.99739 33 | 33 797225 0 0 0.998951 34 | 34 835578 0 0 0.998619 35 | 35 787495 0 0 0.998017 36 | 36 793541 0 0 0.996642 37 | 37 771499 0 0 0.998505 38 | 38 838656 0 0 0.998676 39 | 39 777660 0 0 0.997752 40 | 40 790366 0 0 0.996296 41 | 41 790648 0 0 0.999138 42 | 42 821534 0 0 0.999119 43 | 43 796047 0 0 0.998127 44 | 44 786762 0 0 0.998885 45 | 45 768668 0 0 0.998652 46 | 46 832435 0 0 0.997573 47 | 47 781881 0 0 0.99888 48 | 48 786799 0 0 0.997206 49 | 49 781173 0 0 0.999601 50 | 50 828005 0 0 0.999031 51 | 51 786477 0 0 0.995673 52 | 52 788373 0 0 0.997782 53 | 53 785225 0 0 0.998898 54 | 54 822883 0 0 0.998293 55 | 55 773127 0 0 0.996082 56 | 56 784059 0 0 0.99831 57 | 57 797225 0 0 0.999587 58 | 58 823019 0 0 0.997604 59 | 59 763362 0 0 0.997426 60 | 60 787518 0 0 0.998629 61 | 61 804843 0 0 0.999017 62 | 62 827032 0 0 0.998244 63 | 63 787091 0 0 0.998054 64 | 64 783574 0 0 0.99879 65 | 65 801325 0 0 0.996429 66 | 66 822629 0 0 0.99785 67 | 67 784022 0 0 0.99805 68 | 68 784574 0 0 0.996833 69 | 69 802229 0 0 0.998442 70 | 70 812127 0 0 0.998555 71 | 71 775935 0 0 0.996488 72 | 72 788742 0 0 0.998173 73 | 73 809692 0 0 0.998423 74 | 74 830026 0 0 0.99794 75 | 75 783836 0 0 0.998921 76 | 76 778003 0 0 0.998566 77 | 77 794525 0 0 0.996018 78 | 78 808242 0 0 0.999054 79 | 79 785106 0 0 0.998661 80 | 80 797002 0 0 0.997059 81 | 81 817545 0 0 0.998951 82 | 82 810671 0 0 0.998644 83 | 83 785249 0 0 0.997877 84 | 84 773455 0 0 0.998051 85 | 85 823312 0 0 0.999817 86 | 86 786579 0 0 0.997654 87 | 87 798168 0 0 0.999751 88 | 88 769029 0 0 0.996007 89 | 89 817638 0 0 0.999187 90 | 90 789242 0 0 0.995411 91 | 91 780843 0 0 0.999316 92 | 92 776403 0 0 0.998714 93 | 93 837142 0 0 0.999563 94 | 94 793062 0 0 0.999608 95 | 95 789161 0 0 0.998007 96 | 96 783280 0 0 0.997888 97 | 97 821031 0 0 0.997098 98 | 98 817502 0 0 0.997193 99 | 99 765442 0 0 0.997671 100 | 100 801889 0 0 0.998767 101 | 101 814773 0 0 0.997354 102 | 102 789274 0 0 0.998606 103 | 103 784554 0 0 0.998611 104 | 104 785284 0 0 0.99863 105 | 105 822254 0 0 0.998917 106 | 106 805081 0 0 0.998481 107 | 107 791208 0 0 0.999016 108 | 108 769043 0 0 0.998123 109 | 109 826498 0 0 0.998984 110 | 110 796532 0 0 0.996437 111 | 111 785063 0 0 0.998418 112 | 112 783505 0 0 0.999089 113 | 113 808842 0 0 0.997228 114 | 114 798944 0 0 0.998945 115 | 115 789879 0 0 0.998947 116 | 116 795321 0 0 0.99803 117 | 117 828094 0 0 0.998323 118 | 118 795843 0 0 0.99767 119 | 119 784798 0 0 0.99842 120 | 120 785361 0 0 0.998953 121 | 121 823876 0 0 0.998314 122 | 122 791899 0 0 0.997248 123 | 123 783787 0 0 0.997416 124 | 124 787090 0 0 0.999293 125 | 125 816102 0 0 0.998884 126 | 126 793522 0 0 0.998874 127 | 127 771960 0 0 0.998789 128 | 128 801647 0 0 0.999295 129 | 129 825013 0 0 0.997858 130 | 130 796184 0 0 0.996957 131 | 131 776343 0 0 0.999308 132 | 132 788908 0 0 0.999043 133 | 133 839579 0 0 0.998727 134 | 134 783036 0 0 0.99929 135 | 135 791606 0 0 0.996015 136 | 136 777194 0 0 0.997408 137 | 137 825615 0 0 0.999005 138 | 138 755300 0 0 0.997831 139 | 139 811751 0 0 0.997514 140 | 140 793277 0 0 0.998259 141 | 141 818989 0 0 0.996292 142 | 142 778369 0 0 0.997971 143 | 143 787463 0 0 0.99939 144 | 144 813570 0 0 0.996518 145 | 145 790800 0 0 0.99854 146 | 146 820778 0 0 0.998358 147 | 147 779710 0 0 0.995574 148 | 148 800086 0 0 0.998792 149 | 149 796826 0 0 0.998441 150 | 150 818118 0 0 0.998671 151 | 151 775698 0 0 0.99869 152 | 152 810284 0 0 0.998053 153 | 153 813698 0 0 0.999698 154 | 154 795981 0 0 0.997354 155 | 155 778979 0 0 0.998605 156 | 156 797100 0 0 0.997386 157 | 157 832648 0 0 0.999324 158 | 158 783922 0 0 0.998834 159 | 159 787975 0 0 0.99813 160 | 160 782573 0 0 0.998447 161 | 161 826381 0 0 0.998884 162 | 162 774546 0 0 0.998001 163 | 163 783388 0 0 0.997851 164 | 164 790276 0 0 0.998508 165 | 165 845865 0 0 0.998531 166 | 166 788073 0 0 0.997295 167 | 167 773583 0 0 0.998187 168 | 168 799684 0 0 0.997419 169 | 169 836098 0 0 0.998498 170 | 170 788608 0 0 0.997892 171 | 171 771290 0 0 0.997028 172 | 172 798634 0 0 0.999084 173 | 173 830170 0 0 0.999937 174 | 174 785216 0 0 0.996994 175 | 175 788121 0 0 0.998597 176 | 176 783203 0 0 0.996993 177 | 177 819628 0 0 0.998523 178 | 178 787264 0 0 0.999133 179 | 179 783835 0 0 0.997528 180 | 180 759677 0 0 0 181 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/replayingNetwork/ieee80211b/clientTrace.txt: -------------------------------------------------------------------------------- 1 | 1 626932 0 0 0.093705 2 | 2 811197 0 0 0.996645 3 | 3 805270 0 0 0.998568 4 | 4 811236 0 0 0.997721 5 | 5 796767 0 0 0.997754 6 | 6 795562 0 0 0.995303 7 | 7 799624 0 0 0.999789 8 | 8 791449 0 0 0.996965 9 | 9 809028 0 0 0.998387 10 | 10 787901 0 0 0.997876 11 | 11 775686 0 0 0.997273 12 | 12 787541 0 0 0.999092 13 | 13 796570 0 0 0.995439 14 | 14 779155 0 0 0.998815 15 | 15 795678 0 0 0.997525 16 | 16 782837 0 0 0.998001 17 | 17 740698 0 0 0.998251 18 | 18 750318 0 0 0.996536 19 | 19 789588 0 0 0.997377 20 | 20 763627 0 0 0.999736 21 | 21 749909 0 0 0.997632 22 | 22 811521 0 0 0.997697 23 | 23 794659 0 0 0.997404 24 | 24 782282 0 0 0.998623 25 | 25 783817 0 0 0.996605 26 | 26 799722 0 0 0.998362 27 | 27 825423 0 0 0.998623 28 | 28 778908 0 0 0.996938 29 | 29 784751 0 0 0.998312 30 | 30 815996 0 0 0.998065 31 | 31 805670 0 0 0.997761 32 | 32 787837 0 0 0.998723 33 | 33 797225 0 0 0.998495 34 | 34 835578 0 0 0.99696 35 | 35 787495 0 0 0.995733 36 | 36 793541 0 0 0.994452 37 | 37 771499 0 0 0.998531 38 | 38 838656 0 0 0.997983 39 | 39 777660 0 0 0.999018 40 | 40 790366 0 0 0.997629 41 | 41 790648 0 0 0.999148 42 | 42 821534 0 0 0.997941 43 | 43 796047 0 0 0.998548 44 | 44 786762 0 0 0.998964 45 | 45 768668 0 0 0.997532 46 | 46 832435 0 0 0.997075 47 | 47 781881 0 0 0.998612 48 | 48 786799 0 0 0.997898 49 | 49 781173 0 0 0.997843 50 | 50 828005 0 0 0.996783 51 | 51 786477 0 0 0.99899 52 | 52 788373 0 0 0.998915 53 | 53 785225 0 0 0.998371 54 | 54 822883 0 0 0.998424 55 | 55 773127 0 0 0.998148 56 | 56 784059 0 0 0.998884 57 | 57 797225 0 0 0.998349 58 | 58 823019 0 0 0.998198 59 | 59 763362 0 0 0.998309 60 | 60 787518 0 0 0.99865 61 | 61 804843 0 0 0.996815 62 | 62 827032 0 0 0.996846 63 | 63 787091 0 0 0.997265 64 | 64 783574 0 0 0.998063 65 | 65 801325 0 0 0.999547 66 | 66 822629 0 0 0.99725 67 | 67 784022 0 0 0.997785 68 | 68 784574 0 0 0.99889 69 | 69 802229 0 0 0.996984 70 | 70 812127 0 0 0.999752 71 | 71 775935 0 0 0.997195 72 | 72 788742 0 0 0.998056 73 | 73 809692 0 0 0.999009 74 | 74 830026 0 0 0.997206 75 | 75 783836 0 0 0.999144 76 | 76 778003 0 0 0.996183 77 | 77 794525 0 0 0.999682 78 | 78 808242 0 0 0.996706 79 | 79 785106 0 0 0.999321 80 | 80 797002 0 0 0.998677 81 | 81 817545 0 0 0.998195 82 | 82 810671 0 0 0.996532 83 | 83 785249 0 0 0.996589 84 | 84 773455 0 0 0.998849 85 | 85 823312 0 0 0.998256 86 | 86 786579 0 0 0.999429 87 | 87 798168 0 0 0.998456 88 | 88 769029 0 0 0.997528 89 | 89 817638 0 0 0.997987 90 | 90 789242 0 0 0.99818 91 | 91 780843 0 0 0.999404 92 | 92 776403 0 0 0.996977 93 | 93 837142 0 0 0.999305 94 | 94 793062 0 0 0.998015 95 | 95 789161 0 0 0.99858 96 | 96 783280 0 0 0.997471 97 | 97 821031 0 0 0.998582 98 | 98 817502 0 0 0.998121 99 | 99 765442 0 0 0.997993 100 | 100 801889 0 0 0.999612 101 | 101 814773 0 0 0.997416 102 | 102 789274 0 0 0.997944 103 | 103 784554 0 0 0.997787 104 | 104 785284 0 0 0.998072 105 | 105 822254 0 0 0.997678 106 | 106 805081 0 0 0.998832 107 | 107 791208 0 0 0.997373 108 | 108 769043 0 0 0.998125 109 | 109 826498 0 0 0.997706 110 | 110 796532 0 0 0.997168 111 | 111 785063 0 0 0.999211 112 | 112 783505 0 0 0.998011 113 | 113 808842 0 0 0.998421 114 | 114 798944 0 0 0.997548 115 | 115 789879 0 0 0.999059 116 | 116 795321 0 0 0.99777 117 | 117 828094 0 0 0.998209 118 | 118 795843 0 0 0.998641 119 | 119 784798 0 0 0.998843 120 | 120 785361 0 0 0.998431 121 | 121 823876 0 0 0.997715 122 | 122 791899 0 0 0.996798 123 | 123 783787 0 0 0.998745 124 | 124 787090 0 0 0.995076 125 | 125 816102 0 0 0.998756 126 | 126 793522 0 0 0.99916 127 | 127 771960 0 0 0.996278 128 | 128 801647 0 0 0.997209 129 | 129 825013 0 0 0.998017 130 | 130 796184 0 0 0.997042 131 | 131 776343 0 0 0.99869 132 | 132 788908 0 0 0.99779 133 | 133 839579 0 0 0.998203 134 | 134 783036 0 0 0.99786 135 | 135 791606 0 0 0.998274 136 | 136 777194 0 0 0.996579 137 | 137 825615 0 0 0.99839 138 | 138 755300 0 0 0.997521 139 | 139 811751 0 0 0.998134 140 | 140 793277 0 0 0.998175 141 | 141 818989 0 0 0.998777 142 | 142 778369 0 0 0.996964 143 | 143 787463 0 0 0.998538 144 | 144 813570 0 0 0.999522 145 | 145 790800 0 0 0.996923 146 | 146 820778 0 0 0.998564 147 | 147 779710 0 0 0.997397 148 | 148 800086 0 0 0.997783 149 | 149 796826 0 0 0.998702 150 | 150 818118 0 0 0.996589 151 | 151 775698 0 0 0.996764 152 | 152 810284 0 0 0.998334 153 | 153 813698 0 0 0.999482 154 | 154 795981 0 0 0.997452 155 | 155 778979 0 0 0.997959 156 | 156 797100 0 0 0.998259 157 | 157 832648 0 0 0.998295 158 | 158 783922 0 0 0.998562 159 | 159 787975 0 0 0.997786 160 | 160 782573 0 0 0.998694 161 | 161 826381 0 0 0.998468 162 | 162 774546 0 0 0.998185 163 | 163 783388 0 0 0.99819 164 | 164 790276 0 0 0.996006 165 | 165 845865 0 0 0.998208 166 | 166 788073 0 0 0.998737 167 | 167 773583 0 0 0.998842 168 | 168 799684 0 0 0.997106 169 | 169 836098 0 0 0.998535 170 | 170 788608 0 0 0.999584 171 | 171 771290 0 0 0.997936 172 | 172 798634 0 0 0.998752 173 | 173 830170 0 0 0.998483 174 | 174 785216 0 0 0.99786 175 | 175 788121 0 0 0.998497 176 | 176 783203 0 0 0.997677 177 | 177 819628 0 0 0.998229 178 | 178 787264 0 0 0.997236 179 | 179 783835 0 0 0.996448 180 | 180 759677 0 0 0 181 | -------------------------------------------------------------------------------- /mininet-wifi/SIGCOMM-2016/hybridVirtualPhysical.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """Code created to be presented with the paper titled: 4 | "Rich Experimentation through Hybrid Physical-Virtual Software-Defined Wireless 5 | Networking Emulation" 6 | authors: Ramon dos Reis Fontes and Christian Esteve Rothenberg""" 7 | 8 | """Topology 9 | 10 | (2)ap2(3) 11 | / \ 12 | (3) (2) 13 | wlan1(2)phyap1 ap3(4)wlan0 14 | (4) (3) 15 | \ / 16 | (3)ap4(2) """ 17 | 18 | 19 | from mininet.log import setLogLevel, info 20 | from mininet.node import RemoteController 21 | from mn_wifi.node import UserAP, physicalAP 22 | from mn_wifi.net import Mininet_wifi 23 | from mn_wifi.cli import CLI 24 | from mn_wifi.link import wmediumd, mesh 25 | from mn_wifi.wmediumdConnector import interference 26 | import time 27 | 28 | 29 | def topology(): 30 | 31 | "Create a network." 32 | net = Mininet_wifi( controller=RemoteController, accessPoint=UserAP, 33 | link=wmediumd, wmediumd_mode=interference ) 34 | 35 | internetIface = 'enp3s0' 36 | usbDongleIface = 'wlxf4f26d193319' 37 | 38 | info("*** Creating nodes\n") 39 | for n in range(10): 40 | net.addStation('sta%s' % (n+1), wlans=2, mac='00:00:00:00:00:' + '%02x' % (n+1), 41 | ip='192.168.0.%s/24' % (n+1)) 42 | sta11 = net.addStation('sta11', ip='10.0.0.111/8', position='60,100,0') 43 | 44 | h12 = net.addHost('h12', ip='10.0.0.109/8') 45 | root = net.addHost('root', ip='10.0.0.254/8', inNamespace=False) 46 | 47 | phyap1 = net.addAccessPoint( 48 | 'phyap1', protocols='OpenFlow13', ssid='Sigcomm-2016', 49 | mode='g', channel='1', position='50,115,0', phywlan=usbDongleIface, 50 | cls=physicalAP) 51 | ap2 = net.addAccessPoint( 'ap2', protocols='OpenFlow13', ssid='ap-ssid2', 52 | mode='g', channel='11', position='100,175,0' ) 53 | ap3 = net.addAccessPoint( 'ap3', protocols='OpenFlow13', ssid='ap-ssid3', 54 | mode='g', channel='6', position='150,115,0' ) 55 | ap4 = net.addAccessPoint( 'ap4', protocols='OpenFlow13', ssid='ap-ssid4', 56 | mode='g', channel='11', position='100,55,0' ) 57 | c5 = net.addController( 'c5', controller=RemoteController, port=6653 ) 58 | 59 | info("*** Configuring Propagation Model\n") 60 | net.setPropagationModel(model="logDistance", exp=4) 61 | 62 | info("*** Configuring wifi nodes\n") 63 | net.configureWifiNodes() 64 | 65 | info("*** Creating links\n") 66 | for sta in net.stations: 67 | net.addLink(sta, cls=mesh, intf='%s-wlan0' % sta.name, ssid='meshNet') 68 | 69 | info("*** Associating and Creating links") 70 | net.addLink(phyap1, ap2) 71 | net.addLink(ap2, ap3) 72 | net.addLink(sta11, phyap1) 73 | net.addLink(ap3, ap4) 74 | net.addLink(ap4, phyap1) 75 | net.addLink(root, ap3) 76 | net.addLink(phyap1, h12) 77 | 78 | net.plotGraph(max_x=240, max_y=240) 79 | 80 | net.setMobilityModel(time=0, model='RandomWalk', max_x=200, 81 | max_y=200, min_v=0.1, max_v=0.2, seed=20) 82 | 83 | info("*** Starting network\n") 84 | net.build() 85 | c5.start() 86 | phyap1.start( [c5] ) 87 | ap2.start( [c5] ) 88 | ap3.start( [c5] ) 89 | ap4.start( [c5] ) 90 | 91 | time.sleep(2) 92 | 'output=all,flood' 93 | ap3.cmd('dpctl unix:/tmp/ap3 meter-mod cmd=add,flags=1,meter=1 drop:rate=100') 94 | ap3.cmd('dpctl unix:/tmp/ap3 flow-mod table=0,cmd=add in_port=4,eth_type=0x800,ip_dst=10.0.0.100,meter:1 apply:output=flood') 95 | phyap1.cmd('dpctl unix:/tmp/phyap1 flow-mod table=0,cmd=add in_port=2,ip_dst=10.0.0.109,eth_type=0x800,ip_proto=6,tcp_dst=80 apply:set_field=tcp_dst:80,set_field=ip_dst:10.0.0.111,output=5') 96 | phyap1.cmd('dpctl unix:/tmp/phyap1 flow-mod table=0,cmd=add in_port=1,eth_type=0x800,ip_proto=6,tcp_src=80 apply:set_field=ip_src:10.0.0.109,output=2') 97 | 98 | fixNetworkManager( root, 'root-eth0' ) 99 | 100 | startNAT(root, internetIface) 101 | 102 | sta11.cmd('ip route add default via 10.0.0.254') 103 | sta11.cmd('pushd /home/fontes; python3 -m http.server 80 &') 104 | 105 | for id, sta in enumerate(net.stations): 106 | if sta.name != 'sta11': 107 | sta.setIP('10.0.0.%s/8' % (id+201), intf="%s-wlan1" % sta) 108 | sta.cmd('ip route add default via 10.0.0.254') 109 | 110 | info("*** Running CLI\n") 111 | CLI( net ) 112 | 113 | info("*** Stopping network\n") 114 | net.stop() 115 | 116 | 117 | def startNAT( root, inetIntf, subnet='10.0/8', localIntf = None ): 118 | """Start NAT/forwarding between Mininet and external network 119 | root: node to access iptables from 120 | inetIntf: interface for internet access 121 | subnet: Mininet subnet (default 10.0/8)""" 122 | 123 | # Identify the interface connecting to the mininet network 124 | if localIntf == None: 125 | localIntf = root.defaultIntf() 126 | 127 | # Flush any currently active rules 128 | root.cmd( 'iptables -F' ) 129 | root.cmd( 'iptables -t nat -F' ) 130 | 131 | # Create default entries for unmatched traffic 132 | root.cmd( 'iptables -P INPUT ACCEPT' ) 133 | root.cmd( 'iptables -P OUTPUT ACCEPT' ) 134 | root.cmd( 'iptables -P FORWARD DROP' ) 135 | 136 | # Configure NAT 137 | root.cmd( 'iptables -I FORWARD -i', localIntf, '-d', subnet, '-j DROP' ) 138 | root.cmd( 'iptables -A FORWARD -i', localIntf, '-s', subnet, '-j ACCEPT' ) 139 | root.cmd( 'iptables -A FORWARD -i', inetIntf, '-d', subnet, '-j ACCEPT' ) 140 | root.cmd( 'iptables -t nat -A POSTROUTING -o ', inetIntf, '-j MASQUERADE' ) 141 | 142 | # Instruct the kernel to perform forwarding 143 | root.cmd( 'sysctl net.ipv4.ip_forward=1' ) 144 | 145 | def fixNetworkManager( root, intf ): 146 | """Prevent network-manager from messing with our interface, 147 | by specifying manual configuration in /etc/network/interfaces 148 | root: a node in the root namespace (for running commands) 149 | intf: interface name""" 150 | cfile = '/etc/network/interfaces' 151 | line = '\niface %s inet manual\n' % intf 152 | config = open( cfile ).read() 153 | if ( line ) not in config: 154 | print('*** Adding', line.strip(), 'to', cfile) 155 | with open( cfile, 'a' ) as f: 156 | f.write( line ) 157 | # Probably need to restart network-manager to be safe - 158 | # hopefully this won't disconnect you 159 | root.cmd( 'service network-manager restart' ) 160 | 161 | if __name__ == '__main__': 162 | setLogLevel( 'info' ) 163 | topology() 164 | 165 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/hybridVirtualPhysical.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """Code created to be presented with the paper titled: 4 | "Rich Experimentation through Hybrid Physical-Virtual Software-Defined Wireless Networking Emulation" 5 | authors: Ramon dos Reis Fontes and Christian Esteve Rothenberg""" 6 | 7 | """Topology 8 | 9 | (2)ap2(3) 10 | / \ 11 | (3) (2) 12 | wlan1(2)phyap1 ap3(4)wlan0 13 | (4) (3) 14 | \ / 15 | (3)ap4(2) """ 16 | 17 | 18 | from mininet.log import setLogLevel, info 19 | from mininet.node import RemoteController 20 | from mn_wifi.node import UserAP, physicalAP 21 | from mn_wifi.cli import CLI 22 | from mn_wifi.net import Mininet_wifi 23 | from mn_wifi.wmediumdConnector import interference 24 | from mn_wifi.link import wmediumd, mesh 25 | import time 26 | 27 | 28 | def topology(): 29 | 30 | "Create a network." 31 | net = Mininet_wifi( controller=RemoteController, accessPoint=UserAP, 32 | link=wmediumd, wmediumd_mode=interference) 33 | staList = [] 34 | internetIface = 'enp2s0' 35 | usbDongleIface = 'wlxf4f26d193319' 36 | 37 | info("*** Creating nodes\n") 38 | for n in range(10): 39 | staList.append(n) 40 | staList[n] = net.addStation( 41 | 'sta%s' % (n+1), wlans=2, mac='00:00:00:00:00:%s' 42 | % (n+1), ip='192.168.0.%s/24' % (n+1) ) 43 | phyap1 = net.addAccessPoint( 44 | 'phyap1', protocols='OpenFlow13', ssid='Sigcomm-2016-Mininet-WiFi', 45 | mode='g', channel='1', position='50,115,0', phywlan=usbDongleIface, 46 | cls=physicalAP) 47 | ap2 = net.addAccessPoint( 'ap2', protocols='OpenFlow13', 48 | ssid='ap-ssid2', mode= 'g', channel= '11', 49 | position='100,175,0' ) 50 | ap3 = net.addAccessPoint( 'ap3', protocols='OpenFlow13', 51 | ssid='ap-ssid3', mode= 'g', channel= '6', 52 | position='150,115,0' ) 53 | ap4 = net.addAccessPoint( 'ap4', protocols='OpenFlow13', 54 | ssid='ap-ssid4', mode= 'g', channel= '11', 55 | position='100,55,0' ) 56 | c5 = net.addController( 'c5', controller=RemoteController, port=6653 ) 57 | sta11 = net.addStation( 'sta11', ip='10.0.0.111/8', position='60,100,0') 58 | h12 = net.addHost( 'h12', ip='10.0.0.109/8') 59 | root = net.addHost( 'root', ip='10.0.0.254/8', inNamespace=False ) 60 | 61 | info("*** Configuring wifi nodes") 62 | net.configureWifiNodes() 63 | 64 | info("*** Creating links\n") 65 | for sta in staList: 66 | net.addLink(sta, cls=mesh, ssid='meshNet') 67 | 68 | net.plotGraph(max_x=240, max_y=240) 69 | 70 | info("*** Associating and Creating links\n") 71 | net.addLink(phyap1, ap2) 72 | net.addLink(ap2, ap3) 73 | net.addLink(sta11, ap2) 74 | net.addLink(ap3, ap4) 75 | net.addLink(ap4, phyap1) 76 | net.addLink(root, ap3) 77 | net.addLink(phyap1, h12) 78 | 79 | net.startMobility(startTime=0, model='RandomWalk', 80 | max_x=200, max_y=200, 81 | min_v=0.1, max_v=0.2, seed=20) 82 | 83 | info("*** Starting network\n") 84 | net.build() 85 | c5.start() 86 | phyap1.start( [c5] ) 87 | ap2.start( [c5] ) 88 | ap3.start( [c5] ) 89 | ap4.start( [c5] ) 90 | 91 | time.sleep(2) 92 | """output=all,flood""" 93 | ap3.cmd('dpctl unix:/tmp/ap3 meter-mod cmd=add,flags=1,meter=1 drop:rate=100') 94 | ap3.cmd('dpctl unix:/tmp/ap3 flow-mod table=0,cmd=add in_port=4,eth_type=0x800,ip_dst=10.0.0.100,meter:1 apply:output=flood') 95 | phyap1.cmd('dpctl unix:/tmp/phyap1 flow-mod table=0,cmd=add in_port=2,ip_dst=10.0.0.109,eth_type=0x800,ip_proto=6,tcp_dst=80 apply:set_field=tcp_dst:80,set_field=ip_dst:10.0.0.111,output=5') 96 | phyap1.cmd('dpctl unix:/tmp/phyap1 flow-mod table=0,cmd=add in_port=1,eth_type=0x800,ip_proto=6,tcp_src=80 apply:set_field=ip_src:10.0.0.109,output=2') 97 | 98 | fixNetworkManager( root, 'root-eth0' ) 99 | 100 | startNAT(root, internetIface) 101 | 102 | sta11.cmd('ip route add default via 10.0.0.254') 103 | sta11.cmd('pushd /home/fontes; python3 -m http.server 80 &') 104 | 105 | ip = 201 106 | for sta in staList: 107 | sta.setIP('10.0.0.%s/8' % ip, intf="%s-wlan1" % sta) 108 | sta.cmd('ip route add default via 10.0.0.254') 109 | ip+=1 110 | 111 | info("*** Running CLI\n") 112 | CLI( net ) 113 | 114 | info("*** Stopping network\n") 115 | net.stop() 116 | 117 | def startNAT( root, inetIntf, subnet='10.0/8', localIntf = None ): 118 | """Start NAT/forwarding between Mininet and external network 119 | root: node to access iptables from 120 | inetIntf: interface for internet access 121 | subnet: Mininet subnet (default 10.0/8)""" 122 | 123 | # Identify the interface connecting to the mininet network 124 | if localIntf == None: 125 | localIntf = root.defaultIntf() 126 | 127 | # Flush any currently active rules 128 | root.cmd( 'iptables -F' ) 129 | root.cmd( 'iptables -t nat -F' ) 130 | 131 | # Create default entries for unmatched traffic 132 | root.cmd( 'iptables -P INPUT ACCEPT' ) 133 | root.cmd( 'iptables -P OUTPUT ACCEPT' ) 134 | root.cmd( 'iptables -P FORWARD DROP' ) 135 | 136 | # Configure NAT 137 | root.cmd( 'iptables -I FORWARD -i', localIntf, '-d', subnet, '-j DROP' ) 138 | root.cmd( 'iptables -A FORWARD -i', localIntf, '-s', subnet, '-j ACCEPT' ) 139 | root.cmd( 'iptables -A FORWARD -i', inetIntf, '-d', subnet, '-j ACCEPT' ) 140 | root.cmd( 'iptables -t nat -A POSTROUTING -o ', inetIntf, '-j MASQUERADE' ) 141 | 142 | # Instruct the kernel to perform forwarding 143 | root.cmd( 'sysctl net.ipv4.ip_forward=1' ) 144 | 145 | def fixNetworkManager( root, intf ): 146 | """Prevent network-manager from messing with our interface, 147 | by specifying manual configuration in /etc/network/interfaces 148 | root: a node in the root namespace (for running commands) 149 | intf: interface name""" 150 | cfile = '/etc/network/interfaces' 151 | line = '\niface %s inet manual\n' % intf 152 | config = open( cfile ).read() 153 | if ( line ) not in config: 154 | print('*** Adding', line.strip(), 'to', cfile) 155 | with open( cfile, 'a' ) as f: 156 | f.write( line ) 157 | # Probably need to restart network-manager to be safe - 158 | # hopefully this won't disconnect you 159 | root.cmd( 'service network-manager restart' ) 160 | 161 | if __name__ == '__main__': 162 | setLogLevel( 'info' ) 163 | topology() 164 | -------------------------------------------------------------------------------- /mininet-wifi/V2X-Slicing/multi-c-approach.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import time 4 | import os 5 | 6 | from mininet.log import setLogLevel, info 7 | from mininet.node import RemoteController 8 | from mn_wifi.cli import CLI 9 | from mn_wifi.net import Mininet_wifi 10 | from mn_wifi.link import wmediumd 11 | from mininet.term import makeTerm, cleanUpScreens 12 | from mn_wifi.wmediumdConnector import interference 13 | 14 | 15 | class InbandController( RemoteController ): 16 | 17 | def checkListening( self ): 18 | "Overridden to do nothing." 19 | return 20 | 21 | 22 | def topology(): 23 | 24 | os.system('service network-manager stop') 25 | 26 | "Create a network." 27 | net = Mininet_wifi(controller=InbandController, 28 | link=wmediumd, 29 | wmediumd_mode=interference 30 | ) 31 | 32 | ip_c0 = '10.0.0.101' 33 | ip_c1 = '10.0.0.102' 34 | ip_c2 = '10.0.0.103' 35 | ip_c3 = '10.0.0.104' 36 | 37 | info("*** Creating nodes\n") 38 | cars = [] 39 | car1 = net.addStation('car1', mac='02:00:00:00:00:01', 40 | encrypt='wpa2', 41 | position='40,40,0') #, active_scan=1) 42 | cars.append(car1) 43 | for idx in range(2,11): 44 | cars.append(net.addStation('car%s' % idx, 45 | mac='02:00:00:00:00:%02d' % idx, 46 | encrypt='wpa2', 47 | position='17%s,%s,0' 48 | % (idx, (int(idx)+50)))) #, active_scan=1) 49 | 50 | enb1 = net.addAccessPoint('enb1', mac='00:00:00:00:00:01', ssid="handover", 51 | mode="g", channel="1", datapath='user', 52 | passwd='123456789a', encrypt='wpa2', ieee80211r='yes', 53 | mobility_domain='a1b2', dpid='1', 54 | position='50,50,0', inband=True) 55 | enb2 = net.addAccessPoint('enb2', mac='00:00:00:00:00:02', ssid="handover", 56 | mode="g", channel="1", datapath='user', 57 | passwd='123456789a', encrypt='wpa2', ieee80211r='yes', 58 | mobility_domain='a1b2', dpid='2', 59 | position='110,50,0', color='r', inband=True) 60 | enb3 = net.addAccessPoint('enb3', mac='00:00:00:00:00:03', ssid="handover", 61 | mode="g", channel="1", datapath='user', 62 | passwd='123456789a', encrypt='wpa2', ieee80211r='yes', 63 | mobility_domain='a1b2', dpid='3', 64 | position='130,50,0', inband=True) 65 | backbone1 = net.addSwitch('backbone1', mac='00:00:00:00:00:04', dpid='4', 66 | datapath='user', inband=True) 67 | server1 = net.addHost('server1', ip='10.0.0.100/8') 68 | 69 | h1 = net.addHost('h1', ip=ip_c0) 70 | h2 = net.addHost('h2', ip=ip_c1) 71 | h3 = net.addHost('h3', ip=ip_c2) 72 | h4 = net.addHost('h4', ip=ip_c3) 73 | c0 = net.addController('c0', controller=InbandController, 74 | port=6690, ip=ip_c0) 75 | c1 = net.addController('c1', controller=InbandController, 76 | port=6691, ip=ip_c1) 77 | c2 = net.addController('c2', controller=InbandController, 78 | port=6692, ip=ip_c2) 79 | c3 = net.addController('c3', controller=InbandController, 80 | port=6693, ip=ip_c3) 81 | net.setPropagationModel(model="logDistance", exp=4) 82 | 83 | info("*** Configuring wifi nodes\n") 84 | net.configureWifiNodes() 85 | 86 | #c0.plot(position='50,80,0') 87 | #c1.plot(position='110,80,0') 88 | #c2.plot(position='130,80,0') 89 | #backbone1.plot(position='110,30,0') 90 | #server1.plot(position='110,10,0') 91 | 92 | info("*** Associating Stations\n") 93 | net.addLink(backbone1, enb1) 94 | net.addLink(backbone1, enb2) 95 | net.addLink(backbone1, enb3, delay='5ms') 96 | net.addLink(backbone1, server1) 97 | net.addLink(h1, enb1) 98 | net.addLink(h2, enb2) 99 | net.addLink(h3, enb3) 100 | net.addLink(h4, backbone1) 101 | 102 | net.plotGraph(max_x=200, max_y=200) 103 | 104 | info("*** Starting network\n") 105 | net.build() 106 | enb1.start([c0]) 107 | enb2.start([c1]) 108 | enb3.start([c2]) 109 | backbone1.start([c3]) 110 | 111 | makeTerm(h1, cmd="bash -c 'cd ryu && ./run.sh h1;'") 112 | makeTerm(h2, cmd="bash -c 'cd ryu && ./run.sh h2;'") 113 | makeTerm(h3, cmd="bash -c 'cd ryu && ./run.sh h3;'") 114 | makeTerm(h4, cmd="bash -c 'cd ryu && ./run.sh h4;'") 115 | 116 | time.sleep(3) 117 | 118 | enb1.cmd('sysctl net.ipv4.ip_forward=1') 119 | enb2.cmd('sysctl net.ipv4.ip_forward=1') 120 | enb3.cmd('sysctl net.ipv4.ip_forward=1') 121 | backbone1.cmd('sysctl net.ipv4.ip_forward=1') 122 | 123 | enb1.cmd('ifconfig enb1-eth3 10.0.0.201') 124 | enb2.cmd('ifconfig enb2-eth3 10.0.0.202') 125 | enb3.cmd('ifconfig enb3-eth3 10.0.0.203') 126 | backbone1.cmd('ifconfig backbone1-eth5 10.0.0.204') 127 | 128 | enb1.cmd('route add 10.0.0.101 dev enb1-eth3') 129 | enb2.cmd('route add 10.0.0.102 dev enb2-eth3') 130 | enb3.cmd('route add 10.0.0.103 dev enb3-eth3') 131 | backbone1.cmd('route add 10.0.0.104 dev backbone1-eth5') 132 | 133 | cars[0].cmd('iw dev %s-wlan0 interface ' 134 | 'add %s-mon0 type monitor' 135 | % (cars[0].name, cars[0].name)) 136 | cars[0].cmd('ifconfig %s-mon0 up' % cars[0].name) 137 | 138 | enb1.cmd('ovs-ofctl add-flow "enb1" in_port=1,udp,tp_src=8000,actions=controller') 139 | enb2.cmd('ovs-ofctl add-flow "enb2" in_port=1,udp,tp_src=8000,actions=controller') 140 | enb3.cmd('ovs-ofctl add-flow "enb3" in_port=1,udp,tp_src=8000,actions=controller') 141 | backbone1.cmd('ovs-ofctl add-flow "backbone1" in_port=1,actions=output:4') 142 | backbone1.cmd('ovs-ofctl add-flow "backbone1" in_port=2,actions=output:4') 143 | backbone1.cmd('ovs-ofctl add-flow "backbone1" in_port=3,actions=output:4') 144 | makeTerm(cars[0], cmd="bash -c 'ping 10.0.0.100 -c200 > ping.txt;'") 145 | cars[0].cmd('./%s.py &' % cars[0].name) 146 | 147 | currentTime = time.time() 148 | i = 60 149 | j = 0 150 | while j<3: 151 | if (time.time() - currentTime) >= i: 152 | currentTime = time.time() 153 | if j == 0: 154 | cars[0].setPosition('100,50,0') 155 | else: 156 | cars[0].setPosition('140,50,0') 157 | j+=1 158 | 159 | info("*** Running CLI\n") 160 | CLI(net) 161 | 162 | os.system('pkill -f \"xterm -title\"') 163 | os.system('pkill ryu-manager') 164 | os.system('service network-manager start') 165 | 166 | info("*** Stopping network\n") 167 | net.stop() 168 | 169 | 170 | if __name__ == '__main__': 171 | setLogLevel('info') 172 | topology() 173 | -------------------------------------------------------------------------------- /mininet-wifi/The-Computer-Journal-2017/fileTransferring.cc: -------------------------------------------------------------------------------- 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ 2 | /* Licensing: 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License version 2 as 5 | * published by the Free Software Foundation; 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 | * 16 | * Author: 17 | * Anderson dos Santos Paschoalon 18 | * 19 | * Modified: 20 | * 29/09/2016 first version 21 | * 22 | * About: 23 | * Simulate the tranference of a file of 62.6 Mbytes trough two wifi stations. 24 | * 25 | * Topology: 26 | * Wifi 10.1.1.0 27 | * 28 | * * <-2.72m-> * <-4.08m-> * 29 | * n0 AP n1 30 | * (source) (client) 31 | * 32 | */ 33 | 34 | #include 35 | #include 36 | #include 37 | #include "ns3/core-module.h" 38 | #include "ns3/point-to-point-module.h" 39 | #include "ns3/network-module.h" 40 | #include "ns3/applications-module.h" 41 | #include "ns3/wifi-module.h" 42 | #include "ns3/mobility-module.h" 43 | #include "ns3/csma-module.h" 44 | #include "ns3/internet-module.h" 45 | #include "ns3/flow-monitor-module.h" 46 | 47 | using namespace ns3; 48 | using namespace std; 49 | 50 | int main(int argc, char *argv[]) 51 | { 52 | 53 | //constants 54 | string application = "bulk"; 55 | uint32_t port = 19; 56 | uint64_t fileSize = 62.6 * 1024 * 1024; 57 | uint32_t start_time = 0; 58 | uint32_t stop_time = 1000; 59 | uint32_t delta_time = 1; 60 | uint32_t packetSize = 1470; 61 | uint32_t txPowerStart = 15; 62 | uint32_t txPowerEnd = 15; 63 | //variables 64 | unsigned int txPacketsum = 0; 65 | unsigned int rxPacketsum = 0; 66 | unsigned int DropPacketsum = 0; 67 | unsigned int LostPacketsum = 0; 68 | double Delaysum = 0; 69 | double Jittersum = 0; 70 | 71 | // 72 | // Network elements 73 | // 74 | 75 | //Nodes 76 | NodeContainer ap; 77 | NodeContainer stas; 78 | stas.Create(2); 79 | ap.Create(1); 80 | //Devices 81 | NetDeviceContainer staDevs; 82 | NetDeviceContainer apDev; 83 | //Channel and physical layer 84 | YansWifiChannelHelper channel; 85 | channel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel"); 86 | channel.AddPropagationLoss("ns3::FriisPropagationLossModel", "Frequency", 87 | DoubleValue(5e9)); // Free space propagation model 88 | YansWifiPhyHelper phy = YansWifiPhyHelper::Default(); 89 | phy.SetChannel(channel.Create()); 90 | phy.Set("ChannelNumber", UintegerValue(1)); 91 | phy.Set("TxPowerStart", DoubleValue(txPowerStart)); //dbm 92 | phy.Set("TxPowerEnd", DoubleValue(txPowerEnd)); //dbm 93 | //Wifi and MAC layer 94 | WifiHelper wifi = WifiHelper::Default(); 95 | wifi.SetRemoteStationManager("ns3::AarfWifiManager"); 96 | wifi.SetStandard(WIFI_PHY_STANDARD_80211b); 97 | NqosWifiMacHelper mac = NqosWifiMacHelper::Default(); 98 | 99 | // 100 | // Create network 101 | // 102 | 103 | Ssid ssid = Ssid("wifi-file-transference"); 104 | //mobile nodes config 105 | mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid), "ActiveProbing", 106 | BooleanValue(false)); 107 | staDevs = wifi.Install(phy, mac, stas); 108 | //AP config 109 | mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid)); 110 | apDev = wifi.Install(phy, mac, ap); 111 | 112 | // 113 | // Position Allocation and mobility 114 | // 115 | 116 | MobilityHelper mobility; 117 | Ptr < ListPositionAllocator > positionAlloc = CreateObject< 118 | ListPositionAllocator>(); 119 | 120 | positionAlloc->Add(Vector(0.0, 0.0, 0.0)); //n0 121 | positionAlloc->Add(Vector(4.08 + 2.72, 0.0, 0.0)); //n1 122 | positionAlloc->Add(Vector(2.72, 0.0, 0.0)); //AP 123 | 124 | mobility.SetPositionAllocator(positionAlloc); 125 | mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel"); 126 | mobility.Install(stas); 127 | mobility.Install(ap); 128 | 129 | // 130 | // Internet configuration 131 | // 132 | 133 | InternetStackHelper stack; 134 | stack.Install(ap); 135 | stack.Install(stas); 136 | 137 | Ipv4AddressHelper address; 138 | Ipv4InterfaceContainer wifiInterfaces; 139 | 140 | address.SetBase("10.1.1.0", "255.255.255.0"); 141 | wifiInterfaces = address.Assign(staDevs); 142 | 143 | Ipv4GlobalRoutingHelper::PopulateRoutingTables(); 144 | 145 | // 146 | // Application 147 | // 148 | 149 | printf("Starting bulk ftp-like application\n"); 150 | 151 | Config::SetDefault("ns3::TcpSocket::SegmentSize", 152 | UintegerValue(packetSize)); 153 | 154 | Address apLocalAddress( 155 | InetSocketAddress(wifiInterfaces.GetAddress(1), port)); 156 | BulkSendHelper source("ns3::TcpSocketFactory", apLocalAddress); 157 | 158 | source.SetAttribute("MaxBytes", UintegerValue(fileSize)); 159 | ApplicationContainer sourceApps = source.Install(stas.Get(0)); 160 | sourceApps.Start(Seconds(start_time + delta_time)); 161 | sourceApps.Stop(Seconds(stop_time)); 162 | 163 | PacketSinkHelper sink("ns3::TcpSocketFactory", 164 | InetSocketAddress(Ipv4Address::GetAny(), port)); 165 | ApplicationContainer sinkApps = sink.Install(stas.Get(1)); 166 | sinkApps.Start(Seconds(start_time)); 167 | sinkApps.Stop(Seconds(stop_time)); 168 | 169 | // 170 | // Simulation and data collection 171 | // 172 | 173 | Simulator::Stop(Seconds(stop_time)); 174 | 175 | phy.EnablePcap("ap", apDev.Get(0)); 176 | phy.EnablePcap("sender", staDevs.Get(0)); 177 | phy.EnablePcap("receiver", staDevs.Get(1)); 178 | 179 | FlowMonitorHelper flowHelper; 180 | Ptr < FlowMonitor > monitor; 181 | monitor = flowHelper.InstallAll(); 182 | 183 | Simulator::Run(); 184 | 185 | std::map < FlowId, FlowMonitor::FlowStats > stats = monitor->GetFlowStats(); 186 | 187 | monitor->SerializeToXmlFile("anderson-samira.xml", true, true); 188 | Ptr < Ipv4FlowClassifier > classifier = DynamicCast < Ipv4FlowClassifier 189 | > (flowHelper.GetClassifier()); 190 | 191 | for (std::map::const_iterator i = 192 | stats.begin(); i != stats.end(); ++i) 193 | { 194 | txPacketsum += i->second.txPackets; 195 | rxPacketsum += i->second.rxPackets; 196 | LostPacketsum += i->second.lostPackets; 197 | DropPacketsum += i->second.packetsDropped.size(); 198 | Delaysum += i->second.delaySum.GetSeconds(); 199 | Jittersum += i->second.jitterSum.GetSeconds(); 200 | 201 | } 202 | 203 | cout << "txPacketsum = " << txPacketsum << endl; 204 | cout << "rxPacketsum = " << rxPacketsum << endl; 205 | cout << "LostPacketsum = " << LostPacketsum << endl; 206 | cout << "DropPacketsum = " << DropPacketsum << endl; 207 | cout << "Delaysum = " << Delaysum << endl; 208 | cout << "Jittersum = " << Jittersum << endl; 209 | cout << "latency = " << Delaysum / (rxPacketsum) << endl; 210 | 211 | Simulator::Destroy(); 212 | 213 | return 0; 214 | } 215 | 216 | -------------------------------------------------------------------------------- /mininet-wifi/V2X-Slicing/single-c-approach.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os 4 | from sys import version_info as py_version_info 5 | 6 | from mininet.node import RemoteController 7 | from mininet.term import makeTerm, cleanUpScreens 8 | from mininet.log import setLogLevel 9 | from mn_wifi.net import Mininet_wifi 10 | from mn_wifi.link import wmediumd 11 | from mn_wifi.cli import CLI 12 | from mn_wifi.wmediumdConnector import interference 13 | 14 | 15 | def topology(): 16 | 17 | os.system('rm data-log/sta1.log') 18 | 19 | "Create a network." 20 | net = Mininet_wifi(controller=RemoteController, link=wmediumd, 21 | wmediumd_mode=interference) 22 | 23 | print("*** Creating nodes") 24 | s10 = net.addSwitch('auth10') 25 | s11 = net.addSwitch('s11') 26 | s12 = net.addSwitch('s12') 27 | s13 = net.addSwitch('s13') 28 | s14 = net.addSwitch('s14') 29 | s17 = net.addSwitch('s17') 30 | s20 = net.addSwitch('mecgw20') 31 | sta1 = net.addStation('sta1', wlans=3, mac='00:00:00:00:00:01', ip='10.0.0.1/8', 32 | radius_passwd='sdnteam', encrypt='wpa2,wpa2,', radius_identity='joe', 33 | inNamespace=False) 34 | t1 = net.addStation('telcoA1', mac='00:00:00:00:00:03', ssid='telcoA1', type='ap', 35 | authmode='8021x', encrypt='wpa2', mode='n', channel='1', 36 | radius_server='192.168.0.1', position='500,600,0', range=700) 37 | t2 = net.addStation('telcoA2', mac='00:00:00:00:00:04', ssid='telcoA2', type='ap', 38 | authmode='8021x', encrypt='wpa2', mode='n', channel='1', 39 | radius_server='192.168.0.1', position='500,130,0', range=700) 40 | t3 = net.addStation('telcoC1', mac='00:00:00:00:00:05', ssid='telcoC1', type='ap', 41 | authmode='8021x', encrypt='wpa2', mode='n', channel='11', 42 | radius_server='172.16.0.1', position='500,300,0', range=400) 43 | t4 = net.addStation('telcoB1', mac='00:00:00:00:00:06', ssid='telcoB1', type='ap', 44 | authmode='8021x', encrypt='wpa2', mode='n', channel='6', 45 | radius_server='192.168.0.1', position='500,380,0', range=700) 46 | h1 = net.addHost('authsrv1', ip='192.168.0.1/24') 47 | h2 = net.addHost('h2', ip='192.168.0.100/24') 48 | h3 = net.addHost('h3', ip='192.168.0.100/24') 49 | h4 = net.addHost('h4', ip='192.168.0.100/24') 50 | c1 = net.addController('c1', controller=RemoteController, port=6653) 51 | 52 | print("*** Configuring Propagation Model") 53 | net.setPropagationModel(model="logDistance", exp=3.5) 54 | 55 | #h1.plot(position='200,600,0') 56 | #h2.plot(position='340,630,0') 57 | #h3.plot(position='350,100,0') 58 | #h4.plot(position='50,350,0') 59 | #s17.plot(position='100,300,0') 60 | #s11.plot(position='340,590,0') 61 | #s12.plot(position='340,140,0') 62 | #s13.plot(position='340,310,0') 63 | #s14.plot(position='340,370,0') 64 | #s10.plot(position='320,350,0') 65 | #s20.plot(position='180,350,0') 66 | 67 | #net.setModule('./mac80211_hwsim.ko') 68 | 69 | print("*** Configuring wifi nodes") 70 | net.configureWifiNodes() 71 | 72 | net.addLink(s11, t1, bw=1000) 73 | net.addLink(s12, t2, bw=1000) 74 | net.addLink(s13, t3, bw=1000) 75 | net.addLink(s14, t4, bw=1000) 76 | 77 | net.addLink(s11, s10) 78 | net.addLink(s12, s10) 79 | net.addLink(s13, s10) 80 | net.addLink(s14, s10) 81 | 82 | net.addLink(s11, s20, bw=100, delay='2.5ms') 83 | net.addLink(s12, s20, bw=100, delay='2.5ms') 84 | net.addLink(s13, s20, bw=100, delay='5ms') 85 | net.addLink(s14, s20, bw=100, delay='25ms') 86 | 87 | net.addLink(h2, s11, bw=100, delay='2.5ms') 88 | net.addLink(h3, s12, bw=100, delay='2.5ms') 89 | net.addLink(h4, s17) 90 | 91 | net.addLink(s10, h1) 92 | net.addLink(s20, s17) 93 | 94 | "plotting graph" 95 | net.plotGraph(max_x=700, max_y=700) 96 | 97 | net.startMobility(time=10) 98 | net.mobility(sta1, 'start', time=10, position='510.0,610.0,0.0') 99 | net.mobility(sta1, 'stop', time=100, position='510.0,10.0,0.0') 100 | net.stopMobility(time=100) 101 | 102 | print("*** Starting network") 103 | net.build() 104 | c1.start() 105 | s10.start([c1]) 106 | s11.start([c1]) 107 | s12.start([c1]) 108 | s13.start([c1]) 109 | s14.start([c1]) 110 | s17.start([c1]) 111 | s20.start([c1]) 112 | 113 | sta1.setMasterMode(intf='sta1-wlan2') 114 | sta1.cmd('iw dev sta1-wlan2 interface add mon1 type monitor') 115 | sta1.cmd('ifconfig mon1 up') 116 | 117 | sta1.cmd('ifconfig sta1-wlan0 0') 118 | sta1.cmd('ifconfig sta1-wlan1 0') 119 | 120 | t3.cmd('ifconfig telcoC1-wlan0 192.168.100.2') 121 | 122 | print("\n*** Configuring network") 123 | t1.cmd('ifconfig telcoA1-eth1 192.168.0.201') 124 | t2.cmd('ifconfig telcoA2-eth1 192.168.0.202') 125 | t3.cmd('ifconfig telcoC1-eth1 172.16.0.203') 126 | t4.cmd('ifconfig telcoB1-eth1 192.168.0.204') 127 | t1.cmd('echo 1 > /proc/sys/net/ipv4/ip_forward') 128 | t2.cmd('echo 1 > /proc/sys/net/ipv4/ip_forward') 129 | t3.cmd('echo 1 > /proc/sys/net/ipv4/ip_forward') 130 | t4.cmd('echo 1 > /proc/sys/net/ipv4/ip_forward') 131 | h1.cmd('ifconfig authsrv1-eth0:0 172.16.0.1/16') 132 | 133 | #Configuring radius controller info 134 | h1.cmd('rc.radiusd start') 135 | s20.cmd('ovs-ofctl add-flow mecgw20 in_port=1,actions=5') 136 | s20.cmd('ovs-ofctl add-flow mecgw20 in_port=5,actions=1') 137 | s20.cmd('ovs-ofctl add-flow mecgw20 in_port=2,actions=6') 138 | s20.cmd('ovs-ofctl add-flow mecgw20 in_port=6,actions=2') 139 | s20.cmd('ovs-ofctl add-flow mecgw20 in_port=3,actions=5') 140 | s20.cmd('ovs-ofctl add-flow mecgw20 in_port=5,dl_type=0x800,' 141 | 'nw_dst=172.16.0.1,actions=3') 142 | s20.cmd('ovs-ofctl add-flow mecgw20 in_port=5,dl_type=0x800,' 143 | 'nw_dst=10.0.0.1,actions=4') 144 | s20.cmd('ovs-ofctl add-flow mecgw20 in_port=4,actions=5') 145 | 146 | s11.cmd('ovs-ofctl add-flow s11 in_port=1,priority=65535,' 147 | 'dl_type=0x800,nw_proto=17,tp_dst=1812,actions=2') 148 | s11.cmd('ovs-ofctl add-flow s11 in_port=2,actions=1') 149 | s11.cmd('ovs-ofctl add-flow s11 in_port=4,actions=1') 150 | s12.cmd('ovs-ofctl add-flow s12 in_port=1,priority=65535,' 151 | 'dl_type=0x800,nw_proto=17,tp_dst=1812,actions=2') 152 | s12.cmd('ovs-ofctl add-flow s12 in_port=2,actions=1') 153 | s12.cmd('ovs-ofctl add-flow s12 in_port=4,actions=1') 154 | s13.cmd('ovs-ofctl add-flow s13 in_port=1,priority=65535,' 155 | 'dl_type=0x800,nw_proto=17,tp_dst=1812,actions=2') 156 | s13.cmd('ovs-ofctl add-flow s13 in_port=2,actions=1') 157 | s13.cmd('ovs-ofctl add-flow s13 in_port=3,actions=1') 158 | s14.cmd('ovs-ofctl add-flow s14 in_port=1,priority=65535,' 159 | 'dl_type=0x800,nw_proto=17,tp_dst=1812,actions=2') 160 | s14.cmd('ovs-ofctl add-flow s14 in_port=2,actions=1') 161 | s14.cmd('ovs-ofctl add-flow s14 in_port=3,actions=1') 162 | s10.cmd('ovs-ofctl add-flow auth10 in_port=1,priority=65535,' 163 | 'dl_type=0x800,nw_proto=17,tp_dst=1812,actions=5,controller') 164 | s10.cmd('ovs-ofctl add-flow auth10 in_port=2,priority=65535,' 165 | 'dl_type=0x800,nw_proto=17,tp_dst=1812,actions=5,controller') 166 | s10.cmd('ovs-ofctl add-flow auth10 in_port=3,priority=65535,' 167 | 'dl_type=0x800,nw_proto=17,tp_dst=1812,actions=5,controller') 168 | s10.cmd('ovs-ofctl add-flow auth10 in_port=4,priority=65535,' 169 | 'dl_type=0x800,nw_proto=17,tp_dst=1812,actions=5,controller') 170 | 171 | s11.cmd('ovs-ofctl add-flow s11 in_port=1,dl_type=0x800,' 172 | 'nw_dst=192.168.0.100,actions=4') 173 | s12.cmd('ovs-ofctl add-flow s12 in_port=1,dl_type=0x800,' 174 | 'nw_dst=192.168.0.100,actions=4') 175 | s13.cmd('ovs-ofctl add-flow s13 in_port=1,dl_type=0x800,' 176 | 'nw_dst=172.16.0.100,actions=3') 177 | s14.cmd('ovs-ofctl add-flow s14 in_port=1,dl_type=0x800,' 178 | 'nw_dst=192.168.0.100,actions=3') 179 | 180 | h2.cmd('route add -host 10.0.0.1 gw 192.168.0.201') 181 | h3.cmd('route add -host 10.0.0.1 gw 192.168.0.202') 182 | h4.cmd('route add -host 10.0.0.1 gw 192.168.0.204') 183 | h4.cmd('ifconfig h4-eth0:0 172.16.0.100/16') 184 | h4.cmd('route add -host 192.168.100.1 gw 172.16.0.203') 185 | 186 | s17.cmd('ovs-vsctl set Bridge s17 datapath_type=netdev') 187 | s17.cmd('ovs-ofctl -O Openflow13 add-meter s17 meter=1,kbps,band=type=drop,rate=5000') 188 | 189 | makeTerm( h2, cmd="bash -c 'iperf -s -i 1 -u;'" ) 190 | makeTerm( h3, cmd="bash -c 'iperf -s -i 1 -u;'" ) 191 | makeTerm( h4, cmd="bash -c 'iperf -s -i 1 -u;'" ) 192 | 193 | print("*** Running CLI") 194 | CLI(net) 195 | 196 | os.system('pkill radiusd') 197 | if py_version_info < (3, 0): 198 | os.system('pkill -f SimpleHTTPServer') 199 | else: 200 | os.system('pkill -f http.server') 201 | os.system('pkill -f \"xterm -title\"') 202 | 203 | print("*** Stopping network") 204 | net.stop() 205 | 206 | if __name__ == '__main__': 207 | setLogLevel('info') 208 | topology() 209 | -------------------------------------------------------------------------------- /mininet-wifi/IEEE-Access-2017/vanet.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/python 2 | 3 | """This code illustrates a single case about Vehicular Ad-Hoc Networks. 4 | More detail about VANET implementation can be found at the paper titled 5 | From Theory to Experimental Evaluation: Resource Management in Software-Defined Vehicular Networks 6 | url: http://ieeexplore.ieee.org/document/7859348/ 7 | Video clip available at: https://www.youtube.com/watch?v=kO3O9EwrP_s 8 | """ 9 | 10 | import os 11 | import time 12 | import matplotlib.pyplot as plt 13 | 14 | from mininet.net import Mininet 15 | from mininet.node import Controller, OVSKernelSwitch, OVSKernelAP, Car 16 | from mininet.link import TCLink 17 | from mininet.log import setLogLevel 18 | from mininet.cli import CLI 19 | 20 | switch_pkt = 'switch-pkt.vanetdata' 21 | switch_throughput = 'switch-throughput.vanetdata' 22 | c0_pkt = 'c0-pkt.vanetdata' 23 | c0_throughput = 'c0-throughput.vanetdata' 24 | 25 | def graphic(): 26 | 27 | f1 = open('./' + switch_pkt, 'r') 28 | s_pkt = f1.readlines() 29 | f1.close() 30 | 31 | f11 = open('./' + switch_throughput, 'r') 32 | s_throughput = f11.readlines() 33 | f11.close() 34 | 35 | f2 = open('./' + c0_pkt, 'r') 36 | c_pkt = f2.readlines() 37 | f2.close() 38 | 39 | f21 = open('./' + c0_throughput, 'r') 40 | c_throughput = f21.readlines() 41 | f21.close() 42 | 43 | # initialize some variable to be lists: 44 | time_ = [] 45 | 46 | l1 = [] 47 | l2 = [] 48 | t1 = [] 49 | t2 = [] 50 | 51 | ll1 = [] 52 | ll2 = [] 53 | tt1 = [] 54 | tt2 = [] 55 | 56 | # scan the rows of the file stored in lines, and put the values into some variables: 57 | i = 0 58 | for x in s_pkt: 59 | p = x.split() 60 | l1.append(int(p[0])) 61 | if len(l1) > 1: 62 | ll1.append(l1[i] - l1[i - 1]) 63 | i += 1 64 | 65 | i = 0 66 | for x in s_throughput: 67 | p = x.split() 68 | t1.append(int(p[0])) 69 | if len(t1) > 1: 70 | tt1.append(t1[i] - t1[i - 1]) 71 | i += 1 72 | 73 | i = 0 74 | for x in c_pkt: 75 | p = x.split() 76 | l2.append(int(p[0])) 77 | if len(l2) > 1: 78 | ll2.append(l2[i] - l2[i - 1]) 79 | i += 1 80 | 81 | i = 0 82 | for x in c_throughput: 83 | p = x.split() 84 | t2.append(int(p[0])) 85 | if len(t2) > 1: 86 | tt2.append(t2[i] - t2[i - 1]) 87 | i += 1 88 | 89 | i = 0 90 | for x in range(len(ll1)): 91 | time_.append(i) 92 | i = i + 0.5 93 | 94 | fig, ax1 = plt.subplots() 95 | ax2 = ax1.twinx() 96 | 97 | ax1.plot(time_, ll1, color='red', label='Received Data (client)', markevery=7, linewidth=1) 98 | ax1.plot(time_, ll2, color='black', label='Transmited Data (server)', markevery=7, linewidth=1) 99 | ax2.plot(time_, tt1, color='red', label='Throughput (client)', ls="--", markevery=7, linewidth=1) 100 | ax2.plot(time_, tt2, color='black', label='Throughput (server)', ls='--', markevery=7, linewidth=1) 101 | ax1.legend(loc=2, borderaxespad=0., fontsize=12) 102 | ax2.legend(loc=1, borderaxespad=0., fontsize=12) 103 | 104 | ax2.set_yscale('log') 105 | 106 | ax1.set_ylabel("# Packets (unit)", fontsize=18) 107 | ax1.set_xlabel("Time (seconds)", fontsize=18) 108 | ax2.set_ylabel("Throughput (bytes/sec)", fontsize=18) 109 | 110 | plt.show() 111 | plt.savefig("graphic.eps") 112 | 113 | 114 | def recordValues(car, client, kernel): 115 | if kernel == 1: 116 | car.cmd('ifconfig bond0 | grep \"TX packets\" | awk -F\' \' \'{print $3}\' >> %s' % c0_pkt) 117 | client.cmd('ifconfig client-eth0 | grep \"RX packets\" | awk -F\' \' \'{print $3}\' >> %s' % switch_pkt) 118 | car.cmd('ifconfig bond0 | grep \"bytes\" | awk -F\' \' \'NR==2{print $5}\' >> %s' % c0_throughput) 119 | client.cmd('ifconfig client-eth0 | grep \"bytes\" | awk -F\' \' \'NR==1{print $5}\' >> %s' % switch_throughput) 120 | else: 121 | car.cmd('ifconfig bond0 | grep \"TX packets\" | awk -F\' \' \'{print $2}\' | tr -d packets: >> %s' % c0_pkt) 122 | client.cmd('ifconfig client-eth0 | grep \"RX packets\" | awk -F\' \' \'{print $2}\' | tr -d packets: >> %s' % switch_pkt) 123 | car.cmd('ifconfig bond0 | grep \"bytes\" | awk -F\' \' \'NR==1{print $6}\' | tr -d bytes: >> %s' % c0_throughput) 124 | client.cmd('ifconfig client-eth0 | grep \"bytes\" | awk -F\' \' \'NR==1{print $2}\' | tr -d \'RX bytes:\' >> %s' % switch_throughput) 125 | 126 | 127 | def topology(): 128 | 129 | taskTime = 20 130 | cars = 4 131 | 132 | "Create a network." 133 | net = Mininet(controller=Controller, link=TCLink, switch=OVSKernelSwitch, accessPoint=OVSKernelAP) 134 | 135 | print("*** Creating nodes") 136 | car = [] 137 | stas = [] 138 | for idx in range(0, cars): 139 | car.append(idx) 140 | stas.append(idx) 141 | for idx in range(0, cars): 142 | car[idx] = net.addCar('car%s' % idx, wlans=2, ip='10.0.0.%s/8' % (idx + 1), range=40, \ 143 | mac='00:00:00:00:00:0%s' % idx, mode='b', position='%d,%d,0' % ((120 - (idx * 20)), (100 - (idx * 0)))) 144 | 145 | eNodeB1 = net.addAccessPoint('eNodeB1', ssid='eNodeB1', dpid='1000000000000000', mode='ac', channel='36', position='80,75,0') 146 | eNodeB2 = net.addAccessPoint('eNodeB2', ssid='eNodeB2', dpid='2000000000000000', mode='ac', channel='40', position='180,75,0') 147 | rsu1 = net.addAccessPoint('rsu1', ssid='rsu1', dpid='3000000000000000', mode='g', channel='11', position='140,120,0') 148 | c1 = net.addController('c1', controller=Controller) 149 | client = net.addHost ('client') 150 | switch = net.addSwitch ('switch', dpid='4000000000000000') 151 | 152 | #client.plot(position='125,230,0') 153 | #switch.plot(position='125,200,0') 154 | 155 | print("*** Configuring Propagation Model") 156 | net.propagationModel("logDistancePropagationLossModel", exp=4.1) 157 | 158 | print("*** Configuring wifi nodes") 159 | net.configureWifiNodes() 160 | 161 | print("*** Creating links") 162 | net.addLink(eNodeB1, switch) 163 | net.addLink(eNodeB2, switch) 164 | net.addLink(rsu1, switch) 165 | net.addLink(switch, client) 166 | net.addLink(rsu1, car[0]) 167 | net.addLink(eNodeB2, car[0]) 168 | net.addLink(eNodeB1, car[3]) 169 | 170 | 'Plotting Graph' 171 | net.plotGraph(max_x=250, max_y=250) 172 | 173 | print("*** Starting network") 174 | net.build() 175 | c1.start() 176 | eNodeB1.start([c1]) 177 | eNodeB2.start([c1]) 178 | rsu1.start([c1]) 179 | switch.start([c1]) 180 | 181 | for sw in net.carsSW: 182 | sw.start([c1]) 183 | 184 | i = 1 185 | j = 2 186 | for c in car: 187 | c.cmd('ifconfig %s-wlan0 192.168.0.%s/24 up' % (c, i)) 188 | c.cmd('ifconfig %s-eth0 192.168.1.%s/24 up' % (c, i)) 189 | c.cmd('ip route add 10.0.0.0/8 via 192.168.1.%s' % j) 190 | c.cmd('echo 1 > /proc/sys/net/ipv4/ip_forward') 191 | i += 2 192 | j += 2 193 | 194 | i = 1 195 | j = 2 196 | for v in net.carsSTA: 197 | v.cmd('ifconfig %s-eth0 192.168.1.%s/24 up' % (v, j)) 198 | v.cmd('ifconfig %s-mp0 10.0.0.%s/24 up' % (v, i)) 199 | v.cmd('echo 1 > /proc/sys/net/ipv4/ip_forward') 200 | i += 1 201 | j += 2 202 | 203 | for v1 in net.carsSTA: 204 | i = 1 205 | j = 1 206 | for v2 in net.carsSTA: 207 | if v1 != v2: 208 | v1.cmd('route add -host 192.168.1.%s gw 10.0.0.%s' % (j, i)) 209 | i += 1 210 | j += 2 211 | 212 | client.cmd('ifconfig client-eth0 200.0.10.2') 213 | net.carsSTA[0].cmd('ifconfig car0STA-eth0 200.0.10.50') 214 | 215 | car[0].cmd('modprobe bonding mode=3') 216 | car[0].cmd('ip link add bond0 type bond') 217 | car[0].cmd('ip link set bond0 address 02:01:02:03:04:08') 218 | car[0].cmd('ip link set car0-eth0 down') 219 | car[0].cmd('ip link set car0-eth0 address 00:00:00:00:00:11') 220 | car[0].cmd('ip link set car0-eth0 master bond0') 221 | car[0].cmd('ip link set car0-wlan0 down') 222 | car[0].cmd('ip link set car0-wlan0 address 00:00:00:00:00:15') 223 | car[0].cmd('ip link set car0-wlan0 master bond0') 224 | car[0].cmd('ip link set car0-wlan1 down') 225 | car[0].cmd('ip link set car0-wlan1 address 00:00:00:00:00:13') 226 | car[0].cmd('ip link set car0-wlan1 master bond0') 227 | car[0].cmd('ip addr add 200.0.10.100/24 dev bond0') 228 | car[0].cmd('ip link set bond0 up') 229 | 230 | car[3].cmd('ifconfig car3-wlan0 200.0.10.150') 231 | 232 | client.cmd('ip route add 192.168.1.8 via 200.0.10.150') 233 | client.cmd('ip route add 10.0.0.1 via 200.0.10.150') 234 | 235 | net.carsSTA[3].cmd('ip route add 200.0.10.2 via 192.168.1.7') 236 | net.carsSTA[3].cmd('ip route add 200.0.10.100 via 10.0.0.1') 237 | net.carsSTA[0].cmd('ip route add 200.0.10.2 via 10.0.0.4') 238 | 239 | car[0].cmd('ip route add 10.0.0.4 via 200.0.10.50') 240 | car[0].cmd('ip route add 192.168.1.7 via 200.0.10.50') 241 | car[0].cmd('ip route add 200.0.10.2 via 200.0.10.50') 242 | car[3].cmd('ip route add 200.0.10.100 via 192.168.1.8') 243 | 244 | os.system('rm *.vanetdata') 245 | 246 | #os.system('xterm -hold -title "car0" -e "util/m car0 ping 200.0.10.2" &') 247 | car[0].cmdPrint("cvlc -vvv v4l2:///dev/video0 --mtu 1000 --sout \'#transcode{vcodec=mp4v,vb=800,scale=1,\ 248 | acodec=mpga,ab=128,channels=1}: duplicate{dst=display,dst=rtp{sdp=rtsp://200.0.10.100:8080/helmet.sdp}}\' &") 249 | client.cmdPrint("cvlc rtsp://200.0.10.100:8080/helmet.sdp &") 250 | 251 | os.system('ovs-ofctl mod-flows switch in_port=1,actions=drop') 252 | os.system('ovs-ofctl mod-flows switch in_port=2,actions=drop') 253 | os.system('ovs-ofctl mod-flows switch in_port=3,actions=drop') 254 | 255 | time.sleep(2) 256 | 257 | print("applying first rule") 258 | os.system('ovs-ofctl mod-flows switch in_port=1,actions=output:4') 259 | os.system('ovs-ofctl mod-flows switch in_port=4,actions=output:1') 260 | os.system('ovs-ofctl mod-flows switch in_port=2,actions=drop') 261 | os.system('ovs-ofctl mod-flows switch in_port=3,actions=drop') 262 | os.system('ovs-ofctl del-flows eNodeB1') 263 | os.system('ovs-ofctl del-flows eNodeB2') 264 | os.system('ovs-ofctl del-flows rsu1') 265 | 266 | car[0].cmd('ip route add 200.0.10.2 via 200.0.10.50') 267 | client.cmd('ip route add 200.0.10.100 via 200.0.10.150') 268 | 269 | kernel = 0 270 | var = client.cmd('ifconfig client-eth0 | grep \"bytes\" | awk -F\' \' \'NR==1{print $5}\'') 271 | if isinstance( var, int ): 272 | kernel = 1 273 | 274 | timeout = time.time() + taskTime 275 | currentTime = time.time() 276 | i = 0 277 | while True: 278 | if time.time() > timeout: 279 | break; 280 | if time.time() - currentTime >= i: 281 | recordValues(car[0], client, kernel) 282 | i += 0.5 283 | 284 | print("Moving nodes") 285 | car[0].setPosition('150,100,0') 286 | car[1].setPosition('120,100,0') 287 | car[2].setPosition('90,100,0') 288 | car[3].setPosition('70,100,0') 289 | 290 | #time.sleep(3) 291 | 292 | print("applying second rule") 293 | os.system('ovs-ofctl mod-flows switch in_port=1,actions=drop') 294 | os.system('ovs-ofctl mod-flows switch in_port=2,actions=output:4') 295 | os.system('ovs-ofctl mod-flows switch in_port=4,actions=output:2,3') 296 | os.system('ovs-ofctl mod-flows switch in_port=3,actions=output:4') 297 | os.system('ovs-ofctl del-flows eNodeB1') 298 | os.system('ovs-ofctl del-flows eNodeB2') 299 | os.system('ovs-ofctl del-flows rsu1') 300 | 301 | car[0].cmd('ip route del 200.0.10.2 via 200.0.10.50') 302 | client.cmd('ip route del 200.0.10.100 via 200.0.10.150') 303 | 304 | timeout = time.time() + taskTime 305 | currentTime = time.time() 306 | i = 0 307 | while True: 308 | if time.time() > timeout: 309 | break; 310 | if time.time() - currentTime >= i: 311 | recordValues(car[0], client, kernel) 312 | i += 0.5 313 | 314 | print("Moving nodes") 315 | car[0].setPosition('190,100,0') 316 | car[1].setPosition('150,100,0') 317 | car[2].setPosition('120,100,0') 318 | car[3].setPosition('90,100,0') 319 | 320 | #time.sleep(2) 321 | 322 | print("applying third rule") 323 | os.system('ovs-ofctl mod-flows switch in_port=1,actions=drop') 324 | os.system('ovs-ofctl mod-flows switch in_port=3,actions=drop') 325 | os.system('ovs-ofctl mod-flows switch in_port=2,actions=output:4') 326 | os.system('ovs-ofctl mod-flows switch in_port=4,actions=output:2') 327 | os.system('ovs-ofctl del-flows eNodeB1') 328 | os.system('ovs-ofctl del-flows eNodeB2') 329 | os.system('ovs-ofctl del-flows rsu1') 330 | 331 | timeout = time.time() + taskTime 332 | currentTime = time.time() 333 | i = 0 334 | while True: 335 | if time.time() > timeout: 336 | break; 337 | if time.time() - currentTime >= i: 338 | recordValues(car[0], client, kernel) 339 | i += 0.5 340 | 341 | print("*** Generating graphic") 342 | graphic() 343 | 344 | os.system('pkill -f vlc') 345 | os.system('pkill xterm') 346 | 347 | print("*** Running CLI") 348 | CLI(net) 349 | 350 | #os.system('rm *.vanetdata') 351 | 352 | print("*** Stopping network") 353 | net.stop() 354 | 355 | 356 | if __name__ == '__main__': 357 | setLogLevel('info') 358 | topology() 359 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/code.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | This code makes part of an article towards Reproducible Research. 5 | 6 | authors: Ramon dos Reis Fontes 7 | Christian Rodolfo Esteve Rothenberg 8 | 9 | This code can be used to evaluate the performance of Mininet-WiFi in two different topologies: single and linear 10 | Access Points running at user and kernel space are also evaluated. 11 | 12 | At the end for the test the data will be presented in graphics. 13 | """ 14 | 15 | import os 16 | import math 17 | import glob 18 | import matplotlib 19 | import subprocess 20 | matplotlib.use('Agg') 21 | import matplotlib.pyplot as plt 22 | import pylab 23 | 24 | nr_nodes_single = 256 #Single Topo 25 | nr_nodes_linear = 256 #Linear Topo 26 | repetitions = 1 #Repetitions 27 | RANGE = 16 28 | pmem_ovs_linear = [] 29 | pmem_user_linear = [] 30 | pmem_ovs_single = [] 31 | pmem_user_single = [] 32 | 33 | file1 = 'OVS-LinearTopo-benchmark.txt' 34 | file2 = 'User-LinearTopo-benchmark.txt' 35 | file3 = 'OVS-SingleTopo-benchmark.txt' 36 | file4 = 'User-SingleTopo-benchmark.txt' 37 | file5 = 'icmp-OVS-LinearTopo-benchmark.txt' 38 | file6 = 'icmp-User-LinearTopo-benchmark.txt' 39 | file7 = 'icmp-OVS-SingleTopo-benchmark.txt' 40 | file8 = 'icmp-User-SingleTopo-benchmark.txt' 41 | mem_ovs_linear = 'mem_ovs_linear.txt' 42 | mem_ovs_single = 'mem_ovs_single.txt' 43 | mem_user_linear = 'mem_user_linear.txt' 44 | mem_user_single = 'mem_user_single.txt' 45 | 46 | def numberOfNodes(i): 47 | """Returns the number of nodes""" 48 | 49 | if (i == 1 or i == 2): 50 | i = RANGE 51 | else: 52 | i = i + RANGE 53 | return i 54 | 55 | 56 | def runExperiment(): 57 | """Run Experiment""" 58 | 59 | print('Testing OVS linear topo...') 60 | for n in range(0, repetitions): 61 | i = 1 62 | while i <= nr_nodes_linear: 63 | mem = 'free -m | grep ^Mem | awk \'{print $1 $3}\' | tr -d Mem: | awk NR==1' 64 | v = (int(subprocess.check_output(mem, shell=True))) 65 | os.system('echo %s >> %s' % (v, mem_ovs_linear)) 66 | print('Test %d: Number of access points: %d' % (n, i)) 67 | step1 = '\"sta1 free -m | grep ^Mem | awk \'{print \$1 \$3}\'\nexit\"' 68 | step2 = 'mn --wifi --topo=linear,%d 2>&1' % i 69 | step3 = 'grep -E \"(Mem:|completed in)\" | tr -d em: | tr \'M\' \',\' | tr -d "copltd in" | tr -d ss | awk \'!(NR%2){print$0p}{p=$0}\'' 70 | os.system('echo ' + step1 + ' | ' + step2 + ' | ' + step3 + ' >> %s' % file1) 71 | i = numberOfNodes(i) 72 | 73 | print('\nTesting User linear topo...') 74 | for n in range(0, repetitions): 75 | i = 1 76 | while i <= nr_nodes_linear: 77 | mem = 'free -m | grep ^Mem | awk \'{print $1 $3}\' | tr -d Mem: | awk NR==1' 78 | v = (int(subprocess.check_output(mem, shell=True))) 79 | os.system('echo %s >> %s' % (v, mem_user_linear)) 80 | print('Test %d: Number of access points: %d' % (n, i)) 81 | step1 = '\"sta1 free -m | grep ^Mem | awk \'{print \$1 \$3}\'\nexit\"' 82 | step2 = 'mn --wifi --ap user --topo=linear,%d 2>&1' % i 83 | step3 = 'grep -E \"(Mem:|completed in)\" | tr -d em: | tr \'M\' \',\' | tr -d "copltd in" | tr -d ss | awk \'!(NR%2){print$0p}{p=$0}\'' 84 | os.system('echo ' + step1 + ' | ' + step2 + ' | ' + step3 + ' >> %s' % file2) 85 | i = numberOfNodes(i) 86 | 87 | print('\nTesting OVS single topo...') 88 | for n in range(0, repetitions): 89 | i = 1 90 | while i <= nr_nodes_single: 91 | mem = 'free -m | grep ^Mem | awk \'{print $1 $3}\' | tr -d Mem: | awk NR==1' 92 | v = (int(subprocess.check_output(mem, shell=True))) 93 | os.system('echo %s >> %s' % (v, mem_ovs_single)) 94 | print('Test %d: Number of Stations: %d' % (n, i)) 95 | step1 = '\"sta1 free -m | grep ^Mem | awk \'{print \$1 \$3}\'\nexit\"' 96 | step2 = 'mn --wifi --topo=single,%d 2>&1' % i 97 | step3 = 'grep -E \"(Mem:|completed in)\" | tr -d em: | tr \'M\' \',\' | tr -d "copltd in" | tr -d ss | awk \'!(NR%2){print$0p}{p=$0}\'' 98 | os.system('echo ' + step1 + ' | ' + step2 + ' | ' + step3 + ' >> %s' % file3) 99 | i = numberOfNodes(i) 100 | 101 | print('\nTesting User single topo...') 102 | for n in range(0, repetitions): 103 | i = 1 104 | while i <= nr_nodes_single: 105 | mem = 'free -m | grep ^Mem | awk \'{print $1 $3}\' | tr -d Mem: | awk NR==1' 106 | v = (int(subprocess.check_output(mem, shell=True))) 107 | os.system('echo %s >> %s' % (v, mem_user_single)) 108 | print('Test %d: Number of Stations: %d' % (n, i)) 109 | step1 = '\"sta1 free -m | grep ^Mem | awk \'{print \$1 \$3}\'\nexit\"' 110 | step2 = 'mn --wifi --ap user --topo=single,%d 2>&1' % i 111 | step3 = 'grep -E \"(Mem:|completed in)\" | tr -d em: | tr \'M\' \',\' | tr -d "copltd in" | tr -d ss | awk \'!(NR%2){print$0p}{p=$0}\'' 112 | os.system('echo ' + step1 + ' | ' + step2 + ' | ' + step3 + ' >> %s' % file4) 113 | i = numberOfNodes(i) 114 | 115 | print('\nTesting ICMP OVS linear topo...') 116 | for n in range(0, repetitions): 117 | i = 2 118 | while i <= nr_nodes_linear: 119 | print('Test %d: Number of access points: %d' % (n, i)) 120 | step1 = '\"sta1 ping -c21 sta2\"' 121 | step2 = 'mn --wifi --topo=linear,%d 2>&1' % i 122 | step3 = 'grep -E \"(icmp_seq=20)\" | awk \'{print $7}\' | tr -d "time="' 123 | os.system('echo ' + step1 + ' | ' + step2 + ' | ' + step3 + ' >> %s' % file5) 124 | i = numberOfNodes(i) 125 | 126 | print('\nTesting ICMP User linear topo...') 127 | for n in range(0, repetitions): 128 | i = 2 129 | while i <= nr_nodes_linear: 130 | print('Test %d: Number of access points: %d' % (n, i)) 131 | step1 = '\"sta1 ping -c21 sta2\"' 132 | step2 = 'mn --wifi --ap user --topo=linear,%d 2>&1' % i 133 | step3 = 'grep -E \"(icmp_seq=20)\" | awk \'{print $7}\' | tr -d "time="' 134 | os.system('echo ' + step1 + ' | ' + step2 + ' | ' + step3 + ' >> %s' % file6) 135 | i = numberOfNodes(i) 136 | 137 | print('\nTesting ICMP OVS single topo...') 138 | for n in range(0, repetitions): 139 | i = 2 140 | while i <= nr_nodes_single: 141 | print('Test %d: Number of Stations: %d' % (n, i)) 142 | step1 = '\"sta1 ping -c11 sta2\"' 143 | step2 = 'mn --wifi --topo=single,%d 2>&1' % i 144 | step3 = 'grep -E \"(icmp_seq=10)\" | awk \'{print $7}\' | tr -d "time="' 145 | os.system('echo ' + step1 + ' | ' + step2 + ' | ' + step3 + ' >> %s' % file7) 146 | i = numberOfNodes(i) 147 | 148 | print('\nTesting ICMP User single topo...') 149 | for n in range(0, repetitions): 150 | i = 2 151 | while i <= nr_nodes_single: 152 | print('Test %d: Number of Stations: %d' % (n, i)) 153 | step1 = '\"sta1 ping -c11 sta2\"' 154 | step2 = 'mn --wifi --ap user --topo=single,%d 2>&1' % i 155 | step3 = 'grep -E \"(icmp_seq=10)\" | awk \'{print $7}\' | tr -d "time="' 156 | os.system('echo ' + step1 + ' | ' + step2 + ' | ' + step3 + ' >> %s' % file8) 157 | i = numberOfNodes(i) 158 | 159 | def buildGraph(): 160 | """Builds the Graph""" 161 | 162 | # LINEAR_OVS 163 | file1_ = open(file1, 'r') 164 | f1 = file1_.readlines() 165 | file1_.close() 166 | 167 | # LINEAR_USER 168 | file2_ = open(file2, 'r') 169 | f2 = file2_.readlines() 170 | file2_.close() 171 | 172 | # SINGLE_OVS 173 | file3_ = open(file3, 'r') 174 | f3 = file3_.readlines() 175 | file3_.close() 176 | 177 | # SINGLE_USER 178 | file4_ = open(file4, 'r') 179 | f4 = file4_.readlines() 180 | file4_.close() 181 | 182 | # LINEAR-ICMP-OVS 183 | file5_ = open(file5, 'r') 184 | f5 = file5_.readlines() 185 | file5_.close() 186 | 187 | # LINEAR-ICMP-USER 188 | file6_ = open(file6, 'r') 189 | f6 = file6_.readlines() 190 | file6_.close() 191 | 192 | # SINGLE-ICMP-OVS 193 | file7_ = open(file7, 'r') 194 | f7 = file7_.readlines() 195 | file7_.close() 196 | 197 | # SINGLE-ICMP-USER 198 | file8_ = open(file8, 'r') 199 | f8 = file8_.readlines() 200 | file8_.close() 201 | 202 | mem = open(mem_ovs_linear, 'r') 203 | f_mem_ovs_linear = mem.readlines() 204 | mem.close() 205 | 206 | mem = open(mem_user_linear, 'r') 207 | f_mem_user_linear = mem.readlines() 208 | mem.close() 209 | 210 | mem = open(mem_ovs_single, 'r') 211 | f_mem_ovs_single = mem.readlines() 212 | mem.close() 213 | 214 | mem = open(mem_user_single, 'r') 215 | f_mem_user_single = mem.readlines() 216 | mem.close() 217 | 218 | tovs = [] 219 | tuser = [] 220 | movs = [] 221 | muser = [] 222 | tSINGLEovs = [] 223 | tSINGLEuser = [] 224 | mSINGLEovs = [] 225 | mSINGLEuser = [] 226 | icmpOVS = [] 227 | icmpUser = [] 228 | icmpOVSSINGLE = [] 229 | icmpUserSINGLE = [] 230 | 231 | # scan the rows of the file stored in lines, and put the values into some variables: 232 | for data in f_mem_ovs_linear: 233 | p = data.split() 234 | pmem_ovs_linear.append(float(p[0])) 235 | 236 | for data in f_mem_user_linear: 237 | p = data.split() 238 | pmem_user_linear.append(float(p[0])) 239 | 240 | for data in f_mem_ovs_single: 241 | p = data.split() 242 | pmem_ovs_single.append(float(p[0])) 243 | 244 | for data in f_mem_user_single: 245 | p = data.split() 246 | pmem_user_single.append(float(p[0])) 247 | 248 | for data in f1: 249 | p = data.split(',') 250 | tovs.append(float(p[0])) 251 | movs.append(float(p[1])) 252 | 253 | for data in f2: 254 | p = data.split(',') 255 | tuser.append(float(p[0])) 256 | muser.append(float(p[1])) 257 | 258 | for data in f3: 259 | p = data.split(',') 260 | tSINGLEuser.append(float(p[0])) 261 | mSINGLEuser.append(float(p[1])) 262 | 263 | for data in f4: 264 | p = data.split(',') 265 | tSINGLEovs.append(float(p[0])) 266 | mSINGLEovs.append(float(p[1])) 267 | 268 | for m in range(0, len(movs)): 269 | movs[m] = (movs[m] - pmem_ovs_linear[m]) 270 | muser[m] = (muser[m] - pmem_user_linear[m]) 271 | for m in range(0, len(mSINGLEovs)): 272 | mSINGLEovs[m] = (mSINGLEovs[m] - pmem_ovs_single[m]) 273 | mSINGLEuser[m] = (mSINGLEuser[m] - pmem_user_single[m]) 274 | 275 | for data in f5: 276 | p = data.split() 277 | icmpOVS.append(float(p[0])) 278 | 279 | for data in f6: 280 | p = data.split() 281 | icmpUser.append(float(p[0])) 282 | 283 | for data in f7: 284 | p = data.split() 285 | icmpOVSSINGLE.append(float(p[0])) 286 | 287 | for data in f8: 288 | p = data.split() 289 | icmpUserSINGLE.append(float(p[0])) 290 | 291 | ntovs = [] 292 | ntuser = [] 293 | nmovs = [] 294 | nmuser = [] 295 | nSINGLEtovs = [] 296 | nSINGLEtuser = [] 297 | nSINGLEmovs = [] 298 | nSINGLEmuser = [] 299 | nicmpOVS = [] 300 | nicmpUser = [] 301 | nSINGLEicmpOVS = [] 302 | nSINGLEicmpUser = [] 303 | 304 | nrn = (((nr_nodes_linear / RANGE) + 1)) 305 | nrnSINGLE = (((nr_nodes_single / RANGE) + 1)) 306 | for x in range(0, (nrn)): 307 | ntovs.append(0) 308 | ntuser.append(0) 309 | nmovs.append(0) 310 | nmuser.append(0) 311 | nicmpOVS.append(0) 312 | nicmpUser.append(0) 313 | 314 | for x in range(0, (nrnSINGLE)): 315 | nSINGLEtovs.append(0) 316 | nSINGLEtuser.append(0) 317 | nSINGLEmovs.append(0) 318 | nSINGLEmuser.append(0) 319 | nSINGLEicmpOVS.append(0) 320 | nSINGLEicmpUser.append(0) 321 | 322 | i = 1 323 | nodes = [] 324 | icmpNodes = [] 325 | for x in range(0, nrn): 326 | b = x 327 | for k in range(0, repetitions): 328 | ntovs[x] = ntovs[x] + tovs[b] / 60 329 | ntuser[x] = ntuser[x] + tuser[b] / 60 330 | nmovs[x] = nmovs[x] + movs[b] 331 | nmuser[x] = nmuser[x] + muser[b] 332 | nicmpOVS[x] = nicmpOVS[x] + icmpOVS[b] 333 | nicmpUser[x] = nicmpUser[x] + icmpUser[b] 334 | b = x + (RANGE + 1) 335 | ntovs[x] = ntovs[x] / repetitions 336 | ntuser[x] = ntuser[x] / repetitions 337 | nmovs[x] = nmovs[x] / repetitions 338 | nmuser[x] = nmuser[x] / repetitions 339 | nicmpUser[x] = nicmpUser[x] / repetitions 340 | nicmpOVS[x] = nicmpOVS[x] / repetitions 341 | nodes.append(i) 342 | if i == 1: 343 | icmpNodes.append(i + 1) 344 | else: 345 | icmpNodes.append(i) 346 | i = numberOfNodes(i) 347 | 348 | i = 1 349 | nodesSINGLE = [] 350 | icmpNodesSINGLE = [] 351 | for x in range(0, nrnSINGLE): 352 | b = x 353 | for k in range(0, repetitions): 354 | nSINGLEtovs[x] = nSINGLEtovs[x] + tSINGLEovs[b] / 60 #convert to minutes 355 | nSINGLEtuser[x] = nSINGLEtuser[x] + tSINGLEuser[b] / 60 #convert to minutes 356 | nSINGLEmovs[x] = nSINGLEmovs[x] + mSINGLEovs[b] 357 | nSINGLEmuser[x] = nSINGLEmuser[x] + mSINGLEuser[b] 358 | nSINGLEicmpOVS[x] = nSINGLEicmpOVS[x] + icmpOVSSINGLE[b] 359 | nSINGLEicmpUser[x] = nSINGLEicmpUser[x] + icmpUserSINGLE[b] 360 | b = x + (RANGE + 1) 361 | nSINGLEtovs[x] = nSINGLEtovs[x] / repetitions 362 | nSINGLEtuser[x] = nSINGLEtuser[x] / repetitions 363 | nSINGLEmovs[x] = nSINGLEmovs[x] / repetitions 364 | nSINGLEmuser[x] = nSINGLEmuser[x] / repetitions 365 | nSINGLEicmpUser[x] = nSINGLEicmpUser[x] / repetitions 366 | nSINGLEicmpOVS[x] = nSINGLEicmpOVS[x] / repetitions 367 | nodesSINGLE.append(i) 368 | if i == 1: 369 | icmpNodesSINGLE.append(i + 1) 370 | else: 371 | icmpNodesSINGLE.append(i) 372 | i = numberOfNodes(i) 373 | 374 | fig, ax1 = plt.subplots() 375 | ax1.grid(True) 376 | ax1.plot(nodes, ntovs, color='red', marker='*', mec='red', markersize=5, label='OVS AP', linestyle=':', linewidth=1) 377 | ax1.plot(nodes, ntuser, color='green', marker='x', markersize=5, label='User AP', linestyle='-', linewidth=1) 378 | ax1.legend(loc='best', borderaxespad=0., fontsize=14, frameon=False) 379 | ax1.set_ylabel("start+shutdown time (minutes)", fontsize=20) 380 | ax1.set_xlabel("# of Access Points", fontsize=20) 381 | ax1.set_title('Linear Topo') 382 | plt.xlim([0, nr_nodes_linear + 2]) 383 | plt.ylim([0, plt.ylim()[1]]) 384 | plt.savefig("report_Time_Linear.eps") 385 | 386 | fig, ax1 = plt.subplots() 387 | ax1.grid(True) 388 | ax1.plot(nodes, nmovs, color='red', marker='*', mec='red', markersize=5, label='OVS AP', linestyle=':', linewidth=1) 389 | ax1.plot(nodes, nmuser, color='green', marker='x', markersize=5, label='User AP', linestyle='-', linewidth=1) 390 | ax1.legend(loc='best', borderaxespad=0., fontsize=14, frameon=False) 391 | ax1.set_ylabel("memory usage (megabytes)", fontsize=20) 392 | ax1.set_xlabel("# of Access Points", fontsize=20) 393 | ax1.set_title('Linear Topo') 394 | plt.xlim([0, nr_nodes_linear + 2]) 395 | plt.ylim([0, plt.ylim()[1]]) 396 | plt.savefig("report_Memory_Linear.eps") 397 | 398 | fig, ax1 = plt.subplots() 399 | ax1.grid(True) 400 | ax1.plot(nodesSINGLE, nSINGLEtovs, color='red', marker='*', mec='red', markersize=5, label='OVS AP', linestyle=':', linewidth=1) 401 | ax1.plot(nodesSINGLE, nSINGLEtuser, color='green', marker='x', markersize=5, label='User AP', linestyle='-', linewidth=1) 402 | ax1.legend(loc='best', borderaxespad=0., fontsize=14, frameon=False) 403 | ax1.set_ylabel("start+shutdown time (minutes)", fontsize=20) 404 | ax1.set_xlabel("# of Stations", fontsize=20) 405 | ax1.set_title('Single Topo') 406 | plt.xlim([0, nr_nodes_single + 2]) 407 | plt.ylim([0, plt.ylim()[1]]) 408 | plt.savefig("report_Time_Single.eps") 409 | 410 | fig, ax1 = plt.subplots() 411 | ax1.grid(True) 412 | ax1.plot(nodesSINGLE, nSINGLEmovs, color='red', marker='*', mec='red', markersize=5, label='OVS AP', linestyle=':', linewidth=1) 413 | ax1.plot(nodesSINGLE, nSINGLEmuser, color='green', marker='x', markersize=5, label='User AP', linestyle='-', linewidth=1) 414 | ax1.legend(loc='best', borderaxespad=0., fontsize=14, frameon=False) 415 | ax1.set_ylabel("memory usage (megabytes)", fontsize=20) 416 | ax1.set_xlabel("# of Stations", fontsize=20) 417 | ax1.set_title('Single Topo') 418 | plt.xlim([0, nr_nodes_single + 2]) 419 | plt.ylim([0, plt.ylim()[1]]) 420 | plt.savefig("report_Memory_Single.eps") 421 | 422 | fig, ax1 = plt.subplots() 423 | ax1.grid(True) 424 | ax1.plot(icmpNodes, nicmpOVS, color='red', marker='*', mec='red', markersize=5, label='OVS AP', linestyle=':', linewidth=1) 425 | ax1.plot(icmpNodes, nicmpUser, color='green', marker='x', markersize=5, label='User AP', linestyle='-', linewidth=1) 426 | ax1.legend(loc='best', borderaxespad=0., fontsize=14, frameon=False) 427 | ax1.set_ylabel("time response (ms)", fontsize=20) 428 | ax1.set_xlabel("# of Access Points", fontsize=20) 429 | ax1.set_title('Linear Topo') 430 | plt.xlim([0, nr_nodes_linear + 2]) 431 | plt.ylim([0, plt.ylim()[1]]) 432 | plt.savefig("report_ICMP_Linear.eps") 433 | 434 | fig, ax1 = plt.subplots() 435 | ax1.grid(True) 436 | ax1.plot(icmpNodesSINGLE, nSINGLEicmpOVS, color='red', marker='*', mec='red', markersize=5, label='OVS AP', linestyle=':', linewidth=1) 437 | ax1.plot(icmpNodesSINGLE, nSINGLEicmpUser, color='green', marker='x', markersize=5, label='User AP', linestyle='-', linewidth=1) 438 | ax1.legend(loc='best', borderaxespad=0., fontsize=14, frameon=False) 439 | ax1.set_ylabel("time response (ms)", fontsize=20) 440 | ax1.set_xlabel("# of Stations", fontsize=20) 441 | ax1.set_title('Single Topo') 442 | plt.xlim([0, nr_nodes_single + 2]) 443 | plt.ylim([0, plt.ylim()[1]]) 444 | plt.savefig("report_ICMP_Single.eps") 445 | 446 | def removeFiles(): 447 | """Remove Files""" 448 | 449 | if glob.glob(file1): 450 | os.system('rm %s' % file1) 451 | if glob.glob(file2): 452 | os.system('rm %s' % file2) 453 | if glob.glob(file3): 454 | os.system('rm %s' % file3) 455 | if glob.glob(file4): 456 | os.system('rm %s' % file4) 457 | if glob.glob(file5): 458 | os.system('rm %s' % file5) 459 | if glob.glob(file6): 460 | os.system('rm %s' % file6) 461 | if glob.glob(file7): 462 | os.system('rm %s' % file7) 463 | if glob.glob(file8): 464 | os.system('rm %s' % file8) 465 | if glob.glob(mem_ovs_linear): 466 | os.system('rm %s' % mem_ovs_linear) 467 | if glob.glob(mem_ovs_single): 468 | os.system('rm %s' % mem_ovs_single) 469 | if glob.glob(mem_user_linear): 470 | os.system('rm %s' % mem_user_linear) 471 | if glob.glob(mem_user_single): 472 | os.system('rm %s' % mem_user_single) 473 | 474 | if __name__ == '__main__': 475 | print("------------------------------------------------------------------") 476 | os.system('echo "CPU Model:" && cat /proc/cpuinfo | grep "model name" | awk NR==1 | awk \'{print $4 $5 $6 $7 $8 $9}\'') 477 | os.system('echo "Total Memory:" && cat /proc/meminfo | grep MemTotal | awk \'{print $2 $3}\'') 478 | print("------------------------------------------------------------------") 479 | print("Stopping network manager") 480 | os.system('service network-manager stop') 481 | 482 | removeFiles() # Remove Files 483 | runExperiment() # Running experiment and processing code 484 | buildGraph() # Presenting code 485 | -------------------------------------------------------------------------------- /mininet-wifi/scalabilityTest/report_ICMP_Linear.eps: -------------------------------------------------------------------------------- 1 | %!PS-Adobe-3.0 EPSF-3.0 2 | %%Title: report_ICMP_Linear.eps 3 | %%Creator: matplotlib version 1.5.1, http://matplotlib.org/ 4 | %%CreationDate: Thu Mar 30 09:47:50 2017 5 | %%Orientation: portrait 6 | %%BoundingBox: 18 180 594 612 7 | %%EndComments 8 | %%BeginProlog 9 | /mpldict 8 dict def 10 | mpldict begin 11 | /m { moveto } bind def 12 | /l { lineto } bind def 13 | /r { rlineto } bind def 14 | /c { curveto } bind def 15 | /cl { closepath } bind def 16 | /box { 17 | m 18 | 1 index 0 r 19 | 0 exch r 20 | neg 0 r 21 | cl 22 | } bind def 23 | /clipbox { 24 | box 25 | clip 26 | newpath 27 | } bind def 28 | %!PS-Adobe-3.0 Resource-Font 29 | %%Title: Bitstream Vera Sans 30 | %%Copyright: Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. 31 | %%Creator: Converted from TrueType to type 3 by PPR 32 | 25 dict begin 33 | /_d{bind def}bind def 34 | /_m{moveto}_d 35 | /_l{lineto}_d 36 | /_cl{closepath eofill}_d 37 | /_c{curveto}_d 38 | /_sc{7 -1 roll{setcachedevice}{pop pop pop pop pop pop}ifelse}_d 39 | /_e{exec}_d 40 | /FontName /BitstreamVeraSans-Roman def 41 | /PaintType 0 def 42 | /FontMatrix[.001 0 0 .001 0 0]def 43 | /FontBBox[-183 -236 1287 928]def 44 | /FontType 3 def 45 | /Encoding [ /space /numbersign /parenleft /parenright /zero /one /two /three /five /A /O /P /S /U /V /c /e /f /i /m /n /o /p /r /s /t ] def 46 | /FontInfo 10 dict dup begin 47 | /FamilyName (Bitstream Vera Sans) def 48 | /FullName (Bitstream Vera Sans) def 49 | /Notice (Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.) def 50 | /Weight (Roman) def 51 | /Version (Release 1.10) def 52 | /ItalicAngle 0.0 def 53 | /isFixedPitch false def 54 | /UnderlinePosition -213 def 55 | /UnderlineThickness 143 def 56 | end readonly def 57 | /CharStrings 26 dict dup begin 58 | /space{318 0 0 0 0 0 _sc 59 | }_d 60 | /numbersign{{838 0 77 0 761 718 _sc 61 | 511 440 _m 62 | 369 440 _l 63 | 328 277 _l 64 | 471 277 _l 65 | 511 440 _l 66 | 438 718 _m 67 | 387 515 _l 68 | 530 515 _l 69 | 581 718 _l 70 | 659 718 _l 71 | 609 515 _l 72 | 761 515 _l 73 | 761 440 _l 74 | 590 440 _l 75 | 550 277 _l 76 | 705 277 _l 77 | 705 202 _l 78 | 531 202 _l 79 | 480 0 _l 80 | 402 0 _l 81 | 452 202 _l 82 | 309 202 _l 83 | 259 0 _l 84 | 180 0 _l 85 | 231 202 _l 86 | 77 202 _l 87 | 77 277 _l 88 | 249 277 _l 89 | 290 440 _l 90 | 133 440 _l 91 | }_e{133 515 _l 92 | 309 515 _l 93 | 359 718 _l 94 | 438 718 _l 95 | _cl}_e}_d 96 | /parenleft{390 0 86 -131 310 759 _sc 97 | 310 759 _m 98 | 266 683 234 609 213 536 _c 99 | 191 463 181 389 181 314 _c 100 | 181 238 191 164 213 91 _c 101 | 234 17 266 -56 310 -131 _c 102 | 232 -131 _l 103 | 183 -54 146 20 122 94 _c 104 | 98 168 86 241 86 314 _c 105 | 86 386 98 459 122 533 _c 106 | 146 607 182 682 232 759 _c 107 | 310 759 _l 108 | _cl}_d 109 | /parenright{390 0 80 -131 304 759 _sc 110 | 80 759 _m 111 | 158 759 _l 112 | 206 682 243 607 267 533 _c 113 | 291 459 304 386 304 314 _c 114 | 304 241 291 168 267 94 _c 115 | 243 20 206 -54 158 -131 _c 116 | 80 -131 _l 117 | 123 -56 155 17 177 91 _c 118 | 198 164 209 238 209 314 _c 119 | 209 389 198 463 177 536 _c 120 | 155 609 123 683 80 759 _c 121 | _cl}_d 122 | /zero{636 0 66 -13 570 742 _sc 123 | 318 664 _m 124 | 267 664 229 639 203 589 _c 125 | 177 539 165 464 165 364 _c 126 | 165 264 177 189 203 139 _c 127 | 229 89 267 64 318 64 _c 128 | 369 64 407 89 433 139 _c 129 | 458 189 471 264 471 364 _c 130 | 471 464 458 539 433 589 _c 131 | 407 639 369 664 318 664 _c 132 | 318 742 _m 133 | 399 742 461 709 505 645 _c 134 | 548 580 570 486 570 364 _c 135 | 570 241 548 147 505 83 _c 136 | 461 19 399 -13 318 -13 _c 137 | 236 -13 173 19 130 83 _c 138 | 87 147 66 241 66 364 _c 139 | 66 486 87 580 130 645 _c 140 | 173 709 236 742 318 742 _c 141 | _cl}_d 142 | /one{636 0 110 0 544 729 _sc 143 | 124 83 _m 144 | 285 83 _l 145 | 285 639 _l 146 | 110 604 _l 147 | 110 694 _l 148 | 284 729 _l 149 | 383 729 _l 150 | 383 83 _l 151 | 544 83 _l 152 | 544 0 _l 153 | 124 0 _l 154 | 124 83 _l 155 | _cl}_d 156 | /two{{636 0 73 0 536 742 _sc 157 | 192 83 _m 158 | 536 83 _l 159 | 536 0 _l 160 | 73 0 _l 161 | 73 83 _l 162 | 110 121 161 173 226 239 _c 163 | 290 304 331 346 348 365 _c 164 | 380 400 402 430 414 455 _c 165 | 426 479 433 504 433 528 _c 166 | 433 566 419 598 392 622 _c 167 | 365 646 330 659 286 659 _c 168 | 255 659 222 653 188 643 _c 169 | 154 632 117 616 78 594 _c 170 | 78 694 _l 171 | 118 710 155 722 189 730 _c 172 | 223 738 255 742 284 742 _c 173 | }_e{359 742 419 723 464 685 _c 174 | 509 647 532 597 532 534 _c 175 | 532 504 526 475 515 449 _c 176 | 504 422 484 390 454 354 _c 177 | 446 344 420 317 376 272 _c 178 | 332 227 271 164 192 83 _c 179 | _cl}_e}_d 180 | /three{{636 0 76 -13 556 742 _sc 181 | 406 393 _m 182 | 453 383 490 362 516 330 _c 183 | 542 298 556 258 556 212 _c 184 | 556 140 531 84 482 45 _c 185 | 432 6 362 -13 271 -13 _c 186 | 240 -13 208 -10 176 -4 _c 187 | 144 1 110 10 76 22 _c 188 | 76 117 _l 189 | 103 101 133 89 166 81 _c 190 | 198 73 232 69 268 69 _c 191 | 330 69 377 81 409 105 _c 192 | 441 129 458 165 458 212 _c 193 | 458 254 443 288 413 312 _c 194 | 383 336 341 349 287 349 _c 195 | }_e{202 349 _l 196 | 202 430 _l 197 | 291 430 _l 198 | 339 430 376 439 402 459 _c 199 | 428 478 441 506 441 543 _c 200 | 441 580 427 609 401 629 _c 201 | 374 649 336 659 287 659 _c 202 | 260 659 231 656 200 650 _c 203 | 169 644 135 635 98 623 _c 204 | 98 711 _l 205 | 135 721 170 729 203 734 _c 206 | 235 739 266 742 296 742 _c 207 | 370 742 429 725 473 691 _c 208 | 517 657 539 611 539 553 _c 209 | 539 513 527 479 504 451 _c 210 | 481 423 448 403 406 393 _c 211 | _cl}_e}_d 212 | /five{{636 0 77 -13 549 729 _sc 213 | 108 729 _m 214 | 495 729 _l 215 | 495 646 _l 216 | 198 646 _l 217 | 198 467 _l 218 | 212 472 227 476 241 478 _c 219 | 255 480 270 482 284 482 _c 220 | 365 482 429 459 477 415 _c 221 | 525 370 549 310 549 234 _c 222 | 549 155 524 94 475 51 _c 223 | 426 8 357 -13 269 -13 _c 224 | 238 -13 207 -10 175 -6 _c 225 | 143 -1 111 6 77 17 _c 226 | 77 116 _l 227 | 106 100 136 88 168 80 _c 228 | 199 72 232 69 267 69 _c 229 | }_e{323 69 368 83 401 113 _c 230 | 433 143 450 183 450 234 _c 231 | 450 284 433 324 401 354 _c 232 | 368 384 323 399 267 399 _c 233 | 241 399 214 396 188 390 _c 234 | 162 384 135 375 108 363 _c 235 | 108 729 _l 236 | _cl}_e}_d 237 | /A{684 0 8 0 676 729 _sc 238 | 342 632 _m 239 | 208 269 _l 240 | 476 269 _l 241 | 342 632 _l 242 | 286 729 _m 243 | 398 729 _l 244 | 676 0 _l 245 | 573 0 _l 246 | 507 187 _l 247 | 178 187 _l 248 | 112 0 _l 249 | 8 0 _l 250 | 286 729 _l 251 | _cl}_d 252 | /O{787 0 56 -13 731 742 _sc 253 | 394 662 _m 254 | 322 662 265 635 223 582 _c 255 | 181 528 160 456 160 364 _c 256 | 160 272 181 199 223 146 _c 257 | 265 92 322 66 394 66 _c 258 | 465 66 522 92 564 146 _c 259 | 606 199 627 272 627 364 _c 260 | 627 456 606 528 564 582 _c 261 | 522 635 465 662 394 662 _c 262 | 394 742 _m 263 | 496 742 577 707 639 639 _c 264 | 700 571 731 479 731 364 _c 265 | 731 248 700 157 639 89 _c 266 | 577 21 496 -13 394 -13 _c 267 | 291 -13 209 21 148 89 _c 268 | 86 157 56 248 56 364 _c 269 | 56 479 86 571 148 639 _c 270 | 209 707 291 742 394 742 _c 271 | _cl}_d 272 | /P{603 0 98 0 569 729 _sc 273 | 197 648 _m 274 | 197 374 _l 275 | 321 374 _l 276 | 367 374 402 385 427 409 _c 277 | 452 433 465 467 465 511 _c 278 | 465 555 452 588 427 612 _c 279 | 402 636 367 648 321 648 _c 280 | 197 648 _l 281 | 98 729 _m 282 | 321 729 _l 283 | 402 729 464 710 506 673 _c 284 | 548 636 569 582 569 511 _c 285 | 569 439 548 384 506 348 _c 286 | 464 311 402 293 321 293 _c 287 | 197 293 _l 288 | 197 0 _l 289 | 98 0 _l 290 | 98 729 _l 291 | _cl}_d 292 | /S{{635 0 66 -13 579 742 _sc 293 | 535 705 _m 294 | 535 609 _l 295 | 497 627 462 640 429 649 _c 296 | 395 657 363 662 333 662 _c 297 | 279 662 237 651 208 631 _c 298 | 179 610 165 580 165 542 _c 299 | 165 510 174 485 194 469 _c 300 | 213 452 250 439 304 429 _c 301 | 364 417 _l 302 | 437 403 491 378 526 343 _c 303 | 561 307 579 260 579 201 _c 304 | 579 130 555 77 508 41 _c 305 | 460 5 391 -13 300 -13 _c 306 | 265 -13 228 -9 189 -2 _c 307 | }_e{150 5 110 16 69 32 _c 308 | 69 134 _l 309 | 109 111 148 94 186 83 _c 310 | 224 71 262 66 300 66 _c 311 | 356 66 399 77 430 99 _c 312 | 460 121 476 152 476 194 _c 313 | 476 230 465 258 443 278 _c 314 | 421 298 385 313 335 323 _c 315 | 275 335 _l 316 | 201 349 148 372 115 404 _c 317 | 82 435 66 478 66 534 _c 318 | 66 598 88 649 134 686 _c 319 | 179 723 242 742 322 742 _c 320 | 356 742 390 739 426 733 _c 321 | 461 727 497 717 535 705 _c 322 | }_e{_cl}_e}_d 323 | /U{732 0 87 -13 645 729 _sc 324 | 87 729 _m 325 | 186 729 _l 326 | 186 286 _l 327 | 186 208 200 151 228 117 _c 328 | 256 83 302 66 366 66 _c 329 | 429 66 475 83 503 117 _c 330 | 531 151 546 208 546 286 _c 331 | 546 729 _l 332 | 645 729 _l 333 | 645 274 _l 334 | 645 178 621 107 574 59 _c 335 | 527 11 458 -13 366 -13 _c 336 | 274 -13 204 11 157 59 _c 337 | 110 107 87 178 87 274 _c 338 | 87 729 _l 339 | _cl}_d 340 | /V{684 0 8 0 676 729 _sc 341 | 286 0 _m 342 | 8 729 _l 343 | 111 729 _l 344 | 342 115 _l 345 | 573 729 _l 346 | 676 729 _l 347 | 398 0 _l 348 | 286 0 _l 349 | _cl}_d 350 | /c{{550 0 55 -13 488 560 _sc 351 | 488 526 _m 352 | 488 442 _l 353 | 462 456 437 466 411 473 _c 354 | 385 480 360 484 334 484 _c 355 | 276 484 230 465 198 428 _c 356 | 166 391 150 339 150 273 _c 357 | 150 206 166 154 198 117 _c 358 | 230 80 276 62 334 62 _c 359 | 360 62 385 65 411 72 _c 360 | 437 79 462 90 488 104 _c 361 | 488 21 _l 362 | 462 9 436 0 410 -5 _c 363 | 383 -10 354 -13 324 -13 _c 364 | 242 -13 176 12 128 64 _c 365 | }_e{79 115 55 185 55 273 _c 366 | 55 362 79 432 128 483 _c 367 | 177 534 244 560 330 560 _c 368 | 358 560 385 557 411 551 _c 369 | 437 545 463 537 488 526 _c 370 | _cl}_e}_d 371 | /e{{615 0 55 -13 562 560 _sc 372 | 562 296 _m 373 | 562 252 _l 374 | 149 252 _l 375 | 153 190 171 142 205 110 _c 376 | 238 78 284 62 344 62 _c 377 | 378 62 412 66 444 74 _c 378 | 476 82 509 95 541 113 _c 379 | 541 28 _l 380 | 509 14 476 3 442 -3 _c 381 | 408 -9 373 -13 339 -13 _c 382 | 251 -13 182 12 131 62 _c 383 | 80 112 55 181 55 268 _c 384 | 55 357 79 428 127 481 _c 385 | 175 533 241 560 323 560 _c 386 | 397 560 455 536 498 489 _c 387 | }_e{540 441 562 377 562 296 _c 388 | 472 322 _m 389 | 471 371 457 410 431 440 _c 390 | 404 469 368 484 324 484 _c 391 | 274 484 234 469 204 441 _c 392 | 174 413 156 373 152 322 _c 393 | 472 322 _l 394 | _cl}_e}_d 395 | /f{352 0 23 0 371 760 _sc 396 | 371 760 _m 397 | 371 685 _l 398 | 285 685 _l 399 | 253 685 230 678 218 665 _c 400 | 205 652 199 629 199 595 _c 401 | 199 547 _l 402 | 347 547 _l 403 | 347 477 _l 404 | 199 477 _l 405 | 199 0 _l 406 | 109 0 _l 407 | 109 477 _l 408 | 23 477 _l 409 | 23 547 _l 410 | 109 547 _l 411 | 109 585 _l 412 | 109 645 123 690 151 718 _c 413 | 179 746 224 760 286 760 _c 414 | 371 760 _l 415 | _cl}_d 416 | /i{278 0 94 0 184 760 _sc 417 | 94 547 _m 418 | 184 547 _l 419 | 184 0 _l 420 | 94 0 _l 421 | 94 547 _l 422 | 94 760 _m 423 | 184 760 _l 424 | 184 646 _l 425 | 94 646 _l 426 | 94 760 _l 427 | _cl}_d 428 | /m{{974 0 91 0 889 560 _sc 429 | 520 442 _m 430 | 542 482 569 511 600 531 _c 431 | 631 550 668 560 711 560 _c 432 | 767 560 811 540 842 500 _c 433 | 873 460 889 403 889 330 _c 434 | 889 0 _l 435 | 799 0 _l 436 | 799 327 _l 437 | 799 379 789 418 771 444 _c 438 | 752 469 724 482 686 482 _c 439 | 639 482 602 466 575 435 _c 440 | 548 404 535 362 535 309 _c 441 | 535 0 _l 442 | 445 0 _l 443 | 445 327 _l 444 | 445 379 435 418 417 444 _c 445 | 398 469 369 482 331 482 _c 446 | }_e{285 482 248 466 221 435 _c 447 | 194 404 181 362 181 309 _c 448 | 181 0 _l 449 | 91 0 _l 450 | 91 547 _l 451 | 181 547 _l 452 | 181 462 _l 453 | 201 495 226 520 255 536 _c 454 | 283 552 317 560 357 560 _c 455 | 397 560 430 550 458 530 _c 456 | 486 510 506 480 520 442 _c 457 | _cl}_e}_d 458 | /n{634 0 91 0 549 560 _sc 459 | 549 330 _m 460 | 549 0 _l 461 | 459 0 _l 462 | 459 327 _l 463 | 459 379 448 417 428 443 _c 464 | 408 469 378 482 338 482 _c 465 | 289 482 251 466 223 435 _c 466 | 195 404 181 362 181 309 _c 467 | 181 0 _l 468 | 91 0 _l 469 | 91 547 _l 470 | 181 547 _l 471 | 181 462 _l 472 | 202 494 227 519 257 535 _c 473 | 286 551 320 560 358 560 _c 474 | 420 560 468 540 500 501 _c 475 | 532 462 549 405 549 330 _c 476 | _cl}_d 477 | /o{612 0 55 -13 557 560 _sc 478 | 306 484 _m 479 | 258 484 220 465 192 427 _c 480 | 164 389 150 338 150 273 _c 481 | 150 207 163 156 191 118 _c 482 | 219 80 257 62 306 62 _c 483 | 354 62 392 80 420 118 _c 484 | 448 156 462 207 462 273 _c 485 | 462 337 448 389 420 427 _c 486 | 392 465 354 484 306 484 _c 487 | 306 560 _m 488 | 384 560 445 534 490 484 _c 489 | 534 433 557 363 557 273 _c 490 | 557 183 534 113 490 63 _c 491 | 445 12 384 -13 306 -13 _c 492 | 227 -13 165 12 121 63 _c 493 | 77 113 55 183 55 273 _c 494 | 55 363 77 433 121 484 _c 495 | 165 534 227 560 306 560 _c 496 | _cl}_d 497 | /p{{635 0 91 -207 580 560 _sc 498 | 181 82 _m 499 | 181 -207 _l 500 | 91 -207 _l 501 | 91 547 _l 502 | 181 547 _l 503 | 181 464 _l 504 | 199 496 223 520 252 536 _c 505 | 281 552 316 560 356 560 _c 506 | 422 560 476 533 518 481 _c 507 | 559 428 580 359 580 273 _c 508 | 580 187 559 117 518 65 _c 509 | 476 13 422 -13 356 -13 _c 510 | 316 -13 281 -5 252 10 _c 511 | 223 25 199 49 181 82 _c 512 | 487 273 _m 513 | 487 339 473 390 446 428 _c 514 | 418 466 381 485 334 485 _c 515 | }_e{286 485 249 466 222 428 _c 516 | 194 390 181 339 181 273 _c 517 | 181 207 194 155 222 117 _c 518 | 249 79 286 61 334 61 _c 519 | 381 61 418 79 446 117 _c 520 | 473 155 487 207 487 273 _c 521 | _cl}_e}_d 522 | /r{411 0 91 0 411 560 _sc 523 | 411 463 _m 524 | 401 469 390 473 378 476 _c 525 | 366 478 353 480 339 480 _c 526 | 288 480 249 463 222 430 _c 527 | 194 397 181 350 181 288 _c 528 | 181 0 _l 529 | 91 0 _l 530 | 91 547 _l 531 | 181 547 _l 532 | 181 462 _l 533 | 199 495 224 520 254 536 _c 534 | 284 552 321 560 365 560 _c 535 | 371 560 378 559 386 559 _c 536 | 393 558 401 557 411 555 _c 537 | 411 463 _l 538 | _cl}_d 539 | /s{{521 0 54 -13 472 560 _sc 540 | 443 531 _m 541 | 443 446 _l 542 | 417 458 391 468 364 475 _c 543 | 336 481 308 485 279 485 _c 544 | 234 485 200 478 178 464 _c 545 | 156 450 145 430 145 403 _c 546 | 145 382 153 366 169 354 _c 547 | 185 342 217 330 265 320 _c 548 | 296 313 _l 549 | 360 299 405 279 432 255 _c 550 | 458 230 472 195 472 151 _c 551 | 472 100 452 60 412 31 _c 552 | 372 1 316 -13 246 -13 _c 553 | 216 -13 186 -10 154 -5 _c 554 | }_e{122 0 89 8 54 20 _c 555 | 54 113 _l 556 | 87 95 120 82 152 74 _c 557 | 184 65 216 61 248 61 _c 558 | 290 61 323 68 346 82 _c 559 | 368 96 380 117 380 144 _c 560 | 380 168 371 187 355 200 _c 561 | 339 213 303 226 247 238 _c 562 | 216 245 _l 563 | 160 257 119 275 95 299 _c 564 | 70 323 58 356 58 399 _c 565 | 58 450 76 490 112 518 _c 566 | 148 546 200 560 268 560 _c 567 | 301 560 332 557 362 552 _c 568 | 391 547 418 540 443 531 _c 569 | }_e{_cl}_e}_d 570 | /t{392 0 27 0 368 702 _sc 571 | 183 702 _m 572 | 183 547 _l 573 | 368 547 _l 574 | 368 477 _l 575 | 183 477 _l 576 | 183 180 _l 577 | 183 135 189 106 201 94 _c 578 | 213 81 238 75 276 75 _c 579 | 368 75 _l 580 | 368 0 _l 581 | 276 0 _l 582 | 206 0 158 13 132 39 _c 583 | 106 65 93 112 93 180 _c 584 | 93 477 _l 585 | 27 477 _l 586 | 27 547 _l 587 | 93 547 _l 588 | 93 702 _l 589 | 183 702 _l 590 | _cl}_d 591 | end readonly def 592 | 593 | /BuildGlyph 594 | {exch begin 595 | CharStrings exch 596 | 2 copy known not{pop /.notdef}if 597 | true 3 1 roll get exec 598 | end}_d 599 | 600 | /BuildChar { 601 | 1 index /Encoding get exch get 602 | 1 index /BuildGlyph get exec 603 | }_d 604 | 605 | FontName currentdict end definefont pop 606 | end 607 | %%EndProlog 608 | mpldict begin 609 | 18 180 translate 610 | 576 432 0 0 clipbox 611 | 100000 setmiterlimit 612 | gsave 613 | 0 0 m 614 | 576 0 l 615 | 576 432 l 616 | 0 432 l 617 | cl 618 | 1.000 setgray 619 | fill 620 | grestore 621 | gsave 622 | 72 43.2 m 623 | 518.4 43.2 l 624 | 518.4 388.8 l 625 | 72 388.8 l 626 | cl 627 | 1.000 setgray 628 | fill 629 | grestore 630 | 1.000 setlinewidth 631 | 1 setlinejoin 632 | 0 setlinecap 633 | [1 3] 0 setdash 634 | 1.000 0.000 0.000 setrgbcolor 635 | gsave 636 | 446.4 345.6 72 43.2 clipbox 637 | 75.460465 43.20599 m 638 | 99.683721 43.213248 l 639 | 127.367442 43.226611 l 640 | 155.051163 43.242163 l 641 | 182.734884 43.247693 l 642 | 210.418605 43.259213 l 643 | 238.102326 43.284211 l 644 | 265.786047 43.329024 l 645 | 293.469767 43.28617 l 646 | 321.153488 61.7472 l 647 | 348.837209 43.298842 l 648 | 376.52093 43.308634 l 649 | 404.204651 43.375104 l 650 | 431.888372 43.354368 l 651 | 459.572093 62.5536 l 652 | 487.255814 43.376256 l 653 | 514.939535 43.405056 l 654 | stroke 655 | grestore 656 | 0.500 setlinewidth 657 | 2 setlinejoin 658 | [] 0 setdash 659 | gsave 660 | 446.4 345.6 72 43.2 clipbox 661 | /o { 662 | gsave 663 | newpath 664 | translate 665 | 0.5 setlinewidth 666 | 2 setlinejoin 667 | 0 setlinecap 668 | 0 2.5 m 669 | -0.561285 0.772542 l 670 | -2.377641 0.772542 l 671 | -0.908178 -0.295085 l 672 | -1.469463 -2.022542 l 673 | -0 -0.954915 l 674 | 1.469463 -2.022542 l 675 | 0.908178 -0.295085 l 676 | 2.377641 0.772542 l 677 | 0.561285 0.772542 l 678 | cl 679 | 680 | gsave 681 | 1.000 0.000 0.000 setrgbcolor 682 | fill 683 | grestore 684 | stroke 685 | grestore 686 | } bind def 687 | 75.4605 43.206 o 688 | 99.6837 43.2132 o 689 | 127.367 43.2266 o 690 | 155.051 43.2422 o 691 | 182.735 43.2477 o 692 | 210.419 43.2592 o 693 | 238.102 43.2842 o 694 | 265.786 43.329 o 695 | 293.47 43.2862 o 696 | 321.153 61.7472 o 697 | 348.837 43.2988 o 698 | 376.521 43.3086 o 699 | 404.205 43.3751 o 700 | 431.888 43.3544 o 701 | 459.572 62.5536 o 702 | 487.256 43.3763 o 703 | 514.94 43.4051 o 704 | grestore 705 | 1.000 setlinewidth 706 | 1 setlinejoin 707 | 2 setlinecap 708 | 0.000 0.502 0.000 setrgbcolor 709 | gsave 710 | 446.4 345.6 72 43.2 clipbox 711 | 75.460465 43.221658 m 712 | 99.683721 43.227763 l 713 | 127.367442 43.286976 l 714 | 155.051163 43.28617 l 715 | 182.734884 43.269581 l 716 | 210.418605 43.308058 l 717 | 238.102326 46.08 l 718 | 265.786047 45.74592 l 719 | 293.469767 46.52928 l 720 | 321.153488 65.4336 l 721 | 348.837209 43.362432 l 722 | 376.52093 43.949952 l 723 | 404.204651 43.963776 l 724 | 431.888372 382.6944 l 725 | 459.572093 52.22016 l 726 | 487.255814 106.3296 l 727 | 514.939535 102.7584 l 728 | stroke 729 | grestore 730 | 0.500 setlinewidth 731 | 0 setlinecap 732 | gsave 733 | 446.4 345.6 72 43.2 clipbox 734 | /o { 735 | gsave 736 | newpath 737 | translate 738 | 0.5 setlinewidth 739 | 1 setlinejoin 740 | 0 setlinecap 741 | -2.5 -2.5 m 742 | 2.5 2.5 l 743 | -2.5 2.5 m 744 | 2.5 -2.5 l 745 | 746 | gsave 747 | 0.000 0.502 0.000 setrgbcolor 748 | fill 749 | grestore 750 | stroke 751 | grestore 752 | } bind def 753 | 75.4605 43.2217 o 754 | 99.6837 43.2278 o 755 | 127.367 43.287 o 756 | 155.051 43.2862 o 757 | 182.735 43.2696 o 758 | 210.419 43.3081 o 759 | 238.102 46.08 o 760 | 265.786 45.7459 o 761 | 293.47 46.5293 o 762 | 321.153 65.4336 o 763 | 348.837 43.3624 o 764 | 376.521 43.95 o 765 | 404.205 43.9638 o 766 | 431.888 382.694 o 767 | 459.572 52.2202 o 768 | 487.256 106.33 o 769 | 514.94 102.758 o 770 | grestore 771 | 1.000 setlinewidth 772 | 0 setlinejoin 773 | 2 setlinecap 774 | 0.000 setgray 775 | gsave 776 | 72 388.8 m 777 | 518.4 388.8 l 778 | stroke 779 | grestore 780 | gsave 781 | 518.4 43.2 m 782 | 518.4 388.8 l 783 | stroke 784 | grestore 785 | gsave 786 | 72 43.2 m 787 | 518.4 43.2 l 788 | stroke 789 | grestore 790 | gsave 791 | 72 43.2 m 792 | 72 388.8 l 793 | stroke 794 | grestore 795 | 0.500 setlinewidth 796 | 1 setlinejoin 797 | 0 setlinecap 798 | [1 3] 0 setdash 799 | gsave 800 | 446.4 345.6 72 43.2 clipbox 801 | 72 43.2 m 802 | 72 388.8 l 803 | stroke 804 | grestore 805 | [] 0 setdash 806 | gsave 807 | /o { 808 | gsave 809 | newpath 810 | translate 811 | 0.5 setlinewidth 812 | 1 setlinejoin 813 | 0 setlinecap 814 | 0 0 m 815 | 0 4 l 816 | 817 | gsave 818 | 0.000 setgray 819 | fill 820 | grestore 821 | stroke 822 | grestore 823 | } bind def 824 | 72 43.2 o 825 | grestore 826 | gsave 827 | /o { 828 | gsave 829 | newpath 830 | translate 831 | 0.5 setlinewidth 832 | 1 setlinejoin 833 | 0 setlinecap 834 | 0 0 m 835 | 0 -4 l 836 | 837 | gsave 838 | 0.000 setgray 839 | fill 840 | grestore 841 | stroke 842 | grestore 843 | } bind def 844 | 72 388.8 o 845 | grestore 846 | /BitstreamVeraSans-Roman findfont 847 | 12.000 scalefont 848 | setfont 849 | gsave 850 | 68.179688 30.075000 translate 851 | 0.000000 rotate 852 | 0.000000 0.000000 m /zero glyphshow 853 | grestore 854 | [1 3] 0 setdash 855 | gsave 856 | 446.4 345.6 72 43.2 clipbox 857 | 158.511628 43.2 m 858 | 158.511628 388.8 l 859 | stroke 860 | grestore 861 | [] 0 setdash 862 | gsave 863 | /o { 864 | gsave 865 | newpath 866 | translate 867 | 0.5 setlinewidth 868 | 1 setlinejoin 869 | 0 setlinecap 870 | 0 0 m 871 | 0 4 l 872 | 873 | gsave 874 | 0.000 setgray 875 | fill 876 | grestore 877 | stroke 878 | grestore 879 | } bind def 880 | 158.512 43.2 o 881 | grestore 882 | gsave 883 | /o { 884 | gsave 885 | newpath 886 | translate 887 | 0.5 setlinewidth 888 | 1 setlinejoin 889 | 0 setlinecap 890 | 0 0 m 891 | 0 -4 l 892 | 893 | gsave 894 | 0.000 setgray 895 | fill 896 | grestore 897 | stroke 898 | grestore 899 | } bind def 900 | 158.512 388.8 o 901 | grestore 902 | gsave 903 | 150.871003 30.075000 translate 904 | 0.000000 rotate 905 | 0.000000 0.000000 m /five glyphshow 906 | 7.634766 0.000000 m /zero glyphshow 907 | grestore 908 | [1 3] 0 setdash 909 | gsave 910 | 446.4 345.6 72 43.2 clipbox 911 | 245.023256 43.2 m 912 | 245.023256 388.8 l 913 | stroke 914 | grestore 915 | [] 0 setdash 916 | gsave 917 | /o { 918 | gsave 919 | newpath 920 | translate 921 | 0.5 setlinewidth 922 | 1 setlinejoin 923 | 0 setlinecap 924 | 0 0 m 925 | 0 4 l 926 | 927 | gsave 928 | 0.000 setgray 929 | fill 930 | grestore 931 | stroke 932 | grestore 933 | } bind def 934 | 245.023 43.2 o 935 | grestore 936 | gsave 937 | /o { 938 | gsave 939 | newpath 940 | translate 941 | 0.5 setlinewidth 942 | 1 setlinejoin 943 | 0 setlinecap 944 | 0 0 m 945 | 0 -4 l 946 | 947 | gsave 948 | 0.000 setgray 949 | fill 950 | grestore 951 | stroke 952 | grestore 953 | } bind def 954 | 245.023 388.8 o 955 | grestore 956 | gsave 957 | 233.562318 30.075000 translate 958 | 0.000000 rotate 959 | 0.000000 0.000000 m /one glyphshow 960 | 7.634766 0.000000 m /zero glyphshow 961 | 15.269531 0.000000 m /zero glyphshow 962 | grestore 963 | [1 3] 0 setdash 964 | gsave 965 | 446.4 345.6 72 43.2 clipbox 966 | 331.534884 43.2 m 967 | 331.534884 388.8 l 968 | stroke 969 | grestore 970 | [] 0 setdash 971 | gsave 972 | /o { 973 | gsave 974 | newpath 975 | translate 976 | 0.5 setlinewidth 977 | 1 setlinejoin 978 | 0 setlinecap 979 | 0 0 m 980 | 0 4 l 981 | 982 | gsave 983 | 0.000 setgray 984 | fill 985 | grestore 986 | stroke 987 | grestore 988 | } bind def 989 | 331.535 43.2 o 990 | grestore 991 | gsave 992 | /o { 993 | gsave 994 | newpath 995 | translate 996 | 0.5 setlinewidth 997 | 1 setlinejoin 998 | 0 setlinecap 999 | 0 0 m 1000 | 0 -4 l 1001 | 1002 | gsave 1003 | 0.000 setgray 1004 | fill 1005 | grestore 1006 | stroke 1007 | grestore 1008 | } bind def 1009 | 331.535 388.8 o 1010 | grestore 1011 | gsave 1012 | 320.073946 30.075000 translate 1013 | 0.000000 rotate 1014 | 0.000000 0.000000 m /one glyphshow 1015 | 7.634766 0.000000 m /five glyphshow 1016 | 15.269531 0.000000 m /zero glyphshow 1017 | grestore 1018 | [1 3] 0 setdash 1019 | gsave 1020 | 446.4 345.6 72 43.2 clipbox 1021 | 418.046512 43.2 m 1022 | 418.046512 388.8 l 1023 | stroke 1024 | grestore 1025 | [] 0 setdash 1026 | gsave 1027 | /o { 1028 | gsave 1029 | newpath 1030 | translate 1031 | 0.5 setlinewidth 1032 | 1 setlinejoin 1033 | 0 setlinecap 1034 | 0 0 m 1035 | 0 4 l 1036 | 1037 | gsave 1038 | 0.000 setgray 1039 | fill 1040 | grestore 1041 | stroke 1042 | grestore 1043 | } bind def 1044 | 418.047 43.2 o 1045 | grestore 1046 | gsave 1047 | /o { 1048 | gsave 1049 | newpath 1050 | translate 1051 | 0.5 setlinewidth 1052 | 1 setlinejoin 1053 | 0 setlinecap 1054 | 0 0 m 1055 | 0 -4 l 1056 | 1057 | gsave 1058 | 0.000 setgray 1059 | fill 1060 | grestore 1061 | stroke 1062 | grestore 1063 | } bind def 1064 | 418.047 388.8 o 1065 | grestore 1066 | gsave 1067 | 406.585574 30.075000 translate 1068 | 0.000000 rotate 1069 | 0.000000 0.000000 m /two glyphshow 1070 | 7.634766 0.000000 m /zero glyphshow 1071 | 15.269531 0.000000 m /zero glyphshow 1072 | grestore 1073 | [1 3] 0 setdash 1074 | gsave 1075 | 446.4 345.6 72 43.2 clipbox 1076 | 504.55814 43.2 m 1077 | 504.55814 388.8 l 1078 | stroke 1079 | grestore 1080 | [] 0 setdash 1081 | gsave 1082 | /o { 1083 | gsave 1084 | newpath 1085 | translate 1086 | 0.5 setlinewidth 1087 | 1 setlinejoin 1088 | 0 setlinecap 1089 | 0 0 m 1090 | 0 4 l 1091 | 1092 | gsave 1093 | 0.000 setgray 1094 | fill 1095 | grestore 1096 | stroke 1097 | grestore 1098 | } bind def 1099 | 504.558 43.2 o 1100 | grestore 1101 | gsave 1102 | /o { 1103 | gsave 1104 | newpath 1105 | translate 1106 | 0.5 setlinewidth 1107 | 1 setlinejoin 1108 | 0 setlinecap 1109 | 0 0 m 1110 | 0 -4 l 1111 | 1112 | gsave 1113 | 0.000 setgray 1114 | fill 1115 | grestore 1116 | stroke 1117 | grestore 1118 | } bind def 1119 | 504.558 388.8 o 1120 | grestore 1121 | gsave 1122 | 493.097202 30.075000 translate 1123 | 0.000000 rotate 1124 | 0.000000 0.000000 m /two glyphshow 1125 | 7.634766 0.000000 m /five glyphshow 1126 | 15.269531 0.000000 m /zero glyphshow 1127 | grestore 1128 | /BitstreamVeraSans-Roman findfont 1129 | 20.000 scalefont 1130 | setfont 1131 | gsave 1132 | 202.817187 7.371875 translate 1133 | 0.000000 rotate 1134 | 0.000000 0.000000 m /numbersign glyphshow 1135 | 16.757812 0.000000 m /space glyphshow 1136 | 23.115234 0.000000 m /o glyphshow 1137 | 35.351562 0.000000 m /f glyphshow 1138 | 42.392578 0.000000 m /space glyphshow 1139 | 48.750000 0.000000 m /A glyphshow 1140 | 62.431641 0.000000 m /c glyphshow 1141 | 73.427734 0.000000 m /c glyphshow 1142 | 84.423828 0.000000 m /e glyphshow 1143 | 96.728516 0.000000 m /s glyphshow 1144 | 107.148438 0.000000 m /s glyphshow 1145 | 117.568359 0.000000 m /space glyphshow 1146 | 123.925781 0.000000 m /P glyphshow 1147 | 135.986328 0.000000 m /o glyphshow 1148 | 148.222656 0.000000 m /i glyphshow 1149 | 153.779297 0.000000 m /n glyphshow 1150 | 166.455078 0.000000 m /t glyphshow 1151 | 174.296875 0.000000 m /s glyphshow 1152 | grestore 1153 | [1 3] 0 setdash 1154 | gsave 1155 | 446.4 345.6 72 43.2 clipbox 1156 | 72 43.2 m 1157 | 518.4 43.2 l 1158 | stroke 1159 | grestore 1160 | [] 0 setdash 1161 | gsave 1162 | /o { 1163 | gsave 1164 | newpath 1165 | translate 1166 | 0.5 setlinewidth 1167 | 1 setlinejoin 1168 | 0 setlinecap 1169 | 0 0 m 1170 | 4 0 l 1171 | 1172 | gsave 1173 | 0.000 setgray 1174 | fill 1175 | grestore 1176 | stroke 1177 | grestore 1178 | } bind def 1179 | 72 43.2 o 1180 | grestore 1181 | gsave 1182 | /o { 1183 | gsave 1184 | newpath 1185 | translate 1186 | 0.5 setlinewidth 1187 | 1 setlinejoin 1188 | 0 setlinecap 1189 | 0 0 m 1190 | -4 0 l 1191 | 1192 | gsave 1193 | 0.000 setgray 1194 | fill 1195 | grestore 1196 | stroke 1197 | grestore 1198 | } bind def 1199 | 518.4 43.2 o 1200 | grestore 1201 | /BitstreamVeraSans-Roman findfont 1202 | 12.000 scalefont 1203 | setfont 1204 | gsave 1205 | 60.359375 39.887500 translate 1206 | 0.000000 rotate 1207 | 0.000000 0.000000 m /zero glyphshow 1208 | grestore 1209 | [1 3] 0 setdash 1210 | gsave 1211 | 446.4 345.6 72 43.2 clipbox 1212 | 72 100.8 m 1213 | 518.4 100.8 l 1214 | stroke 1215 | grestore 1216 | [] 0 setdash 1217 | gsave 1218 | /o { 1219 | gsave 1220 | newpath 1221 | translate 1222 | 0.5 setlinewidth 1223 | 1 setlinejoin 1224 | 0 setlinecap 1225 | 0 0 m 1226 | 4 0 l 1227 | 1228 | gsave 1229 | 0.000 setgray 1230 | fill 1231 | grestore 1232 | stroke 1233 | grestore 1234 | } bind def 1235 | 72 100.8 o 1236 | grestore 1237 | gsave 1238 | /o { 1239 | gsave 1240 | newpath 1241 | translate 1242 | 0.5 setlinewidth 1243 | 1 setlinejoin 1244 | 0 setlinecap 1245 | 0 0 m 1246 | -4 0 l 1247 | 1248 | gsave 1249 | 0.000 setgray 1250 | fill 1251 | grestore 1252 | stroke 1253 | grestore 1254 | } bind def 1255 | 518.4 100.8 o 1256 | grestore 1257 | gsave 1258 | 45.078125 97.487500 translate 1259 | 0.000000 rotate 1260 | 0.000000 0.000000 m /five glyphshow 1261 | 7.634766 0.000000 m /zero glyphshow 1262 | 15.269531 0.000000 m /zero glyphshow 1263 | grestore 1264 | [1 3] 0 setdash 1265 | gsave 1266 | 446.4 345.6 72 43.2 clipbox 1267 | 72 158.4 m 1268 | 518.4 158.4 l 1269 | stroke 1270 | grestore 1271 | [] 0 setdash 1272 | gsave 1273 | /o { 1274 | gsave 1275 | newpath 1276 | translate 1277 | 0.5 setlinewidth 1278 | 1 setlinejoin 1279 | 0 setlinecap 1280 | 0 0 m 1281 | 4 0 l 1282 | 1283 | gsave 1284 | 0.000 setgray 1285 | fill 1286 | grestore 1287 | stroke 1288 | grestore 1289 | } bind def 1290 | 72 158.4 o 1291 | grestore 1292 | gsave 1293 | /o { 1294 | gsave 1295 | newpath 1296 | translate 1297 | 0.5 setlinewidth 1298 | 1 setlinejoin 1299 | 0 setlinecap 1300 | 0 0 m 1301 | -4 0 l 1302 | 1303 | gsave 1304 | 0.000 setgray 1305 | fill 1306 | grestore 1307 | stroke 1308 | grestore 1309 | } bind def 1310 | 518.4 158.4 o 1311 | grestore 1312 | gsave 1313 | 37.437500 155.087500 translate 1314 | 0.000000 rotate 1315 | 0.000000 0.000000 m /one glyphshow 1316 | 7.634766 0.000000 m /zero glyphshow 1317 | 15.269531 0.000000 m /zero glyphshow 1318 | 22.904297 0.000000 m /zero glyphshow 1319 | grestore 1320 | [1 3] 0 setdash 1321 | gsave 1322 | 446.4 345.6 72 43.2 clipbox 1323 | 72 216 m 1324 | 518.4 216 l 1325 | stroke 1326 | grestore 1327 | [] 0 setdash 1328 | gsave 1329 | /o { 1330 | gsave 1331 | newpath 1332 | translate 1333 | 0.5 setlinewidth 1334 | 1 setlinejoin 1335 | 0 setlinecap 1336 | 0 0 m 1337 | 4 0 l 1338 | 1339 | gsave 1340 | 0.000 setgray 1341 | fill 1342 | grestore 1343 | stroke 1344 | grestore 1345 | } bind def 1346 | 72 216 o 1347 | grestore 1348 | gsave 1349 | /o { 1350 | gsave 1351 | newpath 1352 | translate 1353 | 0.5 setlinewidth 1354 | 1 setlinejoin 1355 | 0 setlinecap 1356 | 0 0 m 1357 | -4 0 l 1358 | 1359 | gsave 1360 | 0.000 setgray 1361 | fill 1362 | grestore 1363 | stroke 1364 | grestore 1365 | } bind def 1366 | 518.4 216 o 1367 | grestore 1368 | gsave 1369 | 37.437500 212.687500 translate 1370 | 0.000000 rotate 1371 | 0.000000 0.000000 m /one glyphshow 1372 | 7.634766 0.000000 m /five glyphshow 1373 | 15.269531 0.000000 m /zero glyphshow 1374 | 22.904297 0.000000 m /zero glyphshow 1375 | grestore 1376 | [1 3] 0 setdash 1377 | gsave 1378 | 446.4 345.6 72 43.2 clipbox 1379 | 72 273.6 m 1380 | 518.4 273.6 l 1381 | stroke 1382 | grestore 1383 | [] 0 setdash 1384 | gsave 1385 | /o { 1386 | gsave 1387 | newpath 1388 | translate 1389 | 0.5 setlinewidth 1390 | 1 setlinejoin 1391 | 0 setlinecap 1392 | 0 0 m 1393 | 4 0 l 1394 | 1395 | gsave 1396 | 0.000 setgray 1397 | fill 1398 | grestore 1399 | stroke 1400 | grestore 1401 | } bind def 1402 | 72 273.6 o 1403 | grestore 1404 | gsave 1405 | /o { 1406 | gsave 1407 | newpath 1408 | translate 1409 | 0.5 setlinewidth 1410 | 1 setlinejoin 1411 | 0 setlinecap 1412 | 0 0 m 1413 | -4 0 l 1414 | 1415 | gsave 1416 | 0.000 setgray 1417 | fill 1418 | grestore 1419 | stroke 1420 | grestore 1421 | } bind def 1422 | 518.4 273.6 o 1423 | grestore 1424 | gsave 1425 | 37.437500 270.287500 translate 1426 | 0.000000 rotate 1427 | 0.000000 0.000000 m /two glyphshow 1428 | 7.634766 0.000000 m /zero glyphshow 1429 | 15.269531 0.000000 m /zero glyphshow 1430 | 22.904297 0.000000 m /zero glyphshow 1431 | grestore 1432 | [1 3] 0 setdash 1433 | gsave 1434 | 446.4 345.6 72 43.2 clipbox 1435 | 72 331.2 m 1436 | 518.4 331.2 l 1437 | stroke 1438 | grestore 1439 | [] 0 setdash 1440 | gsave 1441 | /o { 1442 | gsave 1443 | newpath 1444 | translate 1445 | 0.5 setlinewidth 1446 | 1 setlinejoin 1447 | 0 setlinecap 1448 | 0 0 m 1449 | 4 0 l 1450 | 1451 | gsave 1452 | 0.000 setgray 1453 | fill 1454 | grestore 1455 | stroke 1456 | grestore 1457 | } bind def 1458 | 72 331.2 o 1459 | grestore 1460 | gsave 1461 | /o { 1462 | gsave 1463 | newpath 1464 | translate 1465 | 0.5 setlinewidth 1466 | 1 setlinejoin 1467 | 0 setlinecap 1468 | 0 0 m 1469 | -4 0 l 1470 | 1471 | gsave 1472 | 0.000 setgray 1473 | fill 1474 | grestore 1475 | stroke 1476 | grestore 1477 | } bind def 1478 | 518.4 331.2 o 1479 | grestore 1480 | gsave 1481 | 37.437500 327.887500 translate 1482 | 0.000000 rotate 1483 | 0.000000 0.000000 m /two glyphshow 1484 | 7.634766 0.000000 m /five glyphshow 1485 | 15.269531 0.000000 m /zero glyphshow 1486 | 22.904297 0.000000 m /zero glyphshow 1487 | grestore 1488 | [1 3] 0 setdash 1489 | gsave 1490 | 446.4 345.6 72 43.2 clipbox 1491 | 72 388.8 m 1492 | 518.4 388.8 l 1493 | stroke 1494 | grestore 1495 | [] 0 setdash 1496 | gsave 1497 | /o { 1498 | gsave 1499 | newpath 1500 | translate 1501 | 0.5 setlinewidth 1502 | 1 setlinejoin 1503 | 0 setlinecap 1504 | 0 0 m 1505 | 4 0 l 1506 | 1507 | gsave 1508 | 0.000 setgray 1509 | fill 1510 | grestore 1511 | stroke 1512 | grestore 1513 | } bind def 1514 | 72 388.8 o 1515 | grestore 1516 | gsave 1517 | /o { 1518 | gsave 1519 | newpath 1520 | translate 1521 | 0.5 setlinewidth 1522 | 1 setlinejoin 1523 | 0 setlinecap 1524 | 0 0 m 1525 | -4 0 l 1526 | 1527 | gsave 1528 | 0.000 setgray 1529 | fill 1530 | grestore 1531 | stroke 1532 | grestore 1533 | } bind def 1534 | 518.4 388.8 o 1535 | grestore 1536 | gsave 1537 | 37.437500 385.487500 translate 1538 | 0.000000 rotate 1539 | 0.000000 0.000000 m /three glyphshow 1540 | 7.634766 0.000000 m /zero glyphshow 1541 | 15.269531 0.000000 m /zero glyphshow 1542 | 22.904297 0.000000 m /zero glyphshow 1543 | grestore 1544 | /BitstreamVeraSans-Roman findfont 1545 | 20.000 scalefont 1546 | setfont 1547 | gsave 1548 | 28.281250 118.640625 translate 1549 | 90.000000 rotate 1550 | 0.000000 0.000000 m /t glyphshow 1551 | 7.841797 0.000000 m /i glyphshow 1552 | 13.398438 0.000000 m /m glyphshow 1553 | 32.880859 0.000000 m /e glyphshow 1554 | 45.185547 0.000000 m /space glyphshow 1555 | 51.542969 0.000000 m /r glyphshow 1556 | 59.765625 0.000000 m /e glyphshow 1557 | 72.070312 0.000000 m /s glyphshow 1558 | 82.490234 0.000000 m /p glyphshow 1559 | 95.185547 0.000000 m /o glyphshow 1560 | 107.421875 0.000000 m /n glyphshow 1561 | 120.097656 0.000000 m /s glyphshow 1562 | 130.517578 0.000000 m /e glyphshow 1563 | 142.822266 0.000000 m /space glyphshow 1564 | 149.179688 0.000000 m /parenleft glyphshow 1565 | 156.982422 0.000000 m /m glyphshow 1566 | 176.464844 0.000000 m /s glyphshow 1567 | 186.884766 0.000000 m /parenright glyphshow 1568 | grestore 1569 | 1.000 setlinewidth 1570 | [1 3] 0 setdash 1571 | 1.000 0.000 0.000 setrgbcolor 1572 | gsave 1573 | 81.8 377.459375 m 1574 | 101.4 377.459375 l 1575 | stroke 1576 | grestore 1577 | 0.500 setlinewidth 1578 | 2 setlinejoin 1579 | [] 0 setdash 1580 | gsave 1581 | /o { 1582 | gsave 1583 | newpath 1584 | translate 1585 | 0.5 setlinewidth 1586 | 2 setlinejoin 1587 | 0 setlinecap 1588 | 0 2.5 m 1589 | -0.561285 0.772542 l 1590 | -2.377641 0.772542 l 1591 | -0.908178 -0.295085 l 1592 | -1.469463 -2.022542 l 1593 | -0 -0.954915 l 1594 | 1.469463 -2.022542 l 1595 | 0.908178 -0.295085 l 1596 | 2.377641 0.772542 l 1597 | 0.561285 0.772542 l 1598 | cl 1599 | 1600 | gsave 1601 | 1.000 0.000 0.000 setrgbcolor 1602 | fill 1603 | grestore 1604 | stroke 1605 | grestore 1606 | } bind def 1607 | 81.8 377.459 o 1608 | 101.4 377.459 o 1609 | grestore 1610 | 0.000 setgray 1611 | /BitstreamVeraSans-Roman findfont 1612 | 14.000 scalefont 1613 | setfont 1614 | gsave 1615 | 116.800000 372.559375 translate 1616 | 0.000000 rotate 1617 | 0.000000 0.000000 m /O glyphshow 1618 | 11.019531 0.000000 m /V glyphshow 1619 | 20.596680 0.000000 m /S glyphshow 1620 | 29.483398 0.000000 m /space glyphshow 1621 | 33.933594 0.000000 m /A glyphshow 1622 | 43.510742 0.000000 m /P glyphshow 1623 | grestore 1624 | 1.000 setlinewidth 1625 | 1 setlinejoin 1626 | 2 setlinecap 1627 | 0.000 0.502 0.000 setrgbcolor 1628 | gsave 1629 | 81.8 356.9125 m 1630 | 101.4 356.9125 l 1631 | stroke 1632 | grestore 1633 | 0.500 setlinewidth 1634 | 0 setlinecap 1635 | gsave 1636 | /o { 1637 | gsave 1638 | newpath 1639 | translate 1640 | 0.5 setlinewidth 1641 | 1 setlinejoin 1642 | 0 setlinecap 1643 | -2.5 -2.5 m 1644 | 2.5 2.5 l 1645 | -2.5 2.5 m 1646 | 2.5 -2.5 l 1647 | 1648 | gsave 1649 | 0.000 0.502 0.000 setrgbcolor 1650 | fill 1651 | grestore 1652 | stroke 1653 | grestore 1654 | } bind def 1655 | 81.8 356.913 o 1656 | 101.4 356.913 o 1657 | grestore 1658 | 0.000 setgray 1659 | gsave 1660 | 116.800000 352.012500 translate 1661 | 0.000000 rotate 1662 | 0.000000 0.000000 m /U glyphshow 1663 | 10.247070 0.000000 m /s glyphshow 1664 | 17.541016 0.000000 m /e glyphshow 1665 | 26.154297 0.000000 m /r glyphshow 1666 | 31.910156 0.000000 m /space glyphshow 1667 | 36.360352 0.000000 m /A glyphshow 1668 | 45.937500 0.000000 m /P glyphshow 1669 | grestore 1670 | 1671 | end 1672 | showpage 1673 | --------------------------------------------------------------------------------