sim/conf/two-node.conf
changeset 0 2b3e5ec03512
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sim/conf/two-node.conf	Thu Apr 21 14:57:45 2011 +0100
@@ -0,0 +1,72 @@
+#
+# Simple two node unidirectional simulation
+#
+
+# Import all the test utilities
+set base_test_dir [pwd]
+while {! [file exists "$base_test_dir/sim/sim-test-utils.tcl"] } {
+    set base_test_dir [file dirname $base_test_dir]
+    if {$base_test_dir == "/"} {
+        error "must run this script from a DTN2 subdirectory"
+    }
+}
+source $base_test_dir/sim/sim-test-utils.tcl
+
+#
+# global simulation parameters
+#
+set opt(route_type) static
+set opt(link_type)  ALWAYSON
+set opt(size)       1024
+set opt(reps)       1
+set opt(interval)   10
+set opt(bw)         100kbps
+set opt(latency)    1s
+set opt(expiration) 1000000000
+
+#
+# parse command line params
+#
+parse_opts
+
+# 
+# Set up the routing state
+#
+sim set route_type $opt(route_type)
+
+#
+# create two nodes and configure their local addresses
+#
+sim create_node n0
+sim create_node n1
+
+n0 route local_eid dtn://n0
+n1 route local_eid dtn://n1
+
+#
+# set the connectivity parameters to activate at time 1
+#
+conn set type static
+conn up n0 n1 bw=$opt(bw) latency=$opt(latency)
+
+#
+# add a registration on node 1
+#
+n1 registration add dtn://n1/*
+
+#
+# now add a link and a route from 0 to 1
+#
+n0 link add link-n1 n1 $opt(link_type) sim
+n0 route add dtn://n1/* link-n1
+
+#
+# start the traffic agent at time 2 to send a bundle
+#
+sim at 2 n0 tragent dtn://n0/src dtn://n1/dst size=$opt(size) \
+    reps=$opt(reps) interval=$opt(interval) expiration=$opt(expiration)
+
+#
+# dump statistics when we're done
+#
+sim at exit dtn::dump_stats