Profile

Cover photo
Ankit Verma
Lives in Bangalore
47 followers|96,261 views
AboutPostsPhotosVideos

Stream

Ankit Verma

Shared publicly  - 
 
Program No 2 Write a TCL script to simulate a file transfer with ns2 Consider a client and a server. The server is running a FTP application (over TCP). The client sends a request to download a file of size 10 MB from the server. Write a script to simulate this scenario. Let node #0 be the server and node #1 be the client. TCP packet size is 1500 B. Assume typical values for other parameters. Note: This simulation require transfer of a fixed size file. Therefore, time required for the transfer would be constant for a given bandwidth of a link. To verify this, determine the time that would roughly be required for the transfer. Then look at the bottom of the trace file and verify whether there is any transmission beyond the time calculated. To verify that the client has downloaded the entire file, plot the "Bytes Received" curve for node#1. The y­axis is in Kbits. Convert it to MB and verify whether it approximates the specified file size. TCP headers would effectively increase the count of received bytes at node # 1.
TCL Script: set ns [new Simulator] set namfile [open ex_02.nam w] $ns namtrace-all $namfile set tracefile [open ex_02.tr w] $ns trace-all $tracefile     Agent/TCP set packetSize_ 1500 set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 1Mb 10ms Drop...
1

Ankit Verma

Shared publicly  - 
 
Program No 8 Simulate a wired network and demonstrate Distance Vector Routing algorithm
TCL Script: set ns [new Simulator] set namfile [open ex_08.nam w] $ns namtrace-all $namfile set tracefile [open ex_08.tr w] $ns trace-all $tracefile     set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] $ns duplex-link $n0 $n1 10Mb 1ms...
TCL Script: set ns [new Simulator] set namfile [open ex_08.nam w] $ns namtrace-all $namfile set tracefile [open ex_08.tr w] $ns trace-all $tracefile set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] ...
1

Ankit Verma

Shared publicly  - 
 
Program no 1. Write a TCL script to simulate the network described below Consider a small network with five nodes n0, n1, n2, n3, n4, forming a star topology. The node n4 is at the center. Node n0 is a TCP source, which transmits packets to node n3 (a TCP sink) through the node n4. Node n1 is another traffic source, and sends UDP packets to node n2 through n4. The duration of the simulation time is 10 seconds.
TCL Script: set ns [new Simulator] set namfile [open ex_01.nam w] $ns namtrace-all $namfile set tracefile [open ex_01.tr w]   $ns trace-all $tracefile set n0 [$ns node]  set n1 [$ns node]  set n2 [$ns node]  set n3 [$ns node]  set n4 [$ns node] $ns duplex-l...
1

Ankit Verma

Shared publicly  - 
 
1: Write a TCL script to simulate the network described below
Consider a small network with five nodes n0, n1, n2, n3, n4, forming a star topology. The node n4 is at the center. Node n0 is a TCP source, which transmits packets to node n3 (a TCP sink) through the node n4. Node n1 is another traffic source, and sends UD...
Consider a small network with five nodes n0, n1, n2, n3, n4, forming a star topology. The node n4 is at the center. Node n0 is a TCP source, which transmits packets to node n3 (a TCP sink) through the node n4. Node n1 is anot...
1

Ankit Verma

Shared publicly  - 
 
1 b. Write a JAVA Program to implement Inner class and demonstrate its Access protection.
// AccessMain.java import
java.io.*; class  outer {      int 
outdata = 10;          void 
display()      {           inner 
inobj = new  inner();           System.out.println("Accessing
from outer class");           System.out.println("The value of
outdata...
// AccessMain.java import java.io.*; class outer { int outdata = 10; void display() { inner inobj = new inner(); System.out.println("Accessing from outer class"); ...
1

Ankit Verma

Shared publicly  - 
 
3. a. Write a JAVA Program to demonstrate Inheritance.
// InheritMain.java class SuperClass { int a,b; SuperClass(int x,int y) { a=x; b=y; } void show() { System.out.println("In Super Class"); System.out.println(" A and B are " + a + " " + b); } } class SubClass extends SuperClass { int ans; int add; SubClass(i...
// InheritMain.java class SuperClass { int a,b; SuperClass(int x,int y) { a=x; b=y; } void show() { System.out.println("In Super Class"); System.out.println(" A and B are " + a + " " + b); } } class SubClass extends SuperClas...
1

Ankit Verma

Shared publicly  - 
 
Program no 1. Write a TCL script to simulate the network described below Consider a small network with five nodes n0, n1, n2, n3, n4, forming a star topology. The node n4 is at the center. Node n0 is a TCP source, which transmits packets to node n3 (a TCP sink) through the node n4. Node n1 is another traffic source, and sends UDP packets to node n2 through n4. The duration of the simulation time is 10 seconds.
TCL Script: set ns [new Simulator] set namfile [open ex_01.nam w] $ns namtrace-all $namfile set tracefile [open ex_01.tr w]   $ns trace-all $tracefile set n0 [$ns node]  set n1 [$ns node]  set n2 [$ns node]  set n3 [$ns node]  set n4 [$ns node] $ns duplex-l...
1

Ankit Verma

Shared publicly  - 
 
Program No 9: Simulate a network which will create congestion in the network. With the trace file created, identify the points at which congestion occurs by writing sed/awk scripts. Also write a mechanism to correct/control the congestion.
TCL Script: set ns [new Simulator] set namfile [open 9a.nam w] $ns namtrace-all $namfile set tracefile [open 9a.tr w] $ns trace-all $tracefile     Agent/TCP set packetSize_ 1460 set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] set n4 ...
TCL Script: set ns [new Simulator] set namfile [open 9a.nam w] $ns namtrace-all $namfile set tracefile [open 9a.tr w] $ns trace-all $tracefile Agent/TCP set packetSize_ 1460 set n0 [$ns node] set n1 [$ns node] set n2 [$ns...
1

Ankit Verma

Shared publicly  - 
 
Program No 8 Simulate a wired network and demonstrate Distance Vector Routing algorithm
TCL Script: set ns [new Simulator] set namfile [open ex_08.nam w] $ns namtrace-all $namfile set tracefile [open ex_08.tr w] $ns trace-all $tracefile     set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] $ns duplex-link $n0 $n1 10Mb 1ms...
TCL Script: set ns [new Simulator] set namfile [open ex_08.nam w] $ns namtrace-all $namfile set tracefile [open ex_08.tr w] $ns trace-all $tracefile set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] ...
1

Ankit Verma

Shared publicly  - 
 
1. a. Write a JAVA Program to demonstrate Constructor overloading and Method overloading.
// ArithmeticMain.java import java.util.; import java.lang.Math; import java.io.; class Arithmetic   { int a,b; Scanner s1=new Scanner(System.in); Arithmetic() { System.out.println("Enter any 2 integers"); a=s1.nextInt(); b=s1.nextInt(); } void display() ...
// ArithmeticMain.java import java.util.*; import java.lang.Math; import java.io.*; class Arithmetic { int a,b; Scanner s1=new Scanner(System.in); Arithmetic() { System.out.println("Enter any 2 integers"); a=s1.nextIn...
1

Ankit Verma

Shared publicly  - 
 
2. Write a program in Java for String handling which performs the following: i) Checks the capacity of StringBuffer objects. ii) Reverses the contents of a string given on console and converts the resultant string in upper case. iii) Reads a string from console and appends it to the resultant string of ii.
// StringHandler.java import java.io.*; class StringHandler   {     public static void main(String s[]) throws IOException       { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String s1,s2,s3,s4,s5; int i,l; s2=" "; System.out.pri...
1

Ankit Verma

Shared publicly  - 
 
3.b. Simple Program on Java for the implementation of multiple inheritance using interfaces to calculate the area of a rectangle and triangle.
// InterfaceMain.java import java.io.*; interface area   {     float compute(float x, float y);   } class rectangle   {     public float compute(float x, float y)       {         return (x*y);       }   } class triangle   {     public float compute(float x,...
// InterfaceMain.java import java.io.*; interface area { float compute(float x, float y); } class rectangle { public float compute(float x, float y) { return (x*y); } } class triangle { ...
1
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Bangalore
Work
Occupation
Student
Basic Information
Birthday
October 4