Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-04-2016, 04:50 PM   #1
fatma alzahra
LQ Newbie
Registered: Aug 2014
Posts: 26

Rep: Reputation: Disabled
new protocol in ns2

The attached file is used to implement security handover in ns2
mipbu.h & in ns-2.29
Agent/MIPBU instproc init args {
$self next $args
foreach prot {
# Common:
#Mobile IP ,Binding update:
MIPBU # mobile IP binding update
#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
trace/ In member function ‘void CMUTrace::format_mipbu(Packet*, int)’:
trace/ 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
Attached Files
File Type: txt (39.3 KB, 17 views)
File Type: txt cmu-trace.h.txt (5.2 KB, 11 views)
File Type: txt (13.6 KB, 9 views)
File Type: txt mipbu.h.txt (2.8 KB, 11 views)
File Type: txt packet.h.txt (20.1 KB, 10 views)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
adding new protocol in ns2.35 rc49 Linux - Newbie 1 09-26-2015 07:21 AM
Create a new protocol in ns2.31 Retta Linux - Software 8 02-03-2014 05:40 AM
protocol used in ns2 simulator keerthanagupta Linux - Newbie 0 01-23-2012 01:06 AM
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 01:44 AM
weight throwing protocol using ns2 code,diffusion based protocol using ns2 code rajrupa Linux - Networking 1 05-27-2010 03:39 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:18 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration