4
NW LAB - NS2 PROGRAMS - ALGORITHM IMPLEMENTATION OF UNICAST ROUTING PROTOCOL AIM: To implement Unicast Routing protocol using network simulator (ns-2). ALGORITHM 1. Dene new simulator 2. Dene dierent colors for data ows (for NAM) 3. Dene a new Trace le and open it 4. Dene a new NAM Trace le and open it 5. Dene a 'nish' procedure – to ush trace record in the `trace and trace output les. 6. Dene the routing protocol as Distance Vector (DV) 7. Create six nodes – n0,n1,..n5 8. Create links between the nodes with 0.3Mb and 10 ms Link with DropTail option 9. Give node position (for NAM) to place six nodes in the layout 10.Setup a TCP connection – attach TCP Source Agent to node n0 and TCP sink agent to node n5 11.Setup a FTP over TCP connection 12.Dene conguration such that link between nodes n1 and n4 to be failed at 1.0 interval, and up again at 4.5 interval 13.Start the simulation PERFORMANCE COMPARISION OF ROUTING PROTOCOLS AIM: To implement two routing algorithms and compare their performance using network simulator (ns2) A) DISTANCE VECTOR ROUTING ALGORITHM ALGORITHM: 1. Dene new simulator 2. Dene dierent colors for data ows (for NAM) 3. Dene a new Trace le and open it 4. Dene a new NAM Trace le and open it 5. Dene a 'nish' procedure – to ush trace record in the `trace and trace output les. 6. Dene the routing protocol as Distance Vector (DV)

Ns 2 Lab Programs - List

Embed Size (px)

Citation preview

NW LAB - NS2 PROGRAMS - ALGORITHMIMPLEMENTATION OF UNICAST ROUTING PROTOCOL

AIM: To implement Unicast Routing protocol using network simulator (ns-2).

ALGORITHM1. Define new simulator2. Define different colors for data flows (for NAM)3. Define a new Trace file and open it4. Define a new NAM Trace file and open it5. Define a 'finish' procedure – to flush trace record in the `trace and trace output

files.6. Define the routing protocol as Distance Vector (DV)7. Create six nodes – n0,n1,..n58. Create links between the nodes with 0.3Mb and 10 ms Link with DropTail option9. Give node position (for NAM) to place six nodes in the layout10.Setup a TCP connection – attach TCP Source Agent to node n0 and TCP sink

agent to node n511.Setup a FTP over TCP connection12.Define configuration such that link between nodes n1 and n4 to be failed at 1.0

interval, and up again at 4.5 interval13.Start the simulation

PERFORMANCE COMPARISION OF ROUTING PROTOCOLS

AIM: To implement two routing algorithms and compare their performance using network simulator (ns2)

A) DISTANCE VECTOR ROUTING ALGORITHM

ALGORITHM:1. Define new simulator2. Define different colors for data flows (for NAM)3. Define a new Trace file and open it4. Define a new NAM Trace file and open it5. Define a 'finish' procedure – to flush trace record in the `trace and trace output

files.6. Define the routing protocol as Distance Vector (DV)

7. Create six nodes – n0,n1,..n58. Create links between the nodes with 0.3Mb and 10 ms Link with DropTail option9. Give node position (for NAM) to place six nodes in the layout10.Setup a TCP connection – attach TCP Source Agent to node n0 and TCP sink

agent to node n511.Setup a FTP over TCP connection12.Define configuration such that link between nodes n1 and n4 to be failed at 1.0

interval, and up again at 4.5 interval13.Start the simulation

B ) LINK STATE ROUTING ALGORITHM

ALGORITHM:1. Define new simualtor2. Define different colors for data flows (for NAM)3. Define a new Trace file and open it4. Define a new NAM Trace file and open it5. Define a 'finish' procedure – to flush trace record in the `trace and trace output

files.6. Define the routing protocol as Link State (LS)7. Create six nodes – n0,n1,..n58. Create links between the nodes with 0.3Mb and 10 ms Link with DropTail option9. Give node position (for NAM) to place six nodes in the layout10.Setup a TCP connection – attach TCP Source Agent to node n0 and TCP sink

agent to node n511.Setup a FTP over TCP connection12.Define configuration such that link between nodes n1 and n4 to be failed at 1.0

interval, and up again at 4.5 interval13.Start the simulation

PERFORMANCE COMPARISION OF MAC PROTOCOLS

AIM: To implement two MAC protocols and compare their performance using network simulator (ns2)

ALGORITHMA ) UNSLOTTED ALOHA

1. Define new simualtor

2. Define different colors for data flows (for NAM)3. Define a new Trace file and open it4. Define a new NAM Trace file and open it5. Define the MAC protocol as Unslotted ALOHA6. Create four nodes – n0,n1,..n47. Create links between the nodes with 2Mb and 10 ms Link and 1.7Mb and 20 ms

with DropTail option8. Give node position (for NAM) to place six nodes in the layout9. Set Queue Size of link between node n2 and n3 as 1010.Setup a TCP connection – attach TCP Source Agent to node n0 and TCP sink

agent to node n311.Setup a FTP over TCP connection12.Setup a UDP connection – attach UDP Source Agent to node n0 and UDP sink

agent to node n313.Setup CBR traffic over TCP connection14.Define a 'finish' procedure – to flush trace record in the `trace and trace output

files.15.Schedule events for simulation16.Run the simulation

B ) SLOTTED ALOHA 1. Define new simualtor2. Define different colors for data flows (for NAM)3. Define a new Trace file and open it4. Define a new NAM Trace file and open it5. Define the MAC protocol as Slotted ALOHA6. Create four nodes – n0,n1,..n47. Create links between the nodes with 2Mb and 10 ms Link and 1.7Mb and 20 ms

with DropTail option8. Give node position (for NAM) to place six nodes in the layout9. Set Queue Size of link between node n2 and n3 as 1010.Setup a TCP connection – attach TCP Source Agent to node n0 and TCP sink

agent to node n311.Setup a FTP over TCP connection12.Setup a UDP connection – attach UDP Source Agent to node n0 and UDP sink

agent to node n313.Setup CBR traffic over TCP connection14.Define a 'finish' procedure – to flush trace record in the `trace and trace output

files.15.Schedule events for simulation16.Run the simulation

STUDY OF UDP & TCP PERFORMANCE

AIM: To implement UDP protocol and Study the performance using network simulator (ns2)

ALGORITHM1. Define new simulator2. Create n number of nodes3. Set the link between each nodes4. Create UDP & TCP agent5. Attach the UDP & TCP agent6. Trace the protocol using CBR & FTP7. Define a 'finish' procedure – to flush trace record in the `trace and trace output

files.8. Schedule events for simulation9. Run the simulation