1 / 70

NS-3 Simulation

2014 YU-ANTL Lab Seminar. NS-3 Simulation. April 1 , 2014 Yashashree Jadhav Advanced Networking Technology Lab. (YU-ANTL) Dept. of Information & Comm. Eng, Graduate School, Yeungnam University, KOREA (Tel : + 82-53-810-3940; Fax : +82-53-810-4742

marc
Download Presentation

NS-3 Simulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 2014 YU-ANTL Lab Seminar NS-3 Simulation April 1, 2014 Yashashree Jadhav Advanced Networking Technology Lab. (YU-ANTL) Dept. of Information & Comm. Eng, Graduate School, Yeungnam University, KOREA (Tel : +82-53-810-3940; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : yashashree@ynu.ac.kr)

  2. Outline (1) • Introduction • What is NS-3? • NS-3 Vs. NS-2 • NS-3 Features • Building, installation and configuration NS-3 • Getting NS-3 Source (installation) • Building and Configuration NS-3 • Testing NS-3 • Abstractions

  3. Outline (2) • Example • Example - Conceptual • NS-3 Models • NS-3 Script • Wired-Script • Building wired-script • Wireless-Script • Building wireless-script • DCE • IEEE802.11n Standard • References

  4. Introduction (1) • What is NS-3? • NS-3 is a discrete-event network simulator for Internet systems • NS-3 allows researchers to study Internet protocols and large-scale systems in a controlled environment • NS-3 is a new simulator (not backwards-compatible with ns-2) • NS-3 is a free, open source software project organized around research community development and maintenance • Developed for network research and education • Developed after ns-2

  5. Introduction (2) • NS-3 Vs. NS-2 • NS-2 uses OTcl as its scripting environment • NS-3 uses C++ programs or python scripts to define simulations • Simulation programs are C++ executables or Python programs • NS-3 is a new simulator (not backwards-compatible with NS-2) • Some NS-2 models that are mostly written in C++ have already been ported to NS-3 • OTcl-based models can not be ported

  6. Introduction (3) • NS-3 Features • It is a discrete event simulator • Modular design / Open source • Actively developed (Contrast NS-2) • Developed in C++ (Python binding available) • Live visualize • Logging facility for debugging • Tracing facility for getting output • Can be connected to a real network • Direct Code Execution (DCE)

  7. Getting NS-3 Source (Installation) (1) • Getting NS-3 source (installation) • http://www.nsnam.org/ • Latest release: ns-3.19 ( 20 December 2013 )

  8. Getting NS-3 Source (Installation) (2) • Procedure 1

  9. Getting NS-3 Source (Installation) (3) • Procedure 1 • Ready to build the NS-3 distribution

  10. Building and Configuration NS-3 (1) • Building with build.py • sudo ./build.py --enable-examples –enable-tests

  11. Building and Configuration NS-3 (2) • Building with waf • cd ns-3.19 • sudo ./waf clean • sudo ./waf -d optimized --enable-examples --enable-tests configure

  12. Building and Configuration NS-3 (3) • Debug build that includes the examples and tests • sudo ./waf clean • sudo ./waf -d debug --enable-examples --enable-tests configure

  13. Building and Configuration NS-3 (4) • Build the debug versions of the ns-3 programs • sudo ./waf • sudo ./waf -d debug –enable-sudo --enable-examples --enable-tests configure • sudo ./waf -d debug -o build/debug --enable-examples --enable-tests configure

  14. Testing NS-3 (1) • Testing ns-3 • sudo ./test.py • sudo ./test.py -c core

  15. Testing NS-3 (2) • Running a Script • sudo ./waf --run hello-simulator

  16. Abstractions • Key Abstractions • Node • Application • Net device • Channel

  17. Example (1) • Example - Conceptual

  18. Example (2) • NS-3 Models

  19. Wired-Script (1) • Module Includes • The code proper starts with a number of include statements • Namespace Declaration • The next line in the wired script is a namespace declaration • Logging

  20. Wired-Script (2) • Main Functions Ns3 : NS_LOG_ERROR — Log error messages; NS_LOG_WARN — Log warning messages; NS_LOG_DEBUG — Log relatively rare, ad-hoc debugging messages; NS_LOG_INFO — Log informational messages about program progress; NS_LOG_FUNCTION — Log a message describing each function called; NS_LOG_LOGIC – Log messages describing logical flow within a function; NS_LOG_ALL — Log everything. NS_LOG_UNCOND – Log the associated message unconditionally.

  21. Wired-Script (3) • Create the ns-3 Node objects that will represent the computers in the simulation • We are constructing a point to point link • We will need to have a list of all of the NetDevice objects that are created

  22. Wired-Script (4) • Protocol stacks installed on our nodes • TCP,IP,UDP etc. • Ipv4AddressHelper • Make the association between an IP address and a device

  23. Wired-Script (5) • Two specializations of the core ns-3 class Application called • UdpEchoServerApplication • UdpEchoClientApplication • UdpEchoServerHelper • UdpEchoClientHelper

  24. Wired-Script (6) • Simulator • What we need to do at this point is to actually run the simulation • scheduled events in the simulator at 1.0 seconds, 2.0 seconds and two events at 10.0 seconds

  25. Building wired-script (1) • Building Your Script • Drop your script into the scratch directory • Now build your script using waf • Run the example

  26. Wireless-Script (1) • Add the Wi-Fi and the mobility modules • The network topology illustration follows

  27. Wireless-Script (2) • Wireless Network Topology • For enabling or disabling logging components and for changing the number of devices created

  28. Wireless-Script (3) • Part of the Wi-Fi Network • Configure the PHY and channel helpers • Create a channel object and associate it to our PHY layer object manager

  29. Wireless-Script (4) • NqosWifiMacHelper object to set MAC parameters • rate control algorithm • AARF (Adaptive Auto-Rate Fallback ) algorithm • The SSID of the infrastructure network

  30. Simulation

  31. Wireless-Script (5) • Create the wifi devices of these stations • Configure the AP (access point) node • Shares the same set of PHY-level Attributes (and channel) as the stations

  32. Wireless-Script (6) • Set some Attributes controlling the “position allocator” functionality • Need to tell them how to move • RandomWalk2dMobilityModel • random direction • random speed

  33. Wireless-Script (7) • Need to tell them how to move • Rectangle (double _xMin, double _xMax, double _yMin, double _yMax) • Want the access point to remain in a fixed position during the simulation • Protocol stacks

  34. Wireless-Script (8) • Assign IP addresses to the device interfaces • Enable internetwork routing

  35. Wireless-Script (9) • Create just enough tracing to cover all three networks • Run the simulation, clean up and then exit the program

  36. Building wireless-script • Building Your Script • Drop your script into the scratch directory • Now build your script using waf • Run the example

  37. Simulation

  38. DCE (1) • Direct Code Execution • DCE ns-3 module provides facilities to execute network protocols within ns-3 existing implementations of user space and kernel space • DCE with iperf(dce-iperf) • The example uses iperf traffic generator in a simulation • DCE use we need to include the file ns3/dce-module.h

  39. DCE (2) • The network topology illustration follows • Main function

  40. DCE (3) • DceManagerHelper • It is the tool you will use within your script to parameter and install DceManager on the ns-3 nodes where you plan to run binaries • LinuxStackHelper • It is used to configure parameters of Linux kernel

  41. DCE (4) • Assign IP addresses to the device • DceApplicationHelper • this helper in order to define which application you want to run within ns-3

  42. DCE (5) • Launch Iperf on client node • Launch Iperf on server node

  43. DCE (6) • Run the simulation

  44. DCE (7) • Run the simulation • Server output

  45. DCE (8) • Client output

  46. IEEE802.11n Standard (1) • MAC configuration • “QosSupported” feature • allows configuration of 802.11e/WMM-style QoS support • “HtSupported” feature • Allows configuration of 802.11n High Throughput style support • ns3::EdcaTxopN • used by QoS-enabled high MACs and also performs QoS operations like 802.11n-style MSDU aggregation

  47. IEEE802.11n Standard (2) • WifiMacHelper • Used to configure MAC parameters • ns3::QosWifiMacHelper • Create MAC instances with QoS support enabled • An MSDU aggregator for a particular Access Category (AC) in order to use 802.11n MSDU aggregation feature • block ack parameters • Following example shows ns3::QosWifiMacHelper to create an AP with QoS enabled, aggregation on AC_VO, and Block Ack on AC_BE

  48. IEEE802.11n Standard (3) • ns3::HtWifiMacHelper • Creation of MAC instances that have 802.11n-style High throughput (Ht) and QoS support enabled • Rate control algorithms • ARF Rate control algorithm • minstrel Rate control algorithm

  49. IEEE802.11n Standard (4) • PHY configuration • YansWifiPhyHelper • To enable 802.11n High Throughput style parameters the following line of code could be used • WifiHelper • It sets the default wifi standard to 802.11a and sets the RemoteStationManager to ns3::ArfWifiManager • Change the RemoteStationManager by calling the WifiHelper::SetRemoteStationManager • To change the wifi standard, call the WifiHelper::SetStandard • Wifi_PHY_STANDARD_80211n_2_4GHZ • Wifi_PHY_STANDARD_80211n_5GHZ

  50. IEEE802.11n Standard (5) • Library • Topology

More Related