[Xorp-hackers] doubt abt packet format(PIM)

shamita pisal shamita1010 at gmail.com
Wed Mar 21 07:16:25 PDT 2007


On 3/17/07, Pavlin Radoslavov <pavlin at icir.org> wrote:
>
> > We want to implement packet header for DF -election messages.The format
> is
> > as under:
> >
> > All DF election BIDIR-PIM control messages share the common header
> >    below:
> >
> >     0                   1                   2                   3
> >     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> >    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> >    |PIM Ver| Type  |Subtype| Rsvd  |           Checksum            |
> >    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> >    |               RP Address (Encoded-Unicast format)           ...
> >    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> >    |                   Sender Metric Preference                    |
> >    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> >    |                        Sender Metric                          |
> >    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> >
> > The Sub-type field  is to be implemented.But
> > In pim.h
> >
> > Struct  pim {
> > .
> > .
> > .
> > uint8_t   pim_reserved
> > uint16_t pim_checksum
> > .
> > .
> > .}
>
> Don't use "struct pim" to access the fields.
> Instead, have a look at the beginning of PimVif::pim_process()
> inside pim_vif.cc. In particular, check the mechanism for accessing
> the Type field and use similar mechanism to access Subtype as well.
> Basically, you explicitly get the second octet from the beginning of
> the packet, and you extract the top 4 bits from it.
>
> Regards,
> Pavlin


hello,
       We have done the following changes and using those we were able to
set the version and type bit for DF election messages.  When we catch these
packets  in  the  ethereal we were able to see the values of TYPE and
VERSION fields but we were unable to see the value of subtype.
1.)        It is showing XLOG_INFO (DF_OFFER) but it is unable to show the
value in ethereal.So we are not confident as to whether the sub-type value
is set or no.




****************************************************************************************************
In pim_bidir_df.cc


int
PimVif::pim_bidir_df_send(const IPvX& src, const IPvX& dst,
         uint8_t message_type,uint8_t message_subtype , buffer_t *buffer,
         string& error_msg)
{
    ....
.......
......

    // Prepare the PIM-BIDIR messages are Multicast with TTL 1           //
to the "ALL-PIm-ROUTERS" header
    //  All DF election BIDIR-PIM control message share the
  //     common    header.

    datalen = BUFFER_DATA_SIZE(buffer);
    BUFFER_RESET_TAIL(buffer);

    pim_vt = PIM_MAKE_VT(proto_version(), message_type);

BUFFER_PUT_OCTET(pim_vt, buffer); // PIM version and message type


    switch(message_subtype){

    case DF_OFFER :
        XLOG_INFO("ash : DF_OFFER");
 BUFFER_PUT_OCTET(DF_OFFER, buffer);    // Offer + Reserved
        break;

    case DF_WINNER :
        XLOG_INFO("ash : DF_WINNER");
BUFFER_PUT_OCTET(DF_WINNER, buffer);  // Winner + Reserved
        break;

    case DF_BACKOFF :
XLOG_INFO("ash : DF_BACKOFF");
BUFFER_PUT_OCTET(DF_BACKOFF, buffer);// Backoff + Reserved         break;

    case DF_PASS    :
   XLOG_INFO("ash : DF_PASS");
   BUFFER_PUT_OCTET(DF_PASS, buffer);     // Pass +Reserved
        break;

    default :
        XLOG_INFO("ash : Default");
        BUFFER_PUT_OCTET(0xb, buffer);
        break;

}
    //    BUFFER_PUT_OCTET(DF_OFFER, buffer);

  BUFFER_PUT_HOST_16(0, buffer);        // Zero the checksum field

 // Restore the buffer to include the data

    BUFFER_RESET_TAIL(buffer);
    BUFFER_PUT_SKIP(datalen, buffer);

    //
    // Send the message
    //
    ret_value = pim_node().pim_send(vif_index(), src, dst, ttl, ip_tos,
                    is_router_alert, buffer, error_msg);

    return (ret_value);

*********************************************************************************************
pim_bidir_df.hh



/*
 * PIM-BIDIR DF election message subtypes
 */

#define DF_OFFER    0x1
#define DF_WINNER    0x2
#define DF_BACKOFF    0x3
#define DF_PASS        0x4

*********************************************************************************************

2.)Also could you please tell us where are the PIM-SM General purpose states
implemented  in  PIM-SM code.

Thanking you in anticipation,
Chintamani
Shamita
Ashish







> we want to add the sub type....how do we add it without disturbing the
> > already existing code.
> > Is it possible to add that subtype in this structure or do we have to
> define
> > another structure which will be only used for DF election messages.
> > Also can we use the already defined flag
> > #define PIM_ALL_DF_ELECTION
> > in file pim.h. How can we use this flag for bidir DF election messages.
> >
> > Thanking you in anticipation
> > ashish karpe
> > chintamani wandhre
> > shamita pisal
> > _______________________________________________
> > Xorp-hackers mailing list
> > Xorp-hackers at icir.org
> > http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/xorp-hackers/attachments/20070321/de0f0e5b/attachment.html 


More information about the Xorp-hackers mailing list