Next:
4. The Class Simulator
Up:
The Manual (formerly Notes
Previous:
3.8 Class InstVar
Contents
Index
2
Simulator Basics
Subsections
4
. The Class Simulator
4
.
1
Simulator Initialization
4
.
2
Schedulers and Events
4
.
2
.
1
The List Scheduler
4
.
2
.
2
the heap scheduler
4
.
2
.
3
The Calendar Queue Scheduler
4
.
2
.
4
The Real-Time Scheduler
4
.
2
.
5
Precision of the scheduler clock used in ns
4
.
3
Other Methods
5
. Nodes and Packet Forwarding
5
.
1
Node Basics
5
.
2
Node Methods: Configuring the Node
5
.
3
Node Configuration Interface
5
.
4
The Classifier
5
.
4
.
1
Address Classifiers
5
.
4
.
2
Multicast Classifiers
5
.
4
.
3
MultiPath Classifier
5
.
4
.
4
Hash Classifier
5
.
4
.
5
Replicator
5
.
5
Routing Module and Classifier Organization
5
.
5
.
1
Routing Module
5
.
5
.
2
Node Interface
5
.
6
Commands at a glance
6
. Links: Simple Links
6
.
1
Instance Procedures for Links and SimpleLinks
6
.
2
Connectors
6
.
3
Object hierarchy
6
.
4
Commands at a glance
7
. Queue Management and Packet Scheduling
7
.
1
The C++ Queue Class
7
.
1
.
1
Queue blocking
7
.
1
.
2
PacketQueue Class
7
.
2
Example: Drop Tail
7
.
3
Different types of Queue objects
7
.
4
Commands at a glance
7
.
5
Queue/JoBS
7
.
5
.
1
The JoBS algorithm
7
.
5
.
1
.
1
Objective
7
.
5
.
1
.
2
Mechanisms
7
.
5
.
2
Configuration
7
.
5
.
2
.
1
Initial Setup
7
.
5
.
2
.
2
Creating the JoBS links
7
.
5
.
2
.
3
Marking the traffic
7
.
5
.
3
Tracing
7
.
5
.
4
Variables
7
.
5
.
4
.
1
JoBS objects
7
.
5
.
4
.
2
Marker objects
7
.
5
.
4
.
3
Demarker objects
7
.
5
.
5
Commands at a glance
7
.
5
.
5
.
1
JoBS objects
7
.
5
.
5
.
2
Marker objects
7
.
5
.
5
.
3
Demarker objects
8
. DOCSIS links
8
.
1
PIE and CoDel-DT
9
. Delays and Links
9
.
1
The LinkDelay Class
9
.
2
Commands at a glance
10
. Differentiated Services Module in
ns
10
.
1
Overview
10
.
2
Implementation
10
.
2
.
1
RED queue in DiffServ module
10
.
2
.
2
Edge and core routers
10
.
2
.
3
Policy
10
.
3
Configuration
10
.
4
Commands at a glance
11
. Agents
11
.
1
Agent state
11
.
2
Agent methods
11
.
3
Protocol Agents
11
.
4
OTcl Linkage
11
.
4
.
1
Creating and Manipulating Agents
11
.
4
.
2
Default Values
11
.
4
.
3
OTcl Methods
11
.
5
Examples: Tcp, TCP Sink Agents
11
.
5
.
1
Creating the Agent
11
.
5
.
2
Starting the Agent
11
.
5
.
3
Processing Input at Receiver
11
.
5
.
4
Processing Responses at the Sender
11
.
5
.
5
Implementing Timers
11
.
6
Creating a New Agent
11
.
6
.
1
Example: A ``ping'' requestor (Inheritance Structure)
11
.
6
.
2
The
recv
() and
timeout
() Methods
11
.
6
.
3
Linking the ``ping'' Agent with OTcl
11
.
6
.
4
Using the agent through OTcl
11
.
7
The Agent API
11
.
8
Different agent objects
11
.
9
Commands at a glance
12
. Timers
12
.
1
C++ abstract base class TimerHandler
12
.
1
.
1
Definition of a new timer
12
.
1
.
2
Example: Tcp retransmission timer
12
.
2
OTcl Timer class
12
.
3
Commands at a glance
13
. Packet Headers and Formats
13
.
1
A Protocol-Specific Packet Header
13
.
1
.
1
Adding a New Packet Header Type
13
.
1
.
2
Selectively Including Packet Headers in Your Simulation
13
.
2
Packet Classes
13
.
2
.
1
The Packet Class
13
.
2
.
2
p_info Class
13
.
2
.
3
The hdr_cmn Class
13
.
2
.
4
The PacketHeaderManager Class
13
.
3
Commands at a glance
14
. Error Model
14
.
1
Implementation
14
.
2
Configuration
14
.
3
Multi-state error model
14
.
4
Commands at a glance
15
. Local Area Networks
15
.
1
Tcl configuration
15
.
2
Components of a LAN
15
.
3
Channel Class
15
.
3
.
1
Channel State
15
.
3
.
2
Example: Channel and classifier of the physical layer
15
.
3
.
3
Channel Class in C++
15
.
4
MacClassifier Class
15
.
5
MAC Class
15
.
5
.
1
Mac State
15
.
5
.
2
Mac Methods
15
.
5
.
3
Mac Class in C++
15
.
5
.
4
CSMA-based MAC
15
.
6
LL (link-layer) Class
15
.
6
.
1
LL Class in C++
15
.
6
.
2
Example: Link Layer configuration
15
.
7
LanRouter class
15
.
8
Other Components
15
.
9
LANs and
ns
routing
15
.
10
Commands at a glance
16
. The (Revised) Addressing Structure in NS
16
.
1
The Default Address Format
16
.
2
The Hierarchical Address Format
16
.
2
.
1
Default Hierarchical Setting
16
.
2
.
2
Specific Hierarchical Setting
16
.
3
Errors in setting address format
16
.
4
Commands at a glance
17
. Mobile Networking in ns
17
.
1
The basic wireless model in ns
17
.
1
.
1
Mobilenode: creating wireless topology
17
.
1
.
2
Creating Node movements
17
.
1
.
3
Network Components in a mobilenode
17
.
1
.
4
Different MAC layer protocols for mobile networking
17
.
1
.
4
.
1
802.11 MAC protocol
17
.
1
.
4
.
2
Preamble based TDMA protocol
17
.
1
.
5
Different types of Routing Agents in mobile networking
17
.
1
.
5
.
1
DSDV
17
.
1
.
5
.
2
DSR
17
.
1
.
5
.
3
TORA
17
.
1
.
5
.
4
AODV
17
.
1
.
5
.
5
PUMA
17
.
1
.
5
.
6
M-DART
17
.
1
.
6
Trace Support
17
.
1
.
7
Revised format for wireless traces
17
.
1
.
7
.
1
Explanation of new trace format
17
.
1
.
8
Generation of node-movement and traffic-connection for wireless scenarios
17
.
1
.
8
.
1
MobileNode Movement
17
.
1
.
8
.
2
Generating traffic pattern files
17
.
2
Extensions made to CMU's wireless model
17
.
2
.
1
wired-cum-wireless scenarios
17
.
2
.
2
MobileIP
17
.
3
802.11 MAC protocol
17
.
4
Lists of changes for merging code developed in older version of ns (2.1b5 or later) into the current version (2.1b8)
17
.
5
Commands at a glance
18
. Satellite Networking in
ns
18
.
1
Overview of satellite models
18
.
1
.
1
Geostationary satellites
18
.
1
.
2
Low-earth-orbiting satellites
18
.
2
Using the satellite extensions
18
.
2
.
1
Nodes and node positions
18
.
2
.
2
Satellite links
18
.
2
.
3
Handoffs
18
.
2
.
4
Routing
18
.
2
.
5
Trace support
18
.
2
.
6
Error models
18
.
2
.
7
Other configuration options
18
.
2
.
8
nam
support
18
.
2
.
9
Integration with wired and wireless code
18
.
2
.
10
Example scripts
18
.
3
Implementation
18
.
3
.
1
Use of linked lists
18
.
3
.
2
Node structure
18
.
3
.
3
Detailed look at satellite links
18
.
4
Commands at a glance
19
. Radio Propagation Models
19
.
1
Free space model
19
.
2
Two-ray ground reflection model
19
.
3
Shadowing model
19
.
3
.
1
Backgroud
19
.
3
.
2
Using shadowing model
19
.
4
Communication range
19
.
5
Commands at a glance
20
. Energy Model in ns
20
.
1
The C++ EnergyModel Class
20
.
2
The OTcl interface
21
. Directed Diffusion
21
.
1
What is Directed Diffusion?
21
.
2
The diffusion model in ns
21
.
3
Some mac issues for diffusion in ns
21
.
4
APIs for using filters in diffusion
21
.
5
Ping: an example diffusion application implementation
21
.
5
.
1
Ping Application as implemented in C++
21
.
5
.
2
Tcl APIs for the ping application
21
.
6
Changes required to add yr diffusion application to ns
21
.
7
Test-suites for diffusion
21
.
8
Commands at a glance
22
. XCP: eXplicit Congestion control Protocol
22
.
1
What is XCP?
22
.
2
Implementation of XCP in NS
22
.
2
.
1
Endpoints in XCP
22
.
2
.
2
XCP Router
22
.
2
.
3
XCP queue
22
.
3
XCP example script
22
.
4
Test-suites for XCP
22
.
5
Commands at a glance
23
. DelayBox: Per-Flow Delay and Loss
23
.
1
Implementation Details
23
.
2
Example
23
.
3
Commands at a Glance
24
. Changes made to the IEEE 802.15.4 Implementation in NS-2.31
24
.
1
Radio shutdown
24
.
2
Other changes
Tom Henderson 2014-12-17