[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] send (pkt, 0) ?



Ok, I used Connector::send(pkt,0) just to avoid
calling TCPSimpleAgent::send(), as ns doc recommended.

However, here is what I got.  The topology is three
node: n0 sending multicast packets to n1 and n2.  For
every 3 senconds, there should be unicast interactions
among them too.  However, below, no unicast is found. 
Multicast seems successful, but there is a strange TCP
from 0.0 to 0.0 come out from nowhere.  It seems not
from my code:

v 0 eval {set sim_annotation {0 1 join-group
-2147483648}}
v 0 eval {set sim_annotation {0 2 join-group
-2147483648}}
+ 0.2 0 1 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 1
- 0.2 0 1 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 1
+ 0.2 0 2 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 1
- 0.2 0 2 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 1 
r 0.207333 0 1 tram_data 1000 ------- 0 0.1
-2147483648.0 -1 1
d 0.207333 0 2 tcp 0 ------- 0 0.0 0.0 0 0
+ 0.3 0 1 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 2
- 0.3 0 1 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 2
+ 0.3 0 2 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 2
- 0.3 0 2 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 2 
r 0.307333 0 1 tram_data 1000 ------- 0 0.1
-2147483648.0 -1 2
d 0.307333 0 2 tcp 0 ------- 0 0.0 0.0 0 0
+ 0.4 0 1 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 3
- 0.4 0 1 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 3
+ 0.4 0 2 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 3
- 0.4 0 2 tram_data 1000 ------- 0 0.1 -2147483648.0
-1 3 
....



--- Haobo Yu <[email protected]> wrote:
> In fact if you look at how connect{} is implemented,
> it simply assigns
> dst_addr_ and dst_port_. You can do the samething in
> c++ because they are
> bound variables. (Of course, if you are using
> abstract tcp there's more to
> do).
> 
> On Tue, 16 May 2000, Frank Chu wrote:
> 
> > Date: Tue, 16 May 2000 08:03:07 -0700 (PDT)
> > From: Frank Chu <[email protected]>
> > To: Haobo Yu <[email protected]>
> > Cc: [email protected]
> > Subject: Re: [ns] send (pkt, 0) ?
> > 
> > What I am now trying to do is to create an agent
> *in
> > C++* that will have to send out both multicast
> packets
> > (to only one group) and unicast packets (to some
> > particular members of this group from time to
> time).
> > 
> > As far as I know, send(pkt,0) will only send the
> > packets to the destination (no matter it's
> multicast
> > or unicast) of current connections.  If current
> > connection is multicast (i.e. dst_addr_ and
> dst_port_
> > are group address), it sends packets to that
> group; if
> > dst_addr_ and dst_port_ is a unicast agent, it
> sends
> > to that agent.  So, you mean I should connect{}
> each
> > time I switch between unicast and multicast ? 
> > However, I need to do it in my newly created agent
> in
> > C++.  Is there a way to do it ?
> > 
> > Thanks,
> > Frank
> > 
> > --- Haobo Yu <[email protected]> wrote:
> > > You can reset the "connection" using
> > > Simulator::connect{}. Essentially it
> > > resets addr and port but doing it this way is
> > > perhaps cleaner. 
> > > 
> > > On Sun, 14 May 2000, Frank Chu wrote:
> > > 
> > > > Date: Sun, 14 May 2000 21:41:17 -0700 (PDT)
> > > > From: Frank Chu <[email protected]>
> > > > To: [email protected]
> > > > Subject: [ns] send (pkt, 0) ?
> > > > 
> > > > Hi, folks, I need to change sending
> destinations
> > > from
> > > > time to time at a sending agent.  I wonder if
> > > > send(pkt,0) will send the packet to my
> destination
> > > > (set by dst_ ) therefore I just need to change
> > > dst_
> > > > from time to time?
> > > > 
> > > > Thanks,
> > > > Frank
> > > > 
> > > >
> __________________________________________________
> > > > Do You Yahoo!?
> > > > Send instant messages & get email alerts with
> > > Yahoo! Messenger.
> > > > http://im.yahoo.com/
> > > > 
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Send instant messages & get email alerts with
> Yahoo! Messenger.
> > http://im.yahoo.com/
> > 
> 
> 


__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/