• 190 likes • 371 Views
Simulating mobile models/networks. Common way to study mobile network Fast, repeatable, scalable Easy to change, isolate parameters Mobility models Random walk (with reflection/wrapping) Random waypoint model Random direction model … More realistic models (city section, …). M n+1. M n.
E N D
Simulating mobile models/networks • Common way to study mobile network • Fast, repeatable, scalable • Easy to change, isolate parameters • Mobility models • Random walk (with reflection/wrapping) • Random waypoint model • Random direction model • … • More realistic models (city section, …)
Mn+1 Mn Random waypoint model • mobile picks next waypoint Mn uniformly in area, independent of past and present • mobile picks next speed Vn uniformly in [vmin: vmax] independent of past and present • mobile moves towards Mn at constant speed Vn courtesy: Le Boudec & Vojnovic
Random waypoint model with pause • After reaching a destination • Pause for a duration • Duration follows a certain distribution (e.g., uniform) Mn+1 courtesy: Le Boudec & Vojnovic Mn
Simulating random waypoint • Surprisingly many challenges • An example • Area: square of 1000 m • 200 mobiles • Initial speed: randomly taken from [0.5: 2] m/s • Initial placement: uniformly random • Simulation length: 9000 seconds
Distributions of speeds at times 0 s and 2000 s Distribution of speed courtesy: Le Boudec & Vojnovic
Sample of instant speed for one and average of 100 users, vmin = 0.1 m/s Instantaneous speed courtesy: Le Boudec & Vojnovic
Samples of location at times 0 s and 2000 s Mobile location courtesy: Le Boudec & Vojnovic
“Surprises” • Node speed distribution changes over time • Steady state: not uniform • Average node speed slowing decay • Steady state: not (vmax – vmin)/2 • Distribution of node position change over time • Steady state: not uniform in area • Intuition: • Time averages differ from event averages
Challenges and precautions • Transient stage may be very long • e.g., exceed 1000 seconds • Do not ignore transient phase! • Stationary regime does not exist for some choice of parameters • Not careful simulation leads to erroneous conclusions!
Evaluate a protocol: Static case: nodes uniformly placed Mobile case: follow random waypoint Reason: in mobile case, nodes are more often towards the center, distance between nodes is shorter -> performance is better Erroneous conclusions: an example Random waypoint Static courtesy: Le Boudec & Vojnovic
Fundamental questions • Can simulation state reach stable distribution ( = stationary regime) if we run the simulation long enough ? • If so, • how long is long enough ? • If it is too long, is there a way to get to the stable distribution without running long simulations? courtesy: Le Boudec & Vojnovic
Answers • See papers in reading list • Different approaches • Palm calculus is a good tool • Relates time averages & event averages • Easy to use • Applicable to wide range of mobility models
Practical guidance on using random waypoint • Vmin > 0 • Identify & remove transient phase • Inefficient: transient phase could be very long • Perfect simulation • Mobility model is in stationary regime at all times
Perfect simulation for random waypoint • Choose initial location and speed according from stationary distribution • Stationary distribution (no pause) • Speed pdf • Location: traveling on straight line, end points (x1,y1), (x2,y2), joint pdf
Choosing initial speed • Generate random speed that follows stationary distribution of speed • can use standard method • Obtain CDF F(s) • F(s) uniformly distributed in (0,1) • Generate U uniformly in (0,1) • Initial speed is F-1(U)
Choosing initial location • Difficult to generate directly from distribution • Choose initial path, choose end points on path • Choosing end points s.t. joint probability density proportional to distance between them • Procedure in unit square • Choose (x1,y1), (x2,y2) uniformly in unit square • Generate u1 uniformly randomly in (0,1) • If u1 < dist((x1,y1), (x2,y2))/sqrt(2), accept (x1,y1), (x2,y2); o.w., go to step 1 • Generate u2 uniformly randomly in (0,1), initial location: (u2x1 + (1-u2)x2, u2y1+(1-u2)y2) • Node travel to (x2,y2) at initially chosen speed. Once reaching (x2,y2), subsequent speed and destination chosen uniformly.
Perfect simulation for general mobility models • See paper [L-Vojnovic-Infocom05] in reading list • These techniques have been developed as tools to be used in ns-2
ns-2, the network simulator Our goal: • flavor of ns: simple example, modification, execution and trace analysis • discrete event simulator • modeling network protocols • wired, wireless, satellite • TCP, UDP, multicast, unicast • web, telnet, ftp • ad hoc, sensor nets • infrastructure: stats, tracing, error models, etc. • prepackaged protocols and modules, or create your own
“ns” components • ns, the simulator itself (this is all we’ll have time for) • nam, the Network AniMator • visualize ns (or other) output • GUI input simple ns scenarios • pre-processing: • traffic and topology generators • post-processing: • simple trace analysis, often in Awk, Perl, or Tcl • tutorial: http://www.isi.edu/nsnam/ns/tutorial/index.html • ns by example: http://nile.wpi.edu/NS/