3 #ifndef NETWORK_GTNETS_HPP_
4 #define NETWORK_GTNETS_HPP_
6 #include "simulator.h" // Definitions for the Simulator Object
7 #include "node.h" // Definitions for the Node Object
8 #include "linkp2p.h" // Definitions for point-to-point link objects
9 #include "ratetimeparse.h" // Definitions for Rate and Time objects
10 #include "application-tcpserver.h" // Definitions for TCPServer application
11 #include "application-tcpsend.h" // Definitions for TCP Sending application
12 #include "tcp-tahoe.h" // Definitions for TCP Tahoe
14 #include "tcp-newreno.h"
16 #include "routing-manual.h"
19 xbt_dict_t network_card_ids;
24 class NetworkGTNetsModel;
25 typedef NetworkGTNetsModel *NetworkGTNetsModelPtr;
27 class NetworkGTNetsLink;
28 typedef NetworkGTNetsLink *NetworkGTNetsLinkPtr;
30 class NetworkGTNetsAction;
31 typedef NetworkGTNetsAction *NetworkGTNetsActionPtr;
33 class NetworkGTNetsActionLmm;
34 typedef NetworkGTNetsActionLmm *NetworkGTNetsActionLmmPtr;
39 class NetworkGTNetsModel : public NetworkCm02Model {
41 NetworkGTNetsModel() : NetworkCm02Model("constant time network") {};
42 int addLink(int id, double bandwidth, double latency);
43 int addOnehop_route(int src, int dst, int link);
44 int addRoute(int src, int dst, int *links, int nlink);
45 int addRouter(int id);
46 int createFlow(int src, int dst, long datasize, void *metadata);
47 double getTimeToNextFlowCompletion();
48 int runUntilNextFlowCompletion(void ***metadata,
49 int *number_of_flows);
50 int run(double deltat);
51 // returns the total received by the TCPServer peer of the given action
52 double gtNetsGetFlowRx(void *metadata);
53 void createGTNetsTopology();
55 void setJitter(double);
56 void setJitterSeed(int);
61 bool nodeInclude(int);
62 bool linkInclude(int);
64 GTNETS_Topology *p_topo;
72 map<int, Uniform*> p_uniformJitterGenerator;
74 map<int, TCPServer*> p_gtnetsServers;
75 map<int, TCPSend*> p_gtnetsClients;
76 map<int, Linkp2p*> p_gtnetsLinks_;
77 map<int, Node*> p_gtnetsNodes;
78 map<void*, int> p_gtnetsActionToFlow;
80 map <int, void*> p_gtnetsMetadata;
84 map<int, GTNETS_Link*> p_links;
85 vector<GTNETS_Node*> p_nodes;
86 map<int, int> p_hosts; //hostid->nodeid
93 class NetworkGTNetsLink : public NetworkCm02Link {
95 NetworkGTNetsLink(NetworkGTNetsModelPtr model, const char* name, double bw, double lat, xbt_dict_t properties);
96 /* Using this object with the public part of
97 model does not make sense */
106 class NetworkGTNetsAction : public NetworkCm02Action {
108 NetworkGTNetsAction(NetworkGTNetsModelPtr model, double latency){};
115 lmm_variable_t p_variable;
121 #endif //HAVE_TRACING
124 #endif /* NETWORK_GTNETS_HPP_ */