Professional Documents
Culture Documents
yuliar@unsyiah.ac.id
AP
2
Jaringan WiFi Sederhana
AP STA
application application
transport transport
network network
link link
physical physical
3
NS-3 basic simulation model
application
Application Application
Application Application
transport
network
Protocol Protocol
stack stack
link
NetDevice NetDevice
NetDevice Channel NetDevice
Channel
Model Jaringan WiFi pada NS-3
Node Node
Application Application
Sockets-like
API
NetDevice NetDevice
Channel
Building with build.py
We should see the following magic words:
6
NS-3 all-in-one package Directory Structure
7
Testing ns-3
We can run the unit tests of the ns-3
distribution by running the script :
$ ./test.py -c core
To run a program :
$ ./waf --run hello-simulator
Waf first checks the program is built
correctly and executes a build if required.
Waf then executes the program, which
produces the following output:
Hello Simulator
Congratulations. You are now an ns-3 user.
8
NS-3 Key Abstractions
1.Node
Host, end system in the Internet
Basic computing device abstraction
Represented in C++ by the class Node
2.Application
A user program that generates some activity to be simulated
Ns-3 applications run on ns-3 Nodes to drive simulations
Represented in C++ by the class Application
Ex: UDP Echo client/server, Onoff Application, Pingv4/6
3.Channel
Medium connected by nodes over which data flows
Represented in C++ by the class Channel
Ex: CsmaChannel, PointToPointChannel, WifiChannel
NS-3 Key Abstractions
4. Net device
Like a specific kind of network cable and a hardware device
(Network Interface Cards; NICs)
NICs are controlled using the software driver, net devices
Represented in C++ by the class NetDevice
Provide methods for managing connections to Node and Channel
Ex) CsmaNetDevice (work with CsmaChannel)
WifiNetDevice (work with WifiChannel)
5. Topology helpers
Topology helpers make ns-3 core operations as easy as possible
Create a NetDevice, add an address, install that net device on a
Node, configure the node’s protocol stack and connet the
NetDevice to a Channel
NS-3 Key Abstractions
5. Topology Helpers
I. NodeContainer: Provide a convenient way to create, manage and access
any Node object
Application Application
NetDevice NetDevice
Channel
\ns-allinone-3.29\ns-3.29\examples\tutorial\first.cc
Emacs mode line
GNU legalese
Module Includes
Namespace declaration
Logging
\ns-allinone-3.29\ns-3.29\examples\tutorial\first.cc
declaration of the main function
Channel
Device
Protocol stack
IPv4 address
Address to device
Server application
\ns-allinone-3.29\ns-3.29\examples\tutorial\first.cc
Client application
Jaringan PTP Sederhana
application application
transport transport
network network
link link
physical physical
3
Jaringan WiFi Sederhana
3
Jaringan WiFi Sederhana
3
Jaringan WiFi Sederhana
link
physical
3
Jaringan WiFi Sederhana
link link
physical physical
3
Jaringan WiFi Sederhana
link link
physical physical
transport
network
3
Jaringan WiFi Sederhana
transport transport
network network
link link
physical physical
3
Jaringan WiFi Sederhana
transport transport
network network
link link
physical physical
application
3
Jaringan WiFi Sederhana
application
transport transport
network network
link link
physical physical
3
Jaringan WiFi Sederhana
application
transport transport
network network
link link
physical physical
application
3
Jaringan WiFi Sederhana
application application
transport transport
network network
link link
physical physical
3
NS-3 basic simulation code
NS-3 basic simulation code
Node Node
NS-3 basic simulation code
Node Node
NS-3 basic simulation code
Node Node
NetDevice NetDevice
NS-3 basic simulation code
Node Node
Protocol Protocol
stack stack
NetDevice NetDevice
NS-3 basic simulation code
Node Node
Protocol Protocol
Stack Stack
Ip: Ip:
1.1.1.2
1.1.1.1
NetDevice NetDevice
NS-3 basic simulation code
Node Node
Application Application
EchoServer EchoClient
Protocol Protocol
Stack Stack
Ip: Ip:
1.1.1.2
1.1.1.1
NetDevice NetDevice
NS-3 basic simulation code
Node Node
Application Application
EchoServer EchoClient
Protocol Protocol
Stack Stack
Ip: Ip:
1.1.1.2
1.1.1.1
NetDevice NetDevice
NS-3 basic simulation code
Node Node
Application Application
EchoServer EchoClient
Protocol Protocol
Stack Stack
Ip: Ip:
1.1.1.2
1.1.1.1
NetDevice NetDevice
NS-3 basic simulation code
Node Node
Application Application
EchoServer EchoClient
Protocol Protocol
Stack Stack
Ip: Ip:
1.1.1.2
1.1.1.1
NetDevice NetDevice
Tugas-2
Pelajari ns-3-tutorial.pdf khususnya Bab-4 (Conceptual
Overview), Bab-5 (Tweaking) dan Bab-6 (Building
Topologies).
Berdasarkan penjelasan pada Bab-6.3 (Building a Wireless
Network Toologi), buatlah simulasi jaringan WiFi dengan
skenario sbb:
Pada jaringan WiFi hanya ada 2 node yaitu satu node Access Point (AP)
dan satu node station (STA).
Channel WiFi gunakan YansWifiChannelHelper::Default
Phy WiFi gunakan YansWifiPhyHelper::Default
Remote station manager gunakan AarfWifiManager
Buat nama SSID-nya no NIM anda
Jarak antar AP dan STA adalah d meter (d = no absen anda dikelas).
Gunakan IP network : 192.168.X.0/24 dimana X = nomor absen anda.
Gunakan UdpEchoServerHelper untuk mencreate aplikasi echoserver.
Gunakan ApplicationContainer dan installkan aplikasi echoserver di AP.
Set aplikasi echoserver start pada detik ke 1,0 dan stop pada detik ke
10,0. 26
Tugas-2
Gunakan UdpEchoClientHelper untuk mencreate aplikasi echoclient. Set
alamat echoserver (ip dan port) pada echoclient agar echo client
mengetahui alamat aplikasi echoserver. Set attribute echoclient sbb :
Jumlah paket (MaxPackets) = 3 buah.