September 25, 2013

Ubuntu Installation using Windows Installer

There is an absolute easy way to install  ubuntu. Let us see step by step procedure to install ubuntu by using ubuntu windows installer.
First download the windows installer by writing following in google and open the first link.
1
Now, click on the Get the installer button.

September 9, 2013

C Program Phases Writing And Executing A Program

System Software
The system software controls the computer. It communicates with computer’s hardware (key board, mouse, modem, sound card etc) and controls different aspects of operations. Sub categories of system software are:
  • Operating system
  • Device drivers
  • Utilities
Operating system

An operating system (sometimes abbreviated as "OS") is the program that manages all the other programs in a computer. It is a integrated collection of routines that service the sequencing and processing of programs by a computer. Note: An operating system may provide many services, such as resource allocation, scheduling, input/output control, and data management.

Device drivers

The device driver software is used to communicate between the devices and the computer. We have monitor, keyboard and mouse attached to almost all PC’s; if we look at the properties of these devices we will see that the operating system has installed special software to control these devices. This piece of software is called device driver software. When we attach a new device with the computer, we need software to communicate with this device. These kinds of software are known as device drivers e.g. CD Rom driver, Sound Card driver and Modem driver. Normally manufacturer of the device provide the device driver software with the device. For scanners to work properly with the computers we install the device driver of the scanner. Nowadays if you have seen a scanner, it comes with TWAIN Drivers. TWAIN stands for Technology Without An Interesting Name.

September 4, 2013

Installation of Dev C++


Here is the step by step procedure for the installation of Dev C++
First, download the Dev C++ from the following link.
http://sourceforge.net/projects/orwelldevcpp/files/latest/download

Then after download execute the setup.  The screenshots are of different versions.

1

Select Language.

 2
Click I agree.

September 3, 2013

Introduction to Programming

Definition

"A program is a precise sequence of steps to solve a particular problem.”It means that when we say that we have a program, it actually means that we know about a complete set activities to be performed in a particular order. The purpose of these activities is to solve a given problem. Alan Perlis, a professor at Yale University, says:"It goes against the grain of modern education to teach children to program. What fun is there in making plans, acquiring discipline in organizing thoughts, devoting attention to detail and learning to be self-critical? ". It is a sarcastic statement about modern education, and it means that the modern education is not developing critical skills like planning, organizing and paying attention to detail. Practically, in our day to day lives we are constantly planning, organizing and paying attention to fine details (if we want our plans to succeed). And it is also fun to do these activities. For example, for a picnic trip we plan where to go, what to wear, what to take for lunch, organize travel details and have a good time while doing so.

May 27, 2013

Xgraph in NS2

 

One part of the ns-allinone package is 'xgraph', a plotting program which can be used to create graphic representations of simulation results. In this section, I will show you a simple way how you can create output files in your Tcl scripts which can be used as data sets for xgraph. On the way there, I will also show you how to use traffic generators.
A note: The technique I present here is one of many possible ways to create output files suitable for xgraph. If you think there is a technique which is superior in terms of understandablity (which is what I aim for in this tutorial), please let me know.


First of all, we create the following topology:
 
Nam snap shot
 
The following piece of code should look familiar to you by now if you read the first sections of this tutorial.



set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]

$ns duplex-link $n0 $n3 1Mb 100ms DropTail
$ns duplex-link $n1 $n3 1Mb 100ms DropTail
$ns duplex-link $n2 $n3 1Mb 100ms DropTail
$ns duplex-link $n3 $n4 1Mb 100ms DropTail


May 22, 2013

NS2 installation using Ubuntu Software Center

There is an absolute easy way to install ns2 (network simulator) by using the easiest technique available on ubuntu. 
Let us install ns2 in a very nice and easy way. Ubuntu Software Center provides with ease to install different softwares by wizard.

Here is how it is done.

Open “Ubuntu Software Center” as hightlighted in the below figure.



Now, in the search box on the top right corner. Write ns2 and press enter.


You will see the package. Hit install button and it will install ns2. Ofcourse, internet connectivity is must :)
Similarly, you can install nam(network animator) by following the same procedure. Just enter "nam" in the search box and hit enter.

Install the first package that you see. And there you go, you have installed ns2 and nam .  You can always install it using terminal simply by writing the following command.

sudo apt-get install ns2 nam xgraph


Remember, when you do the same in Ubuntu 13.04, it will not show you the desired ns2 package. And you will have to install it manually. I guess this is only available for 12.04 version. So, there is another way available if you want to install ns2 in that version.

This could be resolved by applying the following command.


sudo apt-get update


When the update is completed, go and run the command to install ns2 , nam and xgraph. If you want an easy way out to install Ubuntu using windows. Please click here.

 

May 21, 2013

Dynamic Nodes generation and traffic flow in ns2

Here is the code for dynamically creating nodes and create traffic flow dynamically using protocol.


#Create a simulator object
set ns [new Simulator]

#Tell the simulator to use dynamic routing
$ns rtproto DV

#Open the nam trace file
set nf [open out.nam w]
$ns namtrace-all $nf


#Define a 'finish' procedure
proc finish {} {
        global ns nf
        $ns flush-trace
#Close the trace file
        close $nf
#Execute nam on the trace file
        exec nam out.nam &
        exit 0
}

#Create seven nodes
for {set i 0} {$i < 7} {incr i} {
        set n($i) [$ns node]
}


#Create links between the nodes
for {set i 0} {$i < 7} {incr i} {
        $ns duplex-link $n($i) $n([expr ($i+1)%7]) 1Mb 10ms DropTail
}

#Create a UDP agent and attach it to node n(0)
set udp0 [new Agent/UDP]
$ns attach-agent $n(0) $udp0

# Create a CBR traffic source and attach it to udp0
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
$cbr0 attach-agent $udp0

C program to Read From a File

#include <stdio.h> #include <stdlib.h> void main() {     FILE *fptr;     char filename[15];     char ch;   ...