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

Re: [ns] Packet copy function



Hello Aaron
I myself don't know much about the ns2. But for the error message u r
referring to, u may take look at the following method:

void Scheduler::schedule(Handler*, Event*, double)

in the file scheduler.cc.
Before an event is dispatched, ns sets its uid to a negative number. at
the time of dispatch it is changed to positive no. of the same
magnitude.

e->uid = - e->uid;

Since packet derives from Event, after it is once scheduled
its uid becomes a positive number and the error message looks similar to
the one u get.

Bye
Arijit

On Mon, 4 Jun 2001, Aaron D Striegel wrote:

> Hello all.  I've been working with replication for multicast for some time
> now and I am trying to partially optimize some of the code that I am
> working with.  In a nutshell, here is what I have for a sequence of events:
>
> - A packet arrives at a node via the classifier::recv (multicast packet)
> - The packet(s) is/are replicated onto a node as specified inside the
> packet (packet-based encapsulation)
>
> For each replication, the packet is copied and sent onto the appropriate
> links.  The old packet is then freed up and released.  The copy operation
> is especially time consuming.  For nodes where actual replication is going
> on, this is fine.  The problem lies in nodes that are simply non-members,
> forwarding the packet along the tree (i.e. in on one link, out on one
> link).  For these nodes, the copy operation seems entirely unnecessary as
> it would be nice if I could simply just reuse the existing packet without
> allocating an entirely new packet and copying the whole (3000 byte header).
>
> Is it possible to send a packet onwards without allocating a new packet?  I
> get an error along the lines of the scheduler having a problem with an
> invalid object ID or something to that effect.  If I could get this to
> work, it would dramatically speed up some of my simulations as I believe
> that the majority of the sim time is spent copying packet data.
>
> Thanks
>
> Aaron
>
> ---------------------------------------
> Aaron Striegel
> Ph.D Candidate, Computer Engineering - Internet QoS
> Dept. of Electrical & Computer Engineering
> Iowa State University
> Webpage: http://www.public.iastate.edu/~magico
>