Added copyright message to the big buck bunny stream for ccnx planetlab experiments
[nepi.git] / examples / ccnx / planetlab_ccnx_multicast.py
index 62a33c6..cb8bf6b 100644 (file)
@@ -1,5 +1,20 @@
 #!/usr/bin/env python
 
+##
+## Experiment topology:
+## 
+##  ccncatchunks                                ccnsendchunks
+##       |                                            |
+##       .->  node1 -- .. -- nodei -- .. -- nodeN   <-.
+##    
+##
+##  - Nodes are connected through an overlay network over the Intenet
+##  - On each node runs a CCNx daemon
+##  - Static multicast entries are added to the CCNx FIB on each node to communicate them in series.
+##    (Nodes only have FIB entries to at most two nodes)
+##
+
+
 from nepi.core.design import ExperimentDescription, FactoriesProvider
 from nepi.core.execute import ExperimentController
 from nepi.util.constants import ApplicationStatus as AS
@@ -33,7 +48,10 @@ def create_slice_desc(slicename, plc_host, pl_user, pl_pwd, pl_ssh_key,
     slice_desc.set_attribute_value("plcHost", plc_host)
     slice_desc.set_attribute_value("tapPortBase", port_base)
     # Kills all running processes before starting the experiment
-    slice_desc.set_attribute_value("dedicatedSlice", True)
+    slice_desc.set_attribute_value("cleanProc", True)
+    # NOTICE: Setting 'cleanHome' to 'True' will erase all previous
+    # folders in the sliver Home directory, including result files!
+    #slice_desc.set_attribute_value("cleanHome", True)
     slice_desc.set_attribute_value("plLogLevel", "DEBUG")
     return slice_desc
  
@@ -98,7 +116,13 @@ def exec_ccncatchunks(slicename, hostname):
     login = "%s@%s" % (slicename, hostname)
     command = 'PATH=$PATH:$(ls | egrep nepi-ccnd- | head -1)/bin; ccncatchunks2 ccnx:/VIDEO'
     proc1 = subprocess.Popen(['ssh', login, command], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell = False)
-    proc2 = subprocess.Popen(['vlc', '-'], stdin=proc1.stdout, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    proc2 = subprocess.Popen(['vlc', 
+        '--sub-filter', 'marq', 
+        '--marq-marquee', 
+        '(c) copyright 2008, Blender Foundation / www.bigbuckbunny.org', 
+        '--marq-position=8', 
+        '--no-video-title-show',  '-'], 
+        stdin=proc1.stdout, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     return proc2
 
 def create_ed(hostnames, vsys_vnet, slicename, plc_host, pl_user, pl_pwd, pl_ssh_key, 
@@ -137,7 +161,7 @@ def create_ed(hostnames, vsys_vnet, slicename, plc_host, pl_user, pl_pwd, pl_ssh
     # Calculate the number of virtual networks required to connect all the nodes 
     # with all other nodes as the binomial coeficient C(n, 2), with n = #nodes
     n = len(hostnames)
-    c = math.factorial(n) / (2 * math.factorial(n-2)) 
+    c = n * (n-1) / 2
 
     # Validate that we can get 'c' /30 subnetworks
     if c > math.pow(2, (30 - base.prefixlen)):