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

Re: what is wrong with iface_?





On Fri, 10 Jul 1998, Gang Xu wrote:

> Hi, Chetan,
> 
> I tried to read the iface_ from the 'common' header of a packet using
> 	hdr_cmn* cmnh = (hdr_cmn *) p->access(off_cmn_);
> and
> 	cmnh->iface();
> However, no matter for which node, I always get -2 for the iface_. After I
> pass it to 'ifaceGetNode', it only returns -1.

The incoming interface is set to -2 at the *source* - because the packet
is generated at the source, there is no incoming interface. Try checking
cmnh->iface() at the receiver. (don't know if you're already doing this) 
(also, have you used 'Simulator NumberInterfaces_ 1' - without this,
interface numbers are not used) 

-Chetan

> 
> I don't think it is correct. I will try them on some other machines in
> case my NS has some problems. I just want to know whether there is any
> other format to visit the 'common' header of the packet?
> 
> Thanks, 
> Gang
> 
> 
> 
> On Thu, 9 Jul 1998, Chetan Rai wrote:
> 
> > 
> > 
> > On Thu, 9 Jul 1998, George Riley wrote:
> > 
> > > I believe you can look in the ip_hdr of the packet, and check the
> > > ip_hdr->src() value, which indicates the node inthe upper 24 bits.
> > > George
> > 
> > I think Gang wants to find the neighbouring node thru which the packet
> > was routed - the Node instproc 'ifaceGetNode' returns this node - the
> > incoming interface (required as argument to ifaceGetNode) is in the
> > iface_ data member of the cmn header.
> > 
> > -Chetan
> > 
> > > 
> > > 					
> > > 			-George F. Riley ([email protected])
> > > 		 	-Grad Student Liaison
> > > 
> > > 
> > > On Thu, 9 Jul 1998, Gang Xu wrote:
> > > 
> > > > Hi,
> > > > 
> > > > After a node receives a packet, is it possible to check which neighbor
> > > > sends the packet to it? 
> > > > 
> > > > Gang Xu
> > > > ------------------------------------------------------------------
> > > > Department of CS                        Tel: (205)348-0996(O)
> > > > University of Alabama, Tuscaloosa       http://www.eng.ua.edu/~gxu
> > > > 
> > > > 
> > > > 
> > > 
> > > 
> > 
> > 
> 
> Gang Xu
> ------------------------------------------------------------------
> Department of CS                        Tel: (205)348-0996(O)
> University of Alabama, Tuscaloosa       http://www.eng.ua.edu/~gxu
> 
>