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

Re: [ns] Packet Header



Did you follow the 4 steps in ns manual, namely: 

- create ur header
- define member function, including a static offset() and a static
access(). (see how hdr_cmn is done in packet.h).
- create a static packet header class
- add your headers into tcl/lib/ns-packet.tcl

- Haobo

On Fri, 7 Apr 2000, Rudhrakumar Venkatesan wrote:

> Hi,
>       Thanks for the info.
>     What I did was that I created the packet header formats and then made an entry
> in the packet.h file in the enum packet & p_info() and set my default packet size
> and finally change the /tcl/lib/ns-packet.h with a offset value. But I am not
> quite sure how the different headers are going to be initialized. Do I need to use
> a single packet header structure which is a union of all the 8 packet headers so
> that depending upon the input type one of them is selectively chosen or do I need
> to add 8 packet headers in /tcl/lib/ns-packet.h with different offset values. I am
> not quite sure about this aspect. Is there any way within ns to chose between the
> different packet headers of a same agent.
> I am sure wether I am right or wrong in some of my understanding of ns packets.
> Can U please help me through this.
> Thanks & regards
> Rudhra
> 
> Sudhindra Suresh Bengeri wrote:
> 
> > Hi,
> >
> > I far as my knowledge goes, all the headers are configured in to packet
> > header at the time of configuration by the Simulator's create_packetformat
> > instproc. Hence if you have created a packet header class and added an
> > entry in the tcl/lib/ns-packet.tcl file, PacketHeaderManager will add your
> > yourpacket::hdrlen_ bytes to the packet header, and initialize the
> > off_<packetname>_ variable.
> >
> > All this means is that all the header formats defined are in all packet
> > headers. In your case you will have all the 8 packet header formats in
> > every packet header, and can access any particular header according to
> > your Agent processing.
> >
> > Hope that helps.
> >
> > Regards,
> > Sudhin.
> > On Thu, 6 Apr 2000, Rudhrakumar Venkatesan wrote:
> >
> > > Thanks a lot for your immediate response.
> > > I have read the chapter 11, but I am quite sure about how the headers are
> > > attached to the packets.
> > > I have 8 header formats as I said earlier. and I need them to be
> > > differentially used according to the type of packet. Can U please throw
> > > some light on this.
> > > regards
> > > Rudhra
> > >
> > > Haobo Yu wrote:
> > >
> > > > Please read chapter 11 of ns manual on adding new packet headers. You may
> > > > not want to selectively turn on packet headers in different simulations;
> > > > that could be tricky. Instead, you may want to compile all 8 headers in.
> > > >
> > > > I don't see how TclClass is related to this, but it's in
> > > > ~tclcl/{Tcl.cc,tclcl.h}.
> > > >
> > > > - Haobo
> > > >
> > > > On Thu, 6 Apr 2000, Rudhrakumar Venkatesan wrote:
> > > >
> > > > > Hi,
> > > > >     I am developing a new agent for ns-2. I have 8 different packet
> > > > > headers for my agent. How do I specify which header to be used to the NS
> > > > > internal packet (packet* pkt) for a particular situation. How do I make
> > > > > the simulator send these headers together with the packet. I was trying
> > > > > top find the TclClass Class. Where can I find it. Any early help would
> > > > > be greatly appreciated.
> > > > > Regards
> > > > > Rudhra
> > > > >
> > > > > --
> > > > > *****************************************************
> > > > > Rudhrakumar Venkatesan
> > > > > Office          : Mobile Networking Laboratory, Department of ECE
> > > > >                       Oregon State University, Corvallis, Oregon, US
> > > > > 97331
> > > > > Residence   : 440, Nw 23rd st, #6, Corvallis, Oregon, US 97330
> > > > > Phone          : 541-758-4381 ( Res), 541-737-2349 (Off)
> > > > > Home Page : www.engr.orst.edu/~venkatru
> > > > > To Be or not to Be-- It's in your hands..
> > > > > *****************************************************
> > > > >
> > > > >
> > > > >
> > >
> > > --
> > > *****************************************************
> > > Rudhrakumar Venkatesan
> > > Office          : Mobile Networking Laboratory, Department of ECE
> > >                       Oregon State University, Corvallis, Oregon, US 97331
> > > Residence   : 440, Nw 23rd st, #6, Corvallis, Oregon, US 97330
> > > Phone          : 541-758-4381 ( Res), 541-737-2349 (Off)
> > > Home Page : www.engr.orst.edu/~venkatru
> > > To Be or not to Be-- It's in your hands..
> > > *****************************************************
> > >
> > >
> > >
> >
> > ****************** Sudhindra Suresh Bengeri *******************
> > School:                       | Home:                         |
> > Dept. of Computer Science     | 2502, Avent Ferry Rd          |
> > NCSU, Raleigh, NC.            | Apt #206, Raleigh, NC - 27606 |
> > Ph. 919 515 7135(TA room)     | Ph. 919 838 8746              |
> > web page: http://www4.ncsu.edu/~ssbenger
> 
> --
> *****************************************************
> Rudhrakumar Venkatesan
> Office          : Mobile Networking Laboratory, Department of ECE
>                       Oregon State University, Corvallis, Oregon, US 97331
> Residence   : 440, Nw 23rd st, #6, Corvallis, Oregon, US 97330
> Phone          : 541-758-4381 ( Res), 541-737-2349 (Off)
> Home Page : www.engr.orst.edu/~venkatru
> To Be or not to Be-- It's in your hands..
> *****************************************************
> 
> 
>