Upload
manoj-kumar-g
View
84
Download
2
Embed Size (px)
DESCRIPTION
Simulation of ns2
Citation preview
Part I: NSPart I: NS2 2 BasicsBasicsPart I: NSPart I: NS2 2 BasicsBasics
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.1
Simulation of Computer NetworksSimulation of Computer NetworksSimulation of Computer NetworksSimulation of Computer Networks
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.2
Outline• Computer NetworksComputer Networks• Network Simulation
E l• Example• Summaryy
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.3
• Computer + NetworkingComputer Networks
Computer + Networking
Networking
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.4
Computer Networks• Generally there are so many tasksGenerally, there are so many tasks• Layering Concept: Separate
functionalityfunctionality– OSI Model - TCP/IP Model
SessionPresentationApplication
Application
NetworkTransportSession
NetworkTransport
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.PhysicalData Link
PhysicalData Link
5
Outline• Computer NetworksComputer Networks• Network Simulation
E l• Example• Summaryy
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.6
A Study of Computer Networks• Suppose you devise a great protocol Suppose you devise a great protocol.
How do you show that it’s great?Study approaches:• Study approaches:– Experiment: Put all routers together
and let people use themand let people use them– Mathematic model: Model routers using
a graph theorya graph theory– Simulation: Use programming (e.g., C++
or NS2) to represent routersTextbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
or NS2) to represent routers
7
A Study of Computer NetworksPros ConsPros Cons
Experiment Realistic Expensive/ E p r m nt a st c E p ns / Sometime not possible
M th ti I i ht N d t k Mathematic Model
Insight Need to make assumptions
Si l ti E (Ch ) N t h i i ht Simulation •Easy (Cheap)•Used for verification
Not much insight, sometimes need to make
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
assumption
8
Simulation: Overview• Platform: Hardware Software or HybridPlatform: Hardware, Software, or Hybrid
• Developer: Commercial or In-house• Developer: Commercial or In-house
• Source code: Open or close• Source code: Open or close
P di m: Tim d p nd nt/n n tim• Paradigm: Time-dependent/non-time-dependent; Time-driven/Event-driven
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.9
Simulation: Overview• Dimension of simulation performanceDimension of simulation performance
– Execution speed– Scalability
Fid lit– Fidelity– Cost
• Physical Layer: y y– Simulate channel models, BER, PER, etc.– Matlab, LabView, ADS, SPD
• Network Layer• Network Layer– Free: NS2, GloMoSim– Commercial: Opnet, QualNet
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.10
Time-Dependent Simulation• Most commonly-usedMost commonly-used• Simulation proceeds chronologically.
T i • Two main types:1. Time-Driven Simulation2. Event-Driven Simulation
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.11
Time-Driven Simulation• Observe the system at a fixed interval.Observe the system at a fixed interval.• Event occurs within an interval is assumed to
occur at the end of the interval• Suppose an interval = seconds. Then the
simulation proceeds as follows:
– a,b,c,d are events– a is assume to occurred at t= 2– b,c are assume to occurred at t=( 5 )
• The simulation finishes at a pre specified timeTextbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
• The simulation finishes at a pre-specified time.
12
Event-Driven Simulation• Observe every event.
• Each event provide a reference to the next event (e.g., using pointer)
Next_eventa
Next_eventb
Next_eventc
• Simulation finishes– At a pre-specified time
Wh th i t
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
– When there is no more event
13
Outline• Computer NetworksComputer Networks• Network Simulation
E l• Example• Summaryy
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.14
Example: Queuing System
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.15
Example: Queuing System
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.16
Example: Queuing System
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.17
Example: Queuing System
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.18
Outline• Computer NetworksComputer Networks• Network Simulation
E l• Example• Summaryy
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.19
Summary• Computer Networks = Computer + Computer Networks = Computer +
Networking• A Study of Computer NetworksA Study of Computer Networks
– Experimental– Mathematical Model– Simulation
• Time-Dependent Simulation– Time-Driven Simulation– Event-Driven Simulation
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.
• Example: A queuing system20
Additional Reading• W T Kasch J R Ward and J W. T. Kasch, J. R. Ward, and J.
Andrusenko, “Wireless Network Modeling and Simulation Tools for Designers and gDevelopers,” IEEE Communication Magazine, vol. 47, no. 3, pp. 120-127, Mar. 2009 2009,
Textbook: T. Issariyakul and E. Hossain, Introduction to Network Simulator NS2, Springer 2008.21