--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+
+if($#ARGV!=0) {
+ die "Usage: perl transfrom_optorsim_platform.pl <file.conf>\n";
+}
+
+my($conf_file)=$ARGV[0];
+
+open FILE, $conf_file or die "Unable to open $conf_file";
+
+print "<?xml version='1.0'?>\n";
+print "<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n";
+print "<platform version=\"3\">\n";
+print "<AS id=\"AS0\" routing=\"Floyd\">\n";
+
+my $line;
+my @tokens;
+my $token;
+my $dst = 0;
+my $src = 0;
+my @list_of_name;
+my $num_link = 0;
+
+my @links = ();
+my @routers = ();
+my @hosts = ();
+my @routes = ();
+my $power;
+while(defined($line=<FILE>))
+{
+
+ if($line =~ /^#(.*)\)(.*)$/)
+ {
+ print "<!--$1 $2-->\n";
+ push @list_of_name, $2;
+ }
+ elsif($line =~ /^([0-9]*) ([0-9]*) ([0-9]*) (.*)$/)
+ {
+ if($1.$2.$3 == "000"){
+ push @routers, "\t<router id=\"$list_of_name[$src]\"/>\n";
+ }
+ else{
+ $power = $1 * $3;
+ if($power == 0){
+ $power=1;
+ }
+ push @hosts, "\t<host id=\"$list_of_name[$src]\" power=\"$power\"/>\n";
+ }
+ my $table = $4;
+ @tokens = split(/ /,$table);
+ foreach $token (@tokens) {
+ if($token != "0"){
+# print "from \"$list_of_name[$src]\" to \"$list_of_name[$dst]\" bdw=\"$token\"\n";
+ if($src <= $dst){
+
+ push @links, "\t<link id=\"link$num_link\" bandwidth=\"$token\"/>\n";
+
+ push @routes, "\t<route src=\"$list_of_name[$src]\" dst=\"$list_of_name[$dst]\">\n";
+ push @routes, "\t\t<link_ctn id=\"link$num_link\"/>\n";
+ push @routes, "\t</route>\n";
+ $num_link++;
+ }
+ }
+ $dst++;
+ }
+ $src++;
+ $dst = 0;
+ }
+ else
+ {
+ die;
+ }
+
+
+}
+close(FILE);
+
+print @hosts;
+print "\n";
+print @routers;
+print "\n";
+print @links;
+print "\n";
+print @routes;
+
+print "</AS>\n";
+print "</platform>";
+
+print " \n";
\ No newline at end of file
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+
+ <process host="a" function="master">
+ <argument value="100"/>
+ <argument value="c"/>
+ <argument value="1"/>
+ </process>
+
+ <process host="c" function="slave">
+ <argument value="1"/>
+ </process>
+
+</platform>
--- /dev/null
+<?xml version='1.0'?>
+ <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+ <platform version="3">
+ <!--
+
+ a ______1______ b _____2_____ c
+
+ -->
+
+ <AS id="AS0" routing="Full">
+
+ <host id="a" power="1000000000"/>
+ <host id="b" power="1000000000"/>
+ <host id="c" power="1000000000"/>
+
+ <link id="1" bandwidth="1000" latency="0.01"/>
+ <link id="2" bandwidth="1000" latency="0.01"/>
+
+ <route src="a" dst="b">
+ <link_ctn id="1"/>
+ </route>
+ <route src="b" dst="c">
+ <link_ctn id="2"/>
+ </route>
+
+ </AS>
+ </platform>
\ No newline at end of file
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
<platform version="3">
- <AS id="AS0" routing="Full">
+ <!--
+
+ S1 ______1______ C1
+
+ S2 _______2_____ C2
+ S3 ________3____ C2
+
+ -->
+
+ <AS id="AS0" routing="Full">
<host id="S1" power="1000000000"/>
<host id="C1" power="1000000000"/>
<host id="S2" power="1000000000"/>
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+
+ <process host="c-2.me" function="master">
+ <argument value="100"/>
+ <argument value="c-6.me"/>
+ <argument value="1"/>
+ </process>
+
+ <process host="c-6.me" function="slave">
+ <argument value="1"/>
+ </process>
+
+</platform>
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<!-- _________
+ | |
+ | router |
+ ____________|__________|_____________ backbone
+ | | | | | |
+ l0| l1| l2| l97| l96 | | l99
+ | | | ........ | | |
+ | |
+ c-0.me c-99.me
+-->
+<platform version="3">
+<AS id="AS0" routing="Full">
+ <cluster id="my_cluster_1" prefix="c-" suffix=".me"
+ radical="0-99" power="1000000000" bw="125000000" lat="5E-5"
+ bb_bw="2250000000" bb_lat="5E-4"/>
+</AS>
+</platform>
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+
+ <process host="c-30.me" function="master">
+ <argument value="100"/>
+ <argument value="c-160.me"/>
+ <argument value="1"/>
+ </process>
+
+ <process host="c-160.me" function="slave">
+ <argument value="1"/>
+ </process>
+
+</platform>
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+
+<!--
+ __________________________________________________
+ ____|_____ |
+ | | |
+ | router1 | |
+ ____________|__________|_____________ csma1 |
+ | | | | | | |backbone
+ l0| l1| l2| l97| l98| | l99 |
+ | | | ........ | | | |
+ | | |
+ c-0.me c-99.me |
+ ___________________________________________________|
+ ___|______
+ | |
+ | router2 |
+ ____________|__________|_____________ csma2
+ | | | | | |
+ l100|l101| | l197| l198| | l199
+ | | | ........ | | |
+ | |
+ c-100.me c-199.me
+-->
+<AS id="AS0" routing="Full">
+ <cluster id="my_cluster_1" prefix="c-" suffix=".me"
+ radical="0-99" power="1000000000" bw="125000000" lat="5E-5"
+ bb_bw="2250000000" bb_lat="5E-4"/>
+
+ <cluster id="my_cluster_2" prefix="c-" suffix=".me"
+ radical="100-199" power="1000000000" bw="125000000" lat="5E-5"
+ bb_bw="2250000000" bb_lat="5E-4"/>
+
+ <link id="backbone" bandwidth="1250000000" latency="5E-4"/>
+
+ <ASroute src="my_cluster_1" dst="my_cluster_2"
+ gw_src="c-my_cluster_1_router.me"
+ gw_dst="c-my_cluster_2_router.me">
+ <link_ctn id="backbone"/>
+ </ASroute>
+ <ASroute src="my_cluster_2" dst="my_cluster_1"
+ gw_src="c-my_cluster_2_router.me"
+ gw_dst="c-my_cluster_1_router.me">
+ <link_ctn id="backbone"/>
+ </ASroute>
+</AS>
+</platform>
--- /dev/null
+#0)WC_Gla
+#1)WC_Edi
+#2)WC_Manc
+#3)WC_Leeds
+#4)WC_Reading
+#5)WC_London
+#6)WC_Bristol
+#7)WC_Portsmouth
+#8)Gla_router
+#9)Edi_router
+#10)NorMAN
+#11)YHMAN
+#12)EastNet
+#13)LMN
+#14)SWAN_BWEMAN
+#15)TVN
+#16)MidMAN
+#17)NNW_router
+#18)Glasgow
+#19)Edi
+#20)Durham
+#21)Sheffield
+#22)Cam
+#23)UCL
+#24)IC
+#25)QMW
+#26)Brunel
+#27)RHNBC
+#28)Bristol
+#29)RAL
+#30)Oxford
+#31)B_ham
+#32)L_pool
+#33)Manc
+#34)Lanc
+#35)CERN
+0 0 0 10000 10000 0 0 0 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 10000 0 0 10000 0 0 0 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 10000 0 0 10000 10000 0 0 0 0 0 0 0 0 0 0 0 1000 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 10000 10000 0 0 10000 0 0 0 0 622 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 10000 0 0 10000 10000 0 0 0 0 0 0 0 0 622 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 10000 10000 0 0 10000 0 0 0 0 1000 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 10000 0 0 10000 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 155 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+225 1 100000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+320 1 640000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 155 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 1 10000000 0 0 0 0 0 0 0 2500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+<AS id="AS0" routing="Floyd">
+<!--0 WC_Gla-->
+<!--1 WC_Edi-->
+<!--2 WC_Manc-->
+<!--3 WC_Leeds-->
+<!--4 WC_Reading-->
+<!--5 WC_London-->
+<!--6 WC_Bristol-->
+<!--7 WC_Portsmouth-->
+<!--8 Gla_router-->
+<!--9 Edi_router-->
+<!--10 NorMAN-->
+<!--11 YHMAN-->
+<!--12 EastNet-->
+<!--13 LMN-->
+<!--14 SWAN_BWEMAN-->
+<!--15 TVN-->
+<!--16 MidMAN-->
+<!--17 NNW_router-->
+<!--18 Glasgow-->
+<!--19 Edi-->
+<!--20 Durham-->
+<!--21 Sheffield-->
+<!--22 Cam-->
+<!--23 UCL-->
+<!--24 IC-->
+<!--25 QMW-->
+<!--26 Brunel-->
+<!--27 RHNBC-->
+<!--28 Bristol-->
+<!--29 RAL-->
+<!--30 Oxford-->
+<!--31 B_ham-->
+<!--32 L_pool-->
+<!--33 Manc-->
+<!--34 Lanc-->
+<!--35 CERN-->
+ <host id="WC_Edi" power="1"/>
+ <host id="WC_Manc" power="1"/>
+ <host id="Gla_router" power="1"/>
+ <host id="Glasgow" power="20000000"/>
+ <host id="Edi" power="25600000"/>
+ <host id="Durham" power="4134000"/>
+ <host id="Sheffield" power="49640000"/>
+ <host id="Cam" power="1320000"/>
+ <host id="UCL" power="22500000"/>
+ <host id="IC" power="440000000"/>
+ <host id="QMW" power="44000000"/>
+ <host id="Brunel" power="85680000"/>
+ <host id="RHNBC" power="7200000"/>
+ <host id="Bristol" power="60000000"/>
+ <host id="RAL" power="556956000"/>
+ <host id="Oxford" power="156560000"/>
+ <host id="B_ham" power="13500000"/>
+ <host id="L_pool" power="308070000"/>
+ <host id="Manc" power="22500000"/>
+ <host id="Lanc" power="204800000"/>
+ <host id="CERN" power="1"/>
+
+ <router id="WC_Gla"/>
+ <router id="WC_Leeds"/>
+ <router id="WC_Reading"/>
+ <router id="WC_London"/>
+ <router id="WC_Bristol"/>
+ <router id="WC_Portsmouth"/>
+ <router id="Edi_router"/>
+ <router id="NorMAN"/>
+ <router id="YHMAN"/>
+ <router id="EastNet"/>
+ <router id="LMN"/>
+ <router id="SWAN_BWEMAN"/>
+ <router id="TVN"/>
+ <router id="MidMAN"/>
+ <router id="NNW_router"/>
+
+ <link id="link0" bandwidth="10000"/>
+ <link id="link1" bandwidth="10000"/>
+ <link id="link2" bandwidth="1000"/>
+ <link id="link3" bandwidth="10000"/>
+ <link id="link4" bandwidth="1000"/>
+ <link id="link5" bandwidth="10000"/>
+ <link id="link6" bandwidth="10000"/>
+ <link id="link7" bandwidth="1000"/>
+ <link id="link8" bandwidth="1000"/>
+ <link id="link9" bandwidth="10000"/>
+ <link id="link10" bandwidth="622"/>
+ <link id="link11" bandwidth="1000"/>
+ <link id="link12" bandwidth="10000"/>
+ <link id="link13" bandwidth="10000"/>
+ <link id="link14" bandwidth="622"/>
+ <link id="link15" bandwidth="10000"/>
+ <link id="link16" bandwidth="1000"/>
+ <link id="link17" bandwidth="1000"/>
+ <link id="link18" bandwidth="10000"/>
+ <link id="link19" bandwidth="622"/>
+ <link id="link20" bandwidth="2500"/>
+ <link id="link21" bandwidth="1000"/>
+ <link id="link22" bandwidth="1000"/>
+ <link id="link23" bandwidth="155"/>
+ <link id="link24" bandwidth="155"/>
+ <link id="link25" bandwidth="155"/>
+ <link id="link26" bandwidth="155"/>
+ <link id="link27" bandwidth="155"/>
+ <link id="link28" bandwidth="155"/>
+ <link id="link29" bandwidth="155"/>
+ <link id="link30" bandwidth="155"/>
+ <link id="link31" bandwidth="622"/>
+ <link id="link32" bandwidth="622"/>
+ <link id="link33" bandwidth="622"/>
+ <link id="link34" bandwidth="622"/>
+ <link id="link35" bandwidth="155"/>
+ <link id="link36" bandwidth="1000"/>
+ <link id="link37" bandwidth="155"/>
+
+ <route src="WC_Gla" dst="WC_Gla">
+ <link_ctn id="link0"/>
+ </route>
+ <route src="WC_Gla" dst="WC_Edi">
+ <link_ctn id="link1"/>
+ </route>
+ <route src="WC_Gla" dst="WC_Portsmouth">
+ <link_ctn id="link2"/>
+ </route>
+ <route src="WC_Edi" dst="WC_Manc">
+ <link_ctn id="link3"/>
+ </route>
+ <route src="WC_Edi" dst="Gla_router">
+ <link_ctn id="link4"/>
+ </route>
+ <route src="WC_Manc" dst="WC_Manc">
+ <link_ctn id="link5"/>
+ </route>
+ <route src="WC_Manc" dst="WC_Leeds">
+ <link_ctn id="link6"/>
+ </route>
+ <route src="WC_Manc" dst="TVN">
+ <link_ctn id="link7"/>
+ </route>
+ <route src="WC_Manc" dst="MidMAN">
+ <link_ctn id="link8"/>
+ </route>
+ <route src="WC_Leeds" dst="WC_Reading">
+ <link_ctn id="link9"/>
+ </route>
+ <route src="WC_Leeds" dst="Edi_router">
+ <link_ctn id="link10"/>
+ </route>
+ <route src="WC_Leeds" dst="NorMAN">
+ <link_ctn id="link11"/>
+ </route>
+ <route src="WC_Reading" dst="WC_Reading">
+ <link_ctn id="link12"/>
+ </route>
+ <route src="WC_Reading" dst="WC_London">
+ <link_ctn id="link13"/>
+ </route>
+ <route src="WC_Reading" dst="SWAN_BWEMAN">
+ <link_ctn id="link14"/>
+ </route>
+ <route src="WC_London" dst="WC_Bristol">
+ <link_ctn id="link15"/>
+ </route>
+ <route src="WC_London" dst="YHMAN">
+ <link_ctn id="link16"/>
+ </route>
+ <route src="WC_London" dst="EastNet">
+ <link_ctn id="link17"/>
+ </route>
+ <route src="WC_Bristol" dst="WC_Bristol">
+ <link_ctn id="link18"/>
+ </route>
+ <route src="WC_Bristol" dst="LMN">
+ <link_ctn id="link19"/>
+ </route>
+ <route src="WC_Portsmouth" dst="Lanc">
+ <link_ctn id="link20"/>
+ </route>
+ <route src="Gla_router" dst="NNW_router">
+ <link_ctn id="link21"/>
+ </route>
+ <route src="Edi_router" dst="Glasgow">
+ <link_ctn id="link22"/>
+ </route>
+ <route src="NorMAN" dst="Edi">
+ <link_ctn id="link23"/>
+ </route>
+ <route src="YHMAN" dst="Durham">
+ <link_ctn id="link24"/>
+ </route>
+ <route src="EastNet" dst="Sheffield">
+ <link_ctn id="link25"/>
+ </route>
+ <route src="LMN" dst="Cam">
+ <link_ctn id="link26"/>
+ </route>
+ <route src="LMN" dst="UCL">
+ <link_ctn id="link27"/>
+ </route>
+ <route src="LMN" dst="IC">
+ <link_ctn id="link28"/>
+ </route>
+ <route src="LMN" dst="QMW">
+ <link_ctn id="link29"/>
+ </route>
+ <route src="LMN" dst="Brunel">
+ <link_ctn id="link30"/>
+ </route>
+ <route src="SWAN_BWEMAN" dst="RHNBC">
+ <link_ctn id="link31"/>
+ </route>
+ <route src="TVN" dst="Bristol">
+ <link_ctn id="link32"/>
+ </route>
+ <route src="TVN" dst="RAL">
+ <link_ctn id="link33"/>
+ </route>
+ <route src="MidMAN" dst="Oxford">
+ <link_ctn id="link34"/>
+ </route>
+ <route src="NNW_router" dst="B_ham">
+ <link_ctn id="link35"/>
+ </route>
+ <route src="NNW_router" dst="L_pool">
+ <link_ctn id="link36"/>
+ </route>
+ <route src="NNW_router" dst="Manc">
+ <link_ctn id="link37"/>
+ </route>
+</AS>
+</platform>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network_ns3, surf,
"Logging specific to the SURF network NS3 module");
+#define MAX_LENGHT_IPV4 16 //255.255.255.255\0
+
extern routing_global_t global_routing;
extern xbt_dict_t dict_socket;
{
char *temp = xbt_strdup(bdw);
xbt_free(bdw);
- bdw = bprintf("%fbps",atof(temp));
+ bdw = bprintf("%fBps",atof(temp));
xbt_free(temp);
}
ns3_add_host(A_surfxml_host_id)
);
}
+
+static void ns3_free_dynar(void * elmts){
+ if(elmts)
+ free(elmts);
+ return;
+}
+
void parse_ns3_add_link(void)
{
XBT_DEBUG("NS3_ADD_LINK '%s'",A_surfxml_link_id);
- if(!IPV4addr) IPV4addr = xbt_dynar_new(sizeof(char*),free);
+ if(!IPV4addr) IPV4addr = xbt_dynar_new(MAX_LENGHT_IPV4*sizeof(char),ns3_free_dynar);
tmgr_trace_t bw_trace;
tmgr_trace_t state_trace;
}
}
-
-
//Create links
unsigned int cpt;
int elmts;
{
XBT_DEBUG("Starting topology generation");
+ xbt_dynar_shrink(IPV4addr,0);
+
//get the onelinks from the parsed platform
xbt_dynar_t onelink_routes = global_routing->get_onelink_routes();
if (!onelink_routes)
if( strcmp(src,dst) && ((surf_ns3_link_t)link)->created){
XBT_DEBUG("Route from '%s' to '%s' with link '%s'",src,dst,((surf_ns3_link_t)link)->data->id);
- char * link_bdw = bprintf("%sBps",((surf_ns3_link_t)link)->data->bdw);
- char * link_lat = bprintf("%ss",(((surf_ns3_link_t)link)->data->lat));
+ char * link_bdw = bprintf("%s",((surf_ns3_link_t)link)->data->bdw);
+ char * link_lat = bprintf("%s",(((surf_ns3_link_t)link)->data->lat));
+ replace_lat_ns3(link_lat);
+ replace_bdw_ns3(link_bdw);
((surf_ns3_link_t)link)->created = 0;
// XBT_DEBUG("src (%s), dst (%s), src_id = %d, dst_id = %d",src,dst, src_id, dst_id);
ns3_simulator(min);
time_to_next_flow_completion = ns3_time() - surf_get_clock();
+// XBT_INFO("min : %f",min);
+// XBT_INFO("ns3 time : %f",ns3_time());
+// XBT_INFO("surf time : %f",surf_get_clock());
+
xbt_assert(time_to_next_flow_completion,
"Time to next flow completion not initialized!\n");
char* addr = (char*)xbt_dynar_get_ptr(IPV4addr,node2->node_num);
- XBT_INFO("ns3_create_flow %d Bytes from %d to %d with Interface %s",TotalBytes, node1->node_num, node2->node_num,addr);
+ XBT_DEBUG("ns3_create_flow %d Bytes from %d to %d with Interface %s",TotalBytes, node1->node_num, node2->node_num,addr);
ns3_sim->create_flow_NS3(src_node,
dst_node,
port_number,
number_of_links++;
}
XBT_DEBUG("Number of nodes in Cluster_nodes: %d",Cluster_nodes.GetN());
-
}
void * ns3_add_AS(char * id)
static char* transformIpv4Address (Ipv4Address from){
std::stringstream sstream;
- sstream << interfaces.GetAddress(interfaces.GetN()-2);
+ sstream << from ;
std::string s = sstream.str();
size_t size = s.size() + 1;
char* IPaddr = bprintf("%s",s.c_str());
free(adr);
interfaces.Add(address.Assign (netA));
+ XBT_DEBUG("Have write '%s' for Node '%d'",transformIpv4Address(interfaces.GetAddress(interfaces.GetN()-2)),src);
xbt_dynar_set(IPV4addr,src,
transformIpv4Address(interfaces.GetAddress(interfaces.GetN()-2)));
+ XBT_DEBUG("Have write '%s' for Node '%d'",transformIpv4Address(interfaces.GetAddress(interfaces.GetN()-1)),dst);
xbt_dynar_set(IPV4addr,dst,
transformIpv4Address(interfaces.GetAddress(interfaces.GetN()-1)));
toWrite = min (toWrite, localSocket->GetTxAvailable ());
int amountSent = localSocket->Send (&data[0], toWrite, 0);
-// cout << Simulator::Now () << " AmountSend: " << amountSent << " Towrite: " << toWrite << endl;
if(amountSent < 0)
return;
(mysocket->sentBytes) += amountSent;