BCA / B.Tech 8 min read

Nodes & Agents of NS2 & NAM

Nodes & Agents of NS2 & NAM in Hindi


  • Nodes and agents in NS2 are the basic elements of network simulation. Nodes are the physical components of the network, while agents are responsible for data communication. By using NAM, the activities of these nodes and agents can be graphically represented, which helps researchers and students to understand various aspects of networking.
  • The combination of NS2 and NAM acts as a powerful tool in networking research, which is helpful in studying various network protocols and topologies.
  • NS2 (Network Simulator 2) and NAM (Network Animator) are major tools in the field of network simulation. In NS2, nodes and agents are important elements for simulating various aspects of networking.
Here we will discuss nodes and agents in detail.

Nodes in Hindi | Nodes in NS2:

1. Importance of nodes: Nodes are the main components of a network. These are the devices through which data communication takes place. Each node has a unique identity and it can perform many functions in a network, such as sending, receiving, and routing data.

2. Types of nodes: There are different types of nodes in NS2, which include:

  • Sensor Nodes: These are commonly used in wired or wireless networks and they collect information.
  • Gateway Nodes: These nodes guide data between other nodes, such as nodes connected to the internet.
  • End-user Nodes: These nodes send and receive data for end-users, such as computers or mobile devices.

3. Creation of nodes

The creation of nodes in NS2 is done in OTcl (Object-oriented Tcl). For example:

# Start of NS2 script
set ns [new Simulator]

# Creation of nodes
set node1 [$ns node]
set node2 [$ns node]

# Adding connection
$ns connect $node1 $node2

Agents in NS2

1. Importance of agents: Agents are functional elements in NS2 that participate in the process of data communication. Agents work within nodes and implement network protocols.

2. Types of agents

There are different types of agents in NS2, such as:

  • TCP Agents: These send data in a connectionless manner. Examples: TCP Reno, TCP Tahoe, TCP New Reno.
  • UDP Agents: These are connectionless protocols, which are used for real-time applications.
  • Internet Protocol (IP) Agents: These are used for routing packets and other network functions.

3. Creation of agents

Agents are defined in NS2 in the same way as nodes:

# Creation of a TCP agent
set tcp_agent [$ns create-namespace TCP]

NAM (Network Animator)

1. Importance of NAM: NAM is a graphical animator that is used to see the simulation data generated by NS2. It provides users with a visual experience of the activities of nodes and agents during the simulation.

2. View of nodes and agents in NAM: In NAM, nodes and agents are displayed in graphical form. This helps users to understand the data flow between nodes, such as packet transfer, latency, and throughput.

3. Use of NAM: To see data in NAM, you need to load the trace file generated from NS2. This can be done using the following command:

nam tracefile.nam

In this Chapter

Nodes & Agents of NS2 & NAM
Auto-Configuration and Anycast
Modified EUI-64 | What is Modified EUI-64?
Architecture of Mobile Computing
Wireless LAN in Hindi | What is Wireless LAN?
Wireless User Devices
MAC Protocol | What is MAC Protocol?
IEEE 802.11 | What is IEEE 802.11
Mobile IP | What is Mobile IP
Wireless TCP/IP
Unicast & Multicast Communication
Bluetooth | What is Bluetooth?
NS2 & NAM | What are NS2 and NAM?
Purpose & installation of NS2 & NAM
Background of NS2 & NAM
Architecture of NS2 & NAM
Interface of OTcl & C++
Trace Files & Formats
Protocol Support of NS2
Simulation Object of NS2 & NAM
Basic Syntax of NS2 & NAM
Node Creation of NS2 & NAM
Running NS2 & NAM
Finish Procedure NS2 & NAM
Invoking external commands within NS2
NS2 Commands
Creating Links in Wired Network
Setting Link Parameters
Sending Traffics Through NS2 Links
Routing Protocol Support of NS2
Scenarios in Wired Networks
Additional Parameters
Setting node positions
God object & topography
Protocol Support
Scenarios in Wireless Networks
What is the Internet? Difference Between Intranet and Extranet
Types of Internet
OSI Model and its Layers
Computer Network (CN) All Important Questions and Answers in English (MDSU)
BCA | Computer Network | 2025 Paper | MDSU Exam Paper
Importance of the Layer Model in Computer Networks
Network Classification
Network Topology
Network Switching & Components
Ethernet
Token Ring
Basic Networking Concepts & Cabling
What is a Computer in English?
Bridges in Computer Networks
Routers in Computer Networks
Gateways in Computer Networks
Public & Private Networks
FDMA (Frequency Division Multiple Access)
BCA | CN(Computer Network) Paper | 2023 MDSU Exam Paper
What is World Wide Web (WWW)
TDMA, SDMA, CDMA
Personal Communication System | What is PCS
IPv4 | What is IPv4?
Subnetting IPv4 Address
Casting in IPv4
Private IPv4 Addressing
IPv4 Address Scheme
IPv6 Addressing Scheme
Types of IPv6 Addressing