+ All Categories
Home > Documents > ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based...

ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based...

Date post: 23-May-2018
Category:
Upload: vantruc
View: 215 times
Download: 2 times
Share this document with a friend
22
© James P.G. Sterbenz ITTC 30 March 2016 © 2004–2016 James P.G. Sterbenz rev. 16.0 Mobile Wireless Networking The University of Kansas EECS 882 Wireless Network Simulation with ns-3 Anh Nguyễn, Egemen K. Çetinkaya, James P.G. Sterbenz Department of Electrical Engineering & Computer Science Information Technology & Telecommunications Research Center The University of Kansas [email protected] http://www.ittc.ku.edu/~jpgs/courses/mwnets
Transcript
Page 1: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 © 2004–2016 James P.G. Sterbenz rev. 16.0

Mobile Wireless Networking The University of Kansas EECS 882

Wireless Network Simulation with ns-3

Anh Nguyễn, Egemen K. Çetinkaya,

James P.G. Sterbenz

Department of Electrical Engineering & Computer Science Information Technology & Telecommunications Research Center

The University of Kansas

[email protected]

http://www.ittc.ku.edu/~jpgs/courses/mwnets

Page 2: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-2

Wireless Simulation with ns-3 Outline

SW.1 Overview of ns-3 wireless network simulations SW.2 Wireless network simulation example SW.3 Laboratory assignment

Page 3: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-3

Wireless Simulation with ns-3 Overview

SW.1 Overview of ns-3 wireless network simulations SW.2 Wireless network simulation example SW.3 Laboratory assignment

Page 4: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-4

Overview of ns-3 Wireless Simulation Characteristics of Wireless Networks

• Network links are constructed on different mediums – wired – wireless

• Wireless nodes operate untethered – assuming they have power

• Wireless nodes may be mobile – need to choose a mobility model for the simulation needs – more about mobility models in the next lecture

Page 5: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-5

Overview of ns-3 Wireless Simulation Wireless Network Models in ns-3

• Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure or ad-hoc modes – QoS or non-QoS modes

• There are several physical layer models – propagation loss models: Friis, random, etc. – propagation delay models: speed based, random

• WiMAX and LTE modules available • Various mobility models: RWP etc. (next lecture) • More on MANET routing protocols in coming weeks

Page 6: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-6

Overview of ns-3 Wireless Simulation Layered View of ns-3 Wireless Models

• Mobility models affect L1→L3 in ns-3

• Wireless models in ns-3 deal with layer 2 and layer 1 – MAC high – MAC low – physical

physical MAC

link

network

transport

session

application

L1

L7

L5

L4

L3

L2

L2–

data plane control plane

p l a n e

management

social L8

virtual link L2.5

m o b i l i t y

Page 7: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-7

Overview of ns-3 Wireless Simulation Script Structure

• C++ scripts include the following structure – boilerplate: important for documentation – module includes: include header files – ns-3 namespace: global declaration – logging: optional – main function: declare main function – topology helpers: objects to combine distinct operations

• nodes → channels → devices → mobility → L3 → L5

– applications: on/off application, UdpEchoClient/Server – tracing: .tr and/or .pcap files – simulator: start/end simulator, cleanup

Page 8: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-8

Overview of ns-3 Wireless Simulation Wireless Network Construction in ns-3

• Create type of nodes – stations – access points

• Create physical layer and channel, and associate • Create MAC layer characteristics for node types

– QoS or non-QoS – assign Service Set IDentifier (SSID) – and other MAC related attributes

• Install devices to nodes • Set-up mobility models • Configure Internet stack, application, routing models

Page 9: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-9

Wireless Simulation with ns-3 Wireless Network Simulation Example

SW.1 Overview of ns-3 wireless network simulations SW.2 Wireless network simulation example SW.3 Laboratory assignment

Page 10: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-10

Network Simulation Example Wireless Network Simulation Setup

• Example is at examples/tutorial/third.cc – focus of this presentation is wireless configuration

• Network topology consists of: – wireless nodes/links:

• 3 STA nodes • 1 AP node • 802.11 links, non-QoS mode, beaconing enabled

– wired nodes: • 2 nodes connected via PPP link • 4 nodes on a CSMA LAN

• Application: UdpEchoServer – server on CSMA subnetwork, client on a STA node

Page 11: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-11

Network Simulation Example third.cc Script1

• NodeContainer class, create method – NodeContainer wifiStaNodes; – wifiStaNodes.Create (nWifi); – NodeContainer wifiApNode = p2pNodes.Get (0);

• Set WifiChannel and WifiPhy – YansWifiChannelHelper channel =

YansWifiChannelHelper::Default (); – YansWifiPhyHelper phy =

YansWifiPhyHelper::Default ();

• Associate channel and PHY – phy.SetChannel (channel.Create ());

Page 12: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-12

Network Simulation Example third.cc Script2

• Configure MAC layer – WifiHelper wifi = WifiHelper::Default (); – wifi.SetRemoteStationManager

("ns3::AarfWifiManager"); – NqosWifiMacHelper mac =

NqosWifiMacHelper::Default (); – Ssid ssid = Ssid ("ns-3-ssid"); – mac.SetType ("ns3::NqstaWifiMac", "Ssid",

SsidValue (ssid), "ActiveProbing", BooleanValue (false));

Page 13: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-13

Network Simulation Example third.cc Script3

• Install MAC layer properties to the devices – NetDeviceContainer staDevices; – staDevices = wifi.Install (phy, mac,

wifiStaNodes);

• Install mobility models to nodes – mobility.SetMobilityModel

("ns3::ConstantPositionMobilityModel"); – mobility.Install (wifiApNode);

Page 14: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-14

Wireless Simulation with ns-3 Laboratory Assignment

SW.1 Overview of ns-3 wireless network simulations SW.2 Wireless network simulation example SW.3 Laboratory assignment

Page 15: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-15

Wireless Simulation with ns-3 Assignment Configuration

• Only 4 STA nodes, 1 AP node – infrastructure mode – no wired links → this means no CSMA, no PPP links

• Non-QoS MAC • Enable ASCII and PCAP tracing on all interfaces • Application

– from STA 2 to STA 4 – UdpEchoServer on port 70

• Rest of the attribute values: use from the example – IP address assignment – mobility models

Page 16: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-16

Wireless Simulation with ns-3 Extra Credit

• Use WiMAX examples in the folder: – ../ns-3.25/src/wimax/examples

• Generate a topology with – 1 base station – 4 subscriber stations

• Simple scheduling, simple channel, default values • Use your choice of IP addresses and other attributes • Enable ASCII and PCAP tracing • Properly block comment your code • Delete unnecessary lines and simplify

Page 17: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-17

Wireless Simulation with ns-3 Assignment Submission Guidelines

• Write 1–2 page summary • Report should include the following sections:

– experiment setup and procedure (topology, issues, etc.) – results and answer the following question

• first 10 lines of tcpdump output of any .pcap file • does app. data from src to dst go through AP? Why?

– conclusions (what you learned, etc.)

• You can discuss with other students but … … everyone must submit individual report • Attach .cc file along with your submission • Send report in PDF to: GTA and cc: Dr. Sterbenz

Page 18: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-18

Wireless Simulation with ns-3 EECS 882 Assignment Submission Guidelines

• Send only source files (.cc, .pl, .pdf, etc.) – this means no .zip, zipped, .tar files – no reason to send trace files

• Always to: GTA and cc: Dr. Sterbenz • Brownie points for identifying and fixing ns-3 bugs • ns-3 scripts will be graded based on

– functionality • major grade will be deducted for errors!!! • warnings will reduce your grade as well

– documentation • use sensible file names: e.g. lab1_ikus.cc

Page 19: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-19

Wireless Simulation with ns-3 EECS 882 Commenting Guidelines

• Use comments as necessary: – Boilerplate... (optional) – //GNU release blah ... – /* File name: lab1_ikus.cc – Purpose: This is a sample script etc. – Author: Ima KU Student – Date: 19 September 2011 – Version: 1 */ – #include <iostream.h>

• Use comments for block of codes: – // This is an example comment for a block of code

Page 20: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-20

Wireless Simulation with ns-3 Further Reading

• ns-3 main page (for documents, news, announcements) http://www.nsnam.org/

• ns-3 wiki (howtos, roadmap) http://www.nsnam.org/wiki/index.php/Main_Page

• Finish all tutorial chapters http://www.nsnam.org/docs/release/3.12/tutorial/singlehtml/index.html http://www.nsnam.org/docs/release/3.12/manual/singlehtml/index.html http://www.nsnam.org/docs/release/3.12/models/singlehtml/index.html http://www.nsnam.org/docs/release/3.12/doxygen/index.html

• ns-3 users mailing list (usage, implementations, discussions) http://groups.google.com/group/ns-3-users

• ns-3 bug list (closed, open bugs) http://www.nsnam.org/bugzilla/

Page 21: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-21

Wireless Simulation with ns-3 Acknowledgements

Some material in these foils comes from the ns-3 tutorial presentations from conferences, workshops:

• Tom Henderson, ns-3 tutorial SIMUTools 2009 http://www.nsnam.org/tutorials.html

• Gustavo Carneiro, NS-3 Tutorial RTCM 2009 http://telecom.inescporto.pt/~gjc/NS-3-RTCM.pdf

Page 22: ITTC © James P.G. Sterbenz Mobile Wireless Networking ·  · 2016-03-30•Currently 802.11 based wireless models supported – 802.11a, 802.11b, 802.11g, 802.11e, 802.11s – infrastructure

© James P.G. Sterbenz ITTC

30 March 2016 KU EECS 882 – Mobile Wireless Nets – Wireless Simulation MWN-SW-22

Wireless Simulation with ns-3 Other References

• C++ tutorials online – http://www.cplusplus.com/doc/tutorial/ – and many more links and books on the subject

• GDB – http://www.gnu.org/software/gdb/

• valgrind – http://valgrind.org/

• gnuplot – http://www.gnuplot.info/

• Python – http://www.python.org/


Recommended