Advanced Protocol Engineering Lab
Advanced Protocol Engineering Lab
V. Jayaraj
21026
EX:1 – Installation of Network Simulator
Aim: To install Network simulator (NS2) and NAM
Commands:
sudo apt-get install ns2
sudo spt-get install nam
Output:
EX:2 - Configuration of Network Simulator
Aim: To configure Network simulator (NS2) and construct a star topolgy
Commands:
set ns [new Simulator]
set nf [open exp1.nam w]
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam exp1.nam &
exit 0
}
proc finish {} {
global ns nf nt
$ns flush-trace
close $nf
close $nt
exec nam exp2.nam &
exec awk -f exp2.awk exp2.tr &
exit 0
}
(ii) exp4.awk
BEGIN{
stime=0
ftime=0
flag=0
fsize=0
throughput=0
latency=0
}
{
if($1 =="r" && $4 == 3){
fsize += 1
if(flag == 0){
stime = $2
flag = 1
}
ftime = $2
}
}
END{
latency = ftime - stime
throughput = (ftime * 8)/(latency)
printf("\nLatency : %f\n", latency)
printf("\nThroughput : %f\n", throughput)
}
Output:
EX:6–IP Spoofing
Aim:
To implement IP Spoofing using Wireshark.
Commands:
ifconfig
nc –lnvp 12345
sudo dpkg-reconfigure wireshark-common
sudo chmod +x /usr/bin/dumpcap
sudo nmap –sS –Pn –D <src ip> <dest ip>