DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
1. Introduction NS-3 Tutorial C4 Conclusion
DCCN Tutorial C4: Implementation of 4G
cellular communication within the SmartGrid
ecosystem
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 24, 2016
2. Introduction NS-3 Tutorial C4 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 C4 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 24.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 C4 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 C4 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 C4 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 C4 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 C4 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 C4 Conclusion
Network Scenario
MME
SGW/PGW
eNodeB
Remote
host
UEs
Sensors
EPC
model
LTE
model
Devices using the IEEE 802.11g/ah
Devices using the Wireless M-Bus
MTCG
LTE Channel
1.0.0.0/247.0.0.0/24
WN(1)
* **
MTCG
Wi-Fi 10.3.0.0/24
WN(0) WN(9)
*
x
WiFi devices
SGW/
PGW
remoteHost
Internet
10. Introduction NS-3 Tutorial C4 Conclusion
LENA
An open source LTE/EPC Network Simulator:
DL & UL Schedulers
Radio Resource Management Algorithms
Inter-cell interference coordination solutions
Load Balancing and Mobility Management
Heterogeneous Network (HetNets)
solutions
End-to-end QoE provisioning
Multi-RAT network solutions
Cognitive LTE systems
11. Introduction NS-3 Tutorial C4 Conclusion
Tasks
1 Check structure of given code, understand to topology
helpers, containers, nodes, etc.
2 Run the prepared simulation scenario
3 View *.xml output files via netAnim, explore tracing
*.pcap files using Wireshark
4 Try to change provided code (rebuild the scenario) and
check the output files (e.g., change positions of created
nodes, update data flows, etc.)
12. Introduction NS-3 Tutorial C4 Conclusion
T1: LTE + EPC Implementation
LTE-A implementation of both the User Equipment (UE)
and the enhanced NodeB (eNB) devices
RRC entities for both the UE and the eNB
Ptr <LteHelper > lteHelper = CreateObject <LteHelper > ();
// ------------------------------
Ptr <PointToPointEpcHelper > epcHelper = CreateObject <
PointToPointEpcHelper > ();
lteHelper ->SetEpcHelper (epcHelper);
// ------------------------------
ConfigStore inputConfig;
inputConfig. ConfigureDefaults ();
// ------------------------------
Ptr <Node > pgw = epcHelper ->GetPgwNode ();
AnimationInterface :: SetConstantPosition (pgw , 20, 10);
13. Introduction NS-3 Tutorial C4 Conclusion
T1: Remote Host Declaration 1/2
End node within the communication structure (database
server, data analysis, etc.)
Data from PGW to RemoteHost sent via the public
network (Internet)
NodeContainer remoteHostContainer ;
remoteHostContainer .Create (1);
// ------------------------------
Ptr <Node > remoteHost = remoteHostContainer .Get (0);
AnimationInterface :: SetConstantPosition (remoteHost ,
20, 20);
// ------------------------------
InternetStackHelper internet;
internet.Install ( remoteHostContainer );
15. Introduction NS-3 Tutorial C4 Conclusion
T1: On/Off Application 1/2
Traffic generator follows an On/Off pattern. The duration
of each of these states is determined with the onTime and
the offTime random variables.
During the ”Off” state, no traffic is generated. During the
”On” state, CBR traffic is generated. This CBR traffic
is characterized by the specified ”data rate” and ”packet
size”.
OnOffHelper WIFIClientSta1 ("ns3:: UdpSocketFactory ",
Address( InetSocketAddress (remoteHostAddr , 8)));
WIFIClientSta1.SetAttribute ("OnTime",StringValue("ns3
:: ConstantRandomVariable [Constant =1]"));
WIFIClientSta1.SetAttribute ("OffTime",StringValue("
ns3:: ConstantRandomVariable [Constant =0]"));
WIFIClientSta1.SetAttribute ("PacketSize", StringValue
("500"));
WIFIClientSta1.SetAttribute ("DataRate", StringValue (
"0.03 Mb/s"));
16. Introduction NS-3 Tutorial C4 Conclusion
T1: On/Off Application 2/2
Possible to use TCP or UDP Transport layer protocols
ApplicationContainer sourceAppSta1;
sourceAppSta1 = WIFIClientSta1 .Install (wifiStaNodes.
Get (1));
sourceAppSta1.Start (Seconds (0.5));
sourceAppSta1.Stop (Seconds (simTime));
PacketSinkHelper sinkSta1 ("ns3:: UdpSocketFactory ",
InetSocketAddress (Ipv4Address :: GetAny (), 8));
ApplicationContainer sinkAppSta1 = sinkSta1.Install(
remoteHost);
sinkAppSta1.Start (Seconds (0.5));
sinkAppSta1.Stop (Seconds (simTime));
20. Introduction NS-3 Tutorial C4 Conclusion
T3: FlowMonitor Console Output
Uses probes, installed in network nodes, to track the
packets exchanged by the nodes, and it will measure a
number of parameters
Packets are divided according to the flow they belong to,
where each flow is defined according to the probe’s
characteristics
Flow ID: 5 Src Addr 10.3.0.5 Dst Addr 1.0.0.2
Tx Packets = 33
Tx Bytes = 17424
Rx Packets = 33
Rx Bytes = 18744
Throughput: 33.729 Kb/s
Delay Sum = 1766 ms
Delay = 53ms
Jitter = +34780416.0 ns
Lost Packets = 0
21. Introduction NS-3 Tutorial C4 Conclusion
T3: Tracing file wifi+lte nodes-3-2.pcap
Open the wifi+lte nodes-3-2.pcap file using Wireshark
Check transmitted data and used destination port (SIP)
22. Introduction NS-3 Tutorial C4 Conclusion
Final Conclusion
LTE+EPC model with the MTCG node implemented
Utilized topology for today’s aggregation scenarios within
SmartGrid infrastructure
FlowMonitor module used to measure the network
performance
Each flow is defined according to the probe’s characteristics
NetAnim – offline animator based on the Qt toolkit (uses
XML trace file collected during simulation)
Next time: Tutorial C6
Implementation of QoS mechanisms for Device-to-Device (D2D)
communication between mobile devices
23. Introduction NS-3 Tutorial C4 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.