Introduction NS-3 Tutorial C2 Conclusion
DCCN Tutorial C2: Communication Between
Devices Within LAN/WLAN Networks
Pavel Masek, Jiri Hosek
Brno University of Technology,
Faculty of Electrical Engineering and Communication,
Department of Telecommunication.
masekpavel@feec.vutbr.cz, hosek@feec.vutbr.cz
November 23, 2016
Introduction NS-3 Tutorial C2 Conclusion
WISLAB Research Group – http://www.wislab.cz
WISLAB - Wireless System Laboratory of Brno
Coordinated by Dr. Hosek
Experienced researchers and MSc. / Ph.D.
students
Working with the up-to-date equipment
Nowadays, focused mainly on the IoT domain
Communication in 4G / 5G mobile networks
Intel US, Huawei, AT&T, TUT, IITIS, PFUR, SUAI
SmartHome Gateway
Telekom Austria Group
Wearables
Augmented reality, smart glasses
MTC Communication in NS-3
Member of well-known alliances AllSeen Alliance or HGi
Contributor to 3GPP standards and recommendations
Introduction NS-3 Tutorial C2 Conclusion
DCCN Tutorials: Agenda
Tutorial #1 [Wed 23.11.16] - Communication
between devices within LAN/WLAN networks
Tutorial #2 [Thu 24.11.16] - Implementation of 4G cellular
communication within the SmartGrid ecosystem
Tutorial #3 [Fri 25.11.16] - Implementation of QoS
mechanisms for Device-to-Device (D2D) communication
between mobile devices
Main goal
From basic network topology to advanced communication
mechanisms used in today’s IoT/M2M scenarios – utilizing
Network Simulator 3 (NS-3) tool for timely use-cases
Introduction NS-3 Tutorial C2 Conclusion
Network Simulator 3 (NS-3) – https://www.nsnam.org
NS-3 is written in C++, with bindings available for
Python
Simulation programs are C++ executables or Python
programs
NS-3 is a GNU GPLv2 licensed project
Mainly supported fro Linux/Unix, MacOS, and FreeBSD
Currently, port to Visual Studio is available
No backwards compatibility with NS-2
In comparison with other network simulators, oriented to
command-line and Unix (no IDE provided in
standard NS-3 framework)
Introduction NS-3 Tutorial C2 Conclusion
NS-3 Simulation Basics
Simulation time advances in discrete jumps from event
to event
C++ functions schedule events to occur at specific
simulation times
Several supporting libraries, not system-installed, can be in
parallel to NS-3 (netAnim, pybindgen, etc.)
A simulation scheduler orders the event execution
Simulation::Run() gets it all started
Simulation stops at specific time or when events end
Introduction NS-3 Tutorial C2 Conclusion
Motivation – Why to Use NS-3?
You want to study network performance or protocol
operation in a controllable or scalable environment
You are comfortable writing C++ or Python code, and
combining NS-3 with other code
You like the idea of working on an active open source
project
NS-3 has the models you are looking for, or you can
provide / integrate what is missing
Well-known projects
LENA (LTE-EPC Network Simulator)
DCE (Direct Code Execution)
Introduction NS-3 Tutorial C2 Conclusion
Created Virtual Machine for Development
Created as a VMware virtual machine (possible to run
via VMware Workstation/Player or VirtualBox)
Based on Ubuntu 14.04 LTS 32bit (Long Term Support)
Possible to make ”Snapshoots”
Already pre-configured
Eclipse environment bounded with NS-3 (no need to
develop straightforward from the command line; possible to
use advanced debugger)
Visualization tools: NetAnim, FlowMonitor, Python
visualizer
Tracing: Wireshark, trace files in NS-3, routing tables, etc.
As the utilized version, NS-3.23 was chosen – verified
functionality, stable, already contains new syntax
Introduction NS-3 Tutorial C2 Conclusion
Created Virtual Machine for Development
Created as a VMware virtual machine (possible to run
via VMware Workstation/Player or VirtualBox)
Based on Ubuntu 14.04 LTS 32bit (Long Term Support)
Possible to make ”Snapshoots”
Already pre-configured
Eclipse environment bounded with NS-3 (no need to
develop straightforward from the command line; possible to
use advanced debugger)
Visualization tools: NetAnim, FlowMonitor, Python
visualizer
Tracing: Wireshark, trace files in NS-3, routing tables, etc.
As the utilized version, NS-3.23 was chosen – verified
functionality, stable, already contains new syntax
Introduction NS-3 Tutorial C2 Conclusion
Created Virtual Machine – Eclipse with NS-3 project
Introduction NS-3 Tutorial C2 Conclusion
Network Scenario – LAN/WLAN communication
Default network topology implementing IEEE 802.11
PHY and MAC models
Scalable for future projects (number of nodes, used
communication technologies, etc.)
Intended network topology
Three groups of nodes (P2P, CSMA/CD, WiFi
(CSMA/CA))
n0 n1 n2 n3 n4
Point-to-point
LAN
10.1.2.0/24
10.1.1.0/24
n5n6n7
* * **
AP
Wi-Fi 10.1.3.0/24
Introduction NS-3 Tutorial C2 Conclusion
Tasks
1 Check structure of given code, understand to topology
helpers, containers, nodes, etc
2 Run the prepared simulation scenario
3 View output files (tracing files) via tcpdump and
Wireshark
4 Try to change provided code (rebuild the scenario) and
check the output files (e.g., change source and
destination nodes for data transmission, amount of
payload, etc.)
Introduction NS-3 Tutorial C2 Conclusion
T1: Point-to-point (P2P) Link
NodeContainer p2pNodes;
p2pNodes.Create (2);
// ------------------------------
PointToPointHelper pointToPoint;
pointToPoint. SetDeviceAttribute ("DataRate",
StringValue ("5Mbps"));
pointToPoint. SetChannelAttribute ("Delay", StringValue
("2ms"));
// ------------------------------
NetDeviceContainer p2pDevices;
p2pDevices = pointToPoint.Install (p2pNodes);
Introduction NS-3 Tutorial C2 Conclusion
T1: CSMA/CD Ethernet
NodeContainer csmaNodes;
csmaNodes.Add (p2pNodes.Get (1));
csmaNodes.Create (nCsma);
// ------------------------------
CsmaHelper csma;
csma. SetChannelAttribute ("DataRate",
StringValue ("100 Mbps"));
csma. SetChannelAttribute ("Delay", TimeValue (
NanoSeconds (6560)));
// ------------------------------
NetDeviceContainer csmaDevices;
csmaDevices = csma.Install (csmaNodes);
Introduction NS-3 Tutorial C2 Conclusion
T1: CSMA/CA – WiFi
NodeContainer wifiStaNodes;
wifiStaNodes.Create (nWifi);
NodeContainer wifiApNode = p2pNodes.Get (0);
// ------------------------------
YansWifiChannelHelper channel = YansWifiChannelHelper
:: Default ();
YansWifiPhyHelper phy = YansWifiPhyHelper :: Default ();
// ------------------------------
phy.SetChannel (channel.Create ());
Introduction NS-3 Tutorial C2 Conclusion
T1: CSMA/CA – WiFi MAC Layer
NetDeviceContainer staDevices;
staDevices = wifi.Install (phy , mac , wifiStaNodes);
// ------------------------------
mac.SetType ("ns3:: ApWifiMac",
"Ssid", SsidValue (ssid));
// ------------------------------
NetDeviceContainer apDevices;
apDevices = wifi.Install (phy , mac , wifiApNode);
Introduction NS-3 Tutorial C2 Conclusion
T1: IP Configuration
Ipv4AddressHelper address;
// ------------------------------
address.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer p2pInterfaces;
p2pInterfaces = address.Assign (p2pDevices);
// ------------------------------
address.SetBase ("10.1.2.0", "255.255.255.0");
Ipv4InterfaceContainer csmaInterfaces ;
csmaInterfaces = address.Assign (csmaDevices);
// ------------------------------
address.SetBase ("10.1.3.0", "255.255.255.0");
address.Assign (staDevices);
address.Assign (apDevices);
Introduction NS-3 Tutorial C2 Conclusion
T1: ”Echo” Server
Location of echo server on the ”rightmost” node in the
created network topology (CSMA/CD)
UDP service, port 9
UdpEchoServerHelper echoServer (9);
// ------------------------------
ApplicationContainer serverApps = echoServer.Install
(csmaNodes.Get (nCsma));
serverApps.Start (Seconds (1.0));
serverApps.Stop (Seconds (10.0));
// ------------------------------
Introduction NS-3 Tutorial C2 Conclusion
T1: ”Echo” Client
UdpEchoClientHelper echoClient (csmaInterfaces .
GetAddress (nCsma), 9);
echoClient.SetAttribute ("MaxPackets", UintegerValue
(1));
echoClient.SetAttribute ("Interval", TimeValue (
Seconds (1.0)));
echoClient.SetAttribute ("PacketSize", UintegerValue
(1024));
// ------------------------------
ApplicationContainer clientApps =
echoClient.Install (wifiStaNodes.Get (nWifi - 1));
clientApps.Start (Seconds (2.0));
clientApps.Stop (Seconds (10.0));
Introduction NS-3 Tutorial C2 Conclusion
T1: PCAP Tracing
pointToPoint.EnablePcapAll ("wlan_lan");
phy.EnablePcap ("wlan_lan", apDevices.Get (0));
csma.EnablePcap ("wlan_lan",csmaDevices.Get (0),true);
Pcap tracing started on both P2P nodes (CSMA/CA and
CSMA/CD) – our backbone
Promiscuous mode configured on the WiFi (CSMA/CA)
network
Introduction NS-3 Tutorial C2 Conclusion
T3: Captured Communication from ”Echo” Server
reading from file wlan_lan -1-1.pcap , link -type EN10MB
(Ethernet)
2.017837 ARP , Request who -has 10.1.2.4 (ff:ff:ff:ff:ff
:ff) tell 10.1.2.1 , length 50
2.017861 ARP , Reply 10.1.2.4 is -at 00:00:00:00:00:06 ,
length 50
2.017861 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP , length
1024
2.022966 ARP , Request who -has 10.1.2.1 (ff:ff:ff:ff:ff
:ff) tell 10.1.2.4 , length 50
2.022966 ARP , Reply 10.1.2.1 is -at 00:00:00:00:00:03 ,
length 50
2.023072 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP , length
1024
Introduction NS-3 Tutorial C2 Conclusion
T3: Captured Communication from ”Echo” Client
reading from file wlan_lan -1-1.pcap , link -type EN10MB
(Ethernet)
2.017837 ARP , Request who -has 10.1.2.4 (ff:ff:ff:ff:ff
:ff) tell 10.1.2.1 , length 50
2.017861 ARP , Reply 10.1.2.4 is -at 00:00:00:00:00:06 ,
length 50
2.017861 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP , length
1024
2.022966 ARP , Request who -has 10.1.2.1 (ff:ff:ff:ff:ff
:ff) tell 10.1.2.4 , length 50
2.022966 ARP , Reply 10.1.2.1 is -at 00:00:00:00:00:03 ,
length 50
2.023072 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP , length
1024
Introduction NS-3 Tutorial C2 Conclusion
T4: Possible Modifications (Individual Tasks)
1 Add number of WiFi nodes and change location of the
”Echo” client node
2 Change number of transmitted data (payload)
3 Change total number of sent packets
4 Check performed changes via Wireshark (pass: student)
Run terminal: sudo wireshark
Open captured files
Introduction NS-3 Tutorial C2 Conclusion
Final Conclusion
We have got familiar with Network Simulator 3
Initial network topology created and simulated
Utilizing NS-3 structure (helpers, containers, etc.)
Ready to be extended by other communication technologies
Tracing of generated data traffic
Next time: Tutorial C4
Implementation of 4G (LTE) cellular communication
within the SmartGrid ecosystem
Introduction NS-3 Tutorial C2 Conclusion
Thank you for your attention.
Pavel Masek, Jiri Hosek
masekpavel@feec.vutbr.cz, hosek@feec.vutbr.cz
Brno University of Technology,
Faculty of Electrical Engineering and Communication,
Department of Telecommunication.

More Related Content

PDF
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
PDF
DCCN 2016 - Tutorial 3 - QoS for D2D
PPTX
Spring sim 2010-riley
PPTX
Ground to ns3 - Basic wireless topology implementation
PDF
Ns3 implementation wifi
PDF
Kernelvm 201312-dlmopen
PPTX
Netmap presentation
PDF
Direct Code Execution @ CoNEXT 2013
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
DCCN 2016 - Tutorial 3 - QoS for D2D
Spring sim 2010-riley
Ground to ns3 - Basic wireless topology implementation
Ns3 implementation wifi
Kernelvm 201312-dlmopen
Netmap presentation
Direct Code Execution @ CoNEXT 2013

What's hot (20)

PPTX
Introduction to ns3
PDF
Differences of Deep Learning Frameworks
PDF
Tsn linux elce17
DOCX
Creating a firewall in UBUNTU
PPT
Notes from 2016 bay area deep learning school
PDF
ENHANCING PERFORMANCE OF AN HPC CLUSTER BY ADOPTING NONDEDICATED NODES
PPTX
Open shmem
PDF
Simulators for Wireless Sensor Networks (OMNeT++)
PDF
Time Sensitive Networking in the Linux Kernel
PPTX
Preparing OpenSHMEM for Exascale
PPT
Improving Robustness In Distributed Systems
PDF
Intra-coding using non-linear prediction, KLT and Texture Synthesis: AV1 enco...
PDF
Kernel Recipes 2018 - XDP: a new fast and programmable network layer - Jesper...
PDF
Kernel Recipes 2014 - What’s new in nftables?
PDF
Geep networking stack-linuxkernel
PDF
ディープニューラルネットワーク向け拡張可能な高位合成コンパイラの開発
PPT
3DD 1e SyCers
PPT
3rd 3DDRESD: ReCPU 4 NIDS
PDF
PASTE: A Network Programming Interface for Non-Volatile Main Memory
PPT
2.Phys & Link
Introduction to ns3
Differences of Deep Learning Frameworks
Tsn linux elce17
Creating a firewall in UBUNTU
Notes from 2016 bay area deep learning school
ENHANCING PERFORMANCE OF AN HPC CLUSTER BY ADOPTING NONDEDICATED NODES
Open shmem
Simulators for Wireless Sensor Networks (OMNeT++)
Time Sensitive Networking in the Linux Kernel
Preparing OpenSHMEM for Exascale
Improving Robustness In Distributed Systems
Intra-coding using non-linear prediction, KLT and Texture Synthesis: AV1 enco...
Kernel Recipes 2018 - XDP: a new fast and programmable network layer - Jesper...
Kernel Recipes 2014 - What’s new in nftables?
Geep networking stack-linuxkernel
ディープニューラルネットワーク向け拡張可能な高位合成コンパイラの開発
3DD 1e SyCers
3rd 3DDRESD: ReCPU 4 NIDS
PASTE: A Network Programming Interface for Non-Volatile Main Memory
2.Phys & Link
Ad

Similar to DCCN 2016 - Tutorial 1 - Communication with LAN/WLAN (20)

PDF
presentation on NS3 by rahul hada (Session 2)
PDF
Tutorial ns 3-tutorial-slides
PDF
WiMAX implementation in ns3
PDF
NS3 Overview
PDF
DCCN 2016 - Tutorial 1 Advanced
PPT
Network Simulator Tutorial
PDF
Tr ns802 11
PPTX
June 28 Presentation
PPT
NS2 Overview - Network Simulator Tutorial
PPTX
Plenzogan technology
PDF
PPTX
ACMSE2022-Tutorial-Slides.pptx
PDF
Paper9250 implementation of an i pv6 stack for ns-3
PPT
Venkat ns2
PDF
NS2-tutorial.pdf
PPT
Ns fundamentals 1
PPT
Ns2
PPT
Tut hemant ns2
PPT
NS2-tutorial.ppt
presentation on NS3 by rahul hada (Session 2)
Tutorial ns 3-tutorial-slides
WiMAX implementation in ns3
NS3 Overview
DCCN 2016 - Tutorial 1 Advanced
Network Simulator Tutorial
Tr ns802 11
June 28 Presentation
NS2 Overview - Network Simulator Tutorial
Plenzogan technology
ACMSE2022-Tutorial-Slides.pptx
Paper9250 implementation of an i pv6 stack for ns-3
Venkat ns2
NS2-tutorial.pdf
Ns fundamentals 1
Ns2
Tut hemant ns2
NS2-tutorial.ppt
Ad

Recently uploaded (20)

PDF
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
PDF
Fitaura: AI & Machine Learning Powered Fitness Tracker
PDF
State of AI in Business 2025 - MIT NANDA
PDF
1_Keynote_Breaking Barriers_한계를 넘어서_Charith Mendis.pdf
PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PDF
TicketRoot: Event Tech Solutions Deck 2025
PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
PPTX
Information-Technology-in-Human-Society.pptx
PPTX
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
PPTX
Blending method and technology for hydrogen.pptx
PDF
Altius execution marketplace concept.pdf
PDF
Ebook - The Future of AI A Comprehensive Guide.pdf
PDF
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
PDF
substrate PowerPoint Presentation basic one
PDF
Addressing the challenges of harmonizing law and artificial intelligence tech...
PDF
Domain-specific knowledge and context in large language models: challenges, c...
PDF
【AI論文解説】高速・高品質な生成を実現するFlow Map Models(Part 1~3)
PPT
Overviiew on Intellectual property right
PDF
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
Fitaura: AI & Machine Learning Powered Fitness Tracker
State of AI in Business 2025 - MIT NANDA
1_Keynote_Breaking Barriers_한계를 넘어서_Charith Mendis.pdf
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
TicketRoot: Event Tech Solutions Deck 2025
Intravenous drug administration application for pediatric patients via augmen...
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
Information-Technology-in-Human-Society.pptx
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
Blending method and technology for hydrogen.pptx
Altius execution marketplace concept.pdf
Ebook - The Future of AI A Comprehensive Guide.pdf
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
substrate PowerPoint Presentation basic one
Addressing the challenges of harmonizing law and artificial intelligence tech...
Domain-specific knowledge and context in large language models: challenges, c...
【AI論文解説】高速・高品質な生成を実現するFlow Map Models(Part 1~3)
Overviiew on Intellectual property right
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...

DCCN 2016 - Tutorial 1 - Communication with LAN/WLAN

  • 1. Introduction NS-3 Tutorial C2 Conclusion DCCN Tutorial C2: Communication Between Devices Within LAN/WLAN Networks Pavel Masek, Jiri Hosek Brno University of Technology, Faculty of Electrical Engineering and Communication, Department of Telecommunication. [email protected], [email protected] November 23, 2016
  • 2. Introduction NS-3 Tutorial C2 Conclusion WISLAB Research Group – http://www.wislab.cz WISLAB - Wireless System Laboratory of Brno Coordinated by Dr. Hosek Experienced researchers and MSc. / Ph.D. students Working with the up-to-date equipment Nowadays, focused mainly on the IoT domain Communication in 4G / 5G mobile networks Intel US, Huawei, AT&T, TUT, IITIS, PFUR, SUAI SmartHome Gateway Telekom Austria Group Wearables Augmented reality, smart glasses MTC Communication in NS-3 Member of well-known alliances AllSeen Alliance or HGi Contributor to 3GPP standards and recommendations
  • 3. Introduction NS-3 Tutorial C2 Conclusion DCCN Tutorials: Agenda Tutorial #1 [Wed 23.11.16] - Communication between devices within LAN/WLAN networks Tutorial #2 [Thu 24.11.16] - Implementation of 4G cellular communication within the SmartGrid ecosystem Tutorial #3 [Fri 25.11.16] - Implementation of QoS mechanisms for Device-to-Device (D2D) communication between mobile devices Main goal From basic network topology to advanced communication mechanisms used in today’s IoT/M2M scenarios – utilizing Network Simulator 3 (NS-3) tool for timely use-cases
  • 4. Introduction NS-3 Tutorial C2 Conclusion Network Simulator 3 (NS-3) – https://www.nsnam.org NS-3 is written in C++, with bindings available for Python Simulation programs are C++ executables or Python programs NS-3 is a GNU GPLv2 licensed project Mainly supported fro Linux/Unix, MacOS, and FreeBSD Currently, port to Visual Studio is available No backwards compatibility with NS-2 In comparison with other network simulators, oriented to command-line and Unix (no IDE provided in standard NS-3 framework)
  • 5. Introduction NS-3 Tutorial C2 Conclusion NS-3 Simulation Basics Simulation time advances in discrete jumps from event to event C++ functions schedule events to occur at specific simulation times Several supporting libraries, not system-installed, can be in parallel to NS-3 (netAnim, pybindgen, etc.) A simulation scheduler orders the event execution Simulation::Run() gets it all started Simulation stops at specific time or when events end
  • 6. Introduction NS-3 Tutorial C2 Conclusion Motivation – Why to Use NS-3? You want to study network performance or protocol operation in a controllable or scalable environment You are comfortable writing C++ or Python code, and combining NS-3 with other code You like the idea of working on an active open source project NS-3 has the models you are looking for, or you can provide / integrate what is missing Well-known projects LENA (LTE-EPC Network Simulator) DCE (Direct Code Execution)
  • 7. Introduction NS-3 Tutorial C2 Conclusion Created Virtual Machine for Development Created as a VMware virtual machine (possible to run via VMware Workstation/Player or VirtualBox) Based on Ubuntu 14.04 LTS 32bit (Long Term Support) Possible to make ”Snapshoots” Already pre-configured Eclipse environment bounded with NS-3 (no need to develop straightforward from the command line; possible to use advanced debugger) Visualization tools: NetAnim, FlowMonitor, Python visualizer Tracing: Wireshark, trace files in NS-3, routing tables, etc. As the utilized version, NS-3.23 was chosen – verified functionality, stable, already contains new syntax
  • 8. Introduction NS-3 Tutorial C2 Conclusion Created Virtual Machine for Development Created as a VMware virtual machine (possible to run via VMware Workstation/Player or VirtualBox) Based on Ubuntu 14.04 LTS 32bit (Long Term Support) Possible to make ”Snapshoots” Already pre-configured Eclipse environment bounded with NS-3 (no need to develop straightforward from the command line; possible to use advanced debugger) Visualization tools: NetAnim, FlowMonitor, Python visualizer Tracing: Wireshark, trace files in NS-3, routing tables, etc. As the utilized version, NS-3.23 was chosen – verified functionality, stable, already contains new syntax
  • 9. Introduction NS-3 Tutorial C2 Conclusion Created Virtual Machine – Eclipse with NS-3 project
  • 10. Introduction NS-3 Tutorial C2 Conclusion Network Scenario – LAN/WLAN communication Default network topology implementing IEEE 802.11 PHY and MAC models Scalable for future projects (number of nodes, used communication technologies, etc.) Intended network topology Three groups of nodes (P2P, CSMA/CD, WiFi (CSMA/CA)) n0 n1 n2 n3 n4 Point-to-point LAN 10.1.2.0/24 10.1.1.0/24 n5n6n7 * * ** AP Wi-Fi 10.1.3.0/24
  • 11. Introduction NS-3 Tutorial C2 Conclusion Tasks 1 Check structure of given code, understand to topology helpers, containers, nodes, etc 2 Run the prepared simulation scenario 3 View output files (tracing files) via tcpdump and Wireshark 4 Try to change provided code (rebuild the scenario) and check the output files (e.g., change source and destination nodes for data transmission, amount of payload, etc.)
  • 12. Introduction NS-3 Tutorial C2 Conclusion T1: Point-to-point (P2P) Link NodeContainer p2pNodes; p2pNodes.Create (2); // ------------------------------ PointToPointHelper pointToPoint; pointToPoint. SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); pointToPoint. SetChannelAttribute ("Delay", StringValue ("2ms")); // ------------------------------ NetDeviceContainer p2pDevices; p2pDevices = pointToPoint.Install (p2pNodes);
  • 13. Introduction NS-3 Tutorial C2 Conclusion T1: CSMA/CD Ethernet NodeContainer csmaNodes; csmaNodes.Add (p2pNodes.Get (1)); csmaNodes.Create (nCsma); // ------------------------------ CsmaHelper csma; csma. SetChannelAttribute ("DataRate", StringValue ("100 Mbps")); csma. SetChannelAttribute ("Delay", TimeValue ( NanoSeconds (6560))); // ------------------------------ NetDeviceContainer csmaDevices; csmaDevices = csma.Install (csmaNodes);
  • 14. Introduction NS-3 Tutorial C2 Conclusion T1: CSMA/CA – WiFi NodeContainer wifiStaNodes; wifiStaNodes.Create (nWifi); NodeContainer wifiApNode = p2pNodes.Get (0); // ------------------------------ YansWifiChannelHelper channel = YansWifiChannelHelper :: Default (); YansWifiPhyHelper phy = YansWifiPhyHelper :: Default (); // ------------------------------ phy.SetChannel (channel.Create ());
  • 15. Introduction NS-3 Tutorial C2 Conclusion T1: CSMA/CA – WiFi MAC Layer NetDeviceContainer staDevices; staDevices = wifi.Install (phy , mac , wifiStaNodes); // ------------------------------ mac.SetType ("ns3:: ApWifiMac", "Ssid", SsidValue (ssid)); // ------------------------------ NetDeviceContainer apDevices; apDevices = wifi.Install (phy , mac , wifiApNode);
  • 16. Introduction NS-3 Tutorial C2 Conclusion T1: IP Configuration Ipv4AddressHelper address; // ------------------------------ address.SetBase ("10.1.1.0", "255.255.255.0"); Ipv4InterfaceContainer p2pInterfaces; p2pInterfaces = address.Assign (p2pDevices); // ------------------------------ address.SetBase ("10.1.2.0", "255.255.255.0"); Ipv4InterfaceContainer csmaInterfaces ; csmaInterfaces = address.Assign (csmaDevices); // ------------------------------ address.SetBase ("10.1.3.0", "255.255.255.0"); address.Assign (staDevices); address.Assign (apDevices);
  • 17. Introduction NS-3 Tutorial C2 Conclusion T1: ”Echo” Server Location of echo server on the ”rightmost” node in the created network topology (CSMA/CD) UDP service, port 9 UdpEchoServerHelper echoServer (9); // ------------------------------ ApplicationContainer serverApps = echoServer.Install (csmaNodes.Get (nCsma)); serverApps.Start (Seconds (1.0)); serverApps.Stop (Seconds (10.0)); // ------------------------------
  • 18. Introduction NS-3 Tutorial C2 Conclusion T1: ”Echo” Client UdpEchoClientHelper echoClient (csmaInterfaces . GetAddress (nCsma), 9); echoClient.SetAttribute ("MaxPackets", UintegerValue (1)); echoClient.SetAttribute ("Interval", TimeValue ( Seconds (1.0))); echoClient.SetAttribute ("PacketSize", UintegerValue (1024)); // ------------------------------ ApplicationContainer clientApps = echoClient.Install (wifiStaNodes.Get (nWifi - 1)); clientApps.Start (Seconds (2.0)); clientApps.Stop (Seconds (10.0));
  • 19. Introduction NS-3 Tutorial C2 Conclusion T1: PCAP Tracing pointToPoint.EnablePcapAll ("wlan_lan"); phy.EnablePcap ("wlan_lan", apDevices.Get (0)); csma.EnablePcap ("wlan_lan",csmaDevices.Get (0),true); Pcap tracing started on both P2P nodes (CSMA/CA and CSMA/CD) – our backbone Promiscuous mode configured on the WiFi (CSMA/CA) network
  • 20. Introduction NS-3 Tutorial C2 Conclusion T3: Captured Communication from ”Echo” Server reading from file wlan_lan -1-1.pcap , link -type EN10MB (Ethernet) 2.017837 ARP , Request who -has 10.1.2.4 (ff:ff:ff:ff:ff :ff) tell 10.1.2.1 , length 50 2.017861 ARP , Reply 10.1.2.4 is -at 00:00:00:00:00:06 , length 50 2.017861 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP , length 1024 2.022966 ARP , Request who -has 10.1.2.1 (ff:ff:ff:ff:ff :ff) tell 10.1.2.4 , length 50 2.022966 ARP , Reply 10.1.2.1 is -at 00:00:00:00:00:03 , length 50 2.023072 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP , length 1024
  • 21. Introduction NS-3 Tutorial C2 Conclusion T3: Captured Communication from ”Echo” Client reading from file wlan_lan -1-1.pcap , link -type EN10MB (Ethernet) 2.017837 ARP , Request who -has 10.1.2.4 (ff:ff:ff:ff:ff :ff) tell 10.1.2.1 , length 50 2.017861 ARP , Reply 10.1.2.4 is -at 00:00:00:00:00:06 , length 50 2.017861 IP 10.1.3.3.49153 > 10.1.2.4.9: UDP , length 1024 2.022966 ARP , Request who -has 10.1.2.1 (ff:ff:ff:ff:ff :ff) tell 10.1.2.4 , length 50 2.022966 ARP , Reply 10.1.2.1 is -at 00:00:00:00:00:03 , length 50 2.023072 IP 10.1.2.4.9 > 10.1.3.3.49153: UDP , length 1024
  • 22. Introduction NS-3 Tutorial C2 Conclusion T4: Possible Modifications (Individual Tasks) 1 Add number of WiFi nodes and change location of the ”Echo” client node 2 Change number of transmitted data (payload) 3 Change total number of sent packets 4 Check performed changes via Wireshark (pass: student) Run terminal: sudo wireshark Open captured files
  • 23. Introduction NS-3 Tutorial C2 Conclusion Final Conclusion We have got familiar with Network Simulator 3 Initial network topology created and simulated Utilizing NS-3 structure (helpers, containers, etc.) Ready to be extended by other communication technologies Tracing of generated data traffic Next time: Tutorial C4 Implementation of 4G (LTE) cellular communication within the SmartGrid ecosystem
  • 24. Introduction NS-3 Tutorial C2 Conclusion Thank you for your attention. Pavel Masek, Jiri Hosek [email protected], [email protected] Brno University of Technology, Faculty of Electrical Engineering and Communication, Department of Telecommunication.