correct flow value
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Thu, 21 May 2009 17:22:30 +0100
changeset 3994 96eda17b4423
parent 3993 a9c9a1d9eb80
child 3995 b6a5161b3149
correct flow value
utils/flowmon/flowmon-bench.py
--- a/utils/flowmon/flowmon-bench.py	Thu May 21 15:04:25 2009 +0100
+++ b/utils/flowmon/flowmon-bench.py	Thu May 21 17:22:30 2009 +0100
@@ -71,9 +71,9 @@
     port = 9   # Discard port(RFC 863)
     onOffHelper = ns3.OnOffHelper("ns3::UdpSocketFactory",
                                   ns3.Address(ns3.InetSocketAddress(ns3.Ipv4Address("10.0.0.1"), port)))
-    onOffHelper.SetAttribute("DataRate", ns3.DataRateValue(ns3.DataRate("95.5145551456kbps")))
-    onOffHelper.SetAttribute("OnTime", ns3.RandomVariableValue(ns3.ConstantVariable(0.9)))
-    onOffHelper.SetAttribute("OffTime", ns3.RandomVariableValue(ns3.UniformVariable(0, 0.02)))
+    onOffHelper.SetAttribute("DataRate", ns3.DataRateValue(ns3.DataRate("94.4649446494kbps")))
+    onOffHelper.SetAttribute("OnTime", ns3.RandomVariableValue(ns3.ConstantVariable(1)))
+    onOffHelper.SetAttribute("OffTime", ns3.RandomVariableValue(ns3.ConstantVariable(0)))
 
     nodes = []
     for yi in range(num_nodes_side):
@@ -107,6 +107,8 @@
     # -- compute the static routes --
     ns3.GlobalRouteManager.PopulateRoutingTables()
 
+    start_time_rng = ns3.UniformVariable(0.1, 0.2)
+
     # -- create the flows --
     for yi in xrange(num_nodes_side):
         for xi in xrange(num_nodes_side-flow_hops):
@@ -116,13 +118,13 @@
             destaddr = get_node_address(nodes[yi][xi+flow_hops])
             onOffHelper.SetAttribute("Remote", ns3.AddressValue(ns3.InetSocketAddress(destaddr, port)))
             app = onOffHelper.Install(ns3.NodeContainer(nodes[yi][xi]))
-            app.Start(ns3.Seconds(0))
+            app.Start(ns3.Seconds(start_time_rng.GetValue()))
             
             # flow from node (yi, xi+flow_hops) to (yi, xi)
             destaddr = get_node_address(nodes[yi][xi])
             onOffHelper.SetAttribute("Remote", ns3.AddressValue(ns3.InetSocketAddress(destaddr, port)))
             app = onOffHelper.Install(ns3.NodeContainer(nodes[yi][xi+flow_hops]))
-            app.Start(ns3.Seconds(0))
+            app.Start(ns3.Seconds(start_time_rng.GetValue()))
 
 
     # -- create the flow monitor, if requested --