<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VNS</title>
	<atom:link href="http://yuba.stanford.edu/vns/feed/" rel="self" type="application/rss+xml" />
	<link>http://yuba.stanford.edu/vns</link>
	<description></description>
	<lastBuildDate>Wed, 23 Mar 2011 21:18:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Added support for simple dynamic pages</title>
		<link>http://yuba.stanford.edu/vns/2010/11/added-support-for-simple-dynamic-pages/</link>
		<comments>http://yuba.stanford.edu/vns/2010/11/added-support-for-simple-dynamic-pages/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 20:18:31 +0000</pubDate>
		<dc:creator>David Underhill</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://yuba.stanford.edu/vns/?p=189</guid>
		<description><![CDATA[Thanks to Juan Batiz-Benet, the VNS web servers can now serve simple dynamic pages. In particular, the web server replaces instances of %SRC_IP% and %SRC_PORT% in the requested file with the appropriate values for URLs which end with a .dyn extension. This is particularly handy for testing whether the NAT assignment has been implemented correctly.]]></description>
				<content:encoded><![CDATA[<p>Thanks to <a href="https://github.com/jbenet">Juan Batiz-Benet</a>, the VNS web servers can now serve simple dynamic pages.  In particular, the web server replaces instances of <code>%SRC_IP%</code> and <code>%SRC_PORT%</code> in the requested file with the appropriate values for URLs which end with a <code>.dyn</code> extension.  This is particularly handy for testing whether the NAT assignment has been implemented correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://yuba.stanford.edu/vns/2010/11/added-support-for-simple-dynamic-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interacting with and modifying live topologies</title>
		<link>http://yuba.stanford.edu/vns/2010/04/interacting-and-modifying-live-topologies/</link>
		<comments>http://yuba.stanford.edu/vns/2010/04/interacting-and-modifying-live-topologies/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 02:46:51 +0000</pubDate>
		<dc:creator>David Underhill</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://yuba.stanford.edu/vns/?p=177</guid>
		<description><![CDATA[The Topology Interactor Tool was released today. Now users can dynamically modify and interact with their topologies &#8211; disable links on the fly, inject custom packets, and intercept packets. This opens the door for more rigorous testing and evaluation of topologies (e.g., take a link down to see how a dynamic routing protocol reacts, or [...]]]></description>
				<content:encoded><![CDATA[<p>The <a href="http://wiki.github.com/dound/vns/topology-interactor-tool">Topology Interactor Tool</a> was released today.  Now users can dynamically modify and interact with their topologies &#8211; disable links on the fly, inject custom packets, and intercept packets.  This opens the door for more rigorous testing and evaluation of topologies (e.g., take a link down to see how a dynamic routing protocol reacts, or test 2-way outbound traffic in the firewall assignment by sending an echo request from an internal node).  For details, please see the <a href="http://wiki.github.com/dound/vns/topology-interactor-tool">Topology Interactor Tool page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://yuba.stanford.edu/vns/2010/04/interacting-and-modifying-live-topologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better resource sharing between topologies</title>
		<link>http://yuba.stanford.edu/vns/2010/02/fairness/</link>
		<comments>http://yuba.stanford.edu/vns/2010/02/fairness/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 02:45:50 +0000</pubDate>
		<dc:creator>David Underhill</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://yuba.stanford.edu/vns/?p=164</guid>
		<description><![CDATA[In the past, resources were available on a first-come, first-serve basis. This was adequate when students were testing their work using ping. However, when a large file was downloaded from a virtual web server, the flood of packets carrying this data would queue up and cause large delays for other packets coming into the system. [...]]]></description>
				<content:encoded><![CDATA[<p>In the past, resources were available on a first-come, first-serve basis.  This was adequate when students were testing their work using <code>ping</code>.  However, when a large file was downloaded from a virtual web server, the flood of packets carrying this data would queue up and cause large delays for other packets coming into the system.  An ongoing download would increase round-trip-times to unacceptably high levels &#8212; so bad that the these RTTs were measured in seconds instead of milliseconds.</p>
<p>To overcome this fairness problem, each topology now has its own queue into which incoming packets are placed.  These topology-specific queues are then served in a round-robin fashion to ensure that each topology receives prompt attention, even if one topology is experiencing heavier traffic.  Currently, this scheme assumes each packet requires a similar amount of work on the simulator&#8217;s part.  In the future, this scheme might be extended to monitor the time used by each job and then use deficit round robin to serve these queues.  For now, however, the simpler round robin scheme seems to have greatly improved fairness.  In particular, an ongoing download of a large file on one topology now has almost no perceptible impact the round trip times on another topology.</p>
<p>Implementing this scheme incurred some performance costs (mostly due to new synchronization constructs) &#8212; maximum throughput decreased by 25%.  However, these performance costs have been offset by two new improvements.  First, <a href="http://psyco.sourceforge.net/">Psyco</a> is now used to run the simulator.  It only required a dozen or so <a href="http://github.com/dound/vns/commit/54d5415a43043062ae6195b828707692b9231aab">new lines of code</a> for a 6% performance boost.  Second, we utilized a <a href="http://dound.com/2010/02/python-logging-performance/">script for automatically commenting out logging statements and replacing them with <code>pass</code> statements</a>.  <a href="http://dound.com/2010/02/python-logging-performance/">This script</a> completely removes the impact of any logging statements which are only useful when debugging the system.  Since we make liberal use of the <a href="http://docs.python.org/library/logging.html">logging module</a>, this was a big win &#8212; about a 25% boost in performance.  When combined with Psyco, the new system is actually about 5% faster (in terms of throughput) than it was before the topology-specific queues were introduced.</p>
]]></content:encoded>
			<wfw:commentRss>http://yuba.stanford.edu/vns/2010/02/fairness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance gains</title>
		<link>http://yuba.stanford.edu/vns/2010/01/performance-gains/</link>
		<comments>http://yuba.stanford.edu/vns/2010/01/performance-gains/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 03:17:43 +0000</pubDate>
		<dc:creator>David Underhill</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://yuba.stanford.edu/vns/?p=147</guid>
		<description><![CDATA[As last season&#8217;s crop of students worked on their VNS projects it became clear that performance improvements were needed. The most significant performance problem was associated with the download of large files from HTTP servers. This would cause VNS&#8217; response time to become 2 or even 5 times slower. This was exacerbated by already slow [...]]]></description>
				<content:encoded><![CDATA[<p>As last season&#8217;s crop of students worked on their VNS projects it became clear that performance improvements were needed.  The most significant performance problem was associated with the download of large files from HTTP servers.  This would cause VNS&#8217; response time to become 2 or even 5 times slower.  This was exacerbated by already slow transfer times.  We used <a href="http://docs.python.org/library/profile.html">cProfile</a> and <a href="http://www.vrplumber.com/programming/runsnakerun/">RunSnakeRun</a> to analyze the simulator and find the most significant bottlenecks within our code:</p>
<ul>
<li><b><a href="http://github.com/dound/vns/commit/e2e7430b44b0d280867958f3a343e7da3f1f1385">Logging</a></b>.  The VNS Simulator verbosely <a href="http://docs.python.org/library/logging.html">logs</a> various events to aid in development and debugging efforts.  Of course this affects performance, even when logging is disabled.  This makes me miss <a href="http://www.haskell.org/haskellwiki/Haskell">Haskell</a> with its <a href="http://www.haskell.org/haskellwiki/Performance/Laziness">lazy evaluation</a> of parameters (and maybe even cpp&#8217;s <code><a href="http://www.cppreference.com/wiki/preprocessor/define">#define</a></code>&#8216;s a little bit).  However, since VNS is written in Python neither of these avenues were available.  This means that the cost of constructing the messages being logged can still negatively impact performance even if they are never actually logged.  Thankfully, only one particular kind of logging was causing a significant performance hit &#8212; the logging of individual packets.  This was expensive in part because <a href="http://oss.coresecurity.com/projects/impacket.html">decoding packets</a> and stringifying their contents is a bit CPU-intensive (especially in Python).  This was easy to improve by simply bypassing packet decoding.  This alone provided a speedup of about 2x.</li>
<li><b><a href="http://github.com/dound/vns/commit/f90e4ce900f29dbf32a139f4ba0f72ade46b7004">Unnecessary array reallocation</a></b>.  The new TCP stack implementation we use for our virtual web server nodes (<a href="http://yuba.stanford.edu/vns/2010/01/new-approach-to-virtual-web-servers/">more here</a>, <a href="http://github.com/dound/vns/blob/master/TCPStack.py">code here</a>) poorly maintained the outgoing data queue.  In particular, whenever an ACK was received the ACK&#8217;ed data was actively deleted instead of passively ignored.  This lead to the outgoing queue to being resized far too often &#8212; though it was convenient from an implementation standpoint (one line of code), it was an expensive operation behind the scenes which involved allocating a new queue and then copying the remaining portion of the old queue into the new one.  Eliminating this inefficiency increased the complexity a little (~20 lines of code) but paid huge dividends &#8212; large file transfers improved by nearly 5x.</li>
</ul>
<p>The next biggest user of CPU time is largely located within the <a href="http://twistedmatrix.com/trac/">twisted framework</a> itself (to receive incoming packets), so for now this is where we&#8217;ll stop optimizing.  After these optimizations, a single client is now able to transfer large files from an otherwise unloaded VNS server at over a megabit per second!</p>
<p>In the future, our number one performance goal is to provide fairness and isolation between topologies.  Ideally, if one user downloads a large file from one topology, then the impact on the round trip time to another topology should not be significantly affected.</p>
]]></content:encoded>
			<wfw:commentRss>http://yuba.stanford.edu/vns/2010/01/performance-gains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A new approach to virtual web servers</title>
		<link>http://yuba.stanford.edu/vns/2010/01/new-approach-to-virtual-web-servers/</link>
		<comments>http://yuba.stanford.edu/vns/2010/01/new-approach-to-virtual-web-servers/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 01:50:55 +0000</pubDate>
		<dc:creator>David Underhill</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://yuba.stanford.edu/vns/?p=124</guid>
		<description><![CDATA[The current VNS codebase originally implemented virtual web server nodes essentially as a proxy for some other, real web server. I originally imagined that this would make the web servers more interesting (they could mirror content and functionality of &#8220;real&#8221; websites) while simultaneously reducing the complexity of the system (no need to implement web server [...]]]></description>
				<content:encoded><![CDATA[<p>The current <a href="http://github.com/dound/vns">VNS codebase</a> originally implemented virtual web server nodes essentially as a <a href="http://en.wikipedia.org/wiki/Proxy_server">proxy</a> for some other, real web server.  I originally imagined that this would make the web servers more interesting (they could mirror content and functionality of &#8220;real&#8221; websites) while simultaneously reducing the complexity of the system (no need to implement web server logic).  Although it was a nice theory, in practice it did not work out quite so simply.  For instance, the HTTP content returned by the real web server had to be mangled so that the links to the real web server instead pointed back to the virtual web server node (otherwise only the front page would ever go through students&#8217; topologies).  This wasn&#8217;t too hard when the node&#8217;s IP address wasn&#8217;t longer than the proxied domain name because the returning TCP packets could be modified with a simple regular expression on the data portion plus an update to the checksum.  But if the IP address was too long, then there was no easy substitution (adding extra data would cause the sequence numbers to be off).</p>
<p>Another solution I considered was using <a href="http://twistedmatrix.com/trac/wiki/TwistedWeb">twisted&#8217;s built-in HTTP server</a> to handle HTTP requests to our virtual web servers.  Unfortunately, there was no easy way to ask twisted&#8217;s framework to process raw packets once they had arrived in the VNS simulator &#8212; the twisted web server sanely builds on the operating system&#8217;s TCP stack.</p>
<p>I finally gave in and decided that VNS virtual web servers would use a lightweight, user-level TCP stack to process these raw packets.  Though <a href="http://savannah.nongnu.org/projects/lwip/">lwip</a> exists for C/C++, no similar framework was natively available for the Python-based VNS simulator.  Thus we ended up rolling our own (simplified) TCP stack and used it to piece together incoming HTTP requests and to manage all of the TCP details.  Surprisingly, this solution turned out to be much simpler to integrate into the virtual web servers (<a href="http://github.com/dound/vns/commit/e171dbdd28a5836e8263242ba0f807192b2674e6#diff-0">~20 lines of code</a> instead of ~200).  It also works much more reliably and quicker than the proxy solution, and has the advantage of enabling VNS to function as a standalone application with no reliance on external web servers.</p>
]]></content:encoded>
			<wfw:commentRss>http://yuba.stanford.edu/vns/2010/01/new-approach-to-virtual-web-servers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VNS Web UI released</title>
		<link>http://yuba.stanford.edu/vns/2010/01/web-ui-released/</link>
		<comments>http://yuba.stanford.edu/vns/2010/01/web-ui-released/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 08:30:16 +0000</pubDate>
		<dc:creator>David Underhill</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://yuba.stanford.edu/vns/?p=128</guid>
		<description><![CDATA[As of today instructors and their teaching staff have much more control over their classes&#8217; VNS-based projects. A new web-based user interface empowers the teaching staff to create and manage their own virtual topologies. It also enables them to make use of VNS&#8217; new access-control features. In particular, individual or groups of students can be [...]]]></description>
				<content:encoded><![CDATA[<p>As of today instructors and their teaching staff have much more control over their classes&#8217; VNS-based projects.  A new <a href="http://vns-1.stanford.edu/">web-based user interface</a> empowers the teaching staff to create and manage their own virtual topologies.  It also enables them to make use of VNS&#8217; new access-control features.  In particular, individual or groups of students can be assigned to a topology.  This ensures that only the intended students can control virtual nodes on a topology.  It also enables students or staff to setup filters which limit ingress traffic to only specific range(s) of IPs.  This will help prevent traffic from uninvited outside sources (sometimes distracting traffic destined to a student&#8217;s topology from unrecognized IPs elsewhere on the Internet would disrupt a student&#8217;s debugging or development efforts).</p>
<p>This is just the beginning of the interface.  In the future, I&#8217;d like students to be able to see a graphical representation of their topology and tweak it in real-time (e.g., take down a link or node to better test an implementation of a dynamic routing protocol).  Eventually, students should also be able to create their own topologies.</p>
<p>The <a href="http://yuba.stanford.edu/vns/using-vns/">Using VNS</a> page has been updated with information about how to use this web interface.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://yuba.stanford.edu/vns/2010/01/web-ui-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website updated, revamped</title>
		<link>http://yuba.stanford.edu/vns/2010/01/website-migrated-to-wordpress/</link>
		<comments>http://yuba.stanford.edu/vns/2010/01/website-migrated-to-wordpress/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 20:00:41 +0000</pubDate>
		<dc:creator>David Underhill</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://yuba.stanford.edu/vns/?p=126</guid>
		<description><![CDATA[The VNS website has been slightly revamped and reorganized. The new site features prominent links to our open-source repository and issue tracker. We&#8217;ve also updated and consolidated many of the informational pages, and added this news feed. In the near future, we also hope to improve the assignment pages by factoring out common material (many [...]]]></description>
				<content:encoded><![CDATA[<p>The VNS website has been slightly revamped and reorganized.  The new site features prominent links to our <a href="http://github.com/dound/vns">open-source repository</a> and <a href="http://github.com/dound/vns/issues">issue tracker</a>.  We&#8217;ve also updated and consolidated many of the informational pages, and added this news feed.</p>
<p>In the near future, we also hope to improve the <a href="/vns/assignments">assignment</a> pages by factoring out common material (many students participate in more than one of our assignments).</p>
]]></content:encoded>
			<wfw:commentRss>http://yuba.stanford.edu/vns/2010/01/website-migrated-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
