Alex Bikfalvi
SimStream Documentation
ModelFlow.h
00001 #pragma once 00002 00003 #include "Model.h" 00004 #include "Topo.h" 00005 #include "ModelChannel.h" 00006 #include "Route.h" 00007 #include "Router.h" 00008 #include "Link.h" 00009 #include "HostFlow.h" 00010 #include "Info.h" 00011 00012 #define HOST_ID(index) (index) 00013 #define ROUTER_ID(index) (index) 00014 00015 #define HOST_INDEX(id) (id) 00016 #define ROUTER_INDEX(id) (id) 00017 00018 #define LINK_CORE_ID(index) (0x10000000 | index) 00019 #define LINK_ACCESS_ID(index) (0x20000000 | index) 00020 00021 #define HOST_ADDR(index) (index + this->routeNodes) 00022 #define ROUTER_ADDR(index) (index) 00023 00024 #define ROUTE_ADDRESS_INDEX(addr) (addr) 00025 #define ROUTE_ROUTER_INDEX(id) (id) 00026 00027 class CModelFlow : public CModel, public CRoute, public CInfo 00028 { 00029 protected: 00030 // Simulation 00031 CSimHandler* sim; 00032 CTopo* topology; 00033 __uint32 topologyNumber; 00034 00035 // Nodes 00036 __uint32 numHosts; 00037 __uint32 numGateways; 00038 CHostFlow** hosts; 00039 CRouter** routers; 00040 CLink** linksCore; 00041 CLink** linksAccess; 00042 __uint32* gateways; 00043 __uint32* routerAccessLinks; 00044 00045 // Network 00046 __bitrate bwAccessUpLink; 00047 __bitrate bwAccessDownLink; 00048 __time delayAccessUpLink; 00049 __time delayAccessDownLink; 00050 __uint32 queueLink; 00051 00052 // Routing 00053 __uint32 routeNodes; 00054 __uint32 routeDst; 00055 int** route; 00056 00057 // Data : bandwidth 00058 __uint64 dataBwTotal; 00059 double dataBwAvg; 00060 00061 // Data : bandwidth core 00062 __uint64 dataBwCoreTotal; 00063 double dataBwCoreAvg; 00064 // Data : bandwidth access 00065 __uint64 dataBwAccessTotal; 00066 double dataBwAccessAvg; 00067 // Data : bandwidth access uplink 00068 __uint64 dataBwAccessUpTotal; 00069 double dataBwAccessUpAvg; 00070 // Data : bandwidth access downlink 00071 __uint64 dataBwAccessDownTotal; 00072 double dataBwAccessDownAvg; 00073 00074 // Data : bandwidth stream 00075 __uint64 dataBwStreamTotal; 00076 double dataBwStreamAvg; 00077 // Data : bandwidth core stream 00078 __uint64 dataBwCoreStreamTotal; 00079 double dataBwCoreStreamAvg; 00080 // Data : bandwidth access stream 00081 __uint64 dataBwAccessStreamTotal; 00082 double dataBwAccessStreamAvg; 00083 // Data : bandwidth access uplink stream 00084 __uint64 dataBwAccessUpStreamTotal; 00085 double dataBwAccessUpStreamAvg; 00086 // Data : bandwidth access downlink stream 00087 __uint64 dataBwAccessDownStreamTotal; 00088 double dataBwAccessDownStreamAvg; 00089 00090 // Data : bandwidth control 00091 __uint64 dataBwControlTotal; 00092 double dataBwControlAvg; 00093 // Data : bandwidth core control 00094 __uint64 dataBwCoreControlTotal; 00095 double dataBwCoreControlAvg; 00096 // Data : bandwidth access control 00097 __uint64 dataBwAccessControlTotal; 00098 double dataBwAccessControlAvg; 00099 // Data : bandwidth access uplink control 00100 __uint64 dataBwAccessUpControlTotal; 00101 double dataBwAccessUpControlAvg; 00102 // Data : bandwidth access downlink control 00103 __uint64 dataBwAccessDownControlTotal; 00104 double dataBwAccessDownControlAvg; 00105 00106 public: 00107 CModelFlow( 00108 __time maxTime, 00109 CTopo* topology, 00110 __uint32 topologyNumber, 00111 __uint32 numHosts, 00112 __uint32 numGateways, 00113 __bitrate bwAccessUpLink, 00114 __bitrate bwAccessDownLink, 00115 __time delayAccessUpLink, 00116 __time delayAccessDownLink, 00117 __uint32 queueLink 00118 ); 00119 virtual ~CModelFlow(); 00120 00121 virtual void Init(CSimHandler* sim); 00122 virtual __uint32 Events(); 00123 virtual CSimEvent* Event(__uint32 index, __time& time); 00124 00125 virtual void Finalize(); 00126 00127 virtual inline __uint32 NumGroups() { return 0; } 00128 00129 virtual inline CChannel* Channel(__uint32 index) { return NULL; } 00130 virtual inline CChannel* ChannelMulticast(__uint32 index) { return NULL; } 00131 virtual inline CChannel* ChannelUnicast(__uint32 index) { return NULL; } 00132 00133 virtual inline CModelChannel* ModelChannel() { return NULL; } 00134 00135 virtual int Forward(CAddress router, CAddress dst); 00136 };
Last updated: February 8, 2011