[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Define new pkt type
On Tue, 16 Feb 1999, Shuqian Yan wrote:
>
> Hello, all
>
> What is the right way to define new pkt type in ns2? I add some new
> type of control message in mcast_ctrl.cc, so I modify that file, adding
> in new pkt name, etc. then I modify the packt.h file to define the pkt
> type. It doesn't work, the nam animator was showing wrong names for the
> particular control pkt generated, same error also appear in the out.tr
> file.
>
> Tks in advance,
>
> shuqian
>
Hi, Shuqian,
I once made my own packet type. I adopted it from the CBR traffic. The
files I have modified were:
ns-default.tcl
trace.cc
packet.h.
In packet.h, you can name your type, like "my_packet"; in ns-default.tcl,
you can define some properties like maxpacketsize, etc.; and you also need
to go into trace.cc to add something and let NS keep track of your packet
sequence #s.
Hope this help, take care!
------------
Gang Wu
School of ECE
Purdue University
West Lafayette, Indiana 47905
Office: EE Building 51
Phone: +1 765 494-1744