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. 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
3 Support
25. Debugging ns
25.1 Tcl-level Debugging
25.2 C++-Level Debugging
25.3 Mixing Tcl and C debugging
25.4 Memory Debugging
25.4.1 Using dmalloc
25.4.2 Memory Conservation Tips
25.4.3 Some statistics collected by dmalloc
25.5 Memory Leaks
25.5.1 OTcl
25.5.2 C/C++
26. Mathematical Support
26.1 Random Number Generation
26.1.1 Seeding The RNG
26.1.1.1 Example
26.1.1.2 Output
26.1.2 OTcl Support
26.1.2.1 Commands
26.1.2.2 Example
26.1.2.3 Output
26.1.3 C++ Support
26.1.3.1 Member Functions
26.1.3.2 Example
26.1.3.3 Output
26.2 Random Variables
26.3 Integrals
26.4 ns-random
26.5 Some mathematical-support related objects
26.6 Commands at a glance
27. Trace and Monitoring Support
27.1 Trace Support
27.1.1 OTcl Helper Functions
27.2 Library support and examples
27.3 The C++ Trace Class
27.4 Trace File Format
27.5 Packet Types
27.6 Queue Monitoring
27.7 Per-Flow Monitoring
27.7.1 The Flow Monitor
27.7.2 Flow Monitor Trace Format
27.7.3 The Flow Class
27.8 Commands at a glance
28. Test Suite Support
28.1 Test Suite Components
28.2 Write a Test Suite
29. Dynamic Libraries
29.1 Motivation
29.2 Support
29.3 Usage
30. ns Code Styles
30.1 Indentation style
30.2 Variable Naming Conventions
30.3 Miscellaneous
4 Routing
31. Unicast Routing
31.1 The Interface to the Simulation Operator (The API)
31.1.0.0.1 Preference Assignment and Control
31.1.0.0.2 Link Cost Assignment and Control
31.2 Other Configuration Mechanisms for Specialised Routing
31.2.0.0.1 Asymmetric Routing
31.2.0.0.2 MultiPath Routing
31.3 Protocol Specific Configuration Parameters
31.3.0.0.1 Static Routing
31.3.0.0.2 Session Routing
31.3.0.0.3 DV Routing
31.3.0.0.4 Manual Routing
31.4 Internals and Architecture of Routing
31.4.1 The classes
31.4.1.0.1 RouteLogic../ns-2/route-proto.tcl
31.4.1.0.2 rtObject../ns-2/route-proto.tcl
31.4.1.0.3 The rtPeer../ns-2/route-proto.tcl
31.4.1.0.4 Agent/rtProto../ns-2/route-proto.tcl
31.4.1.0.5 Other Extensions to the Simulator, Node, Link, and Classifier
31.4.2 Interface to Network Dynamics and Multicast
31.4.2.0.1 Actions at the individual nodes
31.4.2.0.2 Global Actions
31.5 Protocol Internals
31.5.0.0.1 Direct Routing
31.5.0.0.2 Static Routing
31.5.0.0.3 Session Routing
31.5.0.0.4 DV Routing
31.6 Unicast routing objects
31.7 Commands at a glance
32. Multicast Routing
32.1 Multicast API
32.1.1 Multicast Behavior Monitor Configuration
32.1.2 Protocol Specific configuration
32.1.2.0.1 Centralized Multicast
32.1.2.0.2 Dense Mode
32.1.2.0.3 Shared Tree Mode
32.1.2.0.4 Bi-directional Shared Tree Mode
32.2 Internals of Multicast Routing
32.2.1 The classes
32.2.1.0.1 mrtObject class
32.2.1.0.2 McastProtocol class
32.2.2 Extensions to other classes in ns
32.2.2.0.1 Class Node
32.2.2.0.2 Class Link and SimpleLink
32.2.2.0.3 Class NetworkInterface
32.2.2.0.4 Class Multicast Classifier
32.2.2.0.5 Class Replicator
32.2.3 Protocol Internals
32.2.3.1 Centralized Multicast
32.2.3.2 Dense Mode
32.2.4 The internal variables
32.3 Commands at a glance
33. Network Dynamics
33.1 The user level API
33.2 The Internal Architecture
33.2.1 The class rtModel
33.2.1.0.1 Exponential
33.2.1.0.2 Deterministic
33.2.1.0.3 Trace
33.2.1.0.4 Manual
33.2.2 rtQueue../ns-2/dynamics.tcl
33.3 Interaction with Unicast Routing
33.3.1 Extensions to Other Classes
33.3.1.0.1 DynamicLink../ns-2/dynalink.cc.tcl
33.3.1.0.2 Link../ns-2/ns-link.tcl
33.3.1.0.3 SimpleLink../ns-2/ns-link.tcl
33.4 Deficencies in the Current Network Dynamics API
33.5 Commands at a glance
34. Hierarchical Routing
34.1 Overview of Hierarchical Routing
34.2 Usage of Hierarchical routing
34.3 Creating large Hierarchical topologies
34.4 Hierarchical Routing with SessionSim
34.5 Commands at a glance
5 Transport
35. UDP Agents
35.1 UDP Agents
35.2 Commands at a glance
36. TCP Agents
36.1 One-Way TCP Senders
36.1.1 The Base TCP Sender (Tahoe TCP)
36.1.1.0.1 Responses to Congestion
36.1.1.0.2 Round-Trip Time Estimation and RTO Timeout Selection
36.1.2 Configuration
36.1.3 Simple Configuration
36.1.3.0.1 Creating the Agent
36.1.3.0.2 TCP Data Source
36.1.4 Other Configuration Parameters
36.1.5 Other One-Way TCP Senders
36.1.5.0.1 Reno TCP
36.1.5.0.2 Newreno TCP
36.1.5.0.3 Vegas TCP
36.1.5.0.4 Sack TCP
36.1.5.0.5 Fack TCP
36.1.5.0.6 Linux TCP
36.2 TCP Receivers (sinks)
36.2.1 The Base TCP Sink
36.2.1.0.1 configuration parameters
36.2.2 Delayed-ACK TCP Sink
36.2.2.0.1 configuration parameters
36.2.3 Sack TCP Sink
36.2.3.0.1 configuration parameters
36.3 Two-Way TCP Agents (FullTcp)
36.3.1 Simple Configuration
36.3.1.0.1 Creating the Agent
36.3.1.0.2 Configuration Parameters
36.3.2 BayFullTcp
36.4 Architecture and Internals
36.4.0.0.1 The TCP header
36.4.0.0.2 Functions for Sending Data
36.4.0.0.3 Functions for Window Management
36.4.0.0.4 Functions for Processing ACKs
36.4.0.0.5 Functions for Managing the Retransmission Timer
36.5 Tracing TCP Dynamics
36.6 One-Way TCP Trace Dynamics
36.7 Two-Way TCP Trace Dynamics
36.8 Commands at a glance
37. SCTP Agents
37.1 The Base SCTP Agent
37.1.0.0.1 Association Establishment
37.1.0.0.2 Association Shutdown
37.1.0.0.3 Multihoming
37.1.0.0.4 Packet Number vs TSN Numbering
37.1.1 Configuration Parameters
37.1.2 Commands
37.1.2.0.1 trace
37.1.2.0.2 print
37.1.2.0.3 set-multihome-core
37.1.2.0.4 multihome-add-interface
37.1.2.0.5 multihome-attach-agent
37.1.2.0.6 set-primary-destination
37.1.2.0.7 force-source
37.2 Extensions
37.2.1 HbAfterRto SCTP
37.2.2 MultipleFastRtx SCTP
37.2.3 Timestamp SCTP
37.2.4 MfrHbAfterRto SCTP
37.2.5 MfrHbAfterRto SCTP
37.3 Tracing SCTP Dynamics
37.4 SCTP Applications
37.5 Example Scripts
37.5.1 Singled Homed Example
37.5.2 Multihomed Example
38. Agent/SRM
38.1 Configuration
38.1.1 Trivial Configuration
38.1.1.0.1 Creating the Agent
38.1.1.0.2 Application Data Handling
38.1.1.0.3 Starting the Agent and Traffic Generator
38.1.2 Other Configuration Parameters
38.1.3 Statistics
38.1.3.0.1 Data Loss
38.1.3.0.2 Overall Statistics
38.1.3.0.3 Miscellaneous Information
38.1.4 Tracing
38.2 Architecture and Internals
38.3 Packet Handling: Processing received messages
38.3.0.0.1 Data Packets
38.3.0.0.2 Request Packets
38.3.0.0.3 Repair Packets
38.3.0.0.4 Session Packets
38.4 Loss Detection--The Class SRMinfo
38.5 Loss Recovery Objects
38.5.0.0.1 Request Mechanisms
38.5.0.0.2 Repair Mechanisms
38.5.0.0.3 Mechanisms for Statistics
38.6 Session Objects
38.7 Extending the Base Class Agent
38.7.1 Fixed Timers
38.7.2 Adaptive Timers
38.7.2.0.1 Recompute for Each New Loss Object
38.7.2.0.2 Sending a Message
38.7.2.0.3 Advertising the Distance
38.8 SRM objects
38.9 Commands at a glance
39. PLM
39.1 Configuration
39.1.0.0.1 Creating a simple scenario with one PLM flow (only one receiver)
39.2 The Packet Pair Source Generator
39.3 Architecture of the PLM Protocol
39.3.1 Instantiation of a PLM Source
39.3.2 Instantiation of a PLM Receiver
39.3.3 Reception of a Packet
39.3.4 Detection of a Loss
39.3.5 Joining or Leaving a Layer
39.4 Commands at a Glance
40. DCCP Agents
40.1 DCCP Agents
40.2 Commands at a glance
6 Application
41. Applications and transport agent API
41.1 The class Application
41.2 The transport agent API
41.2.1 Attaching transport agents to nodes
41.2.2 Attaching applications to agents
41.2.3 Using transport agents via system calls
41.2.4 Agent upcalls to applications
41.2.5 An example
41.3 The class TrafficGenerator
41.3.0.0.1 Exponential On/Off
41.3.0.0.2 Pareto On/Off
41.3.0.0.3 CBR
41.3.0.0.4 Traffic Trace
41.3.1 An example
41.4 Simulated applications: Telnet and FTP
41.4.0.0.1 Application/FTP
41.4.0.0.2 Application/Telnet
41.5 Applications objects
41.6 Commands at a glance
42. Web cache as an application
42.1 Using application-level data in ns
42.1.1 ADU
42.1.2 Passing data between applications
42.1.3 Transmitting user data over UDP
42.1.4 Transmitting user data over TCP
42.1.5 Class hierarchy related to user data handling
42.2 Overview of web cache classes
42.2.1 Managing https connections
42.2.1.0.1 OTcl methods
42.2.1.0.2 Configuration parameter
42.2.2 Managing web pages
42.2.3 Debugging
42.3 Representing web pages
42.4 Page pools
42.4.1 PagePool/Math
42.4.2 PagePool/CompMath
42.4.3 PagePool/ProxyTrace
42.4.4 PagePool/Client
42.4.5 PagePool/WebTraf
42.5 Web client
42.5.0.0.1 Creating a client
42.5.0.0.2 Configuring request generation
42.5.0.0.3 Starting
42.5.0.0.4 OTcl interfaces
42.6 Web server
42.7 Web cache
42.7.1 https/Cache
42.7.1.0.1 Creation and startup
42.7.1.0.2 OTcl methods
42.8 Putting together: a simple example
42.9 https trace format
42.10 Commands at a glance
43. Worm Model
43.1 Overview
43.2 Configuration
43.3 Commands at a glance
44. PackMime-https: Web Traffic Generation
44.1 Implementation Details
44.1.1 PackMimehttps Client Application
44.1.2 PackMimehttps Server Application
44.2 PackMimehttps Random Variables
44.3 Use of DelayBox with PackMime-https
44.4 Example
44.5 Commands at a Glance
45. Tmix: Internet Traffic Generation
45.1 Network Setup
45.2 Connection Vectors
45.2.1 Original Connection Vector Format
45.2.2 Alternate Connection Vector Format
45.3 Implementation Details
45.3.1 Tmix Application
45.3.2 Sequential Connections
45.3.3 Concurrent Connections
45.3.4 Acceptor-Sending-First Connections
45.3.5 Sending FINs
45.4 Tmix_DelayBox
45.5 Example
45.6 Commands at a Glance
7 Scale
46. Session-level Packet Distribution
46.1 Configuration
46.1.1 Basic Configuration
46.1.2 Inserting a Loss Module
46.1.2.0.1 Creating a Loss Module
46.1.2.0.2 Inserting a Loss Module
46.2 Architecture
46.3 Internals
46.3.1 Object Linkage
46.3.1.0.1 Nodes and Links
46.3.1.0.2 Session Helper
46.3.1.0.3 Delay and Loss Modules
46.3.2 Packet Forwarding
46.4 Commands at a glance
47. Asim: approximate analytical simulation
8 Emulation
48. Emulation
48.1 Introduction
48.2 Real-Time Scheduler
48.3 Tap Agents
48.3.0.0.1 Configuration
48.4 Network Objects
48.4.1 Pcap/BPF Network Objects
48.4.1.0.1 Configuration
48.4.2 IP Network Objects
48.4.2.0.1 Configuration
48.4.3 IP/UDP Network Objects
48.5 An Example
48.6 Commands at a glance
9 Visualization with Nam - The Network Animator
49. Nam
49.1 Introduction
49.2 Nam Command Line Options
49.3 User Interface
49.4 Keyboard Commands
49.5 Generating External Animations from Nam
49.6 Network Layout
49.7 Animation Objects
50. Nam Trace
50.1 Nam Trace Format
50.1.1 Initialization Events
50.1.2 Nodes
50.1.3 Links
50.1.4 Queues
50.1.5 Packets
50.1.6 Node Marking
50.1.7 Agent Tracing
50.1.8 Variable Tracing
50.1.9 Executing Tcl Procedures and External Code from within Nam
50.1.9.1 Setting playback speed
50.1.9.2 Annotation
50.1.9.3 Node Exec Button
50.1.10 Using Streams for Realtime Applications
50.1.11 Nam Trace File Format Lookup Table
50.2 Ns commands for creating and controlling nam animations
50.2.1 Node
50.2.2 Link/Queue
50.2.3 Agent and Features
50.2.4 Some Generic Commands
10 Other
51. Educational use of NS and NAM
51.1 Using NS for educational purposes
51.1.1 Installing/building/running
51.1.2 The educational scripts' inventory page:
51.2 Using NAM for educational purposes
Bibliography
Index
Subsections
1
. Introduction
2
. Undocumented Facilities
Tom Henderson 2014-12-17