Alex Bikfalvi
SimStream Documentation
ModelPushMulti.h
00001 #pragma once 00002 00003 #include "Model.h" 00004 #include "Topo.h" 00005 #include "ModelChannel.h" 00006 #include "Route.h" 00007 #include "InfoPushMulti.h" 00008 #include "Router.h" 00009 #include "Link.h" 00010 #include "HostClientPushMulti.h" 00011 #include "HostServerPushMulti.h" 00012 #include "StreamSourceMpeg.h" 00013 #include "Data.h" 00014 00015 #define HOST_ID(index) (index) 00016 #define ROUTER_ID(index) (index) 00017 #define SERVER_ID(index) (index) 00018 00019 #define LINK_CORE_ID(index) (0x10000000 | index) 00020 #define LINK_ACCESS_ID(index) (0x20000000 | index) 00021 #define LINK_SERVER_ID(index) (0x30000000 | index) 00022 00023 #define HOST_ADDR(index) (index + this->routeNodes) 00024 #define ROUTER_ADDR(index) (index) 00025 #define SERVER_ADDR(index) (index + this->routeNodes + this->numHosts) 00026 00027 #define ROUTE_ADDRESS_INDEX(addr) (addr) 00028 #define ROUTE_ROUTER_INDEX(id) (id) 00029 00030 class CModelPushMulti : public CModel, public CRoute, public CInfoPushMulti 00031 { 00032 protected: 00033 // Simulation 00034 char* name; 00035 CSimHandler* sim; 00036 CTopo* topology; 00037 __uint32 topologyNumber; 00038 CModelChannel* modelChannel; 00039 00040 // Nodes 00041 __uint32 numHosts; 00042 __uint32 numServers; 00043 __uint32 numGateways; 00044 CHostClientPushMulti** hosts; 00045 CHostServerPushMulti* server; 00046 CRouter** routers; 00047 CLink** linksCore; 00048 CLink** linksAccess; 00049 CLink* linkServer; 00050 __uint32* gateways; 00051 __uint32 gatewayServer; 00052 __uint32* routerAccessLinks; 00053 00054 // Network 00055 __uint32 bwAccessBins; 00056 __bitrate* bwAccessUpLink; 00057 __bitrate* bwAccessDownLink; 00058 double* bwAccessRatio; 00059 __bitrate* bwAccessHostUpLink; 00060 __bitrate* bwAccessHostDownLink; 00061 __time delayAccessUpLink; 00062 __time delayAccessDownLink; 00063 __bitrate bwServerUpLink; 00064 __bitrate bwServerDownLink; 00065 __time delayServerUpLink; 00066 __time delayServerDownLink; 00067 __uint32 queueLink; 00068 __uint32 queueLinkServer; 00069 00070 // Routing 00071 __uint32 routeNodes; 00072 __uint32 routeDst; 00073 int** route; 00074 00075 // Channels 00076 __uint32 numChannels; 00077 __uint32 numChannelsMcast; 00078 __uint32 numChannelsUcast; 00079 __uint32 numLayers; 00080 __uint32 numLayersMin; 00081 00082 __bitrate channelBw; 00083 __byte channelFps; 00084 CChannel* channelsMcast; 00085 CChannel* channelsUcast; 00086 00087 // Multicast 00088 CAddress* mcastRp; 00089 00090 // Stream 00091 CStreamSourceMpeg** streamSources; 00092 __byte mpegGopDistanceItoI; 00093 __byte mpegGopDistanceItoP; 00094 00095 __uint32 streamBufferMcastSize; 00096 __uint32 streamBufferMcastSizeHistory; 00097 __uint32 streamBufferMcastSizeBuffering; 00098 __uint32 streamBufferUcastSize; 00099 __uint32 streamBufferUcastSizeHistory; 00100 __uint32 streamBufferUcastSizeBuffering; 00101 __time streamBufferUnderrunTimeout; 00102 double streamBwMargin; 00103 00104 // Bootstrap 00105 __uint32 bootQueryMax; 00106 __uint32 bootRefreshThreshold; 00107 __time bootQueryTimeout; 00108 __time bootRegisterDelay; 00109 00110 // Data 00111 CData* data; 00112 00113 // Data : bandwidth 00114 __uint64 dataBwTotal; 00115 double dataBwAvg; 00116 00117 // Data : bandwidth core 00118 __uint64 dataBwCoreTotal; 00119 double dataBwCoreAvg; 00120 // Data : bandwidth access 00121 __uint64 dataBwAccessTotal; 00122 double dataBwAccessAvg; 00123 // Data : bandwidth access uplink 00124 __uint64 dataBwAccessUpTotal; 00125 double dataBwAccessUpAvg; 00126 // Data : bandwidth access downlink 00127 __uint64 dataBwAccessDownTotal; 00128 double dataBwAccessDownAvg; 00129 // Data : bandwidth server 00130 __uint64 dataBwServerTotal; 00131 double dataBwServerAvg; 00132 00133 // Data : bandwidth stream 00134 __uint64 dataBwStreamTotal; 00135 double dataBwStreamAvg; 00136 // Data : bandwidth core stream 00137 __uint64 dataBwCoreStreamTotal; 00138 double dataBwCoreStreamAvg; 00139 // Data : bandwidth access stream 00140 __uint64 dataBwAccessStreamTotal; 00141 double dataBwAccessStreamAvg; 00142 // Data : bandwidth access uplink stream 00143 __uint64 dataBwAccessUpStreamTotal; 00144 double dataBwAccessUpStreamAvg; 00145 // Data : bandwidth access downlink stream 00146 __uint64 dataBwAccessDownStreamTotal; 00147 double dataBwAccessDownStreamAvg; 00148 // Data : bandwidth server stream 00149 __uint64 dataBwServerStreamTotal; 00150 double dataBwServerStreamAvg; 00151 00152 // Data : bandwidth control 00153 __uint64 dataBwControlTotal; 00154 double dataBwControlAvg; 00155 // Data : bandwidth core control 00156 __uint64 dataBwCoreControlTotal; 00157 double dataBwCoreControlAvg; 00158 // Data : bandwidth access control 00159 __uint64 dataBwAccessControlTotal; 00160 double dataBwAccessControlAvg; 00161 // Data : bandwidth access uplink control 00162 __uint64 dataBwAccessUpControlTotal; 00163 double dataBwAccessUpControlAvg; 00164 // Data : bandwidth access downlink control 00165 __uint64 dataBwAccessDownControlTotal; 00166 double dataBwAccessDownControlAvg; 00167 // Data : bandwidth server control 00168 __uint64 dataBwServerControlTotal; 00169 double dataBwServerControlAvg; 00170 00171 // Data : multicast entries 00172 double dataRouterMcastEntries; 00173 double dataRouterMcastEntriesIgmp; 00174 double dataRouterMcastEntriesPimSm; 00175 00176 // Data : host statistics 00177 __uint32 dataCoderEncodedPackets; 00178 __uint32 dataCoderDecodedPackets; 00179 __uint32 dataCoderDiscardedPackets; 00180 00181 __uint32 dataCoderEncodedFrames; 00182 __uint32 dataCoderDecodedFrames; 00183 __uint32 dataCoderDiscardedFrames; 00184 00185 __uint32 dataClientRecvFrames; 00186 __uint32 dataClientDiscardedFrames; 00187 __uint32 dataClientExpectedFrames; 00188 00189 public: 00190 CModelPushMulti( 00191 char* name, 00192 __time maxTime, 00193 CTopo* topology, 00194 __uint32 topologyNumber, 00195 CModelChannel* modelChannel, 00196 __uint32 numHosts, 00197 __uint32 numGateways, 00198 __uint32 bwAccessBins, 00199 __bitrate* bwAccessUpLink, 00200 __bitrate* bwAccessDownLink, 00201 double* bwAccessRatio, 00202 __time delayAccessUpLink, 00203 __time delayAccessDownLink, 00204 __bitrate bwServerUpLink, 00205 __bitrate bwServerDownLink, 00206 __time delayServerUpLink, 00207 __time delayServerDownLink, 00208 __uint32 queueLink, 00209 __uint32 queueLinkServer, 00210 __uint32 numChannelsMcast, 00211 __uint32 numChannelsUcast, 00212 __uint32 numLayers, 00213 __uint32 numLayersMin, 00214 __bitrate channelBw, 00215 __byte channelFps, 00216 __byte mpegGopDistanceItoI, 00217 __byte mpegGopDistanceItoP, 00218 __uint32 streamBufferMcastSize, 00219 __uint32 streamBufferMcastSizeHistory, 00220 __uint32 streamBufferMcastSizeBuffering, 00221 __uint32 streamBufferUcastSize, 00222 __uint32 streamBufferUcastSizeHistory, 00223 __uint32 streamBufferUcastSizeBuffering, 00224 __time streamBufferUnderrunTimeout, 00225 double streamBwMargin, 00226 __uint32 bootQueryMax, 00227 __uint32 bootRefreshThreshold, 00228 __time bootQueryTimeout, 00229 __time bootRegisterDelay 00230 ); 00231 virtual ~CModelPushMulti(); 00232 00233 virtual void Init(CSimHandler* sim); 00234 virtual __uint32 Events(); 00235 virtual CSimEvent* Event(__uint32 index, __time& time); 00236 00237 virtual void Finalize(); 00238 00239 virtual int Forward(CAddress router, CAddress dst); 00240 00241 virtual inline __uint32 NumGroups() { return this->numChannelsMcast; } 00242 00243 virtual inline __uint32 NumChannels() { return this->numChannels; } 00244 virtual inline __uint32 NumChannelsMulticast() { return this->numChannelsMcast; } 00245 virtual inline __uint32 NumChannelsUnicast() { return this->numChannelsUcast; } 00246 virtual inline __uint32 NumLayers() { return this->numLayers; } 00247 virtual inline __uint32 NumLayersMin() { return this->numLayersMin; } 00248 virtual inline __byte MpegGopSize() { return this->mpegGopDistanceItoI; } 00249 00250 virtual inline CChannel* Channel(__uint32 index); 00251 virtual inline CChannel* ChannelMulticast(__uint32 index) { assert(index < this->numChannelsMcast); return &this->channelsMcast[index]; } 00252 virtual inline CChannel* ChannelUnicast(__uint32 index) { assert(index < this->numChannelsUcast); return &this->channelsUcast[index]; } 00253 00254 virtual inline __uint32 IndexGlobalToMulticast(__uint32 index) { assert(index < this->numChannelsMcast); return index; } 00255 virtual inline __uint32 IndexGlobalToUnicast(__uint32 index) { assert(index < this->numChannels); assert(index >= this->numChannelsMcast); return index - this->numChannelsMcast; } 00256 virtual inline __uint32 IndexMulticastToGlobal(__uint32 index) { assert(index < this->numChannelsMcast); return index; } 00257 virtual inline __uint32 IndexUnicastToGlobal(__uint32 index) { assert(index < this->numChannelsUcast); return index + this->numChannelsMcast; } 00258 00259 virtual inline __uint32 StreamBufferMcastSize() { return this->streamBufferMcastSize; } 00260 virtual inline __uint32 StreamBufferMcastSizeHistory() { return this->streamBufferMcastSizeHistory; } 00261 virtual inline __uint32 StreamBufferMcastSizeBuffering() { return this->streamBufferMcastSizeBuffering; } 00262 virtual inline __uint32 StreamBufferUcastSize() { return this->streamBufferUcastSize; } 00263 virtual inline __uint32 StreamBufferUcastSizeHistory() { return this->streamBufferUcastSizeHistory; } 00264 virtual inline __uint32 StreamBufferUcastSizeBuffering() { return this->streamBufferUcastSizeBuffering; } 00265 virtual inline __time StreamBufferUnderrunTimeout() { return this->streamBufferUnderrunTimeout; } 00266 virtual inline double StreamBwMargin() { return this->streamBwMargin; } 00267 00268 virtual inline __uint32 BootQueryMax() { return this->bootQueryMax; } 00269 virtual inline __uint32 BootRefreshThreshold() { return this->bootRefreshThreshold; } 00270 virtual inline __time BootQueryTimeout() { return this->bootQueryTimeout; } 00271 virtual inline __time BootRegisterDelay() { return this->bootRegisterDelay; } 00272 00273 virtual inline __uint16 PortStream() { return 0; } 00274 virtual inline __uint16 PortControl() { return 1; } 00275 00276 virtual inline CModelChannel* ModelChannel() { return this->modelChannel; } 00277 00278 virtual inline CStreamSource* StreamSource(__uint32 index) { assert(index < this->numChannels); return this->streamSources[index]; } 00279 };
Last updated: February 8, 2011