RTP Trace System  1.0
abstractlayerdescription.h
Go to the documentation of this file.
00001 // ##########################################################################
00002 // ####                                                                  ####
00003 // ####                    Master Thesis Implementation                  ####
00004 // ####  Management of Layered Variable Bitrate Multimedia Streams over  ####
00005 // ####                  DiffServ with A Priori Knowledge                ####
00006 // ####                                                                  ####
00007 // #### ================================================================ ####
00008 // ####                                                                  ####
00009 // ####                                                                  ####
00010 // #### Abstract Layer Description Inlines                               ####
00011 // ####                                                                  ####
00012 // #### Version 1.00  --  February 19, 2001                              ####
00013 // ####                                                                  ####
00014 // #### Copyright (C) 2000/2001 Thomas Dreibholz                         ####
00015 // #### University of Bonn, Department of Computer Science IV            ####
00016 // #### EMail: dreibh@iem.uni-due.de                                     ####
00017 // #### WWW:   https://www.uni-due.de/~be0001/diplom/index.html          ####
00018 // ####                                                                  ####
00019 // ##########################################################################
00020 
00021 
00022 #ifndef ABSTRACTLAYERDESCRIPTION_H
00023 #define ABSTRACTLAYERDESCRIPTION_H
00024 
00025 
00026 #include "system.h"
00027 #include "framesizescalabilityinterface.h"
00028 #include "internetflow.h"
00029 
00030 
00031 namespace Coral {
00032 
00033 
00044 class AbstractLayerDescription : virtual public FrameSizeScalabilityInterface
00045 {
00046    // ====== Constructor/Destructor =========================================
00047    public:
00051    AbstractLayerDescription();
00052 
00056    virtual ~AbstractLayerDescription();
00057 
00068    inline void initLayer(const cardinal pktHeaderSize,
00069                          const cardinal pktMaxSize,
00070                          const double   maxTransferDelay,
00071                          const cardinal maxBufferDelay,
00072                          const double   maxLossRate,
00073                          const double   maxJitter,
00074                          const cardinal flags);
00075 
00076 
00077    // ====== Bandwidth and bandwidth quality methods ========================
00083    inline card64 getBandwidth() const;
00084 
00092    inline bool setBandwidth(const double frameRate,
00093                             const card64 bandwidth);
00094 
00101    virtual cardinal getPacketRate(const double frameRate) const;
00102 
00110    static inline card64 frameSizeToBandwidth(const double   frameRate,
00111                                              const cardinal frameSize);
00112 
00120    static inline cardinal bandwidthToFrameSize(const double frameRate,
00121                                                const card64 bandwidth);
00122 
00123 
00133    inline card64 bandwidthToBandwidth(const card64   bandwidth,
00134                                       const double   frameRate,
00135                                       const cardinal bufferDelay,
00136                                       const cardinal newBufferDelay) const;
00137 
00138 
00148    card64 payloadBandwidthToBandwidth(const card64   bandwidth,
00149                                       const double   frameRate,
00150                                       const cardinal bufferDelay,
00151                                       const cardinal newBufferDelay) const;
00152 
00153 
00161    virtual cardinal frameSizeToPacketRate(const double   frameRate,
00162                                           const cardinal frameSize) const;
00163 
00169    inline double getMaxTransferDelay() const;
00170 
00176    inline void setMaxTransferDelay(const double maxDelay);
00177 
00183    inline double getMaxLossRate() const;
00184 
00190    inline void setMaxLossRate(const double maxLossRate);
00191 
00197    inline double getMaxJitter() const;
00198 
00204    inline void setMaxJitter(const double maxJitter);
00205 
00206 
00207    // ====== Frame size methods =============================================
00216    inline bool isValidFrameSize(const double   frameRate,
00217                                 const cardinal bufferDelay,
00218                                 const cardinal size) const;
00219 
00228    inline cardinal getNearestValidFrameSize(const double   frameRate,
00229                                             const cardinal bufferDelay,
00230                                             const cardinal size) const;
00231 
00240    virtual cardinal payloadToRaw(const double   frameRate,
00241                                  const cardinal payload,
00242                                  const cardinal bufferDelay) const;
00243 
00252    virtual cardinal rawToPayload(const double   frameRate,
00253                                  const cardinal raw,
00254                                  const cardinal bufferDelay) const;
00255 
00256 
00257    // ====== Scaling and utilization methods, for current buffer delay ======
00264    inline cardinal getMinFrameSize(const double frameRate) const;
00265 
00272    inline cardinal getMaxFrameSize(const double frameRate) const;
00273 
00280    inline cardinal getPeakFrameSizeForSize(const double   frameRate,
00281                                            const cardinal frameSize) const;
00282 
00289    inline cardinal getPacketCountForSize(const double   frameRate,
00290                                          const cardinal frameSize) const;
00291 
00299    inline double getPrevFrameSizeForSize(const double   frameRate,
00300                                          const cardinal frameSize) const;
00301 
00309    inline double getNextFrameSizeForSize(const double   frameRate,
00310                                          const cardinal frameSize) const;
00311 
00320    inline double getFrameSizeScaleFactorForSize(const double   frameRate,
00321                                                 const cardinal frameSize) const;
00322 
00330    inline double getFrameSizeUtilizationForSize(const double   frameRate,
00331                                                 const cardinal frameSize) const;
00332 
00333 
00334    // ====== Scaling and utilization methods, for given buffer delay ========
00341    inline cardinal getMinFrameSizeForDelay(const double   frameRate,
00342                                            const cardinal bufferDelay) const;
00343 
00350    inline cardinal getMaxFrameSizeForDelay(const double   frameRate,
00351                                            const cardinal bufferDelay) const;
00352 
00359    inline cardinal getPeakFrameSizeForDelayAndSize(const double   frameRate,
00360                                                    const cardinal bufferDelay,
00361                                                    const cardinal frameSize) const;
00362 
00369    inline cardinal getPacketCountForDelayAndSize(const double   frameRate,
00370                                                  const cardinal bufferDelay,
00371                                                  const cardinal frameSize) const;
00372 
00380    inline double getPrevFrameSizeForDelayAndSize(const double   frameRate,
00381                                                  const cardinal bufferDelay,
00382                                                  const cardinal frameSize) const;
00390    inline double getNextFrameSizeForDelayAndSize(const double   frameRate,
00391                                                  const cardinal bufferDelay,
00392                                                  const cardinal frameSize) const;
00393 
00402    inline double getFrameSizeScaleFactorForDelayAndSize(const double   frameRate,
00403                                                         const cardinal bufferDelay,
00404                                                         const cardinal frameSize) const;
00405 
00413    inline double getFrameSizeUtilizationForDelayAndSize(const double   frameRate,
00414                                                         const cardinal bufferDelay,
00415                                                         const cardinal frameSize) const;
00416 
00417 
00418    // ====== Buffer delay methods ===========================================
00424    inline cardinal getBufferDelay() const;
00425 
00432    inline cardinal setBufferDelay(const cardinal bufferDelay);
00433 
00440    inline cardinal getPrevBufferDelay(const double frameRate) const;
00441 
00448    inline cardinal getNextBufferDelay(const double frameRate) const;
00449 
00450 
00451    // ====== Source and destination address methods =========================
00457    inline InternetAddress getSource() const;
00458 
00464    inline InternetFlow getDestination() const;
00465 
00471    inline void setSource(const InternetAddress& source);
00472 
00478    inline void setDestination(const InternetFlow& destination);
00479 
00480 
00481    // ====== Flags ==========================================================
00485    inline cardinal getFlags() const;
00486 
00490    inline void setFlags(const cardinal flags);
00491 
00495    enum LayerFlags {
00496       LF_BaseLayer      = 0,
00497       LF_ExtensionLayer = (1 << 0)
00498    };
00499 
00500 
00501    // ====== Protected data =================================================
00502    protected:
00503    cardinal        PktHeaderSize;
00504    cardinal        PktMaxSize;
00505 
00506    card64          Bandwidth;
00507 
00508    double          MaxTransferDelay;
00509    double          MaxLossRate;
00510    double          MaxJitter;
00511 
00512    cardinal        BufferDelay;
00513    cardinal        MaxBufferDelay;
00514    cardinal        Flags;
00515 
00516    InternetAddress Source;
00517    InternetFlow    Destination;
00518 };
00519 
00520 
00521 }
00522 
00523 
00524 #include "abstractlayerdescription.icc"
00525 
00526 
00527 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines