[ns] DSR,hdr_sr.h,size() question

Khoa A To takhoa at rice.edu
Thu Feb 26 21:42:03 PST 2004


These sizes are defined per the DSR draft and I believe that they are
statically added by the function hdr_sr::size() to specify the size of the
packet.

(DSR draft:
http://www.ietf.org/internet-drafts/draft-ietf-manet-dsr-09.txt)

For example, the route request option header is 8 bytes long, therefore,
	if (route_request()) sz+=8;

Thus, if you define a new field in the route_request header, you need to
modify the function hdr_sr::size() to take into account the new field.
(e.g. if your new field is 2 bytes long, then:

	if (route_request()) sz+=10;)

Khoa.


On Thu, 26 Feb 2004, KranthiRanjan wrote:

>
> Can somebody explain to me how the route_request packet's size is
> measured in
> DSR implementation?
> in the function size(), it says if(route_request()) sz += 8;
> what does it mean?
>
> struct route_request {
>         int     req_valid_;     /* request header is valid? */
>         int     req_id_;        /* unique request identifier */
>         int     req_ttl_;       /* max propagation */
>         //The following req_speed_ is the modification
>         int     req_speed_;     /* Node movement speed specification*/
>         //Needs functions to increase, decrease req_speed_
> };
>
> I added an additional field "req_speed_" and now sz +=8 becomes what? and
> how?
>
> Thanks in advance,
> Kranthi.
>
> --
> http://www.fastmail.fm - I mean, what is it about a decent email service?
>
>



More information about the Ns-users mailing list