[ns] Total energy consumption using LEACH protocol
Hi everyone, I have successfully install and running LEACH on ns2.27. However, I've noticed that at the end of simulation, in the file leach.out, the total energy dissipated in the systems is more that the total initial energy of all nodes. Does anyone has the similar problems that I have? For instance, I've run LEACh simulation for 100 nodes with 2J energy each initially. At the end of simulation, what I've got is: At 542.30907: Total Energy = 292.59827246392308 Total Data = 55934 Total Alive = 4 >From what I know, the total energy dissipated cannot exceed 200J which is the total energy available in the network (2J/node x 100 = 200J) I would be very grateful if anyone that has the explanation to this problem could reply my email. Many thanks.
Re: [ns] Help: accessing contents of data payload in NS2
O S wrote: > > > if((PacketData*)p->userdata()!=NULL) { > PacketData* packdata = (PacketData*)p->userdata(); > char* pdata = (char*)packdata->data(); > printf("data = %c\n", pdata); > } > > if (p->accessdata()!=NULL){ > data_char = p->accessdata(); > printf("data = %c and p->datalength = %d real length = %d \n", > data_char, p->datalen(), ((PacketData*)(p->userdata()))->size() ); > } > > > "data_" is a pointer to the class "AppData" . 1. so it is no good idea to cast to a pointer of "char" . try to avoid type casting ! this is not a good programmer's style and resolves in faults. 2. the class AppData is only a interface for different types of payload. so you have to specify the type of payload and the data. maybe you can use the class "PacketData" for your purposes. regards mike -- View this message in context: http://old.nabble.com/Help%3A-accessing-contents-of-data-payload-in-NS2-tp28115846p28132310.html Sent from the ns-users mailing list archive at Nabble.com.
[ns] NS-2 & Packet Payload
For those who want to know how to manipulate a packet payload in NS-2, here is a good solution: http://www-sop.inria.fr/members/Mohamed_Karim.Sbai/index.php/research/56 (code and scripts available in the site) I've used another approach. I'll make it available soon. -- Sidney Doria Redes ad hoc móveis Doutorado em Computação UFCG Brasil "Nessa jornada, o conhecimento será o seu escudo..." (Mestre dos Magos no episódio do grimoire de ouro)
[ns] Query: how to different behavior of differenyt node
Hiii, Please tell me how to add different behavior of different node in tcl script. regards Umang _ Bollywood This Decade http://entertainment.in.msn.com/bollywoodthisdecade/
[ns] how can i take value from field of routing table in aodv c code in ns2
dear sir /madam, i have add an additional field in aodv routing table class and an another field in RREQ message .i have to take value from routing table field to RREQ reception routine field .wheneve i assigned this field .blank trace file is generated. can any body kindly guide me in this regard. fieldin RREQ messag is; rq->rq_reseved[0] and in rout table ; rt->rt_load in aodv.cc file in request recved routine im assigning as rq->rq_reserved[0]=rt->rt_load; this produce blank trace file i do,t understand the problem. i will be thank full for that. iftikhar ahmad
Re: [ns] Segmenting the Region for placing nodes
Hi, Thanks for your reply. So can I write separate TCL script for this and add later like dsr.tcl or other protocol. because I want to take more no. of nodes and want to place them in a manner so that the area will be fully balanced with nodes. Because I want to make a algo in WSN where I need to choose Cluster Heads and I want to make a compulsion for every segments that they have minimum one cluster head. On Sun, Apr 4, 2010 at 6:23 PM, Hoda Hassan wrote: > Hello > You can do that by specifying node coordinates in the tcl script. I have no > idea if it can be done using a function > > On Apr 4, 2010, at 2:44 PM, ashish mohta wrote: > > >> -- Forwarded message -- >> From: ashish mohta >> Date: Sun, Apr 4, 2010 at 5:51 PM >> Subject: Segmenting the Region for placing nodes >> To: ns-users@isi.edu >> >> >> Hello Friends, >> >> I want to divide the Region (can be Grid or any X*Y) in 4 parts to place >> my >> nodes. I want to develop a function for this. But not able to understand >> from where I should start. Please guide me if you can, I need help for >> this >> to improve working of a protocol in ns2. >> >> Thanks >> Ashish >> > >
[ns] Segmenting the Region for placing nodes
-- Forwarded message -- From: ashish mohta Date: Sun, Apr 4, 2010 at 5:51 PM Subject: Segmenting the Region for placing nodes To: ns-users@isi.edu Hello Friends, I want to divide the Region (can be Grid or any X*Y) in 4 parts to place my nodes. I want to develop a function for this. But not able to understand from where I should start. Please guide me if you can, I need help for this to improve working of a protocol in ns2. Thanks Ashish
Re: [ns] Installing ns-2.28, 2.29 under Gentoo or Ubuntu
Hi Cesar, I have to not tried Ubunto 2.6.27. But I did try Ubuntu 9.10. It doesn't work. I guess the problem is because of the gcc package in later Linux distribution. Please see the test result below: http://www.ns2ultimate.com/post/439346614/working-combination-ns-2-34-ubuntu-8-04-and-perhaps What you can do is to use NS-2.35 which fixed the gcc problem. Please find the instruction here: http://www.ns2ultimate.com/post/441093095/ns-2-35-works-on-cygwin Best Regards, Teerawat Issariyakul http://www.ns2ultimate.com/ http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417 http://twitter.com/T_Bear http://www.t-issariyakul.blogspot.com http://www.ece.ubc.ca/~teerawat On 4/3/2010, "Cesar Cardenas" wrote: > >Dear all, >I need to install ns-2.28 or ns.2.29 under Gentoo 2.6.30 r8 or under >Ubuntu 2.6.27-7-server because I want to install WFQ for DiffServ: > >http://sergioandreozzi.com/research/network/diffserv4ns/ >http://www.augustoneto.com/technical.html >http://www.mail-archive.com/ns-users@isi.edu/msg01073.html > >I already have ns-2.30, 2.31 and 2.34 on both machines. > >When I try to install either ns-2.28 and ns-2.29 I got several errors, >some of them related to: > >./common/packet.h:173: warning: deprecated conversion from string >constant to âchar*â >./sctp/sctp.h:253: warning: âtypedefâ was ignored in this declaration > >But finally they don't compile: > >make: *** [trace/trace.o] Error 1 >Ns make failed! > >I tried to look at the following webpage > >http://www.isi.edu/nsnam/ns/ns-problems.html for problems > >But the patch does not work. > >http://www/isi.edu/nsnam/dist/solaris.patch > >Any points to solve this problem will be very appreciated. >All the best, >César Cárdenas >