Communication Networks Simulation of Communication Networks Silvia Krug 01.02.2016
Contents 1 Motivation 2 Definition 3 Simulation Environments 4 Simulation 5 Tool Examples
Motivation So far: Different communication systems Components Protocols, services Working Principles Protocol and Service specification Finite State Machines Message Sequence Charts But: no Implementation or Evaluation Simulation of nodes / networks Performance metrics
What are Simulations? Definition Goals (re-)construct and analyze processes based on realistic models here: communication networks Understand a complex system / model Identify robust solutions for a given problem Compare different possible solutions
Why use Simulations? Options to investigate a system s characteristics: Use the real system often not (yet) available Test beds / field tests limited predication on scalability potentially undesired side effects Physical model unusual in this context Analytic mathematical model allows description as closed-form expression becomes too complex based on restrictive assumptions
Core simulation engine Collection of models (Links, Protocols etc.) Configuration scripts User interface Preprocessing tools Tools for data evaluation and reporting Components of a Simulation Tool
defines the simulation process ensures consistent, uniform processing of simulation steps independently of any application has access to all parameters / components Simulation Engine
Classification Time dependency static (no effect) dynamic (changes depend on time) Randomness deterministic (without random components) stochastic (with random components) Variable updates discrete (event-based) continuous (using differential equations)
Time Changes Continuous real time t 0 Fixed time intervals t 0 t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t 10 t 11 Event-based t 0 t 1 t 2 t 3 t 5 t 6 t 7 t 9
Simulation Types Based on a selection of classification attributes Typically: event-discrete simulation Discrete Event Simulator (DES) System states change only, if an event occurs States in between two events are not considered After processing the current event: Update simulation time to time stamp of the next event Engine calculates new system state (including further new events) Continuous simulation System state updates are calculated based on predefined time intervals Uses real time All state transitions are observable if time interval is sufficiently small
Events in DES Event management Event lists (including event type and time stamp) Events are passed to models Models can create new events as reaction Event types Basic events modify the system state (e.g. incoming / created packets) Supporting events are required for simulation evaluation and control
General Workflow Initialization set initial simulation time (ideally to 0.0) define the initial system state of the simulation generate event lists and load first event Event processing during a simulation update simulation time to time stamp of the next event process the event execute all corresponding actions update system state based on event actions / results Terminate simulation What is missing? Collection of statistical data Data evaluation
Required Information for Simulation Setup Network topology nodes (end systems, routers, servers,...) connections (including their characteristics) Protocol stack of the nodes modular setup following layered structure standardized protocols / own implementations applications that model realistic traffic Evaluation modules Animations Collection / Presentation of observed values
Simulation Requirements Realistic modeling of signal propagation protocols (according to the layered architecture) node mobility the algorithm under test Realistic setup of scenarios / network topology general conditions normal node behavior streets, paths, vehicular traffic rules use cases random node failures, link availability natural disasters, accidents Choice of metrics what parameters shall be observed? throughput, success rate, latency... use case dependent e.g. in case of traffic accidents: stopping distance, pollutant emission, others: traffic jam duration
setup simulation environment setup simulation scenario generate network components generate protocol stack configure applications configure modules to capture measurements General Simulation Setup
Problem Definition Which simulation type should be used? Simulations with terminating condition use defined start and terminating conditions measurements depend on these conditions similar to transient state analysis (but not identical) Simulation of steady-state processes transient phase obtain results of initial or warm-up phase results are highly unstable and correlated Simulation of steady-state processes steady phase shows the long time behavior of a system under normal conditions requires a sufficiently large observation period to achieve the required precision corresponds to steady-state analysis
Input Trace-based use previously collected data very realistic: represents measured / observed data inflexible: does not consider other cases / circumstances optimization on a specific use case is possible Empirical distribution functions derived from measurements by defining a connect the dots function simple, fairly valid difficult to change can cover only limited cases / circumstances Statistical distribution functions use / fit a suitable statistical distribution (i.e. Exponential, Gamma) compact representation of the whole function using few parameters smoothed data, might be difficult to estimate parameters of a suitable function
Why Randomness and Statistics? Learn to fast assess the data Present and compare experimental results How to use statistics for comparison? graphically using statistical hypothesis testing But: Do not compare everything without considering the scales!
Statistics - How many experiments are required? Depending on the number of different variables: n parameters with 10 possible values each result in 10 n possible setups Each setup has to be repeated multiple times using different seed values exponential increase of simulation runs Requires a suitable selection of setups for execution However: ensure to capture all interdependencies between the parameters
Statistics - Data Collection Tools provided by the simulation environment mean, histograms, quantile estimations recognition of transient behavior recognition of predefined precision in results Capturing raw data default methods of corresponding programming language logging features of the simulation tool
Statistics - Deriving Diagrams from Raw Data Extract values from raw data scripts (perl, bash) Calculate metrics (including standard deviations as variance) Save calculated values according to the required data format csv Plot the data gnuplot R If required, fit a distribution
Required Aspects of a Simulation Workflow Define problem Test runs / Debugging Analyze data Verify models Define models Plan experiments Combine models Simulation Verify concept Evaluate results Programming Present results
Advantages often the only suitable form of study enables the comparison of several alternative solutions allows system observations under predefined conditions offers control on environmental conditions enables analysis of systems with large time scope using a shorter time frame detailed procedure steps using delayed execution requires less / no restrictive assumptions enables fast exchange of models, algorithms, and variables allows the usage of external traces from measurement campaigns as input
Drawbacks can be very time consuming (implementations and simulation runs) computationally very expensive results are always an estimation of the real behavior based on model assumptions evaluation and verification of results requires additional time inaccurate results are possible if observation time is too short might use higher complexity than required interdependencies of different variables hard to explain and visualize difficult sensitivity analysis not justified confidence in results due to much data and realistic animations
having no knowledge about simulations vague initial definition of simulation goals wrong level of detail / abstraction unsuitable simulation environment Common problems missing / unclear documentation of simulation environment features abuse of animations using wrong measurements simple replication of a system and treating the output results as the only truth having no knowledge about statistics missing consideration of random effects missing capturing of measurements treating simulations as programming exercise
Simulation Environments / Tools Free/ Open source tools OMNeT++ ns2 ns3 ONE QualNet Commercial tools Matlab OPNET / SteelCentral many others
Example: Wireless Sensor Networks Challenges: modeling of resource constraint devices (processing power, memory, energy efficiency) specialized hardware and operating systems physical phenomenon that should be captured by sensors Specialized simulation tools TOSSIM - TinyOS COOJA - Contiki Castalia - general purpose, OMNeT++ based
Example: Delay Tolerant Networks Challenges: long simulation runs to capture long-term effects overlay / underlay interactions different mobility types Specialized simulation tools ONE
Example: Car-2-X Communication Challenges: realistic modeling of vehicular traffic interaction between vehicles and other devices mobility with high velocity Specialized simulation tool extensions Veins (OMNeT++ and SUMO) itetris (ns3 and SUMO)
Example: Click Challenges: Re-use simulation models for implementation Click Modular Router Routing-Functionality designed as Click-Graph Graphs can be integrated into ns-3 are executable in Linux directly either as Kernel thread or in user space FromDevice(eth0) Classifier(...) ARP IP-in-IP IP ARP other IP queries from 43.0.0.9 for 1.0.0.11 responses for 1.0.0.10 to Linux Strip(14) ARPResponder (1.0.0.10/ 32..., 1.0.0.11/ 32...) CheckIPHeader StripIPHeader GetIPAddress(16) Classifier(...) for 1.0.0.10 for others to Linux Strip(14) IPEncap(4, 1.0.0.10, 43.0.0.9) SetIPAddress(1.0.0.1) ARPQuerier(1.0.0.10,...) ToDevice(eth0)
Conclusions To chose a suitable tool: identify possibilities of a tool check the module availability master the required programming language Different tools most likely produce different results. There is no prefect tool to answer all research questions!
References I [1] MiXiM project. http://mixim.sourceforge.net/. [2] Network Simulator 3 (ns-3). http://www.nsnam.org/. [3] OMNeT++ Network Simulation Framework. http://www.omnetpp.org/. [4] QualNet. http://web.scalable-networks.com/content/qualnet. [5] The Network Simulator (ns-2). http://nsnam.isi.edu/nsnam/index.php/main_page. [6] The Opportunistic Network Environment simulator. http://www.netlab.tkk.fi/tutkimus/dtn/theone/. [7] TOSSIM. http://tinyos.stanford.edu/tinyos-wiki/index.php/tossim. [8] Veins. Vehicle in Network Simulation. http://veins.car2x.org/.
References II [9] F. Dressler and C. Sommer. Network Simulation, 2014. University of Paderborn. Distributed Embedded Systems. [10] E. Kohler, R. Morris, B. Chen, J. Jannotti, and M. Kaashoek. The Click Modular Router. ACM Transactions on Computer Systems, pages 263 297, Aug. 2000. [11] P. Levis, N. Lee, M. Welsh, and D. Culler. TOSSIM: Accurate and Scalable Simulation of Entire TinyOS Applications. In 1st ACM Conference on Embedded Networked Sensor Systems (SenSys), pages 126 137. ACM, Nov. 2003. [12] D. Moltchanov. Network simulation: Network simulation techniques, 2012. Tampere University of Technology, Institute of Communication Engineering. [13] F. Osterlind, A. Dunkels, J. Eriksson, N. Finne, and T. Voigt. Cross-Level Sensor Network Simulation with COOJA. In 31st Conference on Local Computer Networks, pages 641 648. IEEE, Nov. 2006.