[ns] How to introduce an error model between two mobile nodes
I tried something like this, but it gives me an error. set em [new ErrorModel] $em set enable_ 1 $em unit pkt $em set bandwidth_ 5M $em ranvar [new RandomVariable/Uniform] $em drop-target [new Agent/Null] $ns link-lossmodel $em $node_(0) $node_(1) Where node_(0) and node_(1) are mobile nodes. Thanks, Anu
[ns] ARQ protocol - TCP sequence number always one
Hi, Has anyone tried the ARQ protocol code on http://www.ns2ultimate.com/post/1539258323/arq-module-program-update. I tried it on NS2.35, compiles fine but always give TCP sequence number as one. Can someone please help? Thanks, Anu Jain
[ns] ARQ protocol
Hi, I have tried the ARQ protocol at the following link: http://www.ns2ultimate.com/post/1539258323 But it doesn't give the correct results. The TCP sequence number is always one. Anu
[ns] regarding adding and calling new added function in Packet class
I am facing a new problem now. As i have already told that i have added encryption/decryption function in Packet class that are working fine with udpdata.tcl script file after calling functions from udp.cc file. Now i wanted to check it with aodv also. For this i have to call it in aodv.cc file and then have to run tcl script.But when i call it in aodv.cc file and then run the make command, it says 'class Packet' has no member named 'encrypt' can you tell me the reason for this. -- View this message in context: http://www.nabble.com/regarding-adding-and-calling-new-added-function-in-Packet-class-tf3763401.html#a10638154 Sent from the ns-users mailing list archive at Nabble.com.
[ns] regarding sendmsg()
hello First of all thanks to Mr. Timo, for his help regarding sendmsg(). As I wanted to see the data that i set in the tcl file, I edited the ../tcl/ex/udpdata.tcl like $ns at 0.1 $udp0 send 724 Hello1 $ns at 0.2 $udp1 send 100 Hello2 $ns at 0.3 $udp0 send 500 Hello3 $ns at 0.4 $udp1 send 828 Hello4 It calls the following function in udp.cc, where i added the printf statement int UdpAgent::command(int argc, const char*const* argv) { if (argc == 4) { if (strcmp(argv[1], send) == 0) { printf(\n \n%d==%s,atoi(argv[2]),argv[3]); PacketData* data = new PacketData(1 + strlen(argv[3])); strcpy((char*)data-data(), argv[3]); sendmsg(atoi(argv[2]), data); return (TCL_OK); } Its displaying the contents of data, as expected. But after this, when i add printf statement in void UdpAgent::sendmsg(int nbytes, AppData* data, const char* flags) ,like given below if (flags (0 ==strcmp(flags, NEW_BURST))) rh-flags() |= RTP_M; p-setdata(data); printf(after setdata(): %s :,p-userdata()); target_-recv(p); and at receiver end, i did the same, like void UdpAgent::recv(Packet* pkt, Handler*) { // printf(\n userdata():%s, pkt-userdata()); printf(\nData:::%s,pkt-userdata()); printf(\n In UdpAgent::recv(Packet* pkt, Handler*)); if (app_ ) { Now in both cases, its displaying either null or some garbage value. what is the problem here? Any little help will be greatly appreciated. thanks, Anuradha -- View this message in context: http://www.nabble.com/regarding-sendmsg%28%29-tf3678871.html#a10280688 Sent from the ns-users mailing list archive at Nabble.com.
Re: [ns] regarding sendmsg()
hello First of all thanks to Mr. Timo, for his help regarding sendmsg(). As I wanted to see the data that i set in the tcl file, I edited the ../tcl/ex/udpdata.tcl like $ns at 0.1 $udp0 send 724 Hello1 $ns at 0.2 $udp1 send 100 Hello2 $ns at 0.3 $udp0 send 500 Hello3 $ns at 0.4 $udp1 send 828 Hello4 It calls the following function in udp.cc, where i added the printf statement int UdpAgent::command(int argc, const char*const* argv) { if (argc == 4) { if (strcmp(argv[1], send) == 0) { printf(\n \n%d==%s,atoi(argv[2]),argv[3]); PacketData* data = new PacketData(1 + strlen(argv[3])); strcpy((char*)data-data(), argv[3]); sendmsg(atoi(argv[2]), data); return (TCL_OK); } Its displaying the contents of data, as expected. But after this, when i add printf statement in void UdpAgent::sendmsg(int nbytes, AppData* data, const char* flags) ,like given below if (flags (0 ==strcmp(flags, NEW_BURST))) rh-flags() |= RTP_M; p-setdata(data); printf(after setdata(): %s :,p-userdata()); target_-recv(p); and at receiver end, i did the same, like void UdpAgent::recv(Packet* pkt, Handler*) { // printf(\n userdata():%s, pkt-userdata()); printf(\nData:::%s,pkt-userdata()); printf(\n In UdpAgent::recv(Packet* pkt, Handler*)); if (app_ ) { Now in both cases, its displaying either null or some garbage value. what is the problem here? Any little help will be greatly appreciated. thanks, Anuradha -- View this message in context: http://www.nabble.com/regarding-sendmsg%28%29-tf3678871.html#a10280718 Sent from the ns-users mailing list archive at Nabble.com.
Re: [ns] regarding sendmsg()
hello First of all thanks to Mr. Timo, for his help regarding sendmsg(). As I wanted to see the data that i set in the tcl file, I edited the ../tcl/ex/udpdata.tcl like $ns at 0.1 $udp0 send 724 Hello1 $ns at 0.2 $udp1 send 100 Hello2 $ns at 0.3 $udp0 send 500 Hello3 $ns at 0.4 $udp1 send 828 Hello4 It calls the following function in udp.cc, where i added the printf statement int UdpAgent::command(int argc, const char*const* argv) { if (argc == 4) { if (strcmp(argv[1], send) == 0) { printf(\n \n%d==%s,atoi(argv[2]),argv[3]); PacketData* data = new PacketData(1 + strlen(argv[3])); strcpy((char*)data-data(), argv[3]); sendmsg(atoi(argv[2]), data); return (TCL_OK); } Its displaying the contents of data, as expected. But after this, when i add printf statement in void UdpAgent::sendmsg(int nbytes, AppData* data, const char* flags) ,like given below if (flags (0 ==strcmp(flags, NEW_BURST))) rh-flags() |= RTP_M; p-setdata(data); printf(after setdata(): %s :,p-userdata()); target_-recv(p); and at receiver end, i did the same, like void UdpAgent::recv(Packet* pkt, Handler*) { // printf(\n userdata():%s, pkt-userdata()); printf(\nData:::%s,pkt-userdata()); printf(\n In UdpAgent::recv(Packet* pkt, Handler*)); if (app_ ) { Now in both cases, its displaying either null or some garbage value. what is the problem here? Any little help will be greatly appreciated. thanks, Anuradha -- View this message in context: http://www.nabble.com/regarding-sendmsg%28%29-tf3678871.html#a10280776 Sent from the ns-users mailing list archive at Nabble.com.
[ns] regarding segmentation fault(core dumped) in sendmsg() function
hello ns-users I am having a problem in understanding a statement $udp0 sendmsg 0 Hello 0 It calls the sendmsg() function of UDPAgent class in udp.cc file, like, if (strcmp(argv[1], sendmsg) == 0) { PacketData* data = new PacketData(1 + strlen(argv[3])); strcpy((char*)data-data(), argv[3]); sendmsg(atoi(argv[2]), data, argv[4]); return (TCL_OK); } It means its calling sendmsg() in backend. But when i want to see the data_ (member variable of PacketData)value in UDPAgent::sendmsg(), like, void UdpAgent::sendmsg(int nbytes, PacketData* data, const char* flags) { Packet *p; int n; printf(\n In UdpAgent::sendmsg():%d--%s--%s,nbytes,data-data(),flags); //%s,(char *)data-data()); assert (size_ 0); (In this code, the argument was AppData, that i changed to PacketData to access the data_ field in PacketData) it shows me segmentation fault(core dumped), when i run the tcl script after compilation of ns2. I will really appreciate if any body can guide me about this a little bit. Thanks a lot Anuradha -- View this message in context: http://www.nabble.com/-ns--regarding-segmentation-fault%28core-dumped%29-in-sendmsg%28%29-function-tf3674133.html#a10266551 Sent from the ns-users mailing list archive at Nabble.com.
Re: [ns] problem: Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl)
hi did you find the solution of Classifier no-slot problem. I am also having the same problem. Thanks, Anuradha Armando Garcia B. wrote: Hi everybody. I have seen a lot of mails with this problem: --- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) --- _o28: no target for slot -1 _o28 type: Classifier/Hash/Dest content dump: classifier _o28 0 offset 0 shift 2147483647 mask 1 slots slot 5: _o99 (Classifier/Port) -1 default -- Finished standard no-slot{} default handler -- Now, I have the same problem. and I have invested a lot of time, but I can not found the solution. Does some any know the solution? or any idea may be. Regards. -- Armando Garcia B. INT-RST 5 Rue Charles Fourier 91011 EVRY Cedex Tel: 01 60 76 68 56 -- View this message in context: http://www.nabble.com/problem%3A-Classfier%3A%3Ano-slot%7B%7D-default-handler-%28tcl-lib-ns-lib.tcl%29-tf2040687.html#a10264206 Sent from the ns-users mailing list archive at Nabble.com.
[ns] which functions are called in backened of tcl script
hello Is there any tutorial or any other document available, that can tell which functions are called in backend when we run tcl script commands in ns2. Thanks -- Anuradha Sehgal
[ns] Regarding ns-simple.tcl script
hello ns users I have a problem in understanding a tcl script, that i downloaded from the web site http://nile.wpi.edu/NS/ its ns-simple.tcl I added two lines in it that are -some code here--- $cbr set packet_data_ hello ---some code here puts Packet Data= [$cbr set packet_data_] -some code here--- This is running, but my problem is which function or constructor is called when i set the packet_data_ member variable. Thanks a lot !! This is the full version of ns-simple.tcl file #Create a simulator object set ns [new Simulator] #Define different colors for data flows (for NAM) $ns color 1 Blue $ns color 2 Red #Open the NAM trace file set nf [open out.nam w] $ns namtrace-all $nf #Define a 'finish' procedure proc finish {} { global ns nf $ns flush-trace #Close the NAM trace file close $nf #Execute NAM on the trace file exec nam out.nam exit 0 } #Create four nodes set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] #Create links between the nodes $ns duplex-link $n0 $n2 2Mb 10ms DropTail $ns duplex-link $n1 $n2 2Mb 10ms DropTail $ns duplex-link $n2 $n3 1.7Mb 20ms DropTail #Set Queue Size of link (n2-n3) to 10 $ns queue-limit $n2 $n3 10 #Give node position (for NAM) $ns duplex-link-op $n0 $n2 orient right-down $ns duplex-link-op $n1 $n2 orient right-up $ns duplex-link-op $n2 $n3 orient right #Monitor the queue for link (n2-n3). (for NAM) $ns duplex-link-op $n2 $n3 queuePos 0.5 #Setup a TCP connection set tcp [new Agent/TCP] $tcp set class_ 2 $ns attach-agent $n0 $tcp set sink [new Agent/TCPSink] $ns attach-agent $n3 $sink $ns connect $tcp $sink $tcp set fid_ 1 #Setup a FTP over TCP connection set ftp [new Application/FTP] $ftp attach-agent $tcp $ftp set type_ FTP #Setup a UDP connection set udp [new Agent/UDP] $ns attach-agent $n1 $udp set null [new Agent/Null] $ns attach-agent $n3 $null $ns connect $udp $null $udp set fid_ 2 #Setup a CBR over UDP connection set cbr [new Application/Traffic/CBR] $cbr attach-agent $udp $cbr set type_ CBR $cbr set packet_size_ 1000 $cbr set rate_ 1mb $cbr set random_ false $cbr set packet_data_ hello #Schedule events for the CBR and FTP agents $ns at 0.1 $cbr start $ns at 1.0 $ftp start $ns at 4.0 $ftp stop $ns at 4.5 $cbr stop #Detach tcp and sink agents (not really necessary) $ns at 4.5 $ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink #Call the finish procedure after 5 seconds of simulation time $ns at 5.0 finish #Print CBR packet size and interval puts CBR packet size = [$cbr set packet_size_] puts CBR interval = [$cbr set interval_] puts Packet Data= [$cbr set packet_data_] #Run the simulation $ns run Anuradha Sehgal
[ns] how to create a new packet and set/get data?
hello ns-users I am using ns-allinone-2.31 installed on cygwin. I have added some encryption and decryption functions by creating a new class in ns2. I have also used it in a script file by calling it from there. Its working fine. The script file is #myTcl.tcl set encdec [new Agent/EncDecOtcl] $encdec call-my-priv-func2 #end of tcl file= Now i want to create a new packet and want to call that function from there so that data get encrypted and decrypted while sending and receiving. any help will be greatly appreiciated. Thanks in advance With best regards, Anuradha Sehgal
Re: [ns] problem with make
hello sir Did you get any solution for this problem. I am also facing the same problem. if you have its solution, please send it to me my mail id is [EMAIL PROTECTED] i will be very thankful to you. Anuradha sachin dahiya wrote: I am new to NS. I am running NS on cygwin on Windows XP. I was trying the 'make depend' and 'make' commands to see if they are working properly. I did not make any changes to any files after i installed NS. However, I received the errors shown below while i used the 'make' command: ucb; do ( cd $i; make all; ) done make[1]: Entering directory `/home/ns-2.29/indep-utils/cmu-scen-gen/setdest' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/ns-2.29/indep-utils/cmu-scen-gen/setdest' make[1]: Entering directory `/home/ns-2.29/indep-utils/webtrace-conv/dec' g++ -c -Wall -DCPP_NAMESPACE=std -I. -I/home/tclcl-1.17 -I/home/otcl-1.11 -I/home/include -I/home/include -I/usr/include/pcap -o proxytrace2any.o proxytrace2any.cc proxytrace2any.cc: In function `int main(int, char**)': proxytrace2any.cc:112: error: `IsLittleEndian' undeclared (first use this function) proxytrace2any.cc:112: error: (Each undeclared identifier is reported only once for each function it appears in.) proxytrace2any.cc:120: error: `ToOtherEndian' undeclared (first use this function) make[1]: *** [proxytrace2any.o] Error 1 make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/dec' make[1]: Entering directory `/home/ns-2.29/indep-utils/webtrace-conv/epa' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/epa' make[1]: Entering directory `/home/ns-2.29/indep-utils/webtrace-conv/nlanr' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/nlanr' make[1]: Entering directory `/home/ns-2.29/indep-utils/webtrace-conv/ucb' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/ns-2.29/indep-utils/webtrace-conv/ucb' I do not understand why this error is appearing. Can anyone help me with this? Thanks in advance. -- View this message in context: http://www.nabble.com/problem-with-make-tf3251454.html#a10052804 Sent from the ns-users mailing list archive at Nabble.com.
[ns] Errors during running make command
I am new to NS. I am running NS, version ns-allinone-2.31 on cygwin on Windows XP. Its working fine, ns and nam both are working fine. However when I was trying the 'make depend' and 'make' commands, without making any changes, to see if they are working properly or not, I received the errors shown below while i used the 'make' command: === proxytrace2any.cc: In function 'int main(int, char**)'; proxytrace2any.cc: 112 error: 'IsLittleEndian' undeclared(first use this function) proxytrace2any.cc: 112 error (Each undeclared identifier is reported only once for each function it appears in.) proxytrace2any.cc: 120 error: 'IsOtherEndian' undeclared(first use this function) make[1]: *** [proxytrace2any.o] Error 1 make[1]: Leaving directory '/cygdrive/c/cygwin/ns-allinone-2.31/ns-2.31/indep-utils/webtrace-conv/dec' .. make[1]: Leaving directory '/cygdrive/c/cygwin/ns-allinone-2.31/ns-2.31/indep-utils/webtrace-conv/ucb' = I do not understand why this error is appearing. I will really appreiciate any help regarding this. With regards, Anuradha Sehgal
[ns] adding global variables in ns2
I am working with NS-2.31 installed in cygwin. I want to add some global variables in NS-2 or more specifically in packet.h/packet.cc files. I have tried it in packet.h, by simply adding it as we normally do in C, but it gives errors like multiple definition of my_var first defined here etc here my_var is variable that i declared globally Is there some different way of doing this, may be i am following wrong way any help will be appreciated thanks, Anuradha Sehgal
[ns] Query about errors during running make command
hello everyone I am using ns-allinone-2.31 that i installed on cygwin. I am trying to add encryption and decryption in ns2. The encryption and decryption code that i am trying to put in ../ns-2.31/common/packet.h running well when i use gcc, CC or g++. I mean it do not complain for any thing. But the problem is when i run the make command to recompile ns2, it gives three strange errors and a lots of warnings. The three errors are: error:expected primary-expression before int. error:expected ; before int error::non-lvalue in assignment why these errors are occuring?? I checked the code, but there is no problem, moreover its compiling and running sucessfully if i use gcc, CC, g++(and in turbo c also). Is make comamnd is using some older compiler? If so how can i remove these errors? its urgent, please reply soon Thanks in advance, Anuradha Sehgal
[ns] adding encryption/decryption in ns2
hello everyone I am using ns-allinone-2.31 that i installed on cygwin. I am trying to add encryption and decryption in ns2. The encryption and decryption code that i am trying to put in ../ns-2.31/common/packet.h running well when i use gcc, CC or g++. I mean it do not complain for any thing. But the problem is when i run the make command to recompile ns2, it gives three strange errors and a lots of warnings. The three errors are: error:expected primary-expression before int. error:expected ; before int error::non-lvalue in assignment why these errors are occuring?? I checked the code, but there is no problem, moreover its compiling and running sucessfully if i use gcc, CC, g++(and in turbo c also). Is make comamnd is using some older compiler? If so how can i remove these errors? its urgent, please reply soon Thanks in advance, Anuradha Sehgal
[ns] problems during running make command
Hello everone I am using ns-allinone-2.31 that i installed on cygwin. I am trying to add encryption and decryption in ns2. The encryption and decryption code that i am trying to put in ../ns-2.31/common/packet.h running well when i use gcc, CC or g++. I mean it do not complain for any thing. But the problem is when i run the make command to recompile ns2, it gives three strange errors and a lots of warnings. The three errors are: error:expected primary-expression before int. error:expected ; before int error::non-lvalue in assignment why these errors are occuring?? I checked the code, but there is no problem, moreover its compiling and running sucessfully if i use gcc, CC, g++(and in turbo c also). Is make comamnd is using some older compiler? If so how can i remove these errors? its urgent, please reply soon Thanks in advance, -- Anuradha Sehgal
[ns] problems during running make command
Hello I am using ns-allinone-2.31 that i installed on cygwin. I am trying to add encryption and decryption in ns2. The encryption and decryption code that i am trying to put in ../ns-2.31/common/packet.h running well when i use gcc, CC or g++. I mean it do not complain for any thing. But the problem is when i run the make command to recompile ns2, it gives three strange errors and a lots of warnings. The three errors are: error:expected primary-expression before int. error:expected ; before int error::non-lvalue in assignment why these errors are occuring?? I checked the code, but there is no problem, moreover its compiling and running sucessfully if i use gcc, CC, g++(and in turbo c also). Is make comamnd is using some older compiler? If so how can i remove these errors? its urgent, please reply soon Thanks in advance, Anuradha Sehgal
[ns] Regarding linking c++ code in ns2
Dear Sir/Madam, i m facing the probelm of linking c++ code in ns2. i have installed ns2 that is working correctly..but now how to run c++ code in it..please do help me..its really very urgent.. please reply soon..thanks in advance... sincerely, Anuradha Sehgal