Wednesday 12 November 2014

Network Simulation Using NS2

#Create a simulator object
set ns [new Simulator]

#Define different colors for data flows (for NAM)
$ns color 1 Blue
$ns color 2 Red

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

#Define a 'finish' procedure
proc finish {} {
        global ns nf

Click here to view the complete code..

Friday 7 November 2014

Program for distance vector routing using java




import java.io.*;
class distance_vector
{
public static void main(String arg[])throws Exception
{
int n,src,i,j,k;
String ch;
int a[][]=new int[10][10];
System.out.println("Enter the no. of nodes..");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
n=Integer.parseInt(br.readLine());
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)

Read more

Saturday 30 August 2014

java program to implement bit stuffing

In data transmission and telecommunication, bit stuffing is the insertion of non information bits into data. Stuffed bits should not be confused with overhead bits.

Applications:Controller area network,Universal serial bus,HDLC

Click here to view sender program
Click here to view receiver program

Monday 25 August 2014

java program to ping an ip address

import java.io.*; class ping { public static void main(String a[])throws Exception { String IP; String cmd; BufferedReader br=new BufferedReader(new InputStreamReader(System.in));


Read more...