© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 1 ns-2 TCP Simulations with The Network Simulation Cradle Sam Jansen and Anthony McGregor
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 2 About the authors ● The Network Simulation Cradle was developed as part of my PhD studies ● Worked on at the WAND Network Research Group of Waikato University, Hamilton, New Zealand ● Project started in 2003 ● Supervised by Associate Professor Tony McGregor
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 3 The Network Simulation Cradle ● The Network Simulation Cradle is a project that aims to increase the accuracy of TCP network simulation ● Allows Linux, FreeBSD, OpenBSD network stacks to be used as simulation models ● Incorporated with the ns-2 network simulator (some work on supporting other simulators as well such as OMNeT++) ● First presented at the 2005 Winter Simulation Conference ● Will be briefly introduced next ● The focus of this talk is on practical applications of this simulation framework
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 4 The Network Simulation Cradle ● Traditional network simulators (e.g., ns-2) use simplified models of TCP ● Data possibly only flows in one direction ● Packets may be assumed to be of maximum size ● No flow control ● Not modeled after real specific TCP implementations ● This can work quite well for a number of situations, but we might want more accuracy – ideally a model that captures exactly how real implementations work ● The Network Simulation Cradle provides this
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 5 Architecture Networ k Stack Cradle (shared lib) NSC TCP model Network simulator (ns-2) NSC TCP model Networ k Stack Cradle (shared lib) Network Stack Cradle (shared lib) TCP IP Socket API Simulation API connect, send, packet received, timer, read send packet Virtualised Resources Virtualised Resources Virtualised Resources liblinux so libfreebsd5.3.so
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 6 Accuracy ● Have shown NSC to be very accurate – able to produce packet traces that are almost identical to traces measured from a test network
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 7 Accuracy part two Linux TCP undergoing packet loss
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 8 ns-2 has good models: is NSC worth it? ● ns-2 is widely known to have well validated, if abstracted, TCP models ● Does NSC really cast any further light on simulation scenarios? ● Yes! ● And with very little effort – often only couple of lines of code needs to be changed in the simulation script ● Simulation results follow...
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 9 TCP benchmarks ● With NSC we can compare TCP implementations over a range of network scenarios easily and evaluate a set of metrics ● What if we come up with a somewhat constrained simulation scenario and run thousands upon thousands of simulations then evaluate the statistics to compare the implementations? ● We did this: ● A set of 99 recent desktop computers ● Months of simulations resulted in almost 5 cpu-years worth of simulating
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 10 Setup ● Not really a good set of benchmarks, more an illustration of an idea ● Dumb-bell topology, sets of “forward” and “reverse” flows ● Different TCP implementations used for the flows ● “Goodput” of one TCP flow measured ● Comparisons of TCP models with differing loss, bw, latency, etc.
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 11 Some results ● If we compare two ns-2 TCP variants: Newreno and Sack – we see that they are fairly similar ● Only a small percentage of the time is there much of a difference in goodput recorded
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 12 Further results ● But if we compare two real TCP implementations, Linux 2.6 and FreeBSD ● Here we can see many more differences ● On their own, these results do not tell us a lot, but this illustrates a kind of testing and research that is available with NSC
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 13 So we can compare TCP in simple scenarios: so what? ● We can reproduce work as well ● We have established that there can be a large difference in performance between implementations ● This result is perhaps ignored in some previous simulation research: we can use NSC to see if using real TCP implementations affects results ● Validation tool ● Provides further insight into scenarios
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 14 Scenario 1: SIP ● Reproduction of research into using TCP as a transport for Session Initiation Protocol “Invite” messages between proxies ● A number of TCP variants were used with varying network conditions between the proxies Proxies TCP flow Internet
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 15 SIP results ● Various simulations were carried out, including testing response time when there is a small amount of random packet loss occurring between the proxies
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 16 2: High bandwidth delay product links ● Reproducing research that was conducted on a testbed network (but with a somewhat more limited scope) 10Mb/ s 250Mb/ s
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 17 3: Multiple congestion points ● TCP goodput with multiple implementations measured over a topology with multiple congestion points (“hops”)
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 18 4: A more complex topology A more complex topology discussed in a paper presented at an previous MASCOTS conference The results of the simulations were integral to the paper...
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 19 4: Results Results are in-line with those presented in the paper Reproducing this work validates the original work somewhat and provides further insight into the result
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 20 Summing up... The Network Simulation Cradle allows some interesting simulation studies of TCP implementations Have used it here to reproduce prior simulation-based research – it can trivially be used for validation Have also done some of our own simulations comparing TCP variants More information can be found: (It is free for download) Sam Jansen and Anthony McGregor. Simulation with Real World Network Stacks, Winter Simulation Conference 2005.
© THE UNIVERSITY OF WAIKATO TE WHARE WANANGA O WAIKATO 21 WAND Network Research Group Department of Computer Science The University of Waikato Private Bag 3105 Hamilton, New Zealand