Archive for the 'Networking' Category

Jul 05 2008

Internet access: easy in bars, difficult at home

Published by Dougal under Home, Networking

We’ve been fighting with Virgin Media for about 6 weeks now to get our net access transferred over to the new flat. The entire time we’ve been paying for a service we do not have. This will definitely require remuneration when we finally get a service.

We’ve been surviving thus far with a couple of open WiFi connections that we could pick up. Neither were very close to us — this requires careful positioning of laptops to maintain signal levels — but they were still usable.

Were usable. Past tense. On Thursday night both of the networks we used disappeared. One of them hasn’t come back and the other has but appears broken. I can occasionally get an IP address but it doesn’t forward packets past the router. :-( We are bereft, cast loose in a sea of microwaves, all encrypted… we’ve been really suffering!

We’re currently in Montpeliers, downing cocktails and jealously guarding access to the power socket that is powering my laptop. I can highly recommend their Whisky Sour, which is really delightful, and the Espresso Cocktail, which was apparently made with the wrong ingredients but tasted grand anyway. It’s pouring with rain outside and I feel no motivation to get wet.

Email and blogging may be rather light this weekend because we’ll be snatching whatever access is available in cafés and bars (carrying an Eee around is awesome). Please bear with us!

One response so far

Mar 27 2008

When you send a message, where does it go?

Published by Dougal under Networking

When you send any kind of message on a network it gets shunted from place to place until it finally arrives at its destination, or is discarded. I’ll cover the successful case at some point in future, but for now we can look at why a message (a ‘packet’) might be ‘dropped’.

A network is a series of interconnecting machines which all have a small, possibly erroneous, view of the world. They have an idea of which machine is connected to which other machine but since networks are inherently unreliable this internal map is never accurate for very long.

Occasionally a group of machines will be convinced that someone else in the group is the “next step” when delivering a packet. So A will transmit to B will transmit to C will transmit back to A again. This would ordinarily constitute an infinite loop, where these packets will continue being shunted round forever (or at least until someone accidentally pulls out a power cable and kills one of the machines…).

This can be prevented by giving each packet a “lifetime”, known as its Time To Live (TTL). Rather than being measured in seconds the TTL is measured in hops — whenever it is transmitted from one machine to another this number is decremented. If a machine receives a packet which has a TTL of zero, but that machine is not the ultimate destination, then the packet is discarded. This prevents immortal packets from roaming the network forever, undelivered and lost.

The TTL also gives us a nifty tool to find out where packets are disappearing. When a router discards a packet for being too old, it’s supposed to send back a message saying what happened (ie, “too old”) and who discarded it. A packet with a TTL of zero should be discarded at the first machine it meets; a packet with TTL of one at the second machine; and so on down the line. So we can send out little packets with gradually increasing TTLs to see where they go.

This is an example: me tracing the hops to reach www.google.com. The first line is the default gateway for my ISP, which all our home traffic goes through, and the last line is a machine belonging to Google.

dougal@cuttlefish ~ $ traceroute www.google.com
traceroute to www.google.com (64.233.183.104), 30 hops max, 40 byte packets
 1  10.123.104.1 (10.123.104.1)  18.965 ms  19.484 ms  20.071 ms
 2  77-96-1-2.cable.ubr01.azte.blueyonder.co.uk (77.96.1.2)  20.959 ms  21.532 ms  22.123 ms
 3  * * *
 4  pop-bb-a-so-300-0.inet.ntl.com (213.105.175.130)  126.573 ms  127.143 ms  130.025 ms
 5  pop-bb-b-ae0-0.inet.ntl.com (213.105.174.230)  130.604 ms  131.190 ms  131.766 ms
 6  * * *
 7  212.250.14.138 (212.250.14.138)  118.341 ms  120.692 ms  163.523 ms
 8  209.85.252.76 (209.85.252.76)  118.807 ms  124.392 ms  123.757 ms
 9  72.14.232.149 (72.14.232.149)  132.502 ms  133.543 ms  133.671 ms
10  209.85.255.137 (209.85.255.137)  139.149 ms 209.85.255.13 (209.85.255.13)  137.904 ms  138.661 ms
11  72.14.233.77 (72.14.233.77)  143.339 ms 72.14.233.79 (72.14.233.79)  161.037 ms 72.14.233.77 (72.14.233.77)  124.609 ms
12  216.239.43.34 (216.239.43.34)  132.107 ms 209.85.249.129 (209.85.249.129)  132.696 ms 209.85.249.133 (209.85.249.133)  131.462 ms
13  nf-in-f104.google.com (64.233.183.104)  130.411 ms  127.656 ms  132.048 ms

The numbers in the left-hand column are TTL values. So it basically took 13 hops to get into the Google heartland. On each line there is an IP address and sometimes a host name for the machine that discarded the packet. Each packet is sent three times, so there are three times at the end of each line showing how long it took to get there and back. (You’ll notice from about line ten onwards there are several IP addresses and several times per line. This suggests that the packets with identical TTL values were going through different routes. I would guess this points to load-balanced routers which share the incoming packets.)

The asterisks which appear on lines 3 and 6 are where the packet was discarded but no error message was received within 5 seconds. And since most of these messages have a round-trip time of about 200 milliseconds, that’s considered time enough to abandon hope.

No responses yet

Mar 21 2008

The home network

Published by Dougal under Networking

It’s been a while since I wrote about networking here. So let’s look at domestic networking setups.

The scenario we have in our flat is quite ordinary. There are two computers on the network, one desktop machine and one laptop. Traditionally these two would be connected to a switch so they can communicate with each other. In big companies or other places with extensive networks then a switch is necessary to juggle all the traffic in a reasonable way.

(The diagram here shows three computers connected to a switch, the box with the extended X shape in it. The computers can send packets to each other through the switch.)

A small network

But for small networks a full-blown switch is pretty useless. It’s like having a private telephone exchange in a house with only two telephones. So most people won’t see a separate switch: it will be integrated in the box with other things.

One thing you’ll notice in the diagram shown is that there’s no external communication. There’s no internet access — the machines can only talk with others on the same network. The connection between the home network and the rest of the internet is done with a router. It directs the network traffic like a traffic policemen. Local stuff stays local, but data that needs to be sent elsewhere goes via the router.

This is what a network with external access looks like:

A small network with external access

You can see that here the router is doing very little as well. There’s only one connection in and one connection out. So in my house, and probably in yours, the router and the switch are combined into one box. It does switching and routing (and often wireless access too). My home network looks like this:

A simple home network

(Apologies for the lame diagrams. Anyone know pretty diagram software for Linux? Pastel shades and smooth gradients welcome.)

Inside the router/switch hybrid beast the software analyses the destination for each packet sent and decides whether the destination is on the local network or somewhere else, and then sends it in different directions accordingly.

Apart from this, it can probably also hand out IP addresses to new machines as they join (extremely useful, so you don’t have to do any manual configuration). There may be some firewall capability too, so that particular programs can be prevented from sending signals in or out. It’s quite amazing what features are available in 50 quid devices!

3 responses so far

Jan 07 2008

Introduction to Networking

Published by Dougal under Computing, Networking

The fault is all mine. I have started learning more about networking, and so I want to start talking more about networking. But most people, they don’t know about networking. So there’s only one way to solve this problem. Order them to order large books from Amazon! Okay, that’s probably not very effective. The other way is to write about networking myself.

Consider this either a simplified introduction to networking, or a means of cementing my knowledge. You don’t properly know it until you’ve explained it to someone else. This does leave me with a small problem: I can’t actually tell if you’ve had it explained to you, or just told to you. So if there are any unclear bits please let me know.

Continue Reading »

No responses yet

Dec 06 2007

Qualifications

Published by Dougal under Networking, Work

In the interest of continuing professional development and the like, I’ve started studying for the CCNA exam.

What does this mean? Well, a bunch of us at work are having regular study sessions: going through the study guides and the test questions. It’s been easy-going so far, because it’s been the ‘fundamentals’ section and it’s all been stuff that a home network tinkerer might come across. (Well, apart from frame relay…)

I’m nervous that it all just appears easy but the exams will be horrifying. Also, horrifying and expensive to resit. :-(

No responses yet