Friday, March 13, 2009

[NS2] Dropping a Packet

Suppose you have a pointer "p". You can drop the packet by executing

Packet::free(p)
Also the packet "*p" can be dropped from within the Connector object by invoking function drop as follows:
drop(p);

Note that "drop(p)" is a function of class Connector, and therefore must be invoked from within the scope of class Connector.


For more information about Connector and Packet, see Chapters 5 and 8, respectively, in the following book from Springer:

T. Issaraiyakul and E. Hossain, "Introduction to Network Simulator NS2", Springer 2008.
http://www.springer.com/engineering/signals/book/978-0-387-71759-3

You may also find the following website useful:
http://www.ece.ubc.ca/~teerawat/NS2.htm

1 comment:

  1. Please Help:
    Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
    _o194: no target for slot -1
    _o194 type: Classifier/Port
    content dump:
    classifier _o194
    0 offset
    0 shift
    2147483647 mask
    3 slots
    slot 0: _o272 (CMUTrace/Recv)
    slot 1: _o300 (CMUTrace/Recv)
    slot 255: _o196 (CMUTrace/Recv)
    ---------- Finished standard no-slot{} default handler ----------

    ReplyDelete