<?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>tolaris.com</title>
	<atom:link href="http://www.tolaris.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tolaris.com</link>
	<description>When the going gets tough, the tough sniff packets.</description>
	<lastBuildDate>Tue, 24 Jan 2012 17:47:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>On Troubleshooting</title>
		<link>http://www.tolaris.com/2012/01/19/on-troubleshooting/</link>
		<comments>http://www.tolaris.com/2012/01/19/on-troubleshooting/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 21:23:56 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[science]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=1613</guid>
		<description><![CDATA[My colleague TT Mooney has some very important words about troubleshooting. Please take the time to read them. Especially if you work with us.]]></description>
			<content:encoded><![CDATA[<p>My colleague TT Mooney has some very important words about <a href="http://ttmooney.com/?p=51">troubleshooting</a>. Please take the time to read them. <em>Especially</em> if you work with us.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2012/01/19/on-troubleshooting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Market: &#8220;Error while retrieving information from server.&#8221;</title>
		<link>http://www.tolaris.com/2011/12/18/android-market-error-while-retrieving-information-from-server/</link>
		<comments>http://www.tolaris.com/2011/12/18/android-market-error-while-retrieving-information-from-server/#comments</comments>
		<pubDate>Sun, 18 Dec 2011 00:00:51 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=1575</guid>
		<description><![CDATA[Recently Google offered a sale on 10 Android apps each day for 10p (or 10&#162;). During the sale I bought a number of apps, because 10p is practically indistinguishable from &#8220;free&#8221;. Unfortunately, my bank believed this large number of sub-one-pound purchases to be fraudulent. Normally they&#8217;d be right; that&#8217;s exactly the kind of thing criminal [...]]]></description>
			<content:encoded><![CDATA[<p>Recently Google offered a sale on 10 Android apps each day for 10p (or 10&cent;). During the sale I bought a number of apps, because 10p is practically indistinguishable from &#8220;free&#8221;. Unfortunately, my bank believed this large number of sub-one-pound purchases to be fraudulent. Normally they&#8217;d be right; that&#8217;s exactly the kind of thing criminal organisations do when testing credit cards. But in my case, it was just a case of &#8220;SALE! SALE! SALE!&#8221; madness.</p>
<p>I cleared it with the bank, but after that I could no longer buy applications through the Android Market application. When I attempted to do so, the Market required me to check &#8220;I agree to the Payments for Android<br />
Market Terms and Conditions&#8221;, then failed with the message &#8220;Error while retrieving information from server.&#8221;</p>
<p><span id="more-1575"></span>If you don&#8217;t care to read the grimy details, perhaps you should skip to <a href="#solution">the solution</a>.</p>
<p>I reported the issue to Android Market technical support, who replied to me the following day requesting steps to reproduce. I gave them a full bug report:</p>
<ol>
<li>Open Market.</li>
<li>Navigate to any app. Press the amount button, such as &#8220;£0.10&#8243;, button on the upper right.</li>
<li>The confirmation page loads, listing my credit card, gmail account, and total. &#8220;Accept &#038; Buy&#8221; is grey, and the statement &#8220;I agree to the Payments for Android Market Terms and Conditions&#8221; is displayed, unchecked.<br />
<a href="/blog/wp-content/uploads/2011/12/android_market_purchase_1.png"><img src="/blog/wp-content/uploads/2011/12/android_market_purchase_1.png" alt="" title="Android Market purchase error, step 1" width="240" height="400" class="alignnone size-full wp-image-1581" /></a></li>
<li>Check next to &#8220;I agree &#8230;&#8221;. &#8220;Accept &#038; Buy&#8221; becomes blue.<br />
<a href="/blog/wp-content/uploads/2011/12/android_market_purchase_2.png"><img src="/blog/wp-content/uploads/2011/12/android_market_purchase_2.png" alt="" title="Android Market purchase error, step 2" width="240" height="400" class="alignnone size-full wp-image-1582" /></a></li>
<li>Press &#8220;Accept &#038; Buy&#8221;.</li>
<li>The error message &#8220;Error while retrieving information from server&#8221; appears.<br />
<a href="/blog/wp-content/uploads/2011/12/android_market_purchase_3.png"><img src="/blog/wp-content/uploads/2011/12/android_market_purchase_3.png" alt="" title="Android Market purchase error, step 3" width="240" height="400" class="alignnone size-full wp-image-1583" /></a></li>
</ol>
<p>What immediately stood out is that I had never previously seen &#8220;I agree to the Payments for Android Market Terms and Conditions&#8221; appear during a purchase. The Market normally prompts you to accept this the first time you run it after factory reset. My wife&#8217;s phone did not have this message.</p>
<p>Also of interest, I <em>could</em> purchase Android apps through the <a href="https://market.android.com/">Android Market website</a>, and send them to the device (or install them via the Market). The problem was only with purchases made via the Market app.</p>
<p>I provided all these details, including the fraud problem to Android Market technical support. Unfortunately, I also identified my devices as running community-build Android ROMs. My HTC Desire HD phone runs <a href="http://miuiandroid.com/">MIUI</a>, and my Nook Color tablet runs <a href="http://www.cyanogenmod.com/">CyanogenMod</a>. That caused another day of delay while technical support insisted that they could not help me because &#8220;unauthorized operating systems (custom ROMs) may have limited functionality due to the compatibility of the device.&#8221;</p>
<p>I asked technical support to check that my Market account is functioning normally, and they responded with &#8220;I&#8217;ve taken another look at your account, and can find no reason you shouldn&#8217;t be able to access Android Market. Please remember that Android Market may not work well with devices in a modified state as far as operating system or user access privileges. I can only recommend using Android Market with your device in its factory default state.&#8221;</p>
<p>I did not expect technical support to support a modified ROM. And before anyone accuses them of refusing to help for that reason, they did not blame the ROM outright and they did try to help. However, they did not solve the problem.</p>
<p>So I spent another day testing. I purged Market settings from <code>/data/data/com.android.vending</code>. I compared to friends&#8217; devices. I arranged to borrow a stock, unmodified phone from a friend and test the following day. And then I realised something &#8211; my wife&#8217;s phone showed a different credit card number in the purchase screen. We have the same joint account and credit card number, which means that she was able to make purchases <em>with a different credit card</em>.</p>
<p>I logged in to <a href="http://www.google.com/wallet/">Google Wallet</a> and deleted my credit card, and added it again. The problem was immediately solved. The Market no longer displayed &#8220;I agree to the Payments for Android Market Terms and Conditions&#8221;, and I&#8217;ve been able to buy apps ever since.</p>
<p>Conclusions:</p>
<ol>
<li>The Android Market error message &#8220;Error while retrieving information from server&#8221; apparently means &#8220;Your credit card with Google Wallet once refused a charge&#8221;. Or at least indicates a problem with Google Wallet. This error message is totally unhelpful and should be corrected.</li>
<li><a name="solution"></a>If you get this error message, try logging in to <a href="http://www.google.com/wallet/">Google Wallet</a>, remove your credit card, and add it again.</li>
<li>If you are running a custom ROM, Android Market technical support may pause because the ROM could be at fault. I appreciate that they did try, and they were polite and courteous the whole time. But it still sucks that they believe the CyanogenMod team is any less professional than HTC. And it especially sucks when you provide professional-quality steps-to-reproduce which clearly indicate the ROM is not the problem.
</li>
<li>Android Market technical support does not know about this error message or issue with Google Wallet. This is especially disconcerting, as it probably happens all the time and they are exactly the people who should know about it.</li>
</ol>
<p>I found only a handful of references to this error via Google searches, none with solutions. So I&#8217;m writing this all up here, in hopes that it will help other people.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2011/12/18/android-market-error-while-retrieving-information-from-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Merry Christmas, now with more entropy!</title>
		<link>http://www.tolaris.com/2011/12/17/merry-christmas-now-with-more-entropy/</link>
		<comments>http://www.tolaris.com/2011/12/17/merry-christmas-now-with-more-entropy/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 22:46:53 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[xmas]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=1568</guid>
		<description><![CDATA[Merry Christmas, everyone! We have a special card just for you. (In case you miss it the first time, try reloading or clicking the button.) If you&#8217;d like to know more about our awesome card, see a previous year&#8217;s post. Hey Mark, have you stolen my idea yet? You&#8217;re becoming rather tardy, mate. $happy $holiday, [...]]]></description>
			<content:encoded><![CDATA[<p>Merry Christmas, everyone!  We have a <a href="/xmas/xmas2011.php">special card just for you</a>.</p>
<p>(In case you miss it the first time, try reloading or clicking the button.)</p>
<p><span id="more-1568"></span>If you&#8217;d like to know more about our awesome card, see <a href="/2009/12/14/merry-christmas/">a previous year&#8217;s post</a>. Hey <a href="http://mark.denovich.com/">Mark</a>, have you stolen my idea yet? You&#8217;re becoming rather tardy, mate.</p>
<p>$happy $holiday, everyone!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2011/12/17/merry-christmas-now-with-more-entropy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading to OpenWRT 10.03.1-rc6</title>
		<link>http://www.tolaris.com/2011/11/07/upgrading-to-openwrt-10-03-1-rc6/</link>
		<comments>http://www.tolaris.com/2011/11/07/upgrading-to-openwrt-10-03-1-rc6/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 23:11:22 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[openwrt]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=1544</guid>
		<description><![CDATA[Immediately after the upgrade to 10.03.1-rc5, the OpenWRT team released 10.03.1-rc6. Since rc5 didn&#8217;t fix wireless on my Buffalo WZR-HP-G300NH, I gave rc6 a go. This time the upgrade preserved most of my settings. I still had to reinstall my usual software, and fix a few things. Use the following to install my original list [...]]]></description>
			<content:encoded><![CDATA[<p>Immediately after the upgrade to 10.03.1-rc5, the OpenWRT team released 10.03.1-rc6. Since rc5 didn&#8217;t fix wireless on my Buffalo WZR-HP-G300NH, I gave rc6 a go.</p>
<p><span id="more-1544"></span>This time the upgrade preserved most of my settings. I still had to reinstall my usual software, and fix a few things. Use the following to install my <a href="/2010/09/01/openwrt-10-03-on-buffalo-wzr-hp-g300nh/">original list</a> of useful software. This should be handy when rc7 or, haha, the &#8220;final&#8221; 10.03.1 is released.</p>
<pre>
opkg update
opkg install kmod-fs-btrfs kmod-fs-ext2 kmod-fs-ext3 kmod-fs-ext4 kmod-fs-isofs kmod-fs-reiserfs kmod-fs-vfat kmod-fs-xfs
opkg install kmod-nls-cp1250 kmod-nls-cp1251 kmod-nls-cp437 kmod-nls-cp775 kmod-nls-cp850 kmod-nls-cp852 kmod-nls-cp866 kmod-nls-iso8859-1 kmod-nls-iso8859-13 kmod-nls-iso8859-15 kmod-nls-iso8859-2 kmod-nls-koi8r kmod-nls-utf8
opkg install kmod-usb2 kmod-usb-storage kmod-usb-storage-extras block-hotplug block-mount hotplug2
opkg install --force-overwrite avahi-daemon bwm conntrack-tools fdisk fping iftop ip kmod-ipv6 libnl lft lsof luci-app-ntpc luci-app-openvpn luci-app-upnp luci-ssl miniupnpd mtr net-tools-hostname ngrep nmap ntpclient openssh-client openvpn rsync screen snmpd sshfs tcpdump vim
mkdir /mnt/usbstorage -p
</pre>
<p>This list no longer includes iptables-utils, which has been merged into iptables and is now simply a dummy package.</p>
<p>After that, I also had to:</p>
<ol>
<li>Restore my OpenVPN certificates to /lib/uci/upload/</li>
<li>Delete duplicate configurations in &#8220;LED Configuration&#8221;</li>
<li>Go to System -> Startup and enable the newly-installed daemons</li>
</ol>
<p>Warning: do not restore to /overlay, even if that is what your BackupPC server is archiving. Restore to the root directory.</p>
<p>I tested wireless throughput on rc4 and rc6 on my Buffalo WZR-HP-G300NH, and also on a Linksys WRT-54-GL with DD-WRT v24-sp1 for comparison. Since <a href="/2011/11/07/upgrading-to-openwrt-10-03-1-rc5/">rc5 was unstable</a> (except in 802.11b-only mode), I didn&#8217;t bother with full tests. All wireless networks had an identical configuration, from ESSID to channel to encryption settings.</p>
<p>I used iperf to transmit 10-second UDP streams from my laptop (on wireless) to zuul (on gigabit Ethernet). When testing between two directly-connected nodes, iperf will scale its burst rate until it finds the maximum link speed. Example: <code>iperf -u -c zuul -b 35M -t 10</code>. The results, averaged over 5 tests each:</p>
<p>Linksys WRT-54-GL with DD-WRT v24-sp1 &#8211; 28.5 mbit<br />
Buffalo WZR-HP-G300NH with 10.03.1-rc4 &#8211; 23.9 mbit<br />
Buffalo WZR-HP-G300NH with 10.03.1-rc6 &#8211; 26.8 mbit</p>
<p>I&#8217;m glad to see improved throughput since rc4, but it still doesn&#8217;t quite reach the WRT-54-GL, which is surprising. The difference is small enough to ignore. So far, I&#8217;ve had no issues with drops in wireless. I&#8217;ll update this post after I&#8217;ve had time to observe wireless stability.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2011/11/07/upgrading-to-openwrt-10-03-1-rc6/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Upgrading to OpenWRT 10.03.1-rc5</title>
		<link>http://www.tolaris.com/2011/11/07/upgrading-to-openwrt-10-03-1-rc5/</link>
		<comments>http://www.tolaris.com/2011/11/07/upgrading-to-openwrt-10-03-1-rc5/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 22:58:39 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[openwrt]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=1528</guid>
		<description><![CDATA[A few weeks ago, I upgraded my Buffalo WZR-HP-G300NH home router to OpenWRT 10.03.1-rc5. I followed the same upgrade process as I used to upgrade to previous releases. However, this time most settings were not restored correctly. Note: The 10.03.1 &#8220;Release Candidate&#8221; series aren&#8217;t true RCs. They are reasonably stable snapshots of current development, rather [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, I upgraded my Buffalo WZR-HP-G300NH home router to OpenWRT 10.03.1-rc5. I followed the same <a href="/2010/09/02/upgrading-to-openwrt-10-03-1-rc3/">upgrade process</a> as I used to upgrade to previous releases. However, this time most settings were not restored correctly.</p>
<p><span id="more-1528"></span>Note: The 10.03.1 &#8220;Release Candidate&#8221; series aren&#8217;t true RCs. They are reasonably stable snapshots of current development, rather than iterations of bug fixes of the same stable code base. rc5 includes a new Luci web interface and newer kernel and hardware drivers since rc4. This makes experimenting with these releases that much more exciting.</p>
<p>What went wrong:</p>
<ol>
<li>The LAN IP address changed to the default, 192.168.1.1/24. The Luci interface showed the DHCP server disabled, although it gave me an address (from the new range) when I connected. It stopped doing so after I changed the interface IP, which means the &#8220;no DHCP&#8221; setting took effect when I hit Apply.</li>
<li>A number of other settings reset to defaults: hostname, domain name, all DNS and DHCP options, remote syslog server IP, LED configuration, and wifi settings.</li>
</ol>
<p>What went right:</p>
<ol>
<li>It is no longer necessary to install the kmod-ath9k and wpad-mini drivers after installation. Wifi just works without additional packages.</li>
<li>My custom firewall configuration survived, as did my .profile for root.</li>
<li>The new Luci interface really is better than the old one.</li>
<li>Multiple wireless networks with different encryption settings now works. I can again have a hidden WEP network for my Nintendo DS.</li>
</ol>
<p>After the upgrade, I followed the steps in my <a href="/2010/09/01/openwrt-10-03-on-buffalo-wzr-hp-g300nh/">original post</a> and reconfigured the lost settings. Since my BackupPC server takes regular backups of /overlay, it was trivial to restore most of what was lost from /etc/config. That was especially useful for my OpenVPN configuration.</p>
<p>The problems began when I tried to enable wifi. I found that it was stable in 802.11b-only mode, but when I tried to use &#8220;auto&#8221;, &#8220;b+g&#8221;, or &#8220;g+n&#8221; mode, both of my laptops repeatedly lost their connections. I tried many combinations of options before giving up and using another AP (as I have done since a week after buying this router). I have hope that this will one day be unnecessary.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2011/11/07/upgrading-to-openwrt-10-03-1-rc5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using iperf and bwm-ng to measure throughput</title>
		<link>http://www.tolaris.com/2011/10/06/using-iperf-and-bwm-ng-to-measure-throughput/</link>
		<comments>http://www.tolaris.com/2011/10/06/using-iperf-and-bwm-ng-to-measure-throughput/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 20:58:33 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=1518</guid>
		<description><![CDATA[I am often asked to measure the bandwidth of a network path. Many users test this using a simple HTTP download or with speedtest.net. Unfortunately, any test using TCP will produce inaccurate results, due to the limitations of a session-oriented protocol. TCP window size, latency, and the bandwidth of the return channel (for ACK messages) [...]]]></description>
			<content:encoded><![CDATA[<p>I am often asked to measure the bandwidth of a network path. Many users test this using a simple HTTP download or with <a href="http://www.speedtest.net">speedtest.net</a>. Unfortunately, any test using TCP will produce inaccurate results, due to the limitations of a session-oriented protocol. TCP window size, latency, and the bandwidth of the return channel (for ACK messages) all affect the results. The most reliable way to measure true bandwidth is with UDP. That&#8217;s where my friends <code>iperf</code> and <code>bwm-ng</code> come in handy.</p>
<p><span id="more-1518"></span><a href="http://sourceforge.net/projects/iperf">iperf</a> is a tool for measuring bandwidth and reporting on throughput, jitter, and data loss. Others have written <a href="http://openmaniak.com/iperf.php">handy tutorials</a>, but I&#8217;ll summarise the basics here.</p>
<p>iperf will run on any Linux or Unix (including Mac OSX), and must be installed on both hosts. Additionally, the &#8220;server&#8221; (receiving) host must allow incoming traffic to some port (which defaults to 5001/UDP and 5001/TCP). If you want to run bidirectional tests with UDP, this means you must open 5001/UDP on both hosts&#8217; firewalls.</p>
<p><code>iptables -I INPUT -p udp -m udp --dport 5001 -j ACCEPT</code></p>
<p>A network path is really two paths &#8211; the downstream path and the upstream (or return) path. With iperf, the &#8220;client&#8221; is the transmitter and the &#8220;server&#8221; is the receiver. So we&#8217;ll use the term &#8220;downstream&#8221; to refer to traffic transmitted from the client to the server, and &#8220;upstream&#8221; to refer to the opposite. Since these two paths can have different bandwidths and entirely different routes, we should measure them separately.</p>
<p>Start by opening terminal windows to both the client and server hosts, as well as the <a href="http://www.manpagez.com/man/1/iperf/">iperf man page</a>. On the server, you only have to start listening. This runs iperf as a server on the default 5001/UDP.</p>
<pre>root@server:~# iperf -s -u
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size:   124 KByte (default)
------------------------------------------------------------</pre>
<p>The server will output test results, as well as report them back to the client for display.</p>
<p>On the client, you have many options. You can push X data (-b) for Y seconds (-t). For example, to push 1 mbit for 10 seconds:</p>
<pre>root@client:~# iperf -u -c server.example.com -b 1M -t 10
------------------------------------------------------------
Client connecting to 172.16.0.2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size:   110 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.1 port 37731 connected with 172.16.0.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.19 MBytes  1000 Kbits/sec
[  3] Sent 852 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth       Jitter   Lost/Total Datagrams
[  3]  0.0-10.0 sec  1.19 MBytes  1.00 Mbits/sec  0.842 ms    0/  852 (0%)</pre>
<p>You can request that the server perform a reverse connection to test the return path, either at the same time (-d, dual test) or in series (-r, tradeoff). This causes both ends to temporarily start both a client and a server.</p>
<pre>root@client:~# iperf -u -c server.example.com -b 1M -t 10 -r
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size:   110 KByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to 172.16.0.2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size:   110 KByte (default)
------------------------------------------------------------
[  4] local 192.168.1.1 port 46297 connected with 172.16.0.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec  1.19 MBytes  1000 Kbits/sec
[  4] Sent 852 datagrams
[  4] Server Report:
[ ID] Interval       Transfer     Bandwidth       Jitter   Lost/Total Datagrams
[  4]  0.0-10.0 sec  1.19 MBytes    998 Kbits/sec  0.250 ms    2/  852 (0.23%)
[  3] local 192.168.1.1 port 5001 connected with 172.16.0.2 port 34916
[ ID] Interval       Transfer     Bandwidth       Jitter   Lost/Total Datagrams
[  3]  0.0-10.0 sec  1.19 MBytes  1.00 Mbits/sec  0.111 ms    0/  851 (0%)
[  3]  0.0-10.0 sec  1 datagrams received out-of-order</pre>
<p>The above shows first the client->server transmission, then the server->client transmission. If it seems hard to read, each simultaneous link has an ID such as &#8220;[ 3]&#8220;, and look for port 5001 to identify the host that is receiving data.</p>
<p>You can also specify the datagram size. Many devices have limits on packets per second, which means you can push more data with 1470-byte datagrams than with 64-byte datagrams. The same link tested with 64-byte datagrams (requiring nearly 20,000 packets where previously we needed only 852) showed 6% packet loss:</p>
<pre>root@client:~# iperf -u -c server.example.com -b 1M -t 10 -l 64
------------------------------------------------------------
Client connecting to 172.16.0.2, UDP port 5001
Sending 64 byte datagrams
UDP buffer size:   110 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.1 port 47784 connected with 172.16.0.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.19 MBytes  1000 Kbits/sec
[  3] Sent 19533 datagrams
[  3] Server Report:
[ ID] Interval       Transfer     Bandwidth       Jitter   Lost/Total Datagrams
[  3]  0.0-10.0 sec  1.11 MBytes    933 Kbits/sec  0.134 ms 1294/19533 (6.6%)</pre>
<p>To find the total packet size, add 28 bytes to the datagram size for UDP+IP headers. For instance, setting 64-byte datagrams causes iperf to send 92-byte packets. Exceeding the <a href="http://en.wikipedia.org/wiki/Maximum_transmission_unit">MTU</a> can produce even more interesting results, as packets are fragmented.</p>
<p>iperf provides final throughput results at the end of each test. However, I sometimes find it handy to get results as the test is running, or to report on packets/second. That&#8217;s when I use <a href="http://www.gropp.org/?id=projects&#038;sub=bwm-ng">bwm-ng</a>.</p>
<p>Try opening two more terminals, one each to the client and server. In each, start bwm-ng.</p>
<pre>root@client:~# bwm-ng -u bits -t 1000

  bwm-ng v0.6 (probing every 1.000s), press 'h' for help
  input: /proc/net/dev type: rate
  |         iface                   Rx                   Tx                Total
  ==============================================================================
               lo:           0.00 Kb/s            0.00 Kb/s            0.00 Kb/s
             eth0:           0.00 Kb/s         1017.34 Kb/s         1017.34 Kb/s
             eth1:           0.00 Kb/s            0.00 Kb/s            0.00 Kb/s
  ------------------------------------------------------------------------------
            total:           0.00 Kb/s         1017.34 Kb/s         1017.34 Kb/s</pre>
<p>By default, bwm-ng shows bytes/second. Press &#8216;u&#8217; to cycle through bytes, bits, packets, and errors per second. Press &#8216;+&#8217; or &#8216;-&#8217; to change the refresh time. I find that 1 or 2 seconds produces more accurate results on some hardware. Press &#8216;h&#8217; for handy in-line help.</p>
<p>Now, start the same iperf tests. Any packet losses will be immediately apparent, as the throughput measurements won&#8217;t match. The client will show 1 mbit in the Tx column, while the server will show a lower number in the Rx column.</p>
<p>However, bwm-ng will not differentiate between traffic from iperf and other traffic at the same time. When that happens, it is still useful to use the packets/sec display to find the maximum packet throughput limits of your hardware.</p>
<p>One warning to those who want to test TCP throughput with iperf: you cannot specify the data rate. Instead, iperf in TCP mode will scale up the data rate until it finds the maximum safe window size. For low-latency links, this is generally 85% of the true channel bandwidth as measured by UDP tests. However, as latency increases, TCP bandwidth decreases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2011/10/06/using-iperf-and-bwm-ng-to-measure-throughput/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Updated: Tolarski, a variable-width Tarski child theme</title>
		<link>http://www.tolaris.com/2011/09/18/updated-tolarski-a-variable-width-tarski-child-theme/</link>
		<comments>http://www.tolaris.com/2011/09/18/updated-tolarski-a-variable-width-tarski-child-theme/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 18:20:11 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=1505</guid>
		<description><![CDATA[I&#8217;ve updated Tolarski, my variable-width Tarski theme, to work with Tarski 3.1.2 and WordPress 3.2.x. This version is also downloadable as a ZIP file, and can be installed through the WordPress GUI. Download Tolarski v.1.3.2 here. To install, login to WordPress as admin and browse to Appearance -> Themes -> Install Themes -> Upload. I&#8217;d [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve updated <a href="/2011/05/23/tolarski-a-tarski-child-theme-for-variable-width">Tolarski</a>, <a href="/2009/02/03/making-tarski-dynamically-resize-with-sliding-header-images">my variable-width Tarski theme</a>, to work with Tarski 3.1.2 and WordPress 3.2.x. This version is also downloadable as a ZIP file, and can be installed through the WordPress GUI.</p>
<p><span id="more-1505"></span><a href='http://www.tolaris.com/blog/wp-content/uploads/2011/09/tolarski.zip'>Download Tolarski v.1.3.2 here</a>.</p>
<p>To install, login to WordPress as admin and browse to Appearance -> Themes -> Install Themes -> Upload. I&#8217;d appreciate it if someone else could test this and leave feedback with any issues.</p>
<p>I don&#8217;t intend to turn Tolarski into a fully supported theme. But I am happy to answer questions. Some notes:</p>
<ol>
<li>Tolarski displays the full date and time on posts. Tarski only prints the date, and this is not configurable. You can disable this by commenting out the &#8220;add_action &#8230; init_tolarski_post_metadata&#8221; line at the bottom of functions.php.</li>
<li>You must modify tolarski_headerimage() in functions.php. This specifies the 7 header images by filename, which should be placed in tolarski/headers/. Please don’t use my images on your live blog, but if you just want to play with the theme you can find links in the page source and manually download them. If you want to change the floating positions of the images, or use more/less of them, edit style.css.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2011/09/18/updated-tolarski-a-variable-width-tarski-child-theme/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>libblkid, or why you don&#8217;t need to worry about 4K disk format</title>
		<link>http://www.tolaris.com/2011/07/21/libblkid-or-why-you-dont-need-to-worry-about-4k-disk-format/</link>
		<comments>http://www.tolaris.com/2011/07/21/libblkid-or-why-you-dont-need-to-worry-about-4k-disk-format/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 20:15:24 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[raid]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=1431</guid>
		<description><![CDATA[You may have read of the new 4K Advanced Format drives now becoming popular on the market. In fact, if you&#8217;ve got a drive larger than 1 TB, you probably have one, even if you don&#8217;t know it. I&#8217;ve found lots of people assembling home NAS servers using 2 TB drives, linux software RAID or [...]]]></description>
			<content:encoded><![CDATA[<p>You may have read of the new <a href="http://www.bit-tech.net/hardware/storage/2010/04/01/the-facts-4k-advanced-format-hard-disks/1">4K Advanced Format drives</a> now becoming popular on the market. In fact, if you&#8217;ve got a drive larger than 1 TB, you probably have one, even if you don&#8217;t know it. I&#8217;ve found lots of people assembling home NAS servers using 2 TB drives, linux software RAID or LVM, and all of them are <a href="http://askubuntu.com/questions/8592/how-do-i-align-my-partition-table-properly">concerned</a> about <a href="http://busybox.net/~aldot/mkfs_stride.html">aligning</a> various parts of the storage infrastructure to the new <a href="https://ata.wiki.kernel.org/index.php/ATA_4_KiB_sector_issues">4K format</a>. But, thanks to libblkid, you don&#8217;t have to.</p>
<p><span id="more-1431"></span>Full disclosure: I&#8217;m one of those people who assembled such a NAS. And I was one of those people who spent an inordinate amount of time worrying about the 4K alignment problem. I eventually learned that I&#8217;d been wasting my time. When you find people on various mailing lists, forums, and blogs talking about this, please point them here.</p>
<p>The fundamental problem is the need to align data structures to the physical storage device&#8217;s boundaries. If your device stores data in block of 4K, then you want to begin writing your data at a multiple of 4K. You do not want to start writing 4K of data beginning 2K from the start of the device, because that will mean reading and writing two blocks of data. It would be more efficient to align to the boundary and write only one block.</p>
<p>All low-level storage systems, from filesystems (ext4) to logical volume managers (lvm2) to software raid (mdadm) use various block sizes. The terms vary from blocks to chunks to stripes, but the concept is the same. We want these blocks to align to what is best for the underlying layers, from any RAID configuration down to the physical devices.</p>
<p>To solve this problem, <a href="http://www.kernel.org/pub/linux/utils/util-linux/libblkid-docs/libblkid-Topology-information.html">libblkid</a> provides topology information for block devices. This includes physical and logical block sizes. As of spring 2010, support for libblkid is available in all the standard tools:</p>
<ol>
<li>fdisk, since util-linux >= 2.15. You should start with &#8216;-c -u&#8217; to disable DOS compatibility and use sectors instead of cylinders.</li>
<li>parted, since parted >= 2.1. Parted defaults to 1 MiB alignment for unknown disks, which should align to just about any sector size. This includes gparted and other graphical tools such as the partitioner used in the Ubuntu desktop installer.</li>
<li>mdadm, since util-linux >= 2.15. It is no longer necessary to manually specify stride and stripe-width. All MD superblocks are positioned either at the end of the array (0.9 and 1.0) or in multiples of 4K from the beginning (1.1, 1.2).</li>
<li>lvm2, since util-linux >= 2.15.</li>
<li>mkfs.{ext,xfs,gfs2,ocfs2} all support libblkid directly.</li>
</ol>
<p>If you&#8217;re uncertain, verify that your tool depends on util-linux or libblkid. You can use the package manager, although you may need to examine a dependant library:</p>
<pre>user@server:~$ dpkg -s libparted0debian1 | grep libblkid
Depends: libblkid1 (>= 2.17), libc6 (>= 2.8), libdevmapper1.02.1 (>= 2:1.02.36), libuuid1 (>= 2.16)
</pre>
<p>Or use ldd, which is more direct:</p>
<pre>user@server:~$ ldd /sbin/parted | grep libblkid
        libblkid.so.1 => /lib/libblkid.so.1 (0x00007f5833228000)
</pre>
<p>Conclusion: if you are running Ubuntu 10.04, Fedora 13, or RHEL 6 or later, you do not have to do anything to use your 4K disk efficiently. Create the RAID array, logical volume, and filesystem exactly as you normally would.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2011/07/21/libblkid-or-why-you-dont-need-to-worry-about-4k-disk-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reconnecting your SSH agent to a detached GNU screen session</title>
		<link>http://www.tolaris.com/2011/07/12/reconnecting-your-ssh-agent-to-a-detached-gnu-screen-session/</link>
		<comments>http://www.tolaris.com/2011/07/12/reconnecting-your-ssh-agent-to-a-detached-gnu-screen-session/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 20:49:35 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=1455</guid>
		<description><![CDATA[I like GNU Screen. I also like SSH agent forwarding. Combining these two makes for very easy, password-less, large file transfers between two remote hosts. When you login via SSH with agent forwarding enabled, the SSH server creates a socket in /tmp/ssh-[HASH]/agent.[PID]. This allows SSH sessions on the remote host to access your agent back [...]]]></description>
			<content:encoded><![CDATA[<p>I like <a href="http://www.tolaris.com/2010/02/28/flying-without-a-net/">GNU Screen</a>. I also like <a href="http://www.tolaris.com/2009/09/05/using-ssh-agent-and-setting-key-access-limits/">SSH agent forwarding</a>. Combining these two makes for very easy, password-less, large file transfers between two remote hosts.</p>
<p><span id="more-1455"></span>When you login via SSH with agent forwarding enabled, the SSH server creates a socket in /tmp/ssh-[HASH]/agent.[PID]. This allows SSH sessions on the remote host to access your agent back on your workstation. Commands that use the agent, like ssh, scp, and rsync, find it by reading the SSH_AUTH_SOCK environment variable.</p>
<pre>root@server:~#  echo $SSH_AUTH_SOCK
/tmp/ssh-NshdZD1538/agent.1538</pre>
<p>This path is readable only to the current user (and root, which is why agent forwarding is dangerous if you don&#8217;t trust the root users of servers you access). GNU Screen inherits SSH_AUTH_SOCK like any other process. However, what happens when you detach your screen session and logout? When you login again and re-attach to screen, SSH_AUTH_SOCK is pointing to the wrong file:</p>
<pre>root@server:~# screen -r
root@server:~# echo $SSH_AUTH_SOCK
/tmp/ssh-NshdZD1538/agent.1538
root@server:~# ls /tmp/ssh-NshdZD1538/agent.1538
ls: cannot access /tmp/ssh-NshdZD1538/agent.1538: No such file or directory
root@server:~# ssh localhost
root@localhost's password:</pre>
<p>I have found a <a href="http://superuser.com/questions/180148/how-do-you-get-screen-to-automatically-connect-to-the-current-ssh-agent-when-re-a">number</a> of <a href="http://sweetjesus26.livejournal.com/16782.html">solutions</a> of <a href="http://blog.endpoint.com/2011/02/gnu-screen-sshauthsock-my-new-approach.html">varying</a> <a href="http://justinchouinard.com/blog/2010/04/10/fix-stale-ssh-environment-variables-in-gnu-screen-and-tmux/">complexity</a>. But here is a simple one-liner which finds an agent socket and attaches to it. This works in the current screen session (not just new shells within that session), and you don&#8217;t have to modify .bashrc or switch to zsh to use it.</p>
<p><code>export SSH_AUTH_SOCK=$(find /tmp/ssh-* -user `whoami` -name agent\* | tail -n 1)</code></p>
<p>This finds the most recent SSH agent owned by the user, and assigns it to SSH_AUTH_SOCK. This doesn&#8217;t guarantee that you&#8217;ll attach to the socket created for your current SSH session, only the most recent one. For instance, you could login with three SSH sessions and this will find the latest one. But if you&#8217;re using screen, you only really need one SSH session anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2011/07/12/reconnecting-your-ssh-agent-to-a-detached-gnu-screen-session/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solving the 2-second sound delay with XBMC and HDMI</title>
		<link>http://www.tolaris.com/2011/07/03/solving-the-2-second-sound-delay-with-xbmc-and-hdmi/</link>
		<comments>http://www.tolaris.com/2011/07/03/solving-the-2-second-sound-delay-with-xbmc-and-hdmi/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 21:32:06 +0000</pubDate>
		<dc:creator>Tyler Wagner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[htpc]]></category>
		<category><![CDATA[xbmc]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=1434</guid>
		<description><![CDATA[On my HTPC, XBMC outputs sound over HDMI to a Panasonic TX-37LZD70 TV. This works great in most respects. However, there is a 2-second delay between when XBMC starts playing audio (music or video with sound), and when it actually outputs from the TV speakers. The sound is in sync with the video; it just [...]]]></description>
			<content:encoded><![CDATA[<p>On my HTPC, XBMC outputs sound over HDMI to a <a href="http://www.hdtvorg.co.uk/reviews/lcd/panasonic_tx-37lzd70.htm">Panasonic TX-37LZD70</a> TV. This works great in most respects. However, there is a 2-second delay between when XBMC starts playing audio (music or video with sound), and when it actually outputs from the TV speakers. The sound is in sync with the video; it just takes 2 seconds to start. It&#8217;s annoying to always hear a theme song start part-way into the first few notes.</p>
<p><span id="more-1434"></span>This is a <a href="http://wiki.xbmc.org/?title=XBMCbuntu#Known_Issues">known issue</a>, but <a href="http://forum.xbmc.org/showthread.php?t=59176">isn&#8217;t really XBMC&#8217;s fault</a>. Basically, this TV (and many like it) doesn&#8217;t start playing sound right away. But there is a simple workaround &#8211; keep the channel open, by always playing silence. You can do this without any performance penalty.</p>
<p>Run this in a terminal (or in /etc/rc.local, or ~/.gnomerc, or however you like):</p>
<p><code>aplay -c2 -r48000 -fS16_LE < /dev/zero &#038;</code></p>
<p>This will constantly play silence to the ALSA sound system (in the case of Ubuntu, via Pulse). As far as I can tell, the sound server just drops it, or consumes very few resources to do it. The system load never increases nor does it appear as active in <code>top</code>.</p>
<p>I've implemented this as a more sophisticated solution. I have created my own <code>xbmc</code> script, which then calls the real XBMC.</p>
<pre>#!/bin/bash
# if xbmc already running, exit
if (ps -ef | grep '[/]usr/lib/xbmc/xbmc.bin' >/dev/null 2>&#038;1) ; then
   zenity --error --title "XBMC" --text "XBMC is already running. Please select it from the task bar above."
   die "XBMC is already running!"
fi

# Keep sound channel open (play silence), to prevent 2-second HDMI delay
aplay -c2 -r48000 -fS16_LE < /dev/zero &#038;
APLAY_PID=$!

/usr/bin/xbmc "$@"

kill $APLAY_PID</pre>
<p>Copy this script to ~/bin or /usr/local/bin and make it executable. It does two things:</p>
<ol>
<li>Prevent launching more than one copy of XBMC. An easy mistake to make since Gnome provides no launch feedback and XBMC takes some time to start. A more elegant solution would restore the other XBMC instance instead of nagging the user.</li>
<li>Starts playing silence before starting XBMC, then kills it afterward.</li>
</ol>
<p>A better solution would be for XBMC to maintain the channel itself (which must be what my DVD player does), but I'm happy with this until they release an official fix.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2011/07/03/solving-the-2-second-sound-delay-with-xbmc-and-hdmi/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

