Next:
1. Introduction
Up:
The Manual (formerly Notes
Previous:
The Manual (formerly Notes
Index
Contents
1. Introduction
2. Undocumented Facilities
1 Interface to the Interpreter
3. OTcl Linkage
3.1 Concept Overview
3.2 Code Overview
3.3 Class Tcl
3.3.1 Obtain a Reference to the class Tcl instance
3.3.2 Invoking OTcl Procedures
3.3.3 Passing Results to/from the Interpreter
3.3.4 Error Reporting and Exit
3.3.5 Hash Functions within the Interpreter
3.3.6 Other Operations on the Interpreter
3.4 Class TclObject
3.4.0.0.1 Differences from ns v1
3.4.0.0.2 Example configuration of a TclObject
3.4.1 Creating and Destroying TclObjects
3.4.1.0.1 Creating TclObjects
3.4.1.0.2 Deletion of TclObjects
3.4.2 Variable Bindings
3.4.3 Variable Tracing
3.4.4 command Methods: Definition and Invocation
3.5 Class TclClass
3.5.1 How to Bind Static C++ Class Member Variables
3.6 Class TclCommand
3.7 Class EmbeddedTcl
3.8 Class InstVar
2 Simulator Basics
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.2.0.0.1 Control functions
5.2.0.0.2 Address and Port number management
5.2.0.0.3 Agent management
5.2.0.0.4 Tracking Neighbors
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.1.0.0.1 Link procedures
6.1.0.0.2 SimpleLink Procedures
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. Delays and Links
8.1 The LinkDelay Class
8.2 Commands at a glance
9. Differentiated Services Module in ns
9.1 Overview
9.2 Implementation
9.2.1 RED queue in DiffServ module
9.2.2 Edge and core routers
9.2.3 Policy
9.3 Configuration
9.4 Commands at a glance
10. Agents
10.1 Agent state
10.2 Agent methods
10.3 Protocol Agents
10.4 OTcl Linkage
10.4.1 Creating and Manipulating Agents
10.4.2 Default Values
10.4.3 OTcl Methods
10.5 Examples: Tcp, TCP Sink Agents
10.5.1 Creating the Agent
10.5.2 Starting the Agent
10.5.3 Processing Input at Receiver
10.5.4 Processing Responses at the Sender
10.5.5 Implementing Timers
10.6 Creating a New Agent
10.6.1 Example: A ``ping'' requestor (Inheritance Structure)
10.6.2 The recv() and timeout() Methods
10.6.3 Linking the ``ping'' Agent with OTcl
10.6.4 Using the agent through OTcl
10.7 The Agent API
10.8 Different agent objects
10.9 Commands at a glance
11. Timers
11.1 C++ abstract base class TimerHandler
11.1.1 Definition of a new timer
11.1.2 Example: Tcp retransmission timer
11.2 OTcl Timer class
11.3 Commands at a glance
12. Packet Headers and Formats
12.1 A Protocol-Specific Packet Header
12.1.1 Adding a New Packet Header Type
12.1.2 Selectively Including Packet Headers in Your Simulation
12.2 Packet Classes
12.2.1 The Packet Class
12.2.2 p_info Class
12.2.3 The hdr_cmn Class
12.2.4 The PacketHeaderManager Class
12.3 Commands at a glance
13. Error Model
13.1 Implementation
13.2 Configuration
13.3 Multi-state error model
13.4 Commands at a glance
14. Local Area Networks
14.1 Tcl configuration
14.2 Components of a LAN
14.3 Channel Class
14.3.1 Channel State
14.3.2 Example: Channel and classifier of the physical layer
14.3.3 Channel Class in C++
14.4 MacClassifier Class
14.5 MAC Class
14.5.1 Mac State
14.5.2 Mac Methods
14.5.3 Mac Class in C++
14.5.4 CSMA-based MAC
14.6 LL (link-layer) Class
14.6.1 LL Class in C++
14.6.2 Example: Link Layer configuration
14.7 LanRouter class
14.8 Other Components
14.9 LANs and ns routing
14.10 Commands at a glance
15. The (Revised) Addressing Structure in NS
15.1 The Default Address Format
15.2 The Hierarchical Address Format
15.2.1 Default Hierarchical Setting
15.2.2 Specific Hierarchical Setting
15.3 Errors in setting address format
15.4 Commands at a glance
16. Mobile Networking in ns
16.1 The basic wireless model in ns
16.1.1 Mobilenode: creating wireless topology
16.1.2 Creating Node movements
16.1.3 Network Components in a mobilenode
16.1.4 Different MAC layer protocols for mobile networking
16.1.4.1 802.11 MAC protocol
16.1.4.2 Preamble based TDMA protocol
16.1.5 Different types of Routing Agents in mobile networking
16.1.5.1 DSDV
16.1.5.2 DSR
16.1.5.3 TORA
16.1.5.4 AODV
16.1.5.5 PUMA
16.1.5.6 M-DART
16.1.6 Trace Support
16.1.7 Revised format for wireless traces
16.1.7.1 Explanation of new trace format
16.1.8 Generation of node-movement and traffic-connection for wireless scenarios
16.1.8.1 MobileNode Movement
16.1.8.2 Generating traffic pattern files
16.2 Extensions made to CMU's wireless model
16.2.1 wired-cum-wireless scenarios
16.2.2 MobileIP
16.3 802.11 MAC protocol
16.4 Lists of changes for merging code developed in older version of ns (2.1b5 or later) into the current version (2.1b8)
16.5 Commands at a glance
17. Satellite Networking in ns
17.1 Overview of satellite models
17.1.1 Geostationary satellites
17.1.2 Low-earth-orbiting satellites
17.2 Using the satellite extensions
17.2.1 Nodes and node positions
17.2.2 Satellite links
17.2.3 Handoffs
17.2.4 Routing
17.2.5 Trace support
17.2.6 Error models
17.2.7 Other configuration options
17.2.8 nam support
17.2.9 Integration with wired and wireless code
17.2.10 Example scripts
17.3 Implementation
17.3.1 Use of linked lists
17.3.2 Node structure
17.3.3 Detailed look at satellite links
17.4 Commands at a glance
18. Radio Propagation Models
18.1 Free space model
18.2 Two-ray ground reflection model
18.3 Shadowing model
18.3.1 Backgroud
18.3.2 Using shadowing model
18.4 Communication range
18.5 Commands at a glance
19. Energy Model in ns
19.1 The C++ EnergyModel Class
19.2 The OTcl interface
20. Directed Diffusion
20.1 What is Directed Diffusion?
20.2 The diffusion model in ns
20.3 Some mac issues for diffusion in ns
20.4 APIs for using filters in diffusion
20.5 Ping: an example diffusion application implementation
20.5.1 Ping Application as implemented in C++
20.5.2 Tcl APIs for the ping application
20.6 Changes required to add yr diffusion application to ns
20.7 Test-suites for diffusion
20.8 Commands at a glance
21. XCP: eXplicit Congestion control Protocol
21.1 What is XCP?
21.2 Implementation of XCP in NS
21.2.1 Endpoints in XCP
21.2.2 XCP Router
21.2.3 XCP queue
21.3 XCP example script
21.4 Test-suites for XCP
21.5 Commands at a glance
22. DelayBox: Per-Flow Delay and Loss
22.1 Implementation Details
22.2 Example
22.3 Commands at a Glance
23. Changes made to the IEEE 802.15.4 Implementation in NS-2.31
23.1 Radio shutdown
23.2 Other changes
3 Support
24. Debugging ns
24.1 Tcl-level Debugging
24.2 C++-Level Debugging
24.3 Mixing Tcl and C debugging
24.4 Memory Debugging
24.4.1 Using dmalloc
24.4.2 Memory Conservation Tips
24.4.3 Some statistics collected by dmalloc
24.5 Memory Leaks
24.5.1 OTcl
24.5.2 C/C++
25. Mathematical Support
25.1 Random Number Generation
25.1.1 Seeding The RNG
25.1.1.1 Example
25.1.1.2 Output
25.1.2 OTcl Support
25.1.2.1 Commands
25.1.2.2 Example
25.1.2.3 Output
25.1.3 C++ Support
25.1.3.1 Member Functions
25.1.3.2 Example
25.1.3.3 Output
25.2 Random Variables
25.3 Integrals
25.4 ns-random
25.5 Some mathematical-support related objects
25.6 Commands at a glance
26. Trace and Monitoring Support
26.1 Trace Support
26.1.1 OTcl Helper Functions
26.2 Library support and examples
26.3 The C++ Trace Class
26.4 Trace File Format
26.5 Packet Types
26.6 Queue Monitoring
26.7 Per-Flow Monitoring
26.7.1 The Flow Monitor
26.7.2 Flow Monitor Trace Format
26.7.3 The Flow Class
26.8 Commands at a glance
27. Test Suite Support
27.1 Test Suite Components
27.2 Write a Test Suite
28. Dynamic Libraries
28.1 Motivation
28.2 Support
28.3 Usage
29. ns Code Styles
29.1 Indentation style
29.2 Variable Naming Conventions
29.3 Miscellaneous
4 Routing
30. Unicast Routing
30.1 The Interface to the Simulation Operator (The API)
30.1.0.0.1 Preference Assignment and Control
30.1.0.0.2 Link Cost Assignment and Control
30.2 Other Configuration Mechanisms for Specialised Routing
30.2.0.0.1 Asymmetric Routing
30.2.0.0.2 MultiPath Routing
30.3 Protocol Specific Configuration Parameters
30.3.0.0.1 Static Routing
30.3.0.0.2 Session Routing
30.3.0.0.3 DV Routing
30.3.0.0.4 Manual Routing
30.4 Internals and Architecture of Routing
30.4.1 The classes
30.4.1.0.1 RouteLogic../ns-2/route-proto.tcl
30.4.1.0.2 rtObject../ns-2/route-proto.tcl
30.4.1.0.3 The rtPeer../ns-2/route-proto.tcl
30.4.1.0.4 Agent/rtProto../ns-2/route-proto.tcl
30.4.1.0.5 Other Extensions to the Simulator, Node, Link, and Classifier
30.4.2 Interface to Network Dynamics and Multicast
30.4.2.0.1 Actions at the individual nodes
30.4.2.0.2 Global Actions
30.5 Protocol Internals
30.5.0.0.1 Direct Routing
30.5.0.0.2 Static Routing
30.5.0.0.3 Session Routing
30.5.0.0.4 DV Routing
30.6 Unicast routing objects
30.7 Commands at a glance
31. Multicast Routing
31.1 Multicast API
31.1.1 Multicast Behavior Monitor Configuration
31.1.2 Protocol Specific configuration
31.1.2.0.1 Centralized Multicast
31.1.2.0.2 Dense Mode
31.1.2.0.3 Shared Tree Mode
31.1.2.0.4 Bi-directional Shared Tree Mode
31.2 Internals of Multicast Routing
31.2.1 The classes
31.2.1.0.1 mrtObject class
31.2.1.0.2 McastProtocol class
31.2.2 Extensions to other classes in ns
31.2.2.0.1 Class Node
31.2.2.0.2 Class Link and SimpleLink
31.2.2.0.3 Class NetworkInterface
31.2.2.0.4 Class Multicast Classifier
31.2.2.0.5 Class Replicator
31.2.3 Protocol Internals
31.2.3.1 Centralized Multicast
31.2.3.2 Dense Mode
31.2.4 The internal variables
31.3 Commands at a glance
32. Network Dynamics
32.1 The user level API
32.2 The Internal Architecture
32.2.1 The class rtModel
32.2.1.0.1 Exponential
32.2.1.0.2 Deterministic
32.2.1.0.3 Trace
32.2.1.0.4 Manual
32.2.2 rtQueue../ns-2/dynamics.tcl
32.3 Interaction with Unicast Routing
32.3.1 Extensions to Other Classes
32.3.1.0.1 DynamicLink../ns-2/dynalink.cc.tcl
32.3.1.0.2 Link../ns-2/ns-link.tcl
32.3.1.0.3 SimpleLink../ns-2/ns-link.tcl
32.4 Deficencies in the Current Network Dynamics API
32.5 Commands at a glance
33. Hierarchical Routing
33.1 Overview of Hierarchical Routing
33.2 Usage of Hierarchical routing
33.3 Creating large Hierarchical topologies
33.4 Hierarchical Routing with SessionSim
33.5 Commands at a glance
5 Transport
34. UDP Agents
34.1 UDP Agents
34.2 Commands at a glance
35. TCP Agents
35.1 One-Way TCP Senders
35.1.1 The Base TCP Sender (Tahoe TCP)
35.1.1.0.1 Responses to Congestion
35.1.1.0.2 Round-Trip Time Estimation and RTO Timeout Selection
35.1.2 Configuration
35.1.3 Simple Configuration
35.1.3.0.1 Creating the Agent
35.1.3.0.2 TCP Data Source
35.1.4 Other Configuration Parameters
35.1.5 Other One-Way TCP Senders
35.1.5.0.1 Reno TCP
35.1.5.0.2 Newreno TCP
35.1.5.0.3 Vegas TCP
35.1.5.0.4 Sack TCP
35.1.5.0.5 Fack TCP
35.1.5.0.6 Linux TCP
35.2 TCP Receivers (sinks)
35.2.1 The Base TCP Sink
35.2.1.0.1 configuration parameters
35.2.2 Delayed-ACK TCP Sink
35.2.2.0.1 configuration parameters
35.2.3 Sack TCP Sink
35.2.3.0.1 configuration parameters
35.3 Two-Way TCP Agents (FullTcp)
35.3.1 Simple Configuration
35.3.1.0.1 Creating the Agent
35.3.1.0.2 Configuration Parameters
35.3.2 BayFullTcp
35.4 Architecture and Internals
35.4.0.0.1 The TCP header
35.4.0.0.2 Functions for Sending Data
35.4.0.0.3 Functions for Window Management
35.4.0.0.4 Functions for Processing ACKs
35.4.0.0.5 Functions for Managing the Retransmission Timer
35.5 Tracing TCP Dynamics
35.6 One-Way TCP Trace Dynamics
35.7 Two-Way TCP Trace Dynamics
35.8 Commands at a glance
36. SCTP Agents
36.1 The Base SCTP Agent
36.1.0.0.1 Association Establishment
36.1.0.0.2 Association Shutdown
36.1.0.0.3 Multihoming
36.1.0.0.4 Packet Number vs TSN Numbering
36.1.1 Configuration Parameters
36.1.2 Commands
36.1.2.0.1 trace
36.1.2.0.2 print
36.1.2.0.3 set-multihome-core
36.1.2.0.4 multihome-add-interface
36.1.2.0.5 multihome-attach-agent
36.1.2.0.6 set-primary-destination
36.1.2.0.7 force-source
36.2 Extensions
36.2.1 HbAfterRto SCTP
36.2.2 MultipleFastRtx SCTP
36.2.3 Timestamp SCTP
36.2.4 MfrHbAfterRto SCTP
36.2.5 MfrHbAfterRto SCTP
36.3 Tracing SCTP Dynamics
36.4 SCTP Applications
36.5 Example Scripts
36.5.1 Singled Homed Example
36.5.2 Multihomed Example
37. Agent/SRM
37.1 Configuration
37.1.1 Trivial Configuration
37.1.1.0.1 Creating the Agent
37.1.1.0.2 Application Data Handling
37.1.1.0.3 Starting the Agent and Traffic Generator
37.1.2 Other Configuration Parameters
37.1.3 Statistics
37.1.3.0.1 Data Loss
37.1.3.0.2 Overall Statistics
37.1.3.0.3 Miscellaneous Information
37.1.4 Tracing
37.2 Architecture and Internals
37.3 Packet Handling: Processing received messages
37.3.0.0.1 Data Packets
37.3.0.0.2 Request Packets
37.3.0.0.3 Repair Packets
37.3.0.0.4 Session Packets
37.4 Loss Detection--The Class SRMinfo
37.5 Loss Recovery Objects
37.5.0.0.1 Request Mechanisms
37.5.0.0.2 Repair Mechanisms
37.5.0.0.3 Mechanisms for Statistics
37.6 Session Objects
37.7 Extending the Base Class Agent
37.7.1 Fixed Timers
37.7.2 Adaptive Timers
37.7.2.0.1 Recompute for Each New Loss Object
37.7.2.0.2 Sending a Message
37.7.2.0.3 Advertising the Distance
37.8 SRM objects
37.9 Commands at a glance
38. PLM
38.1 Configuration
38.1.0.0.1 Creating a simple scenario with one PLM flow (only one receiver)
38.2 The Packet Pair Source Generator
38.3 Architecture of the PLM Protocol
38.3.1 Instantiation of a PLM Source
38.3.2 Instantiation of a PLM Receiver
38.3.3 Reception of a Packet
38.3.4 Detection of a Loss
38.3.5 Joining or Leaving a Layer
38.4 Commands at a Glance
39. DCCP Agents
39.1 DCCP Agents
39.2 Commands at a glance
6 Application
40. Applications and transport agent API
40.1 The class Application
40.2 The transport agent API
40.2.1 Attaching transport agents to nodes
40.2.2 Attaching applications to agents
40.2.3 Using transport agents via system calls
40.2.4 Agent upcalls to applications
40.2.5 An example
40.3 The class TrafficGenerator
40.3.0.0.1 Exponential On/Off
40.3.0.0.2 Pareto On/Off
40.3.0.0.3 CBR
40.3.0.0.4 Traffic Trace
40.3.1 An example
40.4 Simulated applications: Telnet and FTP
40.4.0.0.1 Application/FTP
40.4.0.0.2 Application/Telnet
40.5 Applications objects
40.6 Commands at a glance
41. Web cache as an application
41.1 Using application-level data in ns
41.1.1 ADU
41.1.2 Passing data between applications
41.1.3 Transmitting user data over UDP
41.1.4 Transmitting user data over TCP
41.1.5 Class hierarchy related to user data handling
41.2 Overview of web cache classes
41.2.1 Managing HTTP connections
41.2.1.0.1 OTcl methods
41.2.1.0.2 Configuration parameter
41.2.2 Managing web pages
41.2.3 Debugging
41.3 Representing web pages
41.4 Page pools
41.4.1 PagePool/Math
41.4.2 PagePool/CompMath
41.4.3 PagePool/ProxyTrace
41.4.4 PagePool/Client
41.4.5 PagePool/WebTraf
41.5 Web client
41.5.0.0.1 Creating a client
41.5.0.0.2 Configuring request generation
41.5.0.0.3 Starting
41.5.0.0.4 OTcl interfaces
41.6 Web server
41.7 Web cache
41.7.1 Http/Cache
41.7.1.0.1 Creation and startup
41.7.1.0.2 OTcl methods
41.8 Putting together: a simple example
41.9 Http trace format
41.10 Commands at a glance
42. Worm Model
42.1 Overview
42.2 Configuration
42.3 Commands at a glance
43. PackMime-HTTP: Web Traffic Generation
43.1 Implementation Details
43.1.1 PackMimeHTTP Client Application
43.1.2 PackMimeHTTP Server Application
43.2 PackMimeHTTP Random Variables
43.3 Use of DelayBox with PackMime-HTTP
43.4 Example
43.5 Commands at a Glance
44. Tmix: Internet Traffic Generation
44.1 Network Setup
44.2 Connection Vectors
44.2.1 Original Connection Vector Format
44.2.2 Alternate Connection Vector Format
44.3 Implementation Details
44.3.1 Tmix Application
44.3.2 Sequential Connections
44.3.3 Concurrent Connections
44.3.4 Acceptor-Sending-First Connections
44.3.5 Sending FINs
44.4 Tmix_DelayBox
44.5 Example
44.6 Commands at a Glance
7 Scale
45. Session-level Packet Distribution
45.1 Configuration
45.1.1 Basic Configuration
45.1.2 Inserting a Loss Module
45.1.2.0.1 Creating a Loss Module
45.1.2.0.2 Inserting a Loss Module
45.2 Architecture
45.3 Internals
45.3.1 Object Linkage
45.3.1.0.1 Nodes and Links
45.3.1.0.2 Session Helper
45.3.1.0.3 Delay and Loss Modules
45.3.2 Packet Forwarding
45.4 Commands at a glance
46. Asim: approximate analytical simulation
8 Emulation
47. Emulation
47.1 Introduction
47.2 Real-Time Scheduler
47.3 Tap Agents
47.3.0.0.1 Configuration
47.4 Network Objects
47.4.1 Pcap/BPF Network Objects
47.4.1.0.1 Configuration
47.4.2 IP Network Objects
47.4.2.0.1 Configuration
47.4.3 IP/UDP Network Objects
47.5 An Example
47.6 Commands at a glance
9 Visualization with Nam - The Network Animator
48. Nam
48.1 Introduction
48.2 Nam Command Line Options
48.3 User Interface
48.4 Keyboard Commands
48.5 Generating External Animations from Nam
48.6 Network Layout
48.7 Animation Objects
49. Nam Trace
49.1 Nam Trace Format
49.1.1 Initialization Events
49.1.2 Nodes
49.1.3 Links
49.1.4 Queues
49.1.5 Packets
49.1.6 Node Marking
49.1.7 Agent Tracing
49.1.8 Variable Tracing
49.1.9 Executing Tcl Procedures and External Code from within Nam
49.1.9.1 Setting playback speed
49.1.9.2 Annotation
49.1.9.3 Node Exec Button
49.1.10 Using Streams for Realtime Applications
49.1.11 Nam Trace File Format Lookup Table
49.2 Ns commands for creating and controlling nam animations
49.2.1 Node
49.2.2 Link/Queue
49.2.3 Agent and Features
49.2.4 Some Generic Commands
10 Other
50. Educational use of NS and NAM
50.1 Using NS for educational purposes
50.1.1 Installing/building/running
50.1.2 The educational scripts' inventory page:
50.2 Using NAM for educational purposes
Bibliography
Index
Subsections
1
. Introduction
2
. Undocumented Facilities
Tom Henderson 2011-11-05