NS2 Ultimate
Mobile Networking: Regular Nodes and Mobile Nodes

Table of Contents ] [ This is the first post ] [ Next Post ]

Note: The content in this series is extracted from the book, Introduction to Network Simulator NS2. You may have to read chapter 12 of the book for better understanding.
Introduction
In NS2, there are two main kinds of nodes: Regular node and mobile node. Although deriving from regular Node, MobileNode differs greatly from regular Node. The inheritance tree is shown below. 
In this post, I shall present the architecture of MobileNode. I will later go though each components of MobileNode in subsequent posts.
Architecture of Mobile Nodes
The picture below shows the architecture of a Mobile Node. It is an extension of a regular node. The part below the dotted line is the extension. This extension consist of several blocks. Here are their description. 
  • Routing agent: A routing agent tells the node how a packet should be transmitted (e.g., who is the next hop node?) It works with routing protocol responsible for propagating routing information throughout the networks. 
  • Link layer: This is Models bandwidth, packet transmission time, propagation delay and so on. 
  • Address Resolution Protocol (ARP): This module translates hardware addresses into network (i.e., IP) addresses. 
  • Interface queue: This module models buffer management.
  • Medium Access Control (MAC): models the MAC layer. 
  • Network interface: It is in this module where actual transmission takes place. It works with the radio propagation model to simulate packet transmission error. 
  • Channel: This module is in fact not a part of a mobile node. It is the part which is shared among all neighboring mobile nodes. A mobile node puts the packet being transmitted on this module. The destination node reads the channel and picks up the packet belonging to itself from this channel. 
Next Post:
In the next post I will walk you through NS2 code related to Mobile Node. You will need to know this before getting to know each of Mobile Node components.
======================================================

T. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009. Buy it now from Amazon:

image image 

You may also find lecture notes and other resource at the following website:http://www.ece.ubc.ca/~teerawat/NS2.htm

Happy New Year 2013

I wish all of you great success and happiness. May this coming year be a very productive year for all of us. I think you all for follow all my contents here. 

Is the CGSR routing protocol is implemented in any ns2 vesion by default?
Anonymous

As far as I know, NS2 does not have CGSR. But somebody may have implemented it. 

Mobile Networking: Main post
Note: The content in this series is extracted from the book (Second Edition only), Introduction to Network Simulator NS2. You may have to read chapter 12 of the book (Second Edition only) for better understanding.
Introduction
Mobile networking is one of the most popular topic in NS2. However, its NS2 implementation is not very well understood.   In this series, I will explain from the very basic how mobile networking work in NS2. I will leave the details for those who are interested to explore the NS2 program by themselves. 
Table of Contents
So, if you are interested, please click on the link below:
  1. Introduction: Regular nodes and mobile nodes
  2. Mobile node architecture

======================================================

T. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009. Buy it now from Amazon:

image image 

You may also find lecture notes and other resource at the following website:http://www.ece.ubc.ca/~teerawat/NS2.htm

Post processing NS2 Result using NS2 Trace — New Wireless Trace file format

Table of Contents ] [ Previous Post ] [ This is the Last Post ]

This post is one of the series of “Post processing NS2 Result using NS2 Trace”. Click the above menu to navigate through the series.

What’s in this post?

This is the final post in the series of result post-processing. Here, I’ll show you the “new wireless packet trace format”. This is the most comprehensive built-in trace pattern in NS2. Although very informative, it can overwhelm you with loads of information. I would not recommend you to use this format if you don’t have to. 

Read More

Active again!

For the last few months, I’d disappeared from the online world. Well, in fact, I’ve been doing Buddism pilgrimage. My religion service has just ended. I will start posting new content pretty soon :-)

Post processing NS2 Result using NS2 Trace — Wireless Trace file format

Table of Contents ] [ Previous Post ] [ Next Post ]

This post is one of the series of “Post processing NS2 Result using NS2 Trace”. Click the above menu to navigate through the series.

What’s in this post?

The previous posts gives foundation about tracing in NS2. But the explanation was based on wired network. In this post, I will show you the format of “NS2 Wireless Packet Trace Format”

The Basic Idea

NS2 Wireless Packet Trace Format is just an extension from the “Normal Packet Trace Format”. Here is an example of ”NS2 Wireless Packet Trace Format” for IP-Trace and AODV-RREQ Trace

Read More

Event-Driven Simulation: The Main Post

Note: The content in this series is extracted from the book, Introduction to Network Simulator NS2. You may have to read chapter 4 of the book for better understanding.

Introduction

In programming, we tell computer what to do using a set of instructions called computer program. We can instruct the computer to carry out an action immediately, or to wait a bit before carrying out the action. The former approach is quite straight forward. In C++, I can use printf(…) to print a message on the screen, and the message would appear immediately. 

The latter had always been mystical to me until I learned it with NS2. How can we stop the computer from printing the message and tell it print later? What kind of statement do I use to stop the computer from printing it right away. How can I make up a schedule to do a set of things at a set of given points in time? As we shall see, NS2 does this using what we call “Event-Driven Simulation”. 

So, in what follows, I will unravel this seemingly mysterious things. I will explain how NS2 make up a schedule (e.g., starting an FTP flow at 5 second and stop it at 20 second), and make the simulation run according to the predefine schedule.  

In a nutshell, we need to learn the following topics:

  1. The Concept
  2. Event and Handler
  3. Event Scheduler
  4. An Example of Scheduling-Dispatching Mechanism—Delayed Packet Reception
  5. Types and Dynamic of UID (Unique ID)

======================================================

T. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009. Buy it now from Amazon:

 

You may also find lecture notes and other resource at the following website:http://www.ece.ubc.ca/~teerawat/NS2.htm

Event-Driven Simulation: Types and Dynamic of UID (Unique ID)

[ Table of Contents ] [ Previous Section ] [ This is the Last Section ]

Note: Note: The content in this series is extracted from the book, Introduction to Network Simulator NS2. You may have to read chapter 4 of the book for better understanding.

What’s in this post?

One of the most common error regarding the Scheduler is an “Event UID is invalid”. So, what exactly is “UID” anyway? In this post, we shall learn that NS2 has two kinds of UID: Global UID and Local (or Event) UID. We will also learn the dynamic of UIDs, show the break in dynamic causes runtime error, and perhaps most importantly how to fix the error. 


Read More

Event-Driven Simulation: An Example of Scheduling-Dispatching Mechanism—Delayed Packet Reception

[ Table of Contents ] [ Previous Section ] [ Next Section ]

Note: The content in this series is extracted from the book, Introduction to Network Simulator NS2. You may have to read chapter 4 of the book for better understanding.

What’s in this post?

This post demonstrate one example of the scheduling-dispatching mechanism in NS2. The example here is delayed packet forwarding. Here, I will show you how to place a packet reception event in the simulation time line “t” seconds in future, and how to execute actions associated with the event when the Scheduler reaches that time.

Read More