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

Re: Get an interface label from an agent





Ahmed A-G Helmy wrote:

> > ns developers:
> >
> >
> > I am implementing CBTv2 in ns. A CBT agent needs to know the local
> > interface (its label) through a message (CBT PDU) has arrived. I have
> > not
> > find an efficient way to do it without modify C code defining a compiled
> >
> > variable, iif_, as follows:
> > message.cc, add   : int iif_;
> >                   modif.:
> > MessageAgent::MessageAgent():Agent(PT_MESSAGE), iif_(2)
> >                    add   : bind("iif_", &iif_);
> >             add(recv): iif_ =
> > ((hdr_cmn*)pkt->access(off_cmn_))->iface();
> >
> > ns-default.tcl, add : Agent/Message set iif_ -2
> >
> > then, a CBT agent access the interface label:
> >   set input_interface_label [messager set iif_]
> >
> > (messager is an Agent/Message object)
> >
> > Do anyone knows a way to do it entirely in Tcl?
> > thanks,
>
> I would probably be in a better position to help you if I understand what
> you are trying to do...
>         an interface_label_ is a variable for an interface.... however,
> you seem to want a message agent have an interface label, which on first
> look seems like the wrong thing to do...
>         are you trying to fake which interface the packet arrived on,
> or... ?!
>
> Regards,
> -A
>
> >
> >   Guillermo Rigotti
> >
> >
> >

  Hi,

I 'll try to explain what I need to do describing the following case:

A message agent receives a CBT join-request; the node is not on tree for the
group, then the CBT agent needs to create transient information and
forward the join-request PDU to the core.

Transient information consists of:

 <group, incoming interface, outgoing interface>

The value the agent gives to "incoming interface", is the interface label of
the interface associated with the link through which the PDU was received.

A way to access the label is (pim-sender.tcl ):

 set oifInfo [$Node get-oif [$ns set link_([$Node id]:$nexthop)]]
 set oif [lindex $oifInfo 1]
 set lbl [$oif set intf_label_]

but the nodes need to be adjacent and it is necessary to know "nexthop",
that may be different from the node that originated the PDU, which generally
is carried in the PDU.

A way to know the previous adjacent node ("nexthop") is to use lookup method
of
RouteLogic, but I am not sure if it works in every case (for example,
if we have different policy routing when simulatintg several AS, etc.)

Another solution is to add a field to every PDU, containing the node id
of the last node that forwarded the packet, but this not seems to me a
good solution.

Thanks,

 Guillermo Rigotti