144

ns3, The Network Simulator: WNS2 Tutorial - October …users.ece.gatech.edu/riley/ece6110/handouts/ns3_tutorial...Introduction to ns3 ns3 is a network simulator for research simulation

Embed Size (px)

Citation preview

ns3, The Network Simulator: WNS2 TutorialOctober 23, 2008

OverviewIntroduction to ns3

Design goals and MotivationSimulated Entities

NodesApplicationsPacketsProtocolsNetDevicesChannelsThe SimulatorAttributes

Getting StartedObtaining ns3Compiling/Building ns3

First ExampleSimulation Scripts

Running ScriptsLoggingHelpersTracing

Second ExampleMore Advanced Features

Command-line arguments

Introduction to ns3

ns3 is a network simulator for research simulation purposes.I Discrete event simulator

I Written in C++ and released under the terms of the GNUGPLv2

I User scripts are written in C++, or via Python bindingsprovided to C++ APIs

I Simuator entities are analogous to the real world (sockets,applications, channels, etc.)

I Modular simulator coreI Redsigned from scratch (only a spiritual sucessor to ns2)

Introduction to ns3

ns3 is a network simulator for research simulation purposes.I Discrete event simulatorI Written in C++ and released under the terms of the GNU

GPLv2

I User scripts are written in C++, or via Python bindingsprovided to C++ APIs

I Simuator entities are analogous to the real world (sockets,applications, channels, etc.)

I Modular simulator coreI Redsigned from scratch (only a spiritual sucessor to ns2)

Introduction to ns3

ns3 is a network simulator for research simulation purposes.I Discrete event simulatorI Written in C++ and released under the terms of the GNU

GPLv2I User scripts are written in C++, or via Python bindings

provided to C++ APIs

I Simuator entities are analogous to the real world (sockets,applications, channels, etc.)

I Modular simulator coreI Redsigned from scratch (only a spiritual sucessor to ns2)

Introduction to ns3

ns3 is a network simulator for research simulation purposes.I Discrete event simulatorI Written in C++ and released under the terms of the GNU

GPLv2I User scripts are written in C++, or via Python bindings

provided to C++ APIsI Simuator entities are analogous to the real world (sockets,

applications, channels, etc.)

I Modular simulator coreI Redsigned from scratch (only a spiritual sucessor to ns2)

Introduction to ns3

ns3 is a network simulator for research simulation purposes.I Discrete event simulatorI Written in C++ and released under the terms of the GNU

GPLv2I User scripts are written in C++, or via Python bindings

provided to C++ APIsI Simuator entities are analogous to the real world (sockets,

applications, channels, etc.)I Modular simulator core

I Redsigned from scratch (only a spiritual sucessor to ns2)

Introduction to ns3

ns3 is a network simulator for research simulation purposes.I Discrete event simulatorI Written in C++ and released under the terms of the GNU

GPLv2I User scripts are written in C++, or via Python bindings

provided to C++ APIsI Simuator entities are analogous to the real world (sockets,

applications, channels, etc.)I Modular simulator coreI Redsigned from scratch (only a spiritual sucessor to ns2)

Design goals and Motivation

I Easy extensibilityI Understandibility for programmers.I Open source and free (as in freedom).I Multi-platform (*NIX systems, including Windows via

cygwin)I Ease of contributing, open development community.I Use of real world concepts

I Real code integration (real linux stacks, real socketsapplication binaries)

I Emulation mode - inject real packets into real networks

Design goals and Motivation

I Easy extensibility

I Understandibility for programmers.I Open source and free (as in freedom).I Multi-platform (*NIX systems, including Windows via

cygwin)I Ease of contributing, open development community.I Use of real world concepts

I Real code integration (real linux stacks, real socketsapplication binaries)

I Emulation mode - inject real packets into real networks

Design goals and Motivation

I Easy extensibilityI Understandibility for programmers.

I Open source and free (as in freedom).I Multi-platform (*NIX systems, including Windows via

cygwin)I Ease of contributing, open development community.I Use of real world concepts

I Real code integration (real linux stacks, real socketsapplication binaries)

I Emulation mode - inject real packets into real networks

Design goals and Motivation

I Easy extensibilityI Understandibility for programmers.I Open source and free (as in freedom).

I Multi-platform (*NIX systems, including Windows viacygwin)

I Ease of contributing, open development community.I Use of real world concepts

I Real code integration (real linux stacks, real socketsapplication binaries)

I Emulation mode - inject real packets into real networks

Design goals and Motivation

I Easy extensibilityI Understandibility for programmers.I Open source and free (as in freedom).I Multi-platform (*NIX systems, including Windows via

cygwin)

I Ease of contributing, open development community.I Use of real world concepts

I Real code integration (real linux stacks, real socketsapplication binaries)

I Emulation mode - inject real packets into real networks

Design goals and Motivation

I Easy extensibilityI Understandibility for programmers.I Open source and free (as in freedom).I Multi-platform (*NIX systems, including Windows via

cygwin)I Ease of contributing, open development community.

I Use of real world conceptsI Real code integration (real linux stacks, real sockets

application binaries)I Emulation mode - inject real packets into real networks

Design goals and Motivation

I Easy extensibilityI Understandibility for programmers.I Open source and free (as in freedom).I Multi-platform (*NIX systems, including Windows via

cygwin)I Ease of contributing, open development community.I Use of real world concepts

I Real code integration (real linux stacks, real socketsapplication binaries)

I Emulation mode - inject real packets into real networks

Design goals and Motivation

I Easy extensibilityI Understandibility for programmers.I Open source and free (as in freedom).I Multi-platform (*NIX systems, including Windows via

cygwin)I Ease of contributing, open development community.I Use of real world concepts

I Real code integration (real linux stacks, real socketsapplication binaries)

I Emulation mode - inject real packets into real networks

Design goals and Motivation

I Easy extensibilityI Understandibility for programmers.I Open source and free (as in freedom).I Multi-platform (*NIX systems, including Windows via

cygwin)I Ease of contributing, open development community.I Use of real world concepts

I Real code integration (real linux stacks, real socketsapplication binaries)

I Emulation mode - inject real packets into real networks

Simulated Entities

Simulated Entities

I Nodes

Entities which form the network, connected by channelsI Applications

Typically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I ProtocolsManage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I ApplicationsTypically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I ProtocolsManage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I Applications

Typically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I ProtocolsManage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I ApplicationsTypically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I ProtocolsManage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I ApplicationsTypically the final data sending/receiving entities, exist onnodes

I Packets

What is sent across networksI Protocols

Manage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I ApplicationsTypically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I ProtocolsManage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I ApplicationsTypically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I Protocols

Manage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I ApplicationsTypically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I ProtocolsManage connectivity

A sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I ApplicationsTypically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I ProtocolsManage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I ApplicationsTypically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I ProtocolsManage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevices

Interfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I ApplicationsTypically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I ProtocolsManage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I ApplicationsTypically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I ProtocolsManage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I Channels

Medium of transmission

Simulated Entities

I NodesEntities which form the network, connected by channels

I ApplicationsTypically the final data sending/receiving entities, exist onnodes

I PacketsWhat is sent across networks

I ProtocolsManage connectivityA sockets like API exists for Applications to send andreceive data through protocols

I NetDevicesInterfaces protocol stack with channels/physical tranmissionmedium

I ChannelsMedium of transmission

Simulated Entities

Nodes

I Abstraction of the "boxes" in your networkI Basically function as a collection of applications, protocol

stacks, and netdevicesI In the internet, these are the end hosts, routers, servers,

etc.I In MANETs, these are the mobile hosts, in WSNs, sensors,

in cell networks, phones, etc.

NodesI Abstraction of the "boxes" in your network

I Basically function as a collection of applications, protocolstacks, and netdevices

I In the internet, these are the end hosts, routers, servers,etc.

I In MANETs, these are the mobile hosts, in WSNs, sensors,in cell networks, phones, etc.

NodesI Abstraction of the "boxes" in your networkI Basically function as a collection of applications, protocol

stacks, and netdevices

I In the internet, these are the end hosts, routers, servers,etc.

I In MANETs, these are the mobile hosts, in WSNs, sensors,in cell networks, phones, etc.

NodesI Abstraction of the "boxes" in your networkI Basically function as a collection of applications, protocol

stacks, and netdevicesI In the internet, these are the end hosts, routers, servers,

etc.

I In MANETs, these are the mobile hosts, in WSNs, sensors,in cell networks, phones, etc.

NodesI Abstraction of the "boxes" in your networkI Basically function as a collection of applications, protocol

stacks, and netdevicesI In the internet, these are the end hosts, routers, servers,

etc.I In MANETs, these are the mobile hosts, in WSNs, sensors,

in cell networks, phones, etc.

NodesI Abstraction of the "boxes" in your networkI Basically function as a collection of applications, protocol

stacks, and netdevicesI In the internet, these are the end hosts, routers, servers,

etc.I In MANETs, these are the mobile hosts, in WSNs, sensors,

in cell networks, phones, etc.

Applications

I These generate and consume traffic in the networksI Simple sending applications such as bulk data transfer,

constant bitrate transfer, random on-off transfer, and echoare supported presently out of the box

I Simple consuming application which sinks Packets is alsocurrently supported

I Researchers will develop application models as their workwill require

Applications

I These generate and consume traffic in the networks

I Simple sending applications such as bulk data transfer,constant bitrate transfer, random on-off transfer, and echoare supported presently out of the box

I Simple consuming application which sinks Packets is alsocurrently supported

I Researchers will develop application models as their workwill require

Applications

I These generate and consume traffic in the networksI Simple sending applications such as bulk data transfer,

constant bitrate transfer, random on-off transfer, and echoare supported presently out of the box

I Simple consuming application which sinks Packets is alsocurrently supported

I Researchers will develop application models as their workwill require

Applications

I These generate and consume traffic in the networksI Simple sending applications such as bulk data transfer,

constant bitrate transfer, random on-off transfer, and echoare supported presently out of the box

I Simple consuming application which sinks Packets is alsocurrently supported

I Researchers will develop application models as their workwill require

Applications

I These generate and consume traffic in the networksI Simple sending applications such as bulk data transfer,

constant bitrate transfer, random on-off transfer, and echoare supported presently out of the box

I Simple consuming application which sinks Packets is alsocurrently supported

I Researchers will develop application models as their workwill require

Packets

I Actual network trafficI "Packet" refers to this data at all layers of the protocol stackI Very smart byte buffers; all packet data is internally

represented as a serialized string of bytes. Contrast withother simulators which use a list of header objects.

I Header object concept retained, but headers are serializedtransparently into the Packet when added.

I Optimized with the copy-on-write (COW) technique;copying/passing packets as parameters isn’t asmemory/time consuming.

Packets

I Actual network traffic

I "Packet" refers to this data at all layers of the protocol stackI Very smart byte buffers; all packet data is internally

represented as a serialized string of bytes. Contrast withother simulators which use a list of header objects.

I Header object concept retained, but headers are serializedtransparently into the Packet when added.

I Optimized with the copy-on-write (COW) technique;copying/passing packets as parameters isn’t asmemory/time consuming.

Packets

I Actual network trafficI "Packet" refers to this data at all layers of the protocol stack

I Very smart byte buffers; all packet data is internallyrepresented as a serialized string of bytes. Contrast withother simulators which use a list of header objects.

I Header object concept retained, but headers are serializedtransparently into the Packet when added.

I Optimized with the copy-on-write (COW) technique;copying/passing packets as parameters isn’t asmemory/time consuming.

Packets

I Actual network trafficI "Packet" refers to this data at all layers of the protocol stackI Very smart byte buffers; all packet data is internally

represented as a serialized string of bytes. Contrast withother simulators which use a list of header objects.

I Header object concept retained, but headers are serializedtransparently into the Packet when added.

I Optimized with the copy-on-write (COW) technique;copying/passing packets as parameters isn’t asmemory/time consuming.

Packets

I Actual network trafficI "Packet" refers to this data at all layers of the protocol stackI Very smart byte buffers; all packet data is internally

represented as a serialized string of bytes. Contrast withother simulators which use a list of header objects.

I Header object concept retained, but headers are serializedtransparently into the Packet when added.

I Optimized with the copy-on-write (COW) technique;copying/passing packets as parameters isn’t asmemory/time consuming.

Packets

I Actual network trafficI "Packet" refers to this data at all layers of the protocol stackI Very smart byte buffers; all packet data is internally

represented as a serialized string of bytes. Contrast withother simulators which use a list of header objects.

I Header object concept retained, but headers are serializedtransparently into the Packet when added.

I Optimized with the copy-on-write (COW) technique;copying/passing packets as parameters isn’t asmemory/time consuming.

Packets

I Overall benefit: packet internal representation is the sameas the real world. Means easy support of e.g. PCAPtraces, emulation mode.

I Optionally has a non-serialized "metadata" which keepstrack of headers and trailers for easy printing.

I Supports "tag" objects which can be used for e.g. flow ID,cross-layer info, delay/jitter calculation, etc. Contrast withhacking extra fields into ns2 headers.

PacketsI Overall benefit: packet internal representation is the same

as the real world. Means easy support of e.g. PCAPtraces, emulation mode.

I Optionally has a non-serialized "metadata" which keepstrack of headers and trailers for easy printing.

I Supports "tag" objects which can be used for e.g. flow ID,cross-layer info, delay/jitter calculation, etc. Contrast withhacking extra fields into ns2 headers.

PacketsI Overall benefit: packet internal representation is the same

as the real world. Means easy support of e.g. PCAPtraces, emulation mode.

I Optionally has a non-serialized "metadata" which keepstrack of headers and trailers for easy printing.

I Supports "tag" objects which can be used for e.g. flow ID,cross-layer info, delay/jitter calculation, etc. Contrast withhacking extra fields into ns2 headers.

PacketsI Overall benefit: packet internal representation is the same

as the real world. Means easy support of e.g. PCAPtraces, emulation mode.

I Optionally has a non-serialized "metadata" which keepstrack of headers and trailers for easy printing.

I Supports "tag" objects which can be used for e.g. flow ID,cross-layer info, delay/jitter calculation, etc. Contrast withhacking extra fields into ns2 headers.

PacketsI Overall benefit: packet internal representation is the same

as the real world. Means easy support of e.g. PCAPtraces, emulation mode.

I Optionally has a non-serialized "metadata" which keepstrack of headers and trailers for easy printing.

I Supports "tag" objects which can be used for e.g. flow ID,cross-layer info, delay/jitter calculation, etc. Contrast withhacking extra fields into ns2 headers.

Protocols

I Sit between Applications and NetDevices, brokerconnections, medium access, addressing, routing, etc

I Full internet-stack supported, with IPv4, v6 on the way,TCP, UDP, ARP

I Also uses Network Simulation Cradle technology to allowthe use of unmodified Linux kernel network stack code,with similar support for BSD on the way

I Global static precomputed routing available for wired typeof topologies, OLSR for wireless

Protocols

I Sit between Applications and NetDevices, brokerconnections, medium access, addressing, routing, etc

I Full internet-stack supported, with IPv4, v6 on the way,TCP, UDP, ARP

I Also uses Network Simulation Cradle technology to allowthe use of unmodified Linux kernel network stack code,with similar support for BSD on the way

I Global static precomputed routing available for wired typeof topologies, OLSR for wireless

Protocols

I Sit between Applications and NetDevices, brokerconnections, medium access, addressing, routing, etc

I Full internet-stack supported, with IPv4, v6 on the way,TCP, UDP, ARP

I Also uses Network Simulation Cradle technology to allowthe use of unmodified Linux kernel network stack code,with similar support for BSD on the way

I Global static precomputed routing available for wired typeof topologies, OLSR for wireless

Protocols

I Sit between Applications and NetDevices, brokerconnections, medium access, addressing, routing, etc

I Full internet-stack supported, with IPv4, v6 on the way,TCP, UDP, ARP

I Also uses Network Simulation Cradle technology to allowthe use of unmodified Linux kernel network stack code,with similar support for BSD on the way

I Global static precomputed routing available for wired typeof topologies, OLSR for wireless

Protocols

I Sit between Applications and NetDevices, brokerconnections, medium access, addressing, routing, etc

I Full internet-stack supported, with IPv4, v6 on the way,TCP, UDP, ARP

I Also uses Network Simulation Cradle technology to allowthe use of unmodified Linux kernel network stack code,with similar support for BSD on the way

I Global static precomputed routing available for wired typeof topologies, OLSR for wireless

NetDevices

I Actual interface between the protocol stack and theChannel

I Modelizes e.g. the ethernet card of your PCI ns3 inherently supports multiple interfaces per node, of

different typesI Currently types include 802.11, ethernet-like CSMA,

serial-like point-to-pointI Also some bridging code which allows traffic to flow across

devices types on a node, e.g.wired⇔ wireless

NetDevicesI Actual interface between the protocol stack and the

Channel

I Modelizes e.g. the ethernet card of your PCI ns3 inherently supports multiple interfaces per node, of

different typesI Currently types include 802.11, ethernet-like CSMA,

serial-like point-to-pointI Also some bridging code which allows traffic to flow across

devices types on a node, e.g.wired⇔ wireless

NetDevicesI Actual interface between the protocol stack and the

ChannelI Modelizes e.g. the ethernet card of your PC

I ns3 inherently supports multiple interfaces per node, ofdifferent types

I Currently types include 802.11, ethernet-like CSMA,serial-like point-to-point

I Also some bridging code which allows traffic to flow acrossdevices types on a node, e.g.wired⇔ wireless

NetDevicesI Actual interface between the protocol stack and the

ChannelI Modelizes e.g. the ethernet card of your PCI ns3 inherently supports multiple interfaces per node, of

different types

I Currently types include 802.11, ethernet-like CSMA,serial-like point-to-point

I Also some bridging code which allows traffic to flow acrossdevices types on a node, e.g.wired⇔ wireless

NetDevicesI Actual interface between the protocol stack and the

ChannelI Modelizes e.g. the ethernet card of your PCI ns3 inherently supports multiple interfaces per node, of

different typesI Currently types include 802.11, ethernet-like CSMA,

serial-like point-to-point

I Also some bridging code which allows traffic to flow acrossdevices types on a node, e.g.wired⇔ wireless

NetDevicesI Actual interface between the protocol stack and the

ChannelI Modelizes e.g. the ethernet card of your PCI ns3 inherently supports multiple interfaces per node, of

different typesI Currently types include 802.11, ethernet-like CSMA,

serial-like point-to-pointI Also some bridging code which allows traffic to flow across

devices types on a node, e.g.wired⇔ wireless

Channels

I Model for the transmission mediumI Typically have a data capacity, transmission delay, loss

characteristics, etc.I Connects two or more NetDevices together such that

Packets can be transmitted and received.I Typicaly implemented as a list of connected NetDevices,

with APIs for sending and receiving on the mediumI ns3 has models for both point-to-point and multipoint

channels (simple serial channel, ethernet-like CSMA, and802.11)

I NetDevice types are tied to the Channel types, i.e. wifidevices must be on wifi channel

Channels

I Model for the transmission medium

I Typically have a data capacity, transmission delay, losscharacteristics, etc.

I Connects two or more NetDevices together such thatPackets can be transmitted and received.

I Typicaly implemented as a list of connected NetDevices,with APIs for sending and receiving on the medium

I ns3 has models for both point-to-point and multipointchannels (simple serial channel, ethernet-like CSMA, and802.11)

I NetDevice types are tied to the Channel types, i.e. wifidevices must be on wifi channel

Channels

I Model for the transmission mediumI Typically have a data capacity, transmission delay, loss

characteristics, etc.

I Connects two or more NetDevices together such thatPackets can be transmitted and received.

I Typicaly implemented as a list of connected NetDevices,with APIs for sending and receiving on the medium

I ns3 has models for both point-to-point and multipointchannels (simple serial channel, ethernet-like CSMA, and802.11)

I NetDevice types are tied to the Channel types, i.e. wifidevices must be on wifi channel

Channels

I Model for the transmission mediumI Typically have a data capacity, transmission delay, loss

characteristics, etc.I Connects two or more NetDevices together such that

Packets can be transmitted and received.

I Typicaly implemented as a list of connected NetDevices,with APIs for sending and receiving on the medium

I ns3 has models for both point-to-point and multipointchannels (simple serial channel, ethernet-like CSMA, and802.11)

I NetDevice types are tied to the Channel types, i.e. wifidevices must be on wifi channel

Channels

I Model for the transmission mediumI Typically have a data capacity, transmission delay, loss

characteristics, etc.I Connects two or more NetDevices together such that

Packets can be transmitted and received.I Typicaly implemented as a list of connected NetDevices,

with APIs for sending and receiving on the medium

I ns3 has models for both point-to-point and multipointchannels (simple serial channel, ethernet-like CSMA, and802.11)

I NetDevice types are tied to the Channel types, i.e. wifidevices must be on wifi channel

Channels

I Model for the transmission mediumI Typically have a data capacity, transmission delay, loss

characteristics, etc.I Connects two or more NetDevices together such that

Packets can be transmitted and received.I Typicaly implemented as a list of connected NetDevices,

with APIs for sending and receiving on the mediumI ns3 has models for both point-to-point and multipoint

channels (simple serial channel, ethernet-like CSMA, and802.11)

I NetDevice types are tied to the Channel types, i.e. wifidevices must be on wifi channel

Channels

I Model for the transmission mediumI Typically have a data capacity, transmission delay, loss

characteristics, etc.I Connects two or more NetDevices together such that

Packets can be transmitted and received.I Typicaly implemented as a list of connected NetDevices,

with APIs for sending and receiving on the mediumI ns3 has models for both point-to-point and multipoint

channels (simple serial channel, ethernet-like CSMA, and802.11)

I NetDevice types are tied to the Channel types, i.e. wifidevices must be on wifi channel

The Simulator

I Simulation time moves discretely from event to eventI Simulation schedules events to occur at specific times, e.g.

"Schedule the receipt of this packet after some delay".I Scheduler priority queue; events are ordered by time of

executionI Events invoke a function; implemented using callbacksI Simulator::Run() method starts processing events from the

queue one by oneI Simulation is over when event queue is empty, or at a

scheduled stop event at user specified time

The Simulator

I Simulation time moves discretely from event to event

I Simulation schedules events to occur at specific times, e.g."Schedule the receipt of this packet after some delay".

I Scheduler priority queue; events are ordered by time ofexecution

I Events invoke a function; implemented using callbacksI Simulator::Run() method starts processing events from the

queue one by oneI Simulation is over when event queue is empty, or at a

scheduled stop event at user specified time

The Simulator

I Simulation time moves discretely from event to eventI Simulation schedules events to occur at specific times, e.g.

"Schedule the receipt of this packet after some delay".

I Scheduler priority queue; events are ordered by time ofexecution

I Events invoke a function; implemented using callbacksI Simulator::Run() method starts processing events from the

queue one by oneI Simulation is over when event queue is empty, or at a

scheduled stop event at user specified time

The Simulator

I Simulation time moves discretely from event to eventI Simulation schedules events to occur at specific times, e.g.

"Schedule the receipt of this packet after some delay".I Scheduler priority queue; events are ordered by time of

execution

I Events invoke a function; implemented using callbacksI Simulator::Run() method starts processing events from the

queue one by oneI Simulation is over when event queue is empty, or at a

scheduled stop event at user specified time

The Simulator

I Simulation time moves discretely from event to eventI Simulation schedules events to occur at specific times, e.g.

"Schedule the receipt of this packet after some delay".I Scheduler priority queue; events are ordered by time of

executionI Events invoke a function; implemented using callbacks

I Simulator::Run() method starts processing events from thequeue one by one

I Simulation is over when event queue is empty, or at ascheduled stop event at user specified time

The Simulator

I Simulation time moves discretely from event to eventI Simulation schedules events to occur at specific times, e.g.

"Schedule the receipt of this packet after some delay".I Scheduler priority queue; events are ordered by time of

executionI Events invoke a function; implemented using callbacksI Simulator::Run() method starts processing events from the

queue one by one

I Simulation is over when event queue is empty, or at ascheduled stop event at user specified time

The Simulator

I Simulation time moves discretely from event to eventI Simulation schedules events to occur at specific times, e.g.

"Schedule the receipt of this packet after some delay".I Scheduler priority queue; events are ordered by time of

executionI Events invoke a function; implemented using callbacksI Simulator::Run() method starts processing events from the

queue one by oneI Simulation is over when event queue is empty, or at a

scheduled stop event at user specified time

Getting Started With ns3

Obtaining ns3

I Distributed as source code (no binaries maintained by thens3 core developers)

I Via mercurial repository: http://code.nsnam.org/I All previous releases are kept here, as well as experimental

and developmental branchesI Tarball source releases http://www.nsnam.org

Obtaining ns3

I Distributed as source code (no binaries maintained by thens3 core developers)

I Via mercurial repository: http://code.nsnam.org/I All previous releases are kept here, as well as experimental

and developmental branchesI Tarball source releases http://www.nsnam.org

Obtaining ns3

I Distributed as source code (no binaries maintained by thens3 core developers)

I Via mercurial repository: http://code.nsnam.org/

I All previous releases are kept here, as well as experimentaland developmental branches

I Tarball source releases http://www.nsnam.org

Obtaining ns3

I Distributed as source code (no binaries maintained by thens3 core developers)

I Via mercurial repository: http://code.nsnam.org/I All previous releases are kept here, as well as experimental

and developmental branches

I Tarball source releases http://www.nsnam.org

Obtaining ns3

I Distributed as source code (no binaries maintained by thens3 core developers)

I Via mercurial repository: http://code.nsnam.org/I All previous releases are kept here, as well as experimental

and developmental branchesI Tarball source releases http://www.nsnam.org

Compiling/Building ns3

I Prerequisites:I GNU compiler toolchain on Linux, Mac OS, or Windows (via

Cygwin or MinGW)I Python 2.4 or newer

I ns3 uses the waf build system based on Python (instead ofthe GNU autotools configure, make, etc)

I Just run ./waf in the source directory; this is like ./configure&& make

I waf not only builds ns3 , it can be used to run exampleprograms

I Now you are ready for your first example program, found inexamples/first.cc

I Copy this file into the scratch directory and run with thecommand ./waf --run scratch/first

Compiling/Building ns3

I Prerequisites:

I GNU compiler toolchain on Linux, Mac OS, or Windows (viaCygwin or MinGW)

I Python 2.4 or newerI ns3 uses the waf build system based on Python (instead of

the GNU autotools configure, make, etc)I Just run ./waf in the source directory; this is like ./configure

&& makeI waf not only builds ns3 , it can be used to run example

programsI Now you are ready for your first example program, found in

examples/first.ccI Copy this file into the scratch directory and run with the

command ./waf --run scratch/first

Compiling/Building ns3

I Prerequisites:I GNU compiler toolchain on Linux, Mac OS, or Windows (via

Cygwin or MinGW)

I Python 2.4 or newerI ns3 uses the waf build system based on Python (instead of

the GNU autotools configure, make, etc)I Just run ./waf in the source directory; this is like ./configure

&& makeI waf not only builds ns3 , it can be used to run example

programsI Now you are ready for your first example program, found in

examples/first.ccI Copy this file into the scratch directory and run with the

command ./waf --run scratch/first

Compiling/Building ns3

I Prerequisites:I GNU compiler toolchain on Linux, Mac OS, or Windows (via

Cygwin or MinGW)I Python 2.4 or newer

I ns3 uses the waf build system based on Python (instead ofthe GNU autotools configure, make, etc)

I Just run ./waf in the source directory; this is like ./configure&& make

I waf not only builds ns3 , it can be used to run exampleprograms

I Now you are ready for your first example program, found inexamples/first.cc

I Copy this file into the scratch directory and run with thecommand ./waf --run scratch/first

Compiling/Building ns3

I Prerequisites:I GNU compiler toolchain on Linux, Mac OS, or Windows (via

Cygwin or MinGW)I Python 2.4 or newer

I ns3 uses the waf build system based on Python (instead ofthe GNU autotools configure, make, etc)

I Just run ./waf in the source directory; this is like ./configure&& make

I waf not only builds ns3 , it can be used to run exampleprograms

I Now you are ready for your first example program, found inexamples/first.cc

I Copy this file into the scratch directory and run with thecommand ./waf --run scratch/first

Compiling/Building ns3

I Prerequisites:I GNU compiler toolchain on Linux, Mac OS, or Windows (via

Cygwin or MinGW)I Python 2.4 or newer

I ns3 uses the waf build system based on Python (instead ofthe GNU autotools configure, make, etc)

I Just run ./waf in the source directory; this is like ./configure&& make

I waf not only builds ns3 , it can be used to run exampleprograms

I Now you are ready for your first example program, found inexamples/first.cc

I Copy this file into the scratch directory and run with thecommand ./waf --run scratch/first

Compiling/Building ns3

I Prerequisites:I GNU compiler toolchain on Linux, Mac OS, or Windows (via

Cygwin or MinGW)I Python 2.4 or newer

I ns3 uses the waf build system based on Python (instead ofthe GNU autotools configure, make, etc)

I Just run ./waf in the source directory; this is like ./configure&& make

I waf not only builds ns3 , it can be used to run exampleprograms

I Now you are ready for your first example program, found inexamples/first.cc

I Copy this file into the scratch directory and run with thecommand ./waf --run scratch/first

Compiling/Building ns3

I Prerequisites:I GNU compiler toolchain on Linux, Mac OS, or Windows (via

Cygwin or MinGW)I Python 2.4 or newer

I ns3 uses the waf build system based on Python (instead ofthe GNU autotools configure, make, etc)

I Just run ./waf in the source directory; this is like ./configure&& make

I waf not only builds ns3 , it can be used to run exampleprograms

I Now you are ready for your first example program, found inexamples/first.cc

I Copy this file into the scratch directory and run with thecommand ./waf --run scratch/first

Compiling/Building ns3

I Prerequisites:I GNU compiler toolchain on Linux, Mac OS, or Windows (via

Cygwin or MinGW)I Python 2.4 or newer

I ns3 uses the waf build system based on Python (instead ofthe GNU autotools configure, make, etc)

I Just run ./waf in the source directory; this is like ./configure&& make

I waf not only builds ns3 , it can be used to run exampleprograms

I Now you are ready for your first example program, found inexamples/first.cc

I Copy this file into the scratch directory and run with thecommand ./waf --run scratch/first

Example Code: first.cc

Running Examples and Scripts

I All of the *.cc files in the examples directory can be runwith ./waf –run ...

I In addition, you can drop simulation scripts into the scratchdirectory, and they will be built automatically (what we didwith first.cc)

I Run things from the scratch directory with ./waf --runscratch/...

I Advanced users can write their simulations scripts, includethe ns3 headers, and link against the ns3 library,bypassing waf for their simulations altogether

Running Examples and Scripts

I All of the *.cc files in the examples directory can be runwith ./waf –run ...

I In addition, you can drop simulation scripts into the scratchdirectory, and they will be built automatically (what we didwith first.cc)

I Run things from the scratch directory with ./waf --runscratch/...

I Advanced users can write their simulations scripts, includethe ns3 headers, and link against the ns3 library,bypassing waf for their simulations altogether

Running Examples and Scripts

I All of the *.cc files in the examples directory can be runwith ./waf –run ...

I In addition, you can drop simulation scripts into the scratchdirectory, and they will be built automatically (what we didwith first.cc)

I Run things from the scratch directory with ./waf --runscratch/...

I Advanced users can write their simulations scripts, includethe ns3 headers, and link against the ns3 library,bypassing waf for their simulations altogether

Running Examples and Scripts

I All of the *.cc files in the examples directory can be runwith ./waf –run ...

I In addition, you can drop simulation scripts into the scratchdirectory, and they will be built automatically (what we didwith first.cc)

I Run things from the scratch directory with ./waf --runscratch/...

I Advanced users can write their simulations scripts, includethe ns3 headers, and link against the ns3 library,bypassing waf for their simulations altogether

Running Examples and Scripts

I All of the *.cc files in the examples directory can be runwith ./waf –run ...

I In addition, you can drop simulation scripts into the scratchdirectory, and they will be built automatically (what we didwith first.cc)

I Run things from the scratch directory with ./waf --runscratch/...

I Advanced users can write their simulations scripts, includethe ns3 headers, and link against the ns3 library,bypassing waf for their simulations altogether

Logging

I Runtime messages indicating debugging info, and softerrors/warnings

I Provide understanding the internals of modelI Can be runtime enabled with LogComponentEnableI Should not necessarily be used to trace the simulation,

there is separate tracing functionalityI UDP echo example: logging output the "Sent 1024 bytes to

10.1.1.2..." messages

Logging

I Runtime messages indicating debugging info, and softerrors/warnings

I Provide understanding the internals of modelI Can be runtime enabled with LogComponentEnableI Should not necessarily be used to trace the simulation,

there is separate tracing functionalityI UDP echo example: logging output the "Sent 1024 bytes to

10.1.1.2..." messages

Logging

I Runtime messages indicating debugging info, and softerrors/warnings

I Provide understanding the internals of model

I Can be runtime enabled with LogComponentEnableI Should not necessarily be used to trace the simulation,

there is separate tracing functionalityI UDP echo example: logging output the "Sent 1024 bytes to

10.1.1.2..." messages

Logging

I Runtime messages indicating debugging info, and softerrors/warnings

I Provide understanding the internals of modelI Can be runtime enabled with LogComponentEnable

I Should not necessarily be used to trace the simulation,there is separate tracing functionality

I UDP echo example: logging output the "Sent 1024 bytes to10.1.1.2..." messages

Logging

I Runtime messages indicating debugging info, and softerrors/warnings

I Provide understanding the internals of modelI Can be runtime enabled with LogComponentEnableI Should not necessarily be used to trace the simulation,

there is separate tracing functionality

I UDP echo example: logging output the "Sent 1024 bytes to10.1.1.2..." messages

Logging

I Runtime messages indicating debugging info, and softerrors/warnings

I Provide understanding the internals of modelI Can be runtime enabled with LogComponentEnableI Should not necessarily be used to trace the simulation,

there is separate tracing functionalityI UDP echo example: logging output the "Sent 1024 bytes to

10.1.1.2..." messages

Helpers

I Entities are not directly manipulated by the user one byone.

I Overlay API which allows manipulating these in groups.I Allows for quick scenario / topology construction.I Saw in first.cc

Helpers

I Entities are not directly manipulated by the user one byone.

I Overlay API which allows manipulating these in groups.I Allows for quick scenario / topology construction.I Saw in first.cc

Helpers

I Entities are not directly manipulated by the user one byone.

I Overlay API which allows manipulating these in groups.

I Allows for quick scenario / topology construction.I Saw in first.cc

Helpers

I Entities are not directly manipulated by the user one byone.

I Overlay API which allows manipulating these in groups.I Allows for quick scenario / topology construction.

I Saw in first.cc

Helpers

I Entities are not directly manipulated by the user one byone.

I Overlay API which allows manipulating these in groups.I Allows for quick scenario / topology construction.I Saw in first.cc

Tracing

I Tracing system allows simulation writers access to exactlythe interesting simulation info

I Lowest level functionality: a user specified callback isinvoked when a particular event occurs

I NetDevice recieves a frameI TCP congestion window changesI Random sending application sends a packetI A Queue drops a packetI etc.

I Can use these "hooks" can be used to generate PCAPoutput, collect statistics, results, etc.

I Primary method of data collection for analysis

Tracing

I Tracing system allows simulation writers access to exactlythe interesting simulation info

I Lowest level functionality: a user specified callback isinvoked when a particular event occurs

I NetDevice recieves a frameI TCP congestion window changesI Random sending application sends a packetI A Queue drops a packetI etc.

I Can use these "hooks" can be used to generate PCAPoutput, collect statistics, results, etc.

I Primary method of data collection for analysis

Tracing

I Tracing system allows simulation writers access to exactlythe interesting simulation info

I Lowest level functionality: a user specified callback isinvoked when a particular event occurs

I NetDevice recieves a frameI TCP congestion window changesI Random sending application sends a packetI A Queue drops a packetI etc.

I Can use these "hooks" can be used to generate PCAPoutput, collect statistics, results, etc.

I Primary method of data collection for analysis

Tracing

I Tracing system allows simulation writers access to exactlythe interesting simulation info

I Lowest level functionality: a user specified callback isinvoked when a particular event occurs

I NetDevice recieves a frame

I TCP congestion window changesI Random sending application sends a packetI A Queue drops a packetI etc.

I Can use these "hooks" can be used to generate PCAPoutput, collect statistics, results, etc.

I Primary method of data collection for analysis

Tracing

I Tracing system allows simulation writers access to exactlythe interesting simulation info

I Lowest level functionality: a user specified callback isinvoked when a particular event occurs

I NetDevice recieves a frameI TCP congestion window changes

I Random sending application sends a packetI A Queue drops a packetI etc.

I Can use these "hooks" can be used to generate PCAPoutput, collect statistics, results, etc.

I Primary method of data collection for analysis

Tracing

I Tracing system allows simulation writers access to exactlythe interesting simulation info

I Lowest level functionality: a user specified callback isinvoked when a particular event occurs

I NetDevice recieves a frameI TCP congestion window changesI Random sending application sends a packet

I A Queue drops a packetI etc.

I Can use these "hooks" can be used to generate PCAPoutput, collect statistics, results, etc.

I Primary method of data collection for analysis

Tracing

I Tracing system allows simulation writers access to exactlythe interesting simulation info

I Lowest level functionality: a user specified callback isinvoked when a particular event occurs

I NetDevice recieves a frameI TCP congestion window changesI Random sending application sends a packetI A Queue drops a packet

I etc.I Can use these "hooks" can be used to generate PCAP

output, collect statistics, results, etc.I Primary method of data collection for analysis

Tracing

I Tracing system allows simulation writers access to exactlythe interesting simulation info

I Lowest level functionality: a user specified callback isinvoked when a particular event occurs

I NetDevice recieves a frameI TCP congestion window changesI Random sending application sends a packetI A Queue drops a packetI etc.

I Can use these "hooks" can be used to generate PCAPoutput, collect statistics, results, etc.

I Primary method of data collection for analysis

Tracing

I Tracing system allows simulation writers access to exactlythe interesting simulation info

I Lowest level functionality: a user specified callback isinvoked when a particular event occurs

I NetDevice recieves a frameI TCP congestion window changesI Random sending application sends a packetI A Queue drops a packetI etc.

I Can use these "hooks" can be used to generate PCAPoutput, collect statistics, results, etc.

I Primary method of data collection for analysis

Tracing

I Tracing system allows simulation writers access to exactlythe interesting simulation info

I Lowest level functionality: a user specified callback isinvoked when a particular event occurs

I NetDevice recieves a frameI TCP congestion window changesI Random sending application sends a packetI A Queue drops a packetI etc.

I Can use these "hooks" can be used to generate PCAPoutput, collect statistics, results, etc.

I Primary method of data collection for analysis

Tracing

I Uses a namespace resemebling operating system paths toconnect a callback to an event, e.g.

I /NodeList/[i]/DeviceList/[j]/$ns3::WifiNetDevice/RxI Refers to Rx event on the jth NetDevice of the ith node

I These trace sources are connected to trace sinks, userprovided methods using Config::Connect, e.g.

I Config::Connect ("/NodeList/*/DeviceList/*/Tx",MakeCallback (&DevTxTrace));

I This gets the user provided function DevTxTrace anotification whenever any node, any NetDevices transmits apacket

I User provided function can log this to file, output to screen,calculate some statistics, etc.

I Complete list can be found in the Doxygen documentation

Tracing

I Uses a namespace resemebling operating system paths toconnect a callback to an event, e.g.

I /NodeList/[i]/DeviceList/[j]/$ns3::WifiNetDevice/RxI Refers to Rx event on the jth NetDevice of the ith node

I These trace sources are connected to trace sinks, userprovided methods using Config::Connect, e.g.

I Config::Connect ("/NodeList/*/DeviceList/*/Tx",MakeCallback (&DevTxTrace));

I This gets the user provided function DevTxTrace anotification whenever any node, any NetDevices transmits apacket

I User provided function can log this to file, output to screen,calculate some statistics, etc.

I Complete list can be found in the Doxygen documentation

Tracing

I Uses a namespace resemebling operating system paths toconnect a callback to an event, e.g.

I /NodeList/[i]/DeviceList/[j]/$ns3::WifiNetDevice/Rx

I Refers to Rx event on the jth NetDevice of the ith nodeI These trace sources are connected to trace sinks, user

provided methods using Config::Connect, e.g.I Config::Connect ("/NodeList/*/DeviceList/*/Tx",

MakeCallback (&DevTxTrace));I This gets the user provided function DevTxTrace a

notification whenever any node, any NetDevices transmits apacket

I User provided function can log this to file, output to screen,calculate some statistics, etc.

I Complete list can be found in the Doxygen documentation

Tracing

I Uses a namespace resemebling operating system paths toconnect a callback to an event, e.g.

I /NodeList/[i]/DeviceList/[j]/$ns3::WifiNetDevice/RxI Refers to Rx event on the jth NetDevice of the ith node

I These trace sources are connected to trace sinks, userprovided methods using Config::Connect, e.g.

I Config::Connect ("/NodeList/*/DeviceList/*/Tx",MakeCallback (&DevTxTrace));

I This gets the user provided function DevTxTrace anotification whenever any node, any NetDevices transmits apacket

I User provided function can log this to file, output to screen,calculate some statistics, etc.

I Complete list can be found in the Doxygen documentation

Tracing

I Uses a namespace resemebling operating system paths toconnect a callback to an event, e.g.

I /NodeList/[i]/DeviceList/[j]/$ns3::WifiNetDevice/RxI Refers to Rx event on the jth NetDevice of the ith node

I These trace sources are connected to trace sinks, userprovided methods using Config::Connect, e.g.

I Config::Connect ("/NodeList/*/DeviceList/*/Tx",MakeCallback (&DevTxTrace));

I This gets the user provided function DevTxTrace anotification whenever any node, any NetDevices transmits apacket

I User provided function can log this to file, output to screen,calculate some statistics, etc.

I Complete list can be found in the Doxygen documentation

Tracing

I Uses a namespace resemebling operating system paths toconnect a callback to an event, e.g.

I /NodeList/[i]/DeviceList/[j]/$ns3::WifiNetDevice/RxI Refers to Rx event on the jth NetDevice of the ith node

I These trace sources are connected to trace sinks, userprovided methods using Config::Connect, e.g.

I Config::Connect ("/NodeList/*/DeviceList/*/Tx",MakeCallback (&DevTxTrace));

I This gets the user provided function DevTxTrace anotification whenever any node, any NetDevices transmits apacket

I User provided function can log this to file, output to screen,calculate some statistics, etc.

I Complete list can be found in the Doxygen documentation

Tracing

I Uses a namespace resemebling operating system paths toconnect a callback to an event, e.g.

I /NodeList/[i]/DeviceList/[j]/$ns3::WifiNetDevice/RxI Refers to Rx event on the jth NetDevice of the ith node

I These trace sources are connected to trace sinks, userprovided methods using Config::Connect, e.g.

I Config::Connect ("/NodeList/*/DeviceList/*/Tx",MakeCallback (&DevTxTrace));

I This gets the user provided function DevTxTrace anotification whenever any node, any NetDevices transmits apacket

I User provided function can log this to file, output to screen,calculate some statistics, etc.

I Complete list can be found in the Doxygen documentation

Tracing

I Uses a namespace resemebling operating system paths toconnect a callback to an event, e.g.

I /NodeList/[i]/DeviceList/[j]/$ns3::WifiNetDevice/RxI Refers to Rx event on the jth NetDevice of the ith node

I These trace sources are connected to trace sinks, userprovided methods using Config::Connect, e.g.

I Config::Connect ("/NodeList/*/DeviceList/*/Tx",MakeCallback (&DevTxTrace));

I This gets the user provided function DevTxTrace anotification whenever any node, any NetDevices transmits apacket

I User provided function can log this to file, output to screen,calculate some statistics, etc.

I Complete list can be found in the Doxygen documentation

Tracing

I Uses a namespace resemebling operating system paths toconnect a callback to an event, e.g.

I /NodeList/[i]/DeviceList/[j]/$ns3::WifiNetDevice/RxI Refers to Rx event on the jth NetDevice of the ith node

I These trace sources are connected to trace sinks, userprovided methods using Config::Connect, e.g.

I Config::Connect ("/NodeList/*/DeviceList/*/Tx",MakeCallback (&DevTxTrace));

I This gets the user provided function DevTxTrace anotification whenever any node, any NetDevices transmits apacket

I User provided function can log this to file, output to screen,calculate some statistics, etc.

I Complete list can be found in the Doxygen documentation

Attributes

I The tracing namespace is reused for simulationconfiguration

I Attributes system allows you to change individualparameters on many simulations entities

I Also allows setting of global defaults for these parametersI Tweak the SIFS, DIFS, PIFS intervals for a specific

NetDevice’s MACI Set the initial congestion window size for all created TCP

instancesI etc.

I Uses the Config::Set and Config::SetDefault APIsI "ns3::WifiRemoteStationManager::RtsCtsThreshold"; used

to set RTS/CTS behavior in WifiI

"/NodeList/5/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/Speed";change the random waypoint mobility model on node 5 touse a uniform distribution random number generator togenerate the speeds

I More info in the doxygen documentation

AttributesI The tracing namespace is reused for simulation

configuration

I Attributes system allows you to change individualparameters on many simulations entities

I Also allows setting of global defaults for these parametersI Tweak the SIFS, DIFS, PIFS intervals for a specific

NetDevice’s MACI Set the initial congestion window size for all created TCP

instancesI etc.

I Uses the Config::Set and Config::SetDefault APIsI "ns3::WifiRemoteStationManager::RtsCtsThreshold"; used

to set RTS/CTS behavior in WifiI

"/NodeList/5/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/Speed";change the random waypoint mobility model on node 5 touse a uniform distribution random number generator togenerate the speeds

I More info in the doxygen documentation

AttributesI The tracing namespace is reused for simulation

configurationI Attributes system allows you to change individual

parameters on many simulations entities

I Also allows setting of global defaults for these parametersI Tweak the SIFS, DIFS, PIFS intervals for a specific

NetDevice’s MACI Set the initial congestion window size for all created TCP

instancesI etc.

I Uses the Config::Set and Config::SetDefault APIsI "ns3::WifiRemoteStationManager::RtsCtsThreshold"; used

to set RTS/CTS behavior in WifiI

"/NodeList/5/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/Speed";change the random waypoint mobility model on node 5 touse a uniform distribution random number generator togenerate the speeds

I More info in the doxygen documentation

AttributesI The tracing namespace is reused for simulation

configurationI Attributes system allows you to change individual

parameters on many simulations entitiesI Also allows setting of global defaults for these parameters

I Tweak the SIFS, DIFS, PIFS intervals for a specificNetDevice’s MAC

I Set the initial congestion window size for all created TCPinstances

I etc.I Uses the Config::Set and Config::SetDefault APIs

I "ns3::WifiRemoteStationManager::RtsCtsThreshold"; usedto set RTS/CTS behavior in Wifi

I

"/NodeList/5/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/Speed";change the random waypoint mobility model on node 5 touse a uniform distribution random number generator togenerate the speeds

I More info in the doxygen documentation

AttributesI The tracing namespace is reused for simulation

configurationI Attributes system allows you to change individual

parameters on many simulations entitiesI Also allows setting of global defaults for these parameters

I Tweak the SIFS, DIFS, PIFS intervals for a specificNetDevice’s MAC

I Set the initial congestion window size for all created TCPinstances

I etc.I Uses the Config::Set and Config::SetDefault APIs

I "ns3::WifiRemoteStationManager::RtsCtsThreshold"; usedto set RTS/CTS behavior in Wifi

I

"/NodeList/5/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/Speed";change the random waypoint mobility model on node 5 touse a uniform distribution random number generator togenerate the speeds

I More info in the doxygen documentation

AttributesI The tracing namespace is reused for simulation

configurationI Attributes system allows you to change individual

parameters on many simulations entitiesI Also allows setting of global defaults for these parameters

I Tweak the SIFS, DIFS, PIFS intervals for a specificNetDevice’s MAC

I Set the initial congestion window size for all created TCPinstances

I etc.I Uses the Config::Set and Config::SetDefault APIs

I "ns3::WifiRemoteStationManager::RtsCtsThreshold"; usedto set RTS/CTS behavior in Wifi

I

"/NodeList/5/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/Speed";change the random waypoint mobility model on node 5 touse a uniform distribution random number generator togenerate the speeds

I More info in the doxygen documentation

AttributesI The tracing namespace is reused for simulation

configurationI Attributes system allows you to change individual

parameters on many simulations entitiesI Also allows setting of global defaults for these parameters

I Tweak the SIFS, DIFS, PIFS intervals for a specificNetDevice’s MAC

I Set the initial congestion window size for all created TCPinstances

I etc.

I Uses the Config::Set and Config::SetDefault APIsI "ns3::WifiRemoteStationManager::RtsCtsThreshold"; used

to set RTS/CTS behavior in WifiI

"/NodeList/5/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/Speed";change the random waypoint mobility model on node 5 touse a uniform distribution random number generator togenerate the speeds

I More info in the doxygen documentation

AttributesI The tracing namespace is reused for simulation

configurationI Attributes system allows you to change individual

parameters on many simulations entitiesI Also allows setting of global defaults for these parameters

I Tweak the SIFS, DIFS, PIFS intervals for a specificNetDevice’s MAC

I Set the initial congestion window size for all created TCPinstances

I etc.I Uses the Config::Set and Config::SetDefault APIs

I "ns3::WifiRemoteStationManager::RtsCtsThreshold"; usedto set RTS/CTS behavior in Wifi

I

"/NodeList/5/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/Speed";change the random waypoint mobility model on node 5 touse a uniform distribution random number generator togenerate the speeds

I More info in the doxygen documentation

AttributesI The tracing namespace is reused for simulation

configurationI Attributes system allows you to change individual

parameters on many simulations entitiesI Also allows setting of global defaults for these parameters

I Tweak the SIFS, DIFS, PIFS intervals for a specificNetDevice’s MAC

I Set the initial congestion window size for all created TCPinstances

I etc.I Uses the Config::Set and Config::SetDefault APIs

I "ns3::WifiRemoteStationManager::RtsCtsThreshold"; usedto set RTS/CTS behavior in Wifi

I

"/NodeList/5/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/Speed";change the random waypoint mobility model on node 5 touse a uniform distribution random number generator togenerate the speeds

I More info in the doxygen documentation

AttributesI The tracing namespace is reused for simulation

configurationI Attributes system allows you to change individual

parameters on many simulations entitiesI Also allows setting of global defaults for these parameters

I Tweak the SIFS, DIFS, PIFS intervals for a specificNetDevice’s MAC

I Set the initial congestion window size for all created TCPinstances

I etc.I Uses the Config::Set and Config::SetDefault APIs

I "ns3::WifiRemoteStationManager::RtsCtsThreshold"; usedto set RTS/CTS behavior in Wifi

I

"/NodeList/5/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/Speed";change the random waypoint mobility model on node 5 touse a uniform distribution random number generator togenerate the speeds

I More info in the doxygen documentation

AttributesI The tracing namespace is reused for simulation

configurationI Attributes system allows you to change individual

parameters on many simulations entitiesI Also allows setting of global defaults for these parameters

I Tweak the SIFS, DIFS, PIFS intervals for a specificNetDevice’s MAC

I Set the initial congestion window size for all created TCPinstances

I etc.I Uses the Config::Set and Config::SetDefault APIs

I "ns3::WifiRemoteStationManager::RtsCtsThreshold"; usedto set RTS/CTS behavior in Wifi

I

"/NodeList/5/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/Speed";change the random waypoint mobility model on node 5 touse a uniform distribution random number generator togenerate the speeds

I More info in the doxygen documentation

Example Code: second.cc

I Allows for command line configuration of simulationparameters

I Can add custom command line arguments to modify; insecond.cc, we saw nCsma, the number of extra LAN nodes

Command-line arguments