DC Rec Remaining
DC Rec Remaining
DC Rec Remaining
AIM: To implement the simulation of the dynamic host configuration protocol using cisco
Packet Tracer.
PROCEDURE
1. Run Cisco Packet Tracer Student.
2. Build the network topology by adding devices (Router, Switch, PC etc.) and connect-
ing them with ethernet cables.
4. On the router, configure interface fastEthernet 0/0 to act as the default gateway for
our LAN and specify the IP address.
5. Configure DHCP server on the Router. In the server define a DHCP pool of IP ad-
dresses to be assigned to hosts, a Default gateway for the LAN and a DNS Server.
6. Click PC->Desktop->IP configuration and enable DHCP for every PC in the network.
7. Every PC should be able to obtain an IP address, default gateway and DNS server, as
defined in step 4. The configuration can be tested by Ping command.
RESULT:
Simulation of the dynamic host configuration protocol was implemented successfully using
cisco packet tracer.
Aim: To simulate a Cisco Packet Tracer for Establishing a Local Area Network (LAN) with
4 hosts and a switch/Hub.
PROCEDURE :
STEP 1 : Open Cisco packet Tracer student software in your PC after installing.
STEP 2 :Drag and drop four PCs from the bottom list of devices which is highlighted in the
image.
STEP 3 : Now Drag and Drop a switch from the same list of devices.
STEP 4 : Now connect all the PC s with the common switch in the middle using cable found
in the bottom area.
STEP 5 : Now as this is static,we have to assign IP address for each and every PC s by
clicking the PC and click desktop and click IP Configuration the a window like this will
appear where you can give the IP address.And after giving IP address the Subnet Mask will
be created automatically by just clicking that column.And we can close this window now.We
have to repeat this process for all the PC s in our network.
STEP 6 : Now Try sending a packet from one PC to any other PC in the network by clicking
this Message icon in the right side of the window and click on the Source node and
Destination node.If the message tranfers Successfully , you will get the last status as
Successful.
Result:
Thus ,the simulation of a Cisco Packet Tracer for Establishing a Local Area Network
(LAN) with 4 hosts and a switch/Hub has been implemented successfully.
AIM: To implement Simulation of Cisco Packet Tracer to Connect two LANs using multi-
router topology with static routes.
Procedure:
Steps to Connect two LANs using multi-router topology with static routes
1. Open Cisco Packet tracer software
5. Make the connection between the routers and switches using copper straight trough
cables
6. In the same way connect the switches and the routers using the copper straight trough
cables.
7.To configure one router to another,click one router ,click on WIC-2T,it will show a
physical view device,in that turn the power off and drag The dual-serial port WAN in-
terface cards (WICs) in to the physical device.
8.do the same step second router and configure both the router using Serial DTE ca-
ble.
9.Click on the first router ,go to config select FASTETHERNET 0/0 and the port status must
be turned on .Select serial 0/0 /0 and the port status must be turned ON.
11.In the the first router ,go to config select FASTETHERNET 0/0 and type the IP address as
192.168.1.1 and subnet mask will be auto generated.repeat this process again in second router
with IP address 192.168.2.1
12.Click on the PC0 and select desktop and go to IP configuration.Give the IP address as
192.168.1.2
And default Gateway as 192.168.1.1
13. repeat the step 12 for other 3 pc’s. For pc1 the
IP address is 192.168.1.3
Default Gateway is 192.168.1.1
For Pc2 the
IP address is 192.168.2.2
Default Gateway is 192.168.2.1
For PC3 the
IP address is 192.168.2.3
Default Gateway is 192.168.2.1
14.click on to first router again ,click on config and select SERIAL0/0/0 and write the IP
address as 192.168.3.1
15. Repeat the step 14 again for the second router and write the IP address as 192.168.3.2
17.Now to execute it,select the data packet ,drop one in source and another in the
destination.click on the simulation and click on auto capture /lay to see the visual movement
of the data packets.once the process in complete it will show the process is successful.
18. to check the connection is correct select a end device select desktop and select command
prompt and write the follwing commands
Ipconfig
Ping 192.168.2.2
Result:
Thus the implementation of Simulation of Cisco Packet Tracer to Connect two LANs using
multi-router topology with static routes is executed successfully.
Introduction to NS-2:
Widely known as NS2, is simply an event driven simulation tool. Useful in studying the
dynamic nature of communication networks. Simulation of wired as well as wireless network
functions and protocols (e.g., routing algorithms, TCP, UDP) can be done using NS2. In
general, NS2 provides users with a way of specifying such network protocols and simulating
their corresponding behaviors.
Basic Architecture:
NS Simulator Preliminaries:
i) Define simulator.
Creating a simulator is essential for any NS-2 simulation. It is done using the following
simple codes.
set simulator_name[new Simulator]
ii) Define topology.
In this step, define the area (in terms of size) under which the simulation occurs. WE must
define it keeping in view the possible locations of our nodes.
set topography_name[new Topography]
$topography_nameload_flatgridsize_xsize_y
iii) Define output trace files.
Trace files record events that occur during any simulation like node creation and data
transfer, among others. There are several trace formats and choosing one among them would
depend on the results we are looking for and what the files log. A trace file is defined as
follows.
set handler [open filename w]
$simulator_nametrace_type$handler
iv)Create a wired node): set node_name[$simulator_namenode]
v)After creation of nodes ,establish the connection between nodes using the following code.
vi) Define traffic generator agent and attach it to the source and destination node.
To define the traffic flow, we need to designate the nodes as source or destination and decide the type
of application/traffic. The first step is to define the source agent.
set src_agent_name[new Agent/src_agent_type]
Now define the destination agent and attach it.
set dest_agent_name[new Agent/dest_agent_type].
$simulator_nameattach-agent $dest_node_name$dest_agent_name
It must be noted that source and destination agents form a pair, and though many options are available
for a type of agent, not all of them all compatible with each other. Finally, we can connect the agents.
$simulator_nameconnect $src_agent_name$dest_agent_name
It is necessary to tell the simulator when to start and stop the traffic flow. To do so we schedule events
that control the agent‟s activities.
$simulator_nameatstart_time"$traffic_namestart"
$simulator_nameatstop_time"$traffic_namestop"
vii)Run simulator.
$simulator_name run
It is necessary to clear variables and close files after the simulation ends. It is customary to create a
procedure for that. $simulator_nameatsimulation_stop_time"proc_name"
proc proc_name{ } {
global vaiable_listfile_list
$simulator_nameflush-trace
close $file_name
exit 0
}
Awk- An Advanced
awk is a programmable, pattern-matching, and processing tool available in UNIX. It works equally well
with text and numbers.
awk is not just a command, but a programming language too. In other words, awk utility is a pattern
scanning and processing language. It searches one or more files to see if they contain lines that match
specified patterns and then perform associated actions, such as writing the line to the standard output or
incrementing a counter each time it finds a match.
Syntax:
Here, selection_criteria filters input and select lines for the action component to act upon. The
selection_criteria is enclosed within single quotes and the action within the curly braces. Both the
selection_criteria and action forms an awk program.
Program:
//basic.tcl
set ns [new Simulator]
set nf [open PA1.nam w]
$ns namtrace-all $nf
set tf [open PA1.tr w]
$ns trace-all $tf
proc finish { } {
global ns nftf
$ns flush-trace
close $nf
close $tf
exec nam PA1.nam &
exit 0
}
set n0 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
$ns duplex-link $n0 $n2 200Mb 10ms DropTail
Output:
SOURCE CODE:
1. Define a set of nodes.
2. Establish link between the nodes and define link attributes.
3. Define a UDP agent and attach it with nodes.
4. Define a Constant bit rate type with needed attributes.
5. Define the sink and connect source and sink.
6. Define link state routing protocol .
7. Define the trace and nam file.
8. Define the finish procedure to simulate the working .
9. Write a AWK code to calculate the number of packets received.
OUTPUT:
To Execute TCL: ns basic.tcl
To Execute nam: nam PA1.nam
To Execute tr: start edit PA1.tr
PA1.nam
PA1.tr
+ 0.00017 0 1 rtProtoLS 100 ------- 0 0.2 1.1 -1 0
- 0.00017 0 1 rtProtoLS 100 ------- 0 0.2 1.1 -1 0
+ 0.007102 2 1 rtProtoLS 100 ------- 0 2.2 1.1 -1 1
- 0.007102 2 1 rtProtoLS 100 ------- 0 2.2 1.1 -1 1
r 0.010174 0 1 rtProtoLS 100 ------- 0 0.2 1.1 -1 0
OUTPUT:
To execute awk: awk -f drop_packet.awk PA1.tr
RESULT: Thus the Link State Routing Algorithm was Simulated and studied.
SOURCE CODE:
1. Define a set of nodes.
2. Establish link between the nodes and define link attributes.
3. Define a UDP agent and attach it with nodes.
4. Define a Constant bit rate type with needed attributes.
5. Define the sink and connect source and sink.
6. Define distance vector routing protocol .
7. Define the trace and nam file.
8. Define the finish procedure to simulate the working .
9. Write a AWK code to calculate the number of packets received.
OUTPUT:
To Execute TCL: ns basic.tcl
To Execute nam: nam PA1.nam
To Execute tr: start edit PA1.tr
PA1.nam
PA1.tr
+ 0.00017 0 1 rtProtoDV 3 ------- 0 0.2 1.1 -1 0
- 0.00017 0 1 rtProtoDV 3 ------- 0 0.2 1.1 -1 0
+ 0.007102 2 1 rtProtoDV 3 ------- 0 2.2 1.1 -1 1
- 0.007102 2 1 rtProtoDV 3 ------- 0 2.2 1.1 -1 1
r 0.01017 0 1 rtProtoDV 3 ------- 0 0.2 1.1 -1 0
+ 0.27794 1 0 rtProtoDV 3 ------- 0 1.1 0.2 -1 38
- 0.27794 1 0 rtProtoDV 3 ------- 0 1.1 0.2 -1 38
+ 0.27794 1 2 rtProtoDV 3 ------- 0 1.1 2.2 -1 39
- 0.27794 1 2 rtProtoDV 3 ------- 0 1.1 2.2 -1 39
r 0.28794 1 0 rtProtoDV 3 ------- 0 1.1 0.2 -1 38
+ 0.28794 0 1 rtProtoDV 3 ------- 0 0.2 1.1 -1 42
- 0.28794 0 1 rtProtoDV 3 ------- 0 0.2 1.1 -1 42
+ 0.29 0 1 cbr500 ------- 0 0.0 2.0 38 43
- 0.29 0 1 cbr 500 ------- 0 0.0 2.0 38 43
+ 0.295 0 1 cbr 500 ------- 0 0.0 2.0 39 44
- 0.295 0 1 cbr 500 ------- 0 0.0 2.0 39 44
r 0.297941 0 1 rtProtoDV 3 ------- 0 0.2 1.1 -1 42
RESULT: Thus the Distance vector Routing Algorithm was Simulated and studied.