Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

lms.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001 University of Southern California.
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms are permitted
00006  * provided that the above copyright notice and this paragraph are
00007  * duplicated in all such forms and that any documentation, advertising
00008  * materials, and other materials related to such distribution and use
00009  * acknowledge that the software was developed by the University of
00010  * Southern California, Information Sciences Institute.  The name of the
00011  * University may not be used to endorse or promote products derived from
00012  * this software without specific prior written permission.
00013  *
00014  * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
00015  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
00016  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017  *
00018  **
00019  * Light-Weight Multicast Services (LMS), Reliable Multicast
00020  *
00021  * lms.h
00022  *
00023  * This holds the packet header structures, and packet type constants for
00024  * the LMS implementation.
00025  *
00026  * Christos Papadopoulos. 
00027  * christos@isi.edu
00028  */
00029 
00030 #ifndef lms_h
00031 #define lms_h
00032 
00033 class LmsAgent;
00034 
00035 #include "node.h"
00036 #include "packet.h"
00037 
00038 
00039 #define LMS_NOADDR      -1
00040 #define LMS_NOPORT      -1
00041 #define LMS_NOIFACE     -99
00042 #define LMS_INFINITY    1000000
00043 
00044 /*
00045  * PT_LMS packet types
00046  */
00047 #define LMS_SRC_REFRESH 1
00048 #define LMS_REFRESH     2
00049 #define LMS_LEAVE       3
00050 #define LMS_REQ         4
00051 #define LMS_DMCAST      5
00052 #define LMS_SETUP       6
00053 #define LMS_SPM         7
00054 #define LMS_LINKS       8
00055 
00056 /*
00057  * LMS header
00058  */
00059 struct hdr_lms {
00060     int         type_;          // packet type
00061     int         ttl_;           // time-to-live
00062     int         cost_;          // cost advertisements for LMS_REFRESH
00063     nsaddr_t    from_;          // real source of packet for DMCASTs
00064     nsaddr_t    src_;           // original source of mcast packet
00065     nsaddr_t    group_;         // mcast group
00066     nsaddr_t    tp_addr_;       // turning point address
00067     int         tp_port_;       // turning point port id 
00068     int         tp_iface_;      // turning point interface
00069     int         lo_, hi_;       // range of lost packets
00070     double      ts_;            // timestamp for RTT estimation
00071     
00072     static int offset_;
00073     inline static int& offset() { return offset_; }
00074     inline static hdr_lms* access(Packet* p) {
00075         return (hdr_lms*)p->access(offset_);
00076     }
00077 
00078     /* per-field member functions */    
00079     int&        type ()  { return type_;  }
00080     nsaddr_t&   from ()  { return from_;  }
00081     nsaddr_t&   src ()   { return src_;   }
00082     nsaddr_t&   tp_addr ()  { return tp_addr_;  }
00083     nsaddr_t&   tp_port ()  { return tp_port_;  }
00084     nsaddr_t&   group () { return group_; }
00085 };
00086 
00087 struct lms_ctl {
00088     int         hop_cnt_;       // hop counter (similar to ttl)
00089     int         cost_;          // cost advertisements for LMS_REFRESH
00090     nsaddr_t    tp_addr_;       // turning point address
00091     nsaddr_t    tp_port_;       // turning point port id
00092     ns_addr_t   downstream_lms_;// needed when in incrDeployment       
00093     int         tp_iface_;      // turning point interface
00094     int         nak_lo_;
00095     int         nak_hi_;        // range of lost packets
00096     double      ts_;            // timestamp
00097 };
00098 
00099 struct lms_nak {
00100         int     nak_lo_;
00101         int     nak_hi_;
00102         int     nak_seqn_;
00103         int     dup_cnt_;    // num of dup requests for each NAK
00104         packet_t t;
00105         int     datsize;    
00106 };
00107 
00108 struct lms_rdl {
00109         int             seqn_;
00110         double          ts_;
00111         struct lms_rdl  *next_;
00112 };
00113 
00114 struct lms_spm {
00115         int             spm_seqno_;
00116         nsaddr_t        spm_path_;
00117         double          spm_ts_;
00118 };
00119 
00120 #endif   /* end ifndef lms_h */

Generated on Tue Apr 20 12:14:22 2004 for NS2.26SourcesOriginal by doxygen 1.3.3