ITTC
© James P.G. Sterbenz
Mobile Wireless Networking
The University of Kansas EECS 882 MANET Routing 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
jpgs@eecs.ku.edu
http://www.ittc.ku.edu/~jpgs/courses/mwnets
11 April 2016
rev. 16.0
© 2004–2016 James P.G. Sterbenz
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in ns-3
Outline
SR.1 Overview of MANETs in ns-3 SR.2 Ad hoc routing examples SR.3 Laboratory assignment
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-2
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in ns-3
Overview of MANETs in ns-3
SR.1 Overview of MANETs in ns-3
SR.2 Ad hoc routing examples SR.3 Laboratory assignment
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-3
ITTC
© James P.G. Sterbenz
Mobile Ad Hoc Networks
Overview
• MANETs are typically – wireless
– mobile
– little or no reliance on infrastructure – communication among peers
– limited network resources
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-4
ITTC
© James P.G. Sterbenz
Network Layer
Services and Functions
• Network layer provides services to layer 4 • Link layer provides services to layer 3
• Network layer operates both HBH and E2E
• Network layer functions are: – forwarding
– routing
– signalling
– addressing
– traffic management
• In MANETs are all of these functions available?
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-5
ITTC
© James P.G. Sterbenz
Routing in ns-3
Routing Protocols for Wired Links
• Global centralized routing
– based on shortest path first algorithm
– only for wired links (PPP and CSMA)
• wireless nodes can use, but does not consider medium effects
– unicast
– GlobalRouter interface in each node advertises LSA – each node has a routing table
• Nix-vector routing
– intended for large topologies
– targeted for simulations with wired links
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-6
ITTC
© James P.G. Sterbenz
Routing in ns-3
MANET Routing Protocols in ns-3
• AODV: ad-hoc on demand distance vector – based on RFC 3561
• DSDV: destination-sequenced distance vector
– developed by Hemanth Narra and Yufei Cheng @ ResiliNets
• DSR: dynamic source routing
– developed by Yufei Cheng @ ResiliNets
• OLSR: optimised link state routing – mostly compliant with RFC 3626
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-7
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in ns-3
Ad Hoc Routing Examples
SR.1 Overview of MANETs in ns-3
SR.2 Ad hoc routing examples
SR.3 Laboratory assignment
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-8
ITTC
© James P.G. Sterbenz
Ad Hoc Routing Examples
Global Routing in ns-3
• Global centralized routing
– by default added to node by InternetStackHelper
– Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-9
ITTC
© James P.G. Sterbenz
Ad Hoc Routing Examples
OLSR in ns-3
• OLSR routing
OlsrHelper olsr;
Ipv4StaticRoutingHelper staticRouting;
Ipv4ListRoutingHelper list;
list.Add (staticRouting, 0);
list.Add (olsr, 10);
InternetStackHelper internet;
internet.SetRoutingHelper (list);
internet.Install (nodes);
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-10
ITTC
© James P.G. Sterbenz
Ad Hoc Routing Examples
AODV in ns-3
• AODV routing
AodvHelper aodv;
InternetStackHelper stack; stack.SetRoutingHelper (aodv); stack.Install (nodes);
Ipv4AddressHelper address;
address.SetBase (“10.0.0.0”, “255.0.0.0”); interfaces = address.Assign (devices);
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-11
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in ns-3
Laboratory Assignment
SR.1 Overview of MANETs in ns-3 SR.2 Ad hoc routing examples SR.3 Laboratory assignment
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-12
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in ns-3
Assignment Configuration1
• Only 4 STA nodes – in ad-hoc mode
• Default physical and channel characteristics
– optional: add propagation and loss model of your choice
• Non-QoS MAC with default configuration • CBR traffic
• IP address block of your choice
• EnableASCIItracing
– for all IPv4 interfaces (EnableAsciiIpv4All) and mobility
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-13
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in ns-3
Assignment Configuration2
• MobilitymodeltouseGaussMarkovMobilityModel – with default values in 2D
• only x and y coordinates
– set initial positions randomly
• Routing:DSDV
– with default values
• Submission deadline: 25 April 2016
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-14
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in ns-3
Extra Credit
• Using the same DSDV configuration, except: – use DSR routing protocol
• Briefly contrast the two routing models…
• … from a simulation point of view
– advantages/disadvantages?
– easiness/difficulty?
– briefly compare in few sentences (open question)
– answer it only if you are sending the DSR simulation model • will not grade pure theoretical answers
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-15
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in ns-3
Assignment Submission Guidelines
• Write 1–2 page summary
• Report should include the following sections:
– experiment setup and procedure (topology, issues, etc.) – conclusions (what you learned, etc.)
• You can discuss with other students but … … everyone must submit individual report
• Attach .cc file along with your submission
• SendreportinPDFto:GTAandcc:Dr.Sterbenz
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-16
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in 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
• Alwaysto:GTAandcc: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
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-17
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in 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: 24 October 2011 – Version: 1 */
– #include
• Use comments for block of codes:
– // This is an example comment for a block of code
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-18
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in ns-3
Further Reading
• Finish all tutorial chapters (if you haven’t yet)
http://www.nsnam.org/docs/release/3.25/tutorial/singlehtml/index.html http://www.nsnam.org/docs/release/3.25/manual/singlehtml/index.html http://www.nsnam.org/docs/release/3.25/models/singlehtml/index.html http://www.nsnam.org/docs/release/3.25/doxygen/index.html
• AODV API
http://www.nsnam.org/docs/release/3.25/doxygen/group__aodv.html http://www.nsnam.org/docs/release/3.25/models/singlehtml/index.html#document-aodv
• DSDV API
http://www.nsnam.org/docs/release/3.25/doxygen/group__dsdv.html http://www.nsnam.org/docs/release/3.25/models/singlehtml/index.html#document-dsdv
• OLSR API
http://www.nsnam.org/docs/release/3.25/doxygen/group__olsr.html http://www.nsnam.org/docs/release/3.25/models/singlehtml/index.html#document-olsr
• DSR API
http://www.nsnam.org/docs/release/3.25/doxygen/group__dsr.html
http://www.nsnam.org/docs/release/3.25/models/singlehtml/index.html#document-dsr
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-19
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in 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
• Hemanth Narra, Yufei Cheng, Egemen K. Çetinkaya, Justin P. Rohrer, and James P.G. Sterbenz, “Destination-Sequenced Distance Vector (DSDV) Routing Protocol Implementation in ns-3” in ICST WNS3, Barcelona, March 2011
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-20
ITTC
© James P.G. Sterbenz
Ad Hoc Routing in 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/
11 April 2016 KU EECS 882 – Mobile Wireless Nets – MANET Routing Simulation MWN-SR-21