p2psim: faqHow many nodes can I simulate?
It mostly depends on the complexity of your protocol, but we simulate Chord with 3000 nodes in a very reasonable amount of time.
Where do I find more documentation?
Use the source, Luke. In other words: the source and this website are the documentation. Barry Demchak (bdemchak [at] tpsoft [dot] com) was kind enough to create this 3-page overview of most C++ classes in p2psim. Other than that, we're not hiding anything. Feel free to ask us specific questions.
Does p2psim compile/run in Cygwin?
Probably not, but you could try. Let us know if you get it to work.
Where can I find more interesting topologies?
We have made our "King" data set public, which can be easily used with p2psim. Read its README for more information.
How do I compile p2psim?
Please read the howto.
How do I simulate protocol X?
In general, you can use scripts/run-simulations.pl. For example:
scripts/run-simulations.pl --protocol Chord \ --topology your_favorate_topology_file \ --logdir . --args examples/chord_args
There is an argument file for every protocol we support in examples/ directory. It specifies all the protocol parameter combinations and the event file parameter. All log files will be generated in the current directory.
How do I interpret the output logfiles?
A typical log file looks like this:
BW_PER_TYPE:: 0:22361596 1:4217912 2:0 3:2275174 4:0 5:1953763 6:224230
BW_TOTALS:: time(s):10800.000 live_time(s/node):5726.899 nodes:1024 overall_bw(bytes/node/s):2.806 live_bw(bytes/node/s):5.292
BW_PERNODE_IN:: 1p:2.285 5p:3.279 10p:3.899 50p:5.337 90p:6.028 95p:6.217 99p:6.632 100p:7.264 avg:5.120
BW_PERNODE:: 1p:1.910 5p:2.891 10p:3.486 50p:5.362 90p:6.478 95p:6.715 99p:7.318 100p:8.025 avg:5.174
LOOKUP_RATES:: success:0.999 incorrect:0.001 failed:0.000
CORRECT_LOOKUPS:: lookup_10th:64 lookup_mean:237.202 lookup_median:193 lookup_90th:417 stretch_10th:0.985 stretch_mean:1.721 stretch_median:1.111 stretch_90th:2.550 hops_10th:1 hops_mean:2.441 hops_median:2 hops_90th:4 numlookups:9268
INCORRECT_LOOKUPS:: lookup_10th:69 lookup_mean:143.400 lookup_median:136 lookup_90th:217 stretch_10th:0.690 stretch_mean:1.434 stretch_median:1.360 stretch_90th:2.170 hops_10th:2 hops_mean:2.400 hops_median:2 hops_90th:3 numlookups:5
FAILED_LOOKUPS:: lookup_10th:0 lookup_mean:65637.000 lookup_median:4967 lookup_90th:252613 stretch_10th:0.000 stretch_mean:656.370 stretch_median:49.675 stretch_90th:2526.130 hops_10th:0 hops_mean:4.500 hops_median:4 hops_90th:9 numlookups:4
OVERALL_LOOKUPS:: lookup_10th:64 lookup_mean:265.350 lookup_median:193 lookup_90th:418 stretch_10th:0.985 stretch_mean:2.003 stretch_median:1.111 stretch_90th:2.553 hops_10th:1 hops_mean:2.441 hops_median:2 hops_90th:4 numlookups:9277
TIMEOUTS_PER_LOOKUP:: time_timeout_10th:0 time_timeout_mean:32.480 time_timeout_median:0 time_timeout_90th:0 num_timeout_10th:0.000 num_timeout_mean:0.088 num_timeout_median:0.000 num_timeout_90th:0.000
WORST_BURST:: in:29.8487 out:37.634
RTABLE:: 10p:65 50p:129 90p:241 avg:143.15
The BW_TOTALS line shows the overall bandwidth usage in the simulation, the total time of the recorded simulation time (10800.000), the total recorded time nodes are alive in the system (5726.899), total number of nodes (1024). The overall bandwidth(2.806) which is the total number of bytes sent out by all nodes (add up all BW_PER_TYPE numbers) divided by the total recorded time. The live_bw(5.292) calculates the total number of bytes sent by all nodes divided by the total recorded time nodes are ALIVE in the system
The BW_PER_TYPE line shows the overall bytes usage in the simulation, break down by different types. 0 is the universal user lookup message (including forwarded DHT lookups) type number. So this log file says 22361596 bytes of lookup messages are sent in the entire simulation. The meaning of the rest of the message types is specified in chord.h
BW_PERNODE_IN logs the incoming bytes seen by each node averaged over its life time. The average, median etc.
BW_PERNODE logs the outgoing bytes sent out by each node averaged over its life time.
LOOKUP_RATES specifies how many lookups have correctly found their responsible nodes corresponding to the lookup key based on simulator's global knowledge.
CORRECT_LOOKUPS logs the lookup latency, hops, stretch, for all correct lookups.
INCORRECT_LOOKUPS logs the lookup latency, hops, stretch, for all incorrect lookups.
FAILED_LOOKUPS logs the lookup latency, hops, stretch, for all failed lookups.
TIMEOUTS_PER_LOOKUP logs the time and number of timeouts incurred during lookups.
RTABLE logs the routing table size
How do I plot graphs with log filesYou can do whatever you like to visulize the results from logfiles. But p2psim provides a standard tool (scripts/make-graph.pl) to help you generate gnuplot graphs easily.
To summarize all logfiles into a single statistics file.
scripts/merge-stats.pl --args examples/chord_args *.log > chord_outTo plot a graph with average lookup latency for correct lookups on y-axis and average bandwidth consumption by live node on x-axis in convex-hull segment style. For discussion for convex-hull segment method to outline the best performance vs. cost tradeoffs, refer to our INFOCOM'05 paper. Do this:
scripts/make-graph.pl --dat chord_out --x BW_TOTALS:live_bw --y CORRECT_LOOKUPS:lookup_mean --convex both
You can plot various output statistics or even protocol parameters (e.g. param:basictimer plots the successor stabilization timer used in chord_out), color different parameter values differently etc. Read the code scripts/make-graph.pl for more advanced features.
How do I create my own protocol?
protocols/sillyprotocol.h and protocols/sillyprotocol.C contain the outline of a new, but unimplemented peer-to-peer protocol. Implement
lookup() to your liking. Look
at the other protocols (in the protocols/ directory) for more example
code. Then run your SillyProtocol as follows:
p2psim/p2psim example/silly-prot.txt example/silly-top.txt example/silly-events.txtDon't hesitate to ask us questions.
configure chokes on GTK stuff and creates no Makefile
Comment out line 16-20 in configure.in:
... dnl PKG_CHECK_MODULES(GSTUFF, gtk+-.... dnl AM_CONDITIONAL(GTK_AVAILABLE, test "$GSTUFF_CFLAGS") dnl AC_SUBST(GSTUFF_CFLAGS) dnl AC_SUBST(GSTUFF_LIBS) ...and re-run setup and configure.
Alternatively, you could install the appropriate GTK header files and libraries. However, this is only necessary to compile vis---a visualizer---which is not required to run p2psim.
Is there a p2psim mailing list?
Why the original name ``p2psim''?
Yeah, we like it too. Thanks.
Why the daisies?
Because we feel happy.
This lousy faq doesn't answer my question!
You can contact us.