[ns] Problem:First packet always get lost under TCP when error rate is bigger than 0.01

2009-02-27 Thread Tong Mao

Hello everyone,

I have a problem when simulate the ordinary FTP/TCP transmission in NS-2.28.
I add a link error model in the link. When I set the packet error reate
bigger than 0.01(for example 0.015). The first packet's t_seqno_ is 1, and
always get lost. The transmission recovered after 6 sec. Here is the trace
file:

0.05000  0  0  1  0  t_seqno_ 1
6.05000  0  0  1  0  t_seqno_ 0
6.05000  0  0  1  0  t_seqno_ 1
6.09032  0  0  1  0  t_seqno_ 2
6.09032  0  0  1  0  t_seqno_ 3
... ...

Is it a bug or something else? Dose anyone can help me? Thank you very much.

I attach my OTcl script here, you can try by yourself.

set ns [new Simulator]

#Define different colors for data flows (for NAM)
$ns color 1 Blue

#Open the Trace files
set tracefile1 [open out.tr w]
set winfile [open WinFile w]
$ns trace-all $tracefile1

#Open the NAM trace file
set namfile [open out.nam w]
$ns namtrace-all $namfile


#Define a 'finish' procedure
proc finish {} {
 global ns tracefile1 namfile
 $ns flush-trace
 close $tracefile1
 close $namfile
 exec nam out.nam 
 exit 0
}

#Create two nodes
set n0 [$ns node]
set n1 [$ns node]

#Create links between the nodes
$ns duplex-link $n0 $n1 2Mb 20ms DropTail

set em [new ErrorModel]
$em set rate_ 0.02
$em unit pkt
$em ranvar [new RandomVariable/Uniform]
$em drop-target [new Agent/Null]
$ns link-lossmodel $em $n0 $n1


#Set Queue Size of link (n0-n1) to 20
#$ns queue-limit $n0 $n1 20

#Setup a TCP connection
set tcp [new Agent/TCP]
$ns attach-agent $n0 $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $n1 $sink
$ns connect $tcp $sink
$tcp set fid_ 1

#Open the t_seqno_ trace file
$tcp trace t_seqno_
set trace_ch [open trace.txt w]
$tcp attach $trace_ch

#Setup a FTP over TCP connection
set ftp [new Application/FTP]
$ftp attach-agent $tcp

$ns at 0.05 $ftp start
$ns at 63.5 $ftp stop

#Procedure for plotting window size. Gets as arguments the name
#of the tcp source node (called tcpSource) and of output file.
proc plotWindow {tcpSource file} {
 global ns
 set time 0.1
 set now [$ns now]
 if { [$tcpSource set cwnd_][$tcpSource set window_]} {
set cwnd [$tcpSource set cwnd_]
 } else {
set cwnd [$tcpSource set window_]
 }
 puts $file $now $cwnd
 $ns at [expr $now+$time] plotWindow $tcpSource $file
}
$ns at 0.1 plotWindow $tcp $winfile

$ns at 64.0 finish
$ns run


Best Regards,
Tong Mao


[ns] PMIPv6 ns-2 module

2009-02-27 Thread Linoh Magagula


Hi,

I am relatively new to ns-2 and I would like to implement PMIPv6 (Proxy Mobile 
IPv6) in ns-2.29 with
the NIST software mobility package extension for ns-2. Can anyone help in 
advising me which files 
need to be edited and possibly how.
 
Thank you in advance for your help
 
PrinceL
_
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx


[ns] Fw: trace file

2009-02-27 Thread eng Rony









Eng Rony
 
hi all
i run simple-wireless.tcl example from Marc Greis' tutorial section  IX. 
Running Wireless Simulations in ns  and i want to know what each field in o/p 
trace file means, for example:
 

s 0.029290548 _1_ RTR --- 0 message 32 [0 0 0 0] --- [1:255 -1:255 32 0] 
M 10.0 0 (5.00, 2.00, 0.00), (20.00, 18.00), 1.00
s 10.0 _0_ AGT --- 2 tcp 40 [0 0 0 0] --- [0:0 1:0 32 0] [0 0] 0 0
r 10.0 _0_ RTR --- 2 tcp 40 [0 0 0 0] --- [0:0 1:0 32 0] [0 0] 0 0
..D 76.430622539 _0_ IFQ ARP 2 tcp 80 [0 0 0 800] --- [0:0 1:0 32 1] [0 0] 
0 0
D 76.430622539 _0_ RTR CBK 8 tcp 80 [0 0 0 800] --- [0:0 1:0 32 1] [0 0] 0 0
s 100.337960577 _1_ RTR --- 80 ack 60 [0 0 0 0] --- [1:0 0:0 32 0] [28 0] 0 0
r 100.340096680 _0_ AGT --- 72 ack 60 [13a 0 1 800] --- [1:0 0:0 32 0] [24 
0] 1 0

r 69.501265756 _1_ RTR --- 15 message 32 [0  0 800] --- [0:255 
-1:255 32 0] 
 
 i want to know also what means by agentTrace,RouterTrace,MacTrace
 
thanks







  


[ns] error in class file

2009-02-27 Thread sankar subramanian



 Header fileiostream.h not available


  Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/


[ns] How to reduce execution time of scenario generation (using setdest)

2009-02-27 Thread Mayur Mansukhlal Vegad

Dear all,

scenario generation takes around 2.5 to 3 minutes for large number (eg
100) of nodes. It is too much. After that the ns simulation takes another
minute or more.

Could anybody guide how to reduce the execution time particularly of the
setdest tool?

with regards,
Mayur



Re: [ns] Fw: trace file

2009-02-27 Thread Mayur Mansukhlal Vegad

Better you refer Ch. 16 of ns-manual for good understanding.










 Eng Rony

 hi all
 i run simple-wireless.tcl example from Marc Greis' tutorial section  IX.
 Running Wireless Simulations in ns  and i want to know what each field in
 o/p trace file means, for example:


 s 0.029290548 _1_ RTR ---  message 32 [0   0] --- [1:255 -1:255 32
 0]
 M 10.0  (5.00, 2.00, 0.00), (20.00, 18.00), 1.00
 s 10.0 _0_ AGT --- 2 tcp 40 [0   0] --- [0:0 1:0 32 0] [0 0]
  0
 r 10.0 _0_ RTR --- 2 tcp 40 [0   0] --- [0:0 1:0 32 0] [0 0]
  0
 ..D 76.430622539 _0_ IFQ ARP 2 tcp 80 [0   800] --- [0:0 1:0 32 1]
 [0 0]  0
 D 76.430622539 _0_ RTR CBK 8 tcp 80 [0   800] --- [0:0 1:0 32 1] [0
 0]  0
 s 100.337960577 _1_ RTR --- 80 ack 60 [0   0] --- [1:0 0:0 32 0] [28
 0]  0
 r 100.340096680 _0_ AGT --- 72 ack 60 [13a  1 800] --- [1:0 0:0 32 0]
 [24 0] 1 0

 r 69.501265756 _1_ RTR --- 15 message 32 [0   800] --- [0:255
 -1:255 32 0]

  i want to know also what means by agentTrace,RouterTrace,MacTrace

 thanks












[ns] ns in eclipse

2009-02-27 Thread sarym binome























hello
how can i integrate ns in eclipse ?
have u any idea ?
plz help me 


_
Sur Windows Live Ideas, découvrez en exclusivité de nouveaux services en 
ligne... si nouveaux qu'ils ne sont pas encore sortis officiellement sur le 
marché !
http://ideas.live.com


[ns] Is it possible to do this scenario with NS2? ?

2009-02-27 Thread Nadine Chen

Hi,
Generally
with NS2, we can make a scenario in tcl and we fix  at the beginning
the number of nodes that will participate in this scenario, but if I
want that the number of the nodes increases during the simulation?
Is it possible to do this with NS2:initially we have  one node after 2 seconds 
another appears .?
Please tell me if it is possible.
Thanks.



  


Re: [ns] ns in eclipse

2009-02-27 Thread Arturo Servin


Yes you can. You have to add the ns paths to eclipse. There is an old  
e-mail with the references of the libraries to include and the paths.  
Do a search in the list and you could find that e-mail.

-as

On 27 Feb 2009, at 21:14, sarym binome wrote:
























 hello
 how can i integrate ns in eclipse ?
 have u any idea ?
 plz help me


 _
 Sur Windows Live Ideas, découvrez en exclusivité de nouveaux  
 services en ligne... si nouveaux qu'ils ne sont pas encore sortis  
 officiellement sur le marché !
 http://ideas.live.com



Re: [ns] Problem with DSR modification...

2009-02-27 Thread Salvo Danilo Giuffrida

I'm thinking if this has to do with the modification of the SR header:
I added an int variable, named low_energy_, which represents a flag
to tell receiving nodes that the source is finishing its energy, but
maybe this increases the size of the header too much, over its limit
(which I don't know exactly, is it 8 bytes?). I also didn't modify the
method ''int size(), to add the size of the integer variable when it
returns...
Could this be the reason, and if yes, how can I add an option to the
SR header safely?

2009/2/26 Salvo Danilo Giuffrida giuffsa...@gmail.com:
 Hello, I modified the DSR implementation of NS-2, in such a way that,
 when a node reaches an energy level below a certain percentage of its
 initial level at the beginning of the simulation (say, 30%), it sends
 a broadcast IP packet

        SRPacket p;
        p.src = net_id;
        p.pkt = allocpkt();

        hdr_sr *srh = hdr_sr::access(p.pkt);
        hdr_ip *iph = hdr_ip::access(p.pkt);
        hdr_cmn *cmnh = hdr_cmn::access(p.pkt);

        iph-daddr() = IP_BROADCAST;
        cmnh-next_hop() = IP_BROADCAST;
        iph-dport() = RT_PORT;
        iph-saddr() = 
 Address::instance().create_ipaddr(net_id.getNSAddr_t(),RT_PORT);
        iph-sport() = RT_PORT;
        iph-ttl() = 1;

        cmnh-ptype() = PT_DSR;
        cmnh-size() = size_ + IP_HDR_LEN; // add in IP header
        cmnh-direction() = hdr_cmn::DOWN;

        //srh-init();
        srh-low_energy()=1;

        Scheduler::instance().schedule(ll, p.pkt, 0);

        p.pkt = NULL;

 The 'valid' flag of the Source Route header is not set to 1, because
 this is a broadcast, route-less packet. That 'low_energy()' method
 sets a flag on the header, which I added to indicate that this is a
 low energy message to neighbors nodes.
 After the packet is received by neighbors, that's what happens in recv(...)

 if (srh-valid() != 1) {
    unsigned int dst = cmh-next_hop();
    if (dst == IP_BROADCAST) {
      // extensions for mobileIP --Padma, 04/99.
      // Brdcast pkt - treat differently
      if (p.src == net_id)
        // I have originated this pkt
        sendOutBCastPkt(packet);

      //Lines added by me
      else if (srh-low_energy()) {
        ID to_id(iph-saddr(),::IP);
        ID from_id(net_id.addr,::IP);

        /* kill any routes we have using this link (this node-sender node of
 the broadcast packet) */
        route_cache-noticeDeadLink(from_id, 
 to_id,Scheduler::instance().clock());
        flow_table.noticeDeadLink(from_id, to_id);

        /* now kill all the other packets in the output queue that would
           use the same next hop. */

        Packet *r, *nr, *queue1 = 0, *queue2 = 0;
        // pkts to be recycled

        while((r = ifq-prq_get_nexthop(to_id.getNSAddr_t( {
                r-next_ = queue1;
                queue1 = r;
        }

        // the packets are now in the reverse order of how they
        // appeared in the IFQ so reverse them again
        for(r = queue1; r; r = nr) {
                nr = r-next_;
                r-next_ = queue2;
                queue2 = r;
        }

        // now process them in order
        for(r = queue2; r; r = nr) {
                nr = r-next_;
                undeliverablePkt(r, 1);
        }
        return;

      } else
        //hand it over to port-dmux
        port_dmux_-recv(packet, (Handler*)0);
 ...

 The idea is that receivers of this broadcast low energy packet would
 clear their route caches from the link X-Y, where X it's net_id
 (themselves), and Y is the low energy nodeThen, if packets with
 a route having X-Y among the links are received, to be forwarded to a
 certain destination, this neighbors nodes would try to savage the
 package, or generate an RERR to the original sender. Hopefully, with
 new RREQs, a new route, which would not pass for the low energy node,
 would be selected (I made other modifications to make this more
 likely). But if this node is the only possible route for a certain
 destination, it would be used anyway.
 What I see happening is that the broadcast packet is received by
 neighbors, the link net_id-Y is cleared (I guess), but new RREQs
 can't be generated by the other nodes, because for a while the other
 nodes are unable to forward packets, and drop them (IFQ_FULL),
 including RREQs packets. So, becuase of these dropping, links between
 good nodes (nodes with enough energy, and I'm sure it's not a problem
 of the interface queue size, because even with a value of 500 packets,
 the problem remains).
 I can send the Tcl scenario file, and/or the trace output, if anyone
 is interested and willing to help.
 Also, is there a way to dump the content of a mobilenode's
 routecache?...I looked into the source code, and currently the 'dump'
 method is unimplemented, and I didn't find in 'routecache.h' any
 mention of the data structure where all routes are memorized...
 Thanks a lot




[ns] carrier sense

2009-02-27 Thread neeraj gupta


hi all

 it's true the node uses the carrier sense before sending the data. as per my 
understanding the NAV for the nodes in the carrier sense rage is updated. Nodes 
uses this nav to determine the time after which the it is permited to send the 
data. my promblem is to use the entries in nav for my work.how can i access the 
nav table.

Neeraj Gupta
Assistant Professor
HOD, CSE  IT Department
Hindu College of Engineering
Sonepat