LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   new protocol in ns2 (https://www.linuxquestions.org/questions/linux-software-2/new-protocol-in-ns2-4175592915/)

fatma alzahra 11-04-2016 04:50 PM

new protocol in ns2
 
5 Attachment(s)
Hello;
The attached file is used to implement security handover in ns2
mipbu.h & mipbu.cc in ns-2.29
ns-agent.tcl
Quote:

Agent/MIPBU instproc init args {
$self next $args
}
ns-packet.tcl
Quote:

foreach prot {
# Common:
Common
Flags
-
-
-
#Mobile IP ,Binding update:
MIPBU # mobile IP binding update
}
Makefile
Quote:

MIPBU/MIPBU.o
test.tcl
Quote:

#NS2 code for testing the simulation
#Create a simulator object
set ns [new Simulator]
#Open the nam trace file
set nf [open out.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf
$ns flush-trace
#Close the trace file
close $nf
#Execute nam on the trace file
exec nam out.nam &
exit 0
}
#Create two nodes
set Mobile_Node [$ns node]
set Home_Agent [$ns node]
set Corres_Agent [$ns node]
#Set color for the nodes
$Mobile_Node color Blue
$Home_Agent color Red
$Corres_Agent color Green
#Create a duplex link between the nodes
$ns duplex-link $Mobile_Node $Home_Agent 1Mb 10ms DropTail orient right
$ns duplex-link $Home_Agent $Corres_Agent 1Mb 10ms DropTail orient down
#Create a
MIPBU agent and attach it to node n0
set mipbu0 [new Agent/Mipbu]
$ns attach-agent $Mobile_Node $mipbu0
#Create a MIPBU agent and attach it to node n1
set mipbu1 [new Agent/Mipbu]
$ns attach-agent $Home_Agent $mipbu1
#Create a MIPBU agent and attach it to node n2
set mipbu2 [new Agent/Mipbu]
$ns attach-agent $Corres_Agent $mipbu2
#attach agents
$ns connect $mipbu0 $mipbu1
$ns connect $mipbu1 $mipbu2
$ns at 0.0 "$mipbu0 start"
$ns at 9.5 "$mipbu0 stop"
#Call the finish procedure after 5 seconds of simulation time
$ns at 10.0 "finish"
#Run the simulation
$ns run

got error after ./configure make clean make
Quote:

trace/cmu-trace.cc: In member function ‘void CMUTrace::format_mipbu(Packet*, int)’:
trace/cmu-trace.cc:1151: error: ‘HDR_MIPBU’ was not declared in this scope
make: *** [trace/cmu-trace.o] Error 1
I really appreciate your kind help
thanks in advance


All times are GMT -5. The time now is 01:21 PM.