<?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>The Imaginary Part &#187; networking</title>
	<atom:link href="http://1.21jiggawatts.net/blog/tag/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://1.21jiggawatts.net/blog</link>
	<description>Just another Australian geek&#039;s perspective</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:33:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Making UConnect suck less with urlyconnect</title>
		<link>http://1.21jiggawatts.net/blog/2010/04/making-uconnect-suck-less-with-urlyconnect/</link>
		<comments>http://1.21jiggawatts.net/blog/2010/04/making-uconnect-suck-less-with-urlyconnect/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 07:44:41 +0000</pubDate>
		<dc:creator>TK</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://arctanx.id.au/blog/?p=151</guid>
		<description><![CDATA[The University of Tasmania has student wireless Internet access, a network called UConnect. (Great pun.) This network has sucked by varying amounts over the three and a half years I've spent there as a student. It's some sort of 802.1X beastie. Setting it up on GNU/Linux is mostly a trial-and-error affair. My current settings are [...]]]></description>
			<content:encoded><![CDATA[<p>The University of Tasmania has student wireless Internet access, a network called UConnect. (Great pun.) This network has sucked by varying amounts over the three and a half years I've spent there as a student.</p>
<p>It's some sort of 802.1X beastie. Setting it up on GNU/Linux is mostly a trial-and-error affair. My current settings are WPA2 Enterprise security, PEAP authentication, MSCHAPv2 inner authentication, and an AusCERT-certified identity whose <a href="http://arctanx.id.au/urlyconnect/auscert.cer">root certificate</a> isn't included in any normal root certificate packs.</p>
<p>They don't actually tell you what the settings are. The current way you're supposed to set it up on Windows or Mac OS X is to run some java-ish program which asks you for your administrator password and proceeds to mess with your settings such that it should work. Furthermore, if you're running Windows and it can't detect antivirus software it forces you to install McAfee Antivirus before it will mess with your settings. But that's okay, because <a href="http://andreyf.tumblr.com/post/538652366/info-roundup-mcafee-kills-computers-worldwide">McAfee is awesome</a>.</p>
<p>Nonetheless it can be made to authenticate and have your computer on the University network. At this point you have access to the Internet, sort of. You can make DNS requests, or open TCP connections to destination ports 80, 110 and 443. Previously you had to explicitly go through proxy.utas.edu.au to get your web traffic out, but this year they brought in transparent proxies <em>(edit: Not true. See comments)</em>. This is a minor improvement, but still doesn't do much for my IMAPS email, Google Talk, or anything else I want to do.</p>
<p>The general technique I've used for this other traffic is an ssh tunnel to my computer at home, using corkscrew where necessary to get through an HTTPS proxy. ssh -D will set up a SOCKS proxy on the local computer, causing all connections to be made via the remote computer (my computer at home). All I have to do is tell pidgin and Thunderbird and possibly firefox to use a SOCKS proxy at localhost and I can use the Internet how I like.</p>
<p>I wish I could say that having negotiated all these challenges I can relax and concentrate on my studies. This year they introduced a new problem: connections drop out. After some random interval of normally 2-30 seconds most TCP connections will stop having packets go either way. New connections continue as normal. I have no idea what routing problem is responsible for this but it's damn annoying.</p>
<p>Even HTTP requests can be affected by this. Sometimes I'll load a wikipedia page and half the maths images won't load. There is one little bit of respite: if a connection lasts for longer than about 30 seconds, it will tend to live more or less forever. Weird. This gives me a solution to web browsing: I keep on trying to establish an ssh tunnel to my home computer, and once one has managed to stay established for over half a minute, I can start using it to do web browsing through the SOCKS proxy.</p>
<p>This is where I've been at for the last seven or eight weeks but it's getting seriously frustrating killing ssh connections until I manage to establish a tunnel which stays up. I wanted a program to automate this process. Let's make a lot of ssh connections, poke them every ten seconds for half a minute, then grab one that's still alive and start another channel with that ssh TCP connection.</p>
<p>This can be facilitated using the ssh ControlMaster option (-M -S). Each of the simultaneous connections puts a socket in /tmp. Then when I want to use a particular TCP connection I launch another ssh process with -S to indicate the socket to use and also with the -D option which enables the SOCKS proxy behaviour on that connection. Then I want that first background connection to hang around until I'm done with the second, then die automatically.</p>
<p>So I've written a program that does just that: <a href="http://arctanx.id.au/urlyconnect/">urlyconnect</a>. If you're at UTAS you too might find it useful. I've tested its functionality on Debian and Ubuntu GNU/Linux but I see no reason why it shouldn't run on a Mac. If you use Ubuntu, note carefully the instructions in the README about the required version of OpenSSH.</p>
<p>Well, that's that done. Time to go and do something related to my degree.</p>
]]></content:encoded>
			<wfw:commentRss>http://1.21jiggawatts.net/blog/2010/04/making-uconnect-suck-less-with-urlyconnect/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Units and prefixes</title>
		<link>http://1.21jiggawatts.net/blog/2010/04/units-and-prefixes/</link>
		<comments>http://1.21jiggawatts.net/blog/2010/04/units-and-prefixes/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 02:20:33 +0000</pubDate>
		<dc:creator>TK</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[pedantry]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://arctanx.id.au/blog/?p=148</guid>
		<description><![CDATA[Lots of people get units wrong. Please don't be one of those people. This is a tutorial introduction to getting your computing units right. The history of these issues is covered in extensive detail at Wikipedia. File or Data Size Everyone knows that computers store things as 1s and 0s. These are called bits. (Short [...]]]></description>
			<content:encoded><![CDATA[<p>Lots of people get units wrong. Please don't be one of those people.</p>
<p>This is a tutorial introduction to getting your computing units right. The history of these issues is covered in <a href="http://en.wikipedia.org/wiki/Binary_prefix">extensive detail at Wikipedia</a>.</p>
<p><strong>File or Data Size</strong></p>
<p>Everyone knows that computers store things as 1s and 0s. These are called <strong>bits</strong>. (Short for <em>binary digits</em>).</p>
<p>All modern computers represent things like letters and numbers with a group of 8 bits, which is called a <strong>byte</strong>. That is; there are 8 bits to every byte.</p>
<p>Convention is to use a lower case <strong>b</strong> to refer to quantities of bits and an upper case <strong>B</strong> to refer to a number of bytes. 220B refers to 220 bytes.</p>
<p>If we want to talk about lots of bytes there are SI prefixes available to us:</p>
<ul>
<li><em>k</em> (kilo) 1,000</li>
<li><em>M</em> (mega) 1,000,000</li>
<li><em>G</em> (giga) 1,000,000,000</li>
<li><em>T</em> (tera) 1,000,000,000,000</li>
</ul>
<p>So it is perfectly okay to talk about 936 kB, 1.24 Mb, 50 GB, referring to kilobytes, megabits and gigabytes respectively. It is <em>not</em> okay to talk about 936 mb because the prefix <em>m</em> (milli) means <em>one-thousandth of a bit</em>. You can't have parts of a bit. Please don't use the wrong case.</p>
<p><strong>Binary prefixes</strong></p>
<p>Confusingly, often people use terms like kB, MB and GB while meaning something slightly different.</p>
<p>When a computer stores a bunch of bytes in memory it tends to group them into chunks of powers of 2. This is because it needs to be able to give each spot in memory an address and it's easier to build hardware conforming to:</p>
<p>All addresses of the form 000000xx xxxxxxxx are stored in chip 1, 000001xx xxxxxxxx are stored in chip 2, etc.</p>
<p>In this example every chip has 10 bits of address space and can store 1024 bytes. If you were lazy, you would say that each chip stores 1 kB of data. But that means 1,000 bytes, not 1,024!</p>
<p>Similarly, with 2^20 bytes you get approximately one million: 1,048,576. So you can't say that this is a "megabyte" really, because that would mean exactly one million bytes.</p>
<p>There are two main solutions to this problem. The first and most common is to ignore it. This entails using kB, MB, GB, etc. and letting the person reading it guess exactly how many bytes you mean. This works most of the time because usually an approximate file size is good enough. Will the file fit on my flash drive? About how long will this take to download? Near enough is good enough.</p>
<p>But I'm an engineering student so I find this imprecision annoying, and sometimes we need to be explicit about what we mean. For this we have a method developed by the International Electrotechnical Commission:</p>
<ul>
<li><em>Ki</em> (kibi) 1,024</li>
<li><em>Mi</em> (mebi) 1,048,576</li>
<li><em>Gi</em> (gibi) 1,073,741,824</li>
<li><em>Ti</em> (tebi) 1,099,511,627,776</li>
</ul>
<p>If you ever see numbers like 3 KiB, 2.3 GiB, etc., you know exactly how many bytes they really mean. Better yet, if you always use those forms to represent the powers of 2, you also know that the ordinary SI prefixes always mean powers of 10.</p>
<p>The only downside is that it sounds ridiculous to say "mebibytes" out loud. But hey, it might be cool some day. It's only been around since 1996. If you look carefully, some computer software will express quantities in MiB or GiB. DC++ is an example.</p>
<p><strong>Transfer Speeds</strong></p>
<p>There are two main things to say about speeds. First of all, a transfer speed is how much data you can transfer in a given amount of time. Therefore the speed is an amount of data <em>per second</em>.</p>
<p>When speaking out loud it's convenient to talk about a "one-point-five megabit connection" but when written it should be "1.5 Mb/s".</p>
<p>Secondly, standard Internet connection speeds are quoted in bits per second. When you download files in your browser it usually shows you bytes per second. If you have a 1500 kb/s connection, to estimate your download speed in bytes per second you need to divide that number by 8, which is 187.5 kB/s. In reality it won't be quite that fast, but there's a big difference in the number depending on whether you're using bits or bytes.</p>
<p><strong>Conclusion</strong></p>
<p>I'm not as pedantic as some people. I have a lecturer who will happily write distances in Mm (megametres) instead of thousands of kilometres like almost anybody else would do.</p>
<p>All the same, the chances are you'll run across these numbers quite a lot and if you know exactly what they mean, more power to you. I will also be happier if I am reading something you've written and don't have to make mental conversions.</p>
<p>Finally and most importantly: sometimes it can be ambiguous. There is such a wide range of internet connections available these days that a download speed of 1 MB/s or a download of speed of 1 Mb/s could both be reasonable. If you're working out how long something will take to transfer you can't rely upon common sense to guess the correct form.</p>
]]></content:encoded>
			<wfw:commentRss>http://1.21jiggawatts.net/blog/2010/04/units-and-prefixes/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>SLIP and slattach</title>
		<link>http://1.21jiggawatts.net/blog/2009/11/slip-and-slattach/</link>
		<comments>http://1.21jiggawatts.net/blog/2009/11/slip-and-slattach/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 05:11:51 +0000</pubDate>
		<dc:creator>TK</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[slip]]></category>

		<guid isPermaLink="false">http://arctanx.id.au/blog/?p=101</guid>
		<description><![CDATA[After some experimenting I've managed to get a semi-permanent 115kb/s SLIP connection between my main Debian server and a 486 running BSD. By semi-permanent, I mean as soon as there's a power cycle I'm going to have to run out with a laptop with DHCP server, a crossover cable and some patience to make it [...]]]></description>
			<content:encoded><![CDATA[<p>After some experimenting I've managed to get a semi-permanent 115kb/s SLIP connection between my main Debian server and a 486 running BSD. By semi-permanent, I mean as soon as there's a power cycle I'm going to have to run out with a laptop with DHCP server, a crossover cable and some patience to make it work again.</p>
<p>Here's a bit of odd behaviour from the BSD machine shown from /var/log/messages:</p>
<pre>Nov 20 03:08:33 cogline slattach[644]: SIGHUP on /dev/ttyd0 (sl-1); exiting</pre>
<p>This occurs when I run <code>slattach -s 115200 /dev/ttyd0</code> with nothing attached to the port, or when the other computer is connected and has been running slattach for "a while" (a minute or two?). Debian slattach has no difficulty running with the serial port in any condition, and if it's started reasonably soon before the BSD slattach, everything is fine.</p>
<p>Unfortunately this kind of problem makes it difficult to set up computers that will automatically negotiate a SLIP connection when they first turn on. I configured the BSD system to run slattach and the required ifconfig command on boot and it never works.</p>
<p>Normally SIGHUP is used to indicate that the carrier has dropped and a redial is necessary. The BSD slattach code reveals that the above message is simply what the SIGHUP handler does when no redial command is set, presumably before the interface has finished initialising because the "unit" is still "sl-1" instead of "sl0". I'm using a null modem cable so it makes sense that the carrier will go down when nothing is attached, but that doesn't explain the failure when both are running for a while.</p>
<p>Curious. Stay tuned, I might learn something.</p>
]]></content:encoded>
			<wfw:commentRss>http://1.21jiggawatts.net/blog/2009/11/slip-and-slattach/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
