1 /* Copyright (c) 2013-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #ifndef NETWORK_GTNETS_HPP_
10 #define NETWORK_GTNETS_HPP_
12 #include "simulator.h" // Definitions for the Simulator Object
13 #include "node.h" // Definitions for the Node Object
14 #include "linkp2p.h" // Definitions for point-to-point link objects
15 #include "ratetimeparse.h" // Definitions for Rate and Time objects
16 #include "application-tcpserver.h" // Definitions for TCPServer application
17 #include "application-tcpsend.h" // Definitions for TCP Sending application
18 #include "tcp-tahoe.h" // Definitions for TCP Tahoe
20 #include "tcp-newreno.h"
22 #include "routing-manual.h"
25 xbt_dict_t network_card_ids;
30 class NetworkGTNetsModel;
31 typedef NetworkGTNetsModel *NetworkGTNetsModelPtr;
33 class NetworkGTNetsAction;
34 typedef NetworkGTNetsAction *NetworkGTNetsActionPtr;
36 class NetworkGTNetsActionLmm;
37 typedef NetworkGTNetsActionLmm *NetworkGTNetsActionLmmPtr;
42 class NetworkGTNetsModel : public NetworkCm02Model {
44 NetworkGTNetsModel() : NetworkCm02Model("constant time network") {};
45 int addLink(int id, double bandwidth, double latency);
46 int addOnehop_route(int src, int dst, int link);
47 int addRoute(int src, int dst, int *links, int nlink);
48 int addRouter(int id);
49 int createFlow(int src, int dst, long datasize, void *metadata);
50 double getTimeToNextFlowCompletion();
51 int runUntilNextFlowCompletion(void ***metadata,
52 int *number_of_flows);
53 int run(double deltat);
54 // returns the total received by the TCPServer peer of the given action
55 double gtNetsGetFlowRx(void *metadata);
56 void createGTNetsTopology();
58 void setJitter(double);
59 void setJitterSeed(int);
64 bool nodeInclude(int);
65 bool linkInclude(int);
67 GTNETS_Topology *p_topo;
75 map<int, Uniform*> p_uniformJitterGenerator;
77 map<int, TCPServer*> p_gtnetsServers;
78 map<int, TCPSend*> p_gtnetsClients;
79 map<int, Linkp2p*> p_gtnetsLinks_;
80 map<int, Node*> p_gtnetsNodes;
81 map<void*, int> p_gtnetsActionToFlow;
83 map <int, void*> p_gtnetsMetadata;
87 map<int, GTNETS_Link*> p_links;
88 vector<GTNETS_Node*> p_nodes;
89 map<int, int> p_hosts; //hostid->nodeid
96 class NetworkGTNetsLink : public NetworkCm02Link {
98 NetworkGTNetsLink(NetworkGTNetsModelPtr model, const char* name, double bw, double lat, xbt_dict_t properties);
99 /* Using this object with the public part of
100 model does not make sense */
109 class NetworkGTNetsAction : public NetworkCm02Action {
111 NetworkGTNetsAction(NetworkGTNetsModelPtr model, double latency){};
116 lmm_variable_t p_variable;
123 #endif /* NETWORK_GTNETS_HPP_ */