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

[ns] Packet copy function



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