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

Pavlin Radoslavov pavlin at icir.org
Wed Mar 21 13:47:36 PDT 2007


>        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.

Your code below seems to be doing the right thing.

Look into the raw bytes on the wire (I presume Ethereal can show
them) rather than what Ethereal decodes.
If necessary, use tcpdump and again look into the raw bytes.

> 
> 
> 
> ****************************************************************************************************
> 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.

Those states are non-group specific are are kept inside pim_vif.hh .
E.g., search for "effective_override_interval" and
"effective_propagation_delay" .
Note that some of the state is computed on-the-fly when it is
needed.

Regards,
Pavlin



More information about the Xorp-hackers mailing list