i added a new manet routing protocol with name of corp and make is successful .i followed all the instructions and code is according to protoname protocol guide. but when i write tcl file for simulation it gives errors. i think there are some parameters to pass in tcl. if any one can help me in writing a tcl for that i shall be thankfull. simply i need a tcl same as for protoname.
-----Original Message----- From: [email protected] To: [email protected] Date: Sun, 10 Jul 2011 17:00:23 -0700 Subject: Ns-users Digest, Vol 91, Issue 10 Send Ns-users mailing list submissions to [email protected] To subscribe or unsubscribe via the World Wide Web, visit http://mailman.isi.edu/mailman/listinfo/ns-users [http://mailman.isi.edu/mailman/listinfo/ns-users] or, via email, send a message with subject or body 'help' to [email protected] You can reach the person managing the list at [email protected] When replying, please edit your Subject line so it is more specific than "Re: Contents of Ns-users digest..." Today's Topics: 1. Re: add extra field in GPSR packet header (???? ???? ?? ?? ???? mohammed) 2. Re: installation problem (???? ???? ?? ?? ???? mohammed) 3. Re: trace2stats for awk (???? ???? ?? ?? ???? mohammed) 4. Re: exponential distribution (???? ???? ?? ?? ???? mohammed) 5. Re: INSPECT installation in ns2.34 (???? ???? ?? ?? ???? mohammed) 6. awk script from mailing list (umair shah) 7. add maodv (Zeinab Rezaiefar) 8. problem in adding a new protocol in ns2.34 (M.Mehran Ajmal) ---------------------------------------------------------------------- Message: 1 Date: Sun, 10 Jul 2011 00:37:10 -0700 (PDT) From: ???? ???? ?? ?? ???? mohammed <[email protected]> Subject: Re: [ns] add extra field in GPSR packet header To: Zakia Khalfallah <[email protected]> Cc: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset=iso-8859-1 Hi, there is file gpsr_pkt.h , here you can extra field as you want . --- On Thu, 7/7/11, Zakia Khalfallah <[email protected]> wrote: From: Zakia Khalfallah <[email protected]> Subject: [ns] add extra field in GPSR packet header To: "NS Hassan gpsr" <[email protected]>, "NS user" <[email protected]> Date: Thursday, July 7, 2011, 9:19 AM Hi all, I'm simulating GPSR protocol. I need to calculate delay through Timestamp in real time during the simulation. So i need to add the timestamp field in the GPSR packet header. How can i add that ? Thank you, Zak ??? ???????? ?????? ??? ? ------------------------------ Message: 2 Date: Sun, 10 Jul 2011 00:45:02 -0700 (PDT) From: ???? ???? ?? ?? ???? mohammed <[email protected]> Subject: Re: [ns] installation problem To: shwta jain <[email protected]> Cc: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset=iso-8859-1 HI , i suggest to you install ns2 on any environment related to linux such as ubuntu and there is some steps must be followed to run ns2 , and you must have internet on the pc that download ns2 on it ? here the steps :- First, we download the ns-2 all-in-one file [54.4 MB]. $ wget http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.34.tar.gz [http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.34.tar.gz]$ tar -xzvf ns-allinone-2.34.tar.gz$ cd ns-allinone-2.34$ sudo apt-get install build-essential autoconf automake libxmu-dev$ ./install If your ubuntu version is 9.10, you must change the variable of environment CC $ export CC=gcc-4.3 ? Set environment variables $ gedit ~/.bashrc Add the following lines to the end of the file. Remember replace "/your/path" by the folder where you have stored extracted the ns-2 file (For example, if your Linux account name is purple, and you have extracted the file to your home directory, you have to change /your path to /home/purple) # LD_LIBRARY_PATHOTCL_LIB=/your/path/ns-allinone-2.34/otcl-1.13NS2_LIB=/your/path/ns-allinone-2.34/libX11_LIB=/usr/X11R6/libUSR_LOCAL_LIB=/usr/local/libexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB?# TCL_LIBRARYTCL_LIB=/your/path/ns-allinone-2.34/tcl8.4.18/libraryUSR_LIB=/usr/libexport TCL_LIBRARY=$TCL_LIB:$USR_LIB?# PATHXGRAPH=/your/path/ns-allinone-2.34/bin:/your/path/ns-allinone-2.34/tcl8.4.18/unix:/your/path/ns-allinone-2.34/tk8.4.18/unixNS=/your/path/ns-allinone-2.34/ns-2.34/NAM=/your/path/ns-allinone-2.34/nam-1.14/PATH=$PATH:$XGRAPH:$NS:$NAM Ensure that it immediately takes effect: $ source ~/.bashrc Note: the previous step is important; else you cannot successfully run ns-2. (Alternatively, you may have to restart your X-windows, that is logout, and then login, or restart your computer.) Now, the installation has been completed. Try: $ ns The "%" symbol appears on the screen. Type "exit" to quit. Validation To run the ns validation suite: $ cd ns-2.34$ ./validate --- On Fri, 7/8/11, shwta jain <[email protected]> wrote: From: shwta jain <[email protected]> Subject: [ns] installation problem To: [email protected] Date: Friday, July 8, 2011, 6:27 AM Hi Following error is coming during installation of ns-2.34. Can anybody help me regarding this error * Build Stanford GraphBase ============================================================ Making sgb if test -r gb_io.ch; then ctangle gb_io.w gb_io.ch; else ctangle gb_io.w; fi /bin/sh: line 1: ctangle: command not found make: *** [gb_io.c] Error 127 Unable to create sgb library, but it's optional, so continuing... ============================================================ * Build GT-ITM ============================================================ sgb lib not found. gt-itm & sgb2ns could not be installed. Continuing.. ============================================================ * Build zlib ============================================================ Checking for gcc... Building static library libz.a version 1.2.3 with cc. Checking for unistd.h... No. Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf() Checking for snprintf() in stdio.h... No. ? WARNING: snprintf() not found, falling back to sprintf(). zlib ? can build but will be open to possible buffer-overflow security ? vulnerabilities. Checking for return value of sprintf()... No. ? WARNING: apparently sprintf() does not return a value. zlib ? can build but will be open to possible string-format security ? vulnerabilities. Checking for errno.h... No. Checking for mmap support... No. cc -O -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H???-c -o example.o example.c make: cc: Command not found make: *** [example.o] Error 127 Zlib make failed, but it's optional Continue ... ============================================================ * Build tcl8.4.18 ============================================================ ./install: line 431: autoconf: command not found loading cache ./config.cache checking whether to use symlinks for manpages... no checking whether to compress the manpages... no checking whether to add a package name suffix for the manpages... no checking for gcc... no checking for cc... no configure: error: no acceptable cc found in $PATH tcl8.4.18 configuration failed! Exiting ... Tcl is not part of the ns project.? Please see www.Scriptics.com [http://www.scriptics.com/] to see if they have a fix for your platform. [shweta@localhost ns-allinone-2.34]$ ------------------------------ Message: 3 Date: Sun, 10 Jul 2011 00:49:33 -0700 (PDT) From: ???? ???? ?? ?? ???? mohammed <[email protected]> Subject: Re: [ns] trace2stats for awk To: umair shah <[email protected]> Cc: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset=iso-8859-1 hi the number of columns not correspond to new trace format node_id not the colume number 5 , you must recorrect the esquence of the number that match to new trace format --- On Sat, 7/9/11, umair shah <[email protected]> wrote: From: umair shah <[email protected]> Subject: [ns] trace2stats for awk To: "nsusers" <[email protected]> Date: Saturday, July 9, 2011, 2:38 AM http://perso.citi.insa-lyon.fr/mfiore/research.html [http://perso.citi.insa-lyon.fr/mfiore/research.html] the website has A set of AWK scripts to get node-to-node statistics from the ??? ??? ??? ??? ??? tracefiles generated by the ns-2 network simulat ,the awk script for instant throughput,instant jitter and avgstats but when I run any of them i don't get the results in any case just blank lines ,I'm using the new trace format as stated in readme file . this is from instant throughput script in awk # Trace line format: new ??? if ($2 == "-t") { ??? ??? event = $1 ??? ??? time = $3 ??? ??? node_id = $5 ??? ??? flow_id = $39 ??? ??? pkt_id = $41 ??? ??? pkt_size = $37 ??? ??? flow_t = $45 ??? ??? level = $19 I have a question is this the correct field setting values because I think $5!= node id if it is ,then why is it note working please reply . ------------------------------ Message: 4 Date: Sun, 10 Jul 2011 00:53:27 -0700 (PDT) From: ???? ???? ?? ?? ???? mohammed <[email protected]> Subject: Re: [ns] exponential distribution To: Mohamed Ibrahim Salman <[email protected]> Cc: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset=iso-8859-1 hi , there is tool named bonnmotion extends to ns2 to create movement pattern to many mobility models and there is many parametrs can play in it . --- On Sat, 7/9/11, Mohamed Ibrahim Salman <[email protected]> wrote: From: Mohamed Ibrahim Salman <[email protected]> Subject: [ns] exponential distribution To: "[email protected]" <[email protected]> Date: Saturday, July 9, 2011, 4:33 PM Hi, In a Network with a 40 mobile node, the used model is RWP. How to set the pause time for the mobile node to be exponentially distributed with a mean of 50 s. ------------------------------ Message: 5 Date: Sun, 10 Jul 2011 01:12:25 -0700 (PDT) From: ???? ???? ?? ?? ???? mohammed <[email protected]> Subject: Re: [ns] INSPECT installation in ns2.34 To: umair shah <[email protected]> Cc: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset=iso-8859-1 we are need ispect beacuse the ns2 is very poor in related to visualizing of wirless only you can show the number of node and the movement , but using inspect you can show many of properties such as??the position of node at any time and many features --- On Sat, 7/9/11, umair shah <[email protected]> wrote: From: umair shah <[email protected]> Subject: [ns] INSPECT installation in ns2.34 To: "nsusers" <[email protected]> Date: Saturday, July 9, 2011, 4:42 AM Hey how can I install visualizing? Wireless simulations? on ns2 is iNSpect in ns2 2.34 ?Is it better than nam visualizer ?and why do I need that ? ------------------------------ Message: 6 Date: Sun, 10 Jul 2011 02:14:23 -0700 (PDT) From: umair shah <[email protected]> Subject: [ns] awk script from mailing list To: nsusers <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=utf-8 Hey i found the awk script from mailing list,wondering if this would function,but it doesn't can anyone tell me why ? from mailing list : Plz see the following awk scripts that calcualate the following Performance Metrics Used Routing Overhead Normalize Routing Load Packet Delivery Fraction Average End to End delay Jitter Drop Packets Drop Bytes Throughput These scripts work with new trace format and DSR protocol. Make changes for other protocols. As an example, if you want to calculate throughput, awk -f throughput.awk output.tr # ==============================throughput.awk ======================== BEGIN { recvdSize = 0 startTime = 1e6 stopTime = 0 } { # Trace line format: normal if ($2 != "-t") { event = $1 time = $2 if (event == "+" || event == "-") node_id = $3 if (event == "r" || event == "d") node_id = $4 flow_id = $8 pkt_id = $12 pkt_size = $6 flow_t = $5 level = "AGT" } # Trace line format: new if ($2 == "-t") { event = $1 time = $3 node_id = $5 flow_id = $39 pkt_id = $41 pkt_size = $37 flow_t = $45 level = $19 } # Store start time if (level == "AGT" && (event == "+" || event == "s") && pkt_size >= 512) { if (time < startTime) { startTime = time } } # Update total received packets' size and store packets arrival time if (level == "AGT" && event == "r" && pkt_size >= 512) { if (time > stopTime) { stopTime = time } # Rip off the header hdr_size = pkt_size % 512 pkt_size -= hdr_size # Store received packet's size recvdSize += pkt_size } } END { printf("Average Throughput[kbps] = %.2f\t\t StartTime=%.2f\tStopTime=%.2f\n",(recvdSize/(stopTime-startTime))*(8/1000),startTime,stopTime) } # ============================= parameters.awk ======================== BEGIN { sends=0; recvs=0; routing_packets=0.0; droppedBytes=0; droppedPackets=0; highest_packet_id =0; sum=0; recvnum=0; } { time = $3; packet_id = $41; #============= CALCULATE PACKET DELIVERY FRACTION================= if (( $1 == "s") && ( $35 == "cbr" ) && ( $19=="AGT" )) { sends++; } if (( $1 == "r") && ( $35 == "cbr" ) && ( $19=="AGT" )) { recvs++; } #============= CALCULATE DELAY ================================ if ( start_time[packet_id] == 0 ) start_time[packet_id] = time; if (( $1 == "r") && ( $35 == "cbr" ) && ( $19=="AGT" )) { end_time[packet_id] = time; } else { end_time[packet_id] = -1; } #============= TOTAL DSR OVERHEAD ================================ if (($1 == "s" || $1 == "f") && $19 == "RTR" && $35 =="DSR") routing_packets++; #============= DROPPED DSR PACKETS ================================ if (( $1 == "d" ) && ( $35 == "cbr" ) && ( $3 > 0 )) { droppedBytes=droppedBytes+$37; droppedPackets=droppedPackets+1; } #find the number of packets in the simulation if (packet_id > highest_packet_id) highest_packet_id = packet_id; } END { for ( i in end_time ) { start = start_time[i]; end = end_time[i]; packet_duration = end - start; if ( packet_duration > 0 ) { sum += packet_duration; recvnum++; } } delay=sum/recvnum; NRL = routing_packets/recvs; #normalized routing load = routing load but it differ from routing overhead PDF = (recvs/sends)*100; #packet delivery ratio[fraction] printf("send = %.2f\n",sends); printf("recv = %.2f\n",recvs); printf("routingpkts = %.2f\n",routing_packets++); printf("PDF = %.2f\n",PDF); printf("NRL = %.2f\n",NRL); printf("Average e-e delay(ms)= %.2f\n",delay*1000); printf("No. of dropped data (packets) = %d\n",droppedPackets); printf("No. of dropped data (bytes) = %d\n",droppedBytes); printf("Packet Loss [%]= %.2f \n", (droppedPackets/(highest_packet_id+1))*100); } # ============================== jitter.awk ============================ BEGIN { num_recv=0 } { # Trace line format: normal if ($2 != "-t") { event = $1 time = $2 if (event == "+" || event == "-") node_id = $3 if (event == "r" || event == "d") node_id = $4 flow_id = $8 pkt_id = $12 pkt_size = $6 flow_t = $5 level = "AGT" } # Trace line format: new if ($2 == "-t") { event = $1 time = $3 node_id = $5 flow_id = $39 pkt_id = $41 pkt_size = $37 flow_t = $45 level = $19 } # Store packets send time if (level == "AGT" && sendTime[pkt_id] == 0 && (event == "+" || event == "s") && pkt_size >= 512) { sendTime[pkt_id] = time } # Store packets arrival time if (level == "AGT" && event == "r" && pkt_size >= 512) { recvTime[pkt_id] = time num_recv++ } } END { # Compute average jitter jitter1 = jitter2 = tmp_recv = 0 prev_time = delay = prev_delay = processed = 0 prev_delay = -1 for (i=0; processed if(recvTime[i] != 0) { tmp_recv++ if(prev_time != 0) { delay = recvTime[i] - prev_time e2eDelay = recvTime[i] - sendTime[i] if(delay < 0) delay = 0 if(prev_delay != -1) { jitter1 += abs(e2eDelay - prev_e2eDelay) jitter2 += abs(delay-prev_delay) } prev_delay = delay prev_e2eDelay = e2eDelay } prev_time = recvTime[i] } processed++ } } END { printf("Jitter1 = %.2f\n",jitter1*1000/tmp_recv); printf("Jitter2 = %.2f\n",jitter2*1000/tmp_recv); } function abs(value) { if (value < 0) value = 0-value return value } # =========================== end ======================== ------------------------------ Message: 7 Date: Sun, 10 Jul 2011 08:33:45 -0700 (PDT) From: Zeinab Rezaiefar <[email protected]> Subject: [ns] add maodv To: ns user <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=iso-8859-1 hi everyone i?download modv code for ns2.26 but i want to add it to ns2.34 or ns 2.29 but in readme doesn't say about where of code we should change?. is there anyone can help me.?? best regard zeinab ------------------------------ Message: 8 Date: Mon, 11 Jul 2011 03:05:57 +0500 From: "M.Mehran Ajmal" <[email protected]> Subject: [ns] problem in adding a new protocol in ns2.34 To: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset="us-ascii" i am adding a new protocol in ns2.34 after removing all the errors during make. it started compiling and an unknown error occured without reference to the line which is as follows. corp/corp.o: In function `Corp::Corp(int)': corp.cc:(.text+0x5b): undefined reference to `Corp_rtable::Corp_rtable()' collect2: ld returned 1 exit status make: *** [ns] Error 1 the code of corp.cc is as follows in which error is coming if any one can help i will be great full. //int corp_pkt; int hdr_corp_pkt::offset_; static class CorpHeaderClass : public PacketHeaderClass { public: CorpHeaderClass() : PacketHeaderClass("PacketHeader/Corp", sizeof(hdr_corp_pkt)) { bind_offset(&hdr_corp_pkt::offset_); } } class_rtProtoCorp_hdr; static class CorpClass : public TclClass { public: CorpClass() : TclClass("Agent/Corp") {} TclObject* create(int argc, const char*const* argv) { assert(argc == 5); return (new Corp((nsaddr_t)Address::instance().str2addr(argv[4]))); } } class_rtProtoCorp; // Timers void Corp_PktTimer::expire(Event* e) { agent_->send_corp_pkt(); agent_->reset_corp_pkt_timer(); } //constructor Corp::Corp(nsaddr_t id) : Agent(PT_CORP), pkt_timer_(this) { bind_bool("accessible_var_", &accessible_var_); ra_addr_ = id; } //Command int Corp::command(int argc, const char*const* argv) { if (argc == 2) { if (strcasecmp(argv[1], "start") == 0) { pkt_timer_.resched(0.0); return TCL_OK; } else if (strcasecmp(argv[1], "print_rtable") == 0) { if (logtarget_ != 0) { sprintf(logtarget_->pt_->buffer(), "P %f _%d_ Routing Table",CURRENT_TIME,ra_addr()); logtarget_->pt_->dump(); rtable_.print(logtarget_); } else { fprintf(stdout, "%f _%d_ If you want to print this routing table you must create a trace file in your tcl script",CURRENT_TIME,ra_addr()); } return TCL_OK; } } else if (argc == 3) { // Obtains corresponding dmux to carry packets to upper layers if (strcmp(argv[1], "port-dmux") == 0) { dmux_ = (PortClassifier*)TclObject::lookup(argv[2]); if (dmux_ == 0) { fprintf(stderr, "%s: %s lookup of %s failed\n",__FILE__,argv[1],argv[2]); return TCL_ERROR; } return TCL_OK; } // Obtains corresponding tracer else if (strcmp(argv[1], "log-target") == 0 || strcmp(argv[1], "tracetarget") == 0) { logtarget_ = (Trace*)TclObject::lookup(argv[2]); if (logtarget_ == 0) return TCL_ERROR; return TCL_OK; } } // Pass the command to the base class return Agent::command(argc, argv); } //Recive void Corp::recv(Packet* p, Handler* h) { struct hdr_cmn* ch = HDR_CMN(p); struct hdr_ip* ih= HDR_IP(p); if (ih->saddr() == ra_addr()) { // If there exists a loop, must drop the packet if (ch->num_forwards() > 0) { drop(p, DROP_RTR_ROUTE_LOOP); return; } // else if this is a packet I am originating, must add IP header else if (ch->num_forwards() == 0) ch->size() += IP_HDR_LEN; } // If it is a corp packet, must process it if (ch->ptype() == PT_CORP) recv_corp_pkt(p); // Otherwise, must forward the packet (unless TTL has reached zero) else { ih->ttl_--; if (ih->ttl_ == 0) { drop(p, DROP_RTR_TTL); return; } forward_data(p); } } // Recv Corp pkt void Corp::recv_corp_pkt(Packet* p) { struct hdr_ip* ih= HDR_IP(p); struct hdr_corp_pkt* ph = HDR_CORP_PKT(p); // All routing messages are sent from and to port RT_PORT, // so we check it. assert(ih->sport() == RT_PORT); assert(ih->dport() == RT_PORT); /* ... processing of corp packet ... */ // Release resources Packet::free(p); } //Send Corp pkt void Corp::send_corp_pkt() { Packet* p= allocpkt(); struct hdr_cmn* ch= HDR_CMN(p); struct hdr_ip* ih= HDR_IP(p); struct hdr_corp_pkt* ph = HDR_CORP_PKT(p); ph->pkt_src()= ra_addr(); ph->pkt_len()= 7; ph->pkt_seq_num()= seq_num_++; ch->ptype()= PT_CORP; ch->direction() = hdr_cmn::DOWN; ch->size() = IP_HDR_LEN + ph->pkt_len(); ch->error() = 0; ch->next_hop() = IP_BROADCAST; ch->addr_type() = NS_AF_INET; ih->saddr() = ra_addr(); ih->daddr() = IP_BROADCAST; ih->sport() = RT_PORT; ih->dport() = RT_PORT; ih->ttl() = IP_DEF_TTL; Scheduler::instance().schedule(target_, p, JITTER); } //Reset Timer void Corp::reset_corp_pkt_timer() { pkt_timer_.resched((double)5.0); } //Forward data void Corp::forward_data(Packet* p) { struct hdr_cmn* ch = HDR_CMN(p); struct hdr_ip* ih = HDR_IP(p); if (ch->direction() == hdr_cmn::UP &&((u_int32_t)ih->daddr() == IP_BROADCAST || ih->daddr() == ra_addr())) { dmux_->recv(p,0); return; } else { ch->direction() = hdr_cmn::DOWN; ch->addr_type() = NS_AF_INET; if ((u_int32_t)ih->daddr() == IP_BROADCAST) ch->next_hop() = IP_BROADCAST; else { nsaddr_t next_hop = rtable_.lookup(ih->daddr()); if (next_hop == IP_BROADCAST) { debug("%f: Agent %d can not forward a packet destined to %d\n",CURRENT_TIME,ra_addr(),ih->daddr()); drop(p, DROP_RTR_NO_ROUTE); return; } else ch->next_hop() = next_hop; } Scheduler::instance().schedule(target_, p, 0.0); } } ------------------------------ _______________________________________________ Ns-users mailing list [email protected] http://mailman.isi.edu/mailman/listinfo/ns-users [http://mailman.isi.edu/mailman/listinfo/ns-users] End of Ns-users Digest, Vol 91, Issue 10 ****************************************
