Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge the two wifi platform files
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 22 Sep 2019 23:19:48 +0000 (01:19 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 22 Sep 2019 23:27:58 +0000 (01:27 +0200)
And rename the result to simply 'wifi.xml'

examples/platforms/wifi.xml [new file with mode: 0755]
examples/platforms/wifi/1STA-1LINK-1NODE.xml [deleted file]
examples/platforms/wifi/2STA.xml [deleted file]
teshsuite/surf/wifi_usage/1STA-1LINK-1NODE.tesh
teshsuite/surf/wifi_usage/2STA.cpp
teshsuite/surf/wifi_usage/2STA.tesh

diff --git a/examples/platforms/wifi.xml b/examples/platforms/wifi.xml
new file mode 100755 (executable)
index 0000000..fed5614
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version='1.0'?>
+
+<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
+<platform version="4.1">
+  <zone id="world" routing="Full">
+
+    <zone id="WIFI zone" routing="Cluster">
+        <!-- First declare the Access Point (ie, the wifi media) -->
+        <link id="AP1" sharing_policy="WIFI" bandwidth="54Mbps" latency="0ms" />
+
+        <!-- Two stations in the wifi zone -->
+        <host id="Station 1" speed="100.0Mf,50.0Mf,20.0Mf" />
+        <host id="Station 2" speed="100.0Mf,50.0Mf,20.0Mf" />
+
+        <!-- Specify that stations use the WIFI link for every communication (incoming or outgoing) -->
+        <host_link id="Station 1" up="AP1" down="AP1"/>
+        <host_link id="Station 2" up="AP1" down="AP1"/>
+
+        <router id="WIFI router"/>
+    </zone>
+
+
+    <!-- NODE1 AS -->
+    <zone id="Wired zone" routing="Full">
+      <host id="NODE1" speed="100.0Mf,50.0Mf,20.0Mf" />
+    </zone>
+    
+
+    <!-- AS Routing -->
+    <link id="Collector" sharing_policy="SHARED" bandwidth="100Mbps" latency="0ms" />
+    <zoneRoute src="WIFI zone" dst="Wired zone" gw_src="WIFI router" gw_dst="NODE1">
+      <link_ctn id="Collector" />
+    </zoneRoute>
+    
+  </zone>
+</platform>
diff --git a/examples/platforms/wifi/1STA-1LINK-1NODE.xml b/examples/platforms/wifi/1STA-1LINK-1NODE.xml
deleted file mode 100755 (executable)
index 19991cb..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version='1.0'?>
-
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4.1">
-  <zone id="world" routing="Full">
-
-    <!-- WIFI cell -->
-    <zone id="AP1 zone" routing="Cluster">
-      <host id="STA1" speed="100.0Mf,50.0Mf,20.0Mf" />
-      <router id="AP1 router"/>
-
-      <!-- Access Point -->
-      <link id="AP1" sharing_policy="WIFI" bandwidth="54Mbps" latency="0ms" />
-         
-      <host_link id="STA1" up="AP1" down="AP1"/>
-    </zone>
-
-
-    <!-- NODE1 AS -->
-    <zone id="AS1" routing="Full">
-      <host id="NODE1" speed="100.0Mf,50.0Mf,20.0Mf" />
-    </zone>
-    
-
-    <!-- AS Routing -->
-    <link id="LINK1" sharing_policy="SHARED" bandwidth="100Mbps" latency="0ms" />
-    <zoneRoute src="AP1 zone" dst="AS1" gw_src="AP1 router" gw_dst="NODE1">
-      <link_ctn id="LINK1" />
-    </zoneRoute>
-    
-  </zone>
-</platform>
diff --git a/examples/platforms/wifi/2STA.xml b/examples/platforms/wifi/2STA.xml
deleted file mode 100755 (executable)
index bcd9711..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version='1.0'?>
-
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4.1">
-    <zone id="world" routing="Cluster">
-        <!-- Access Point -->
-        <link id="AP1" sharing_policy="WIFI" bandwidth="54Mbps" latency="0ms" />
-
-        <host id="STA1" speed="100.0Mf,50.0Mf,20.0Mf" />
-        <host_link id="STA1" up="AP1" down="AP1"/>
-
-        <host id="STA2" speed="100.0Mf,50.0Mf,20.0Mf" />
-        <host_link id="STA2" up="AP1" down="AP1"/>
-    </zone>
-</platform>
index accf3d0..05194f7 100644 (file)
@@ -1,12 +1,12 @@
 #!/usr/bin/env tesh
 
 p Test WITH crosstraffic
-$ ${bindir:=.}/1STA-1LINK-1NODE ${platfdir}/wifi/1STA-1LINK-1NODE.xml
+$ ${bindir:=.}/1STA-1LINK-1NODE ${platfdir}/wifi.xml
 > [Station 1:sender:(1) 0.000156] [simulator/INFO] Station 1 sent 1000 bytes to NODE1 in 0.000156 seconds from 0.000000 to 0.000156
 > [0.000156] [simulator/INFO] Simulation took 0.000156s
 
 p Test WITHOUT crosstraffic
-$ ${bindir:=.}/1STA-1LINK-1NODE ${platfdir}/wifi/1STA-1LINK-1NODE.xml --cfg=network/crosstraffic:0
+$ ${bindir:=.}/1STA-1LINK-1NODE ${platfdir}/wifi.xml --cfg=network/crosstraffic:0
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/crosstraffic' to '0'
 > [Station 1:sender:(1) 0.000148] [simulator/INFO] Station 1 sent 1000 bytes to NODE1 in 0.000148 seconds from 0.000000 to 0.000148
 > [0.000148] [simulator/INFO] Simulation took 0.000148s
index a8d1dbe..1ac77c1 100644 (file)
@@ -46,14 +46,14 @@ void setup_simulation()
 {
 
   std::vector<std::string> args, noArgs;
-  args.push_back("STA2");
+  args.push_back("Station 2");
   args.push_back("1000");
-  simgrid::s4u::Actor::create("STA1", simgrid::s4u::Host::by_name("STA1"), flowActor, args);
-  simgrid::s4u::Actor::create("STA2", simgrid::s4u::Host::by_name("STA2"), flowActor, noArgs);
+  simgrid::s4u::Actor::create("sender", simgrid::s4u::Host::by_name("Station 1"), flowActor, args);
+  simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name("Station 2"), flowActor, noArgs);
   simgrid::kernel::resource::NetworkWifiLink* l =
       (simgrid::kernel::resource::NetworkWifiLink*)simgrid::s4u::Link::by_name("AP1")->get_impl();
-  l->set_host_rate(simgrid::s4u::Host::by_name("STA1"), 0);
-  l->set_host_rate(simgrid::s4u::Host::by_name("STA2"), 0);
+  l->set_host_rate(simgrid::s4u::Host::by_name("Station 1"), 0);
+  l->set_host_rate(simgrid::s4u::Host::by_name("Station 2"), 0);
 }
 
 static void flowActor(std::vector<std::string> args)
index d06cd8f..b0cf6a2 100644 (file)
@@ -1,10 +1,10 @@
 #!/usr/bin/env tesh
 
-$ ${bindir:=.}/2STA ${platfdir}/wifi/2STA.xml --cfg=network/crosstraffic:0
+$ ${bindir:=.}/2STA ${platfdir}/wifi.xml --cfg=network/crosstraffic:0
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/crosstraffic' to '0'
-> [STA1:STA1:(1) 0.000296] [simulator/INFO] STA1 sent 1000 bytes to STA2 in 0.000296 seconds from 0.000000 to 0.000296
+> [Station 1:sender:(1) 0.000296] [simulator/INFO] Station 1 sent 1000 bytes to Station 2 in 0.000296 seconds from 0.000000 to 0.000296
 > [0.000296] [simulator/INFO] Simulation took 0.000296s
 
-$ ${bindir:=.}/2STA ${platfdir}/wifi/2STA.xml
-> [STA1:STA1:(1) 0.000311] [simulator/INFO] STA1 sent 1000 bytes to STA2 in 0.000311 seconds from 0.000000 to 0.000311
+$ ${bindir:=.}/2STA ${platfdir}/wifi.xml
+> [Station 1:sender:(1) 0.000311] [simulator/INFO] Station 1 sent 1000 bytes to Station 2 in 0.000311 seconds from 0.000000 to 0.000311
 > [0.000311] [simulator/INFO] Simulation took 0.000311s