CS1102 Lab 8

This week's work

Below, there are 4 activities. Complete each activity, and answer the questions. Write your answers onto a sheet of paper. Write your name on the paper. Hand it up at the end of the session. After you have completed the activities, resume work on your personal home page (lab 6).

Re-read the worksheet for lab 7, if you need to remind yourself of how to run `nslookup` and `ping`.

Let me remind you again of UCC's Acceptable Usage Policy.

Activity 1

(Windows or cosmos) As you know from lectures, there are 232 IP addresses (IPv4) but many of them are wasted and not in use. (Do you remember why?) Let's use `nslookup` to make a (rather unreliable) estimate of the proportion that are in use.

Invent 10 different IP addresses, at random (but make them fairly different). (Remember, each IP address consists of four decimal numbers, each between 0 and 255.) Use `nslookup` on each of your 10 IP addresses. If the address has a domain name, we'll assume the address is in use. (Reasonable enough!) If the address doesn't have a domain name, we'll assume the address is not in use. (Dodgy!).

1. On this basis, what is your estimate of the proportion of the IP address space that is in use?

Activity 2

(cosmos) Choose the hostname of some computer on the Internet outside of UCC. Use `nslookup` to find its IP address. Now `ping` the hostname, and then `ping` the IP address. (Some machines disallow `ping` requests, in which case you'll have to pick a different target computer.)

1. Do you see any difference between `ping`ing the address versus `ping`ing the name? If so, what?
2. Why would there be a difference?

Activity 3

The `whois` command can tell you to whom a domain name is registered.

1. First use `nslookup` to compare the IP address for `britannica.com` and the IP address for `britanica.com`. Then use `whois` to find to whom these doman names are registered. What do you think is going on here?
2. Do the same for `w3c.org`, `w3c.net` and `w3c.com`. What do you think is going on here? (Use your browser to visit these hosts, if it helps.)

Activity 4

(cosmos) You can use `/usr/sbin/traceroute` to obtain the route that a packet follows across the Internet, e.g.:

```/usr/sbin/traceroute www.w3c.org
```

Let's use `/usr/sbin/traceroute` to estimate the diameter of the Internet.

If we were being mathematically accurate, we would measure the diameter by finding the shortest distance (in terms of hops, not kilometres) between every pair of computers. The diameter would then be the longest of these paths. The longest shortest path, if you like!

But we can't do that.

Here's what we'll do. Use your browser and find 5 web sites that you think are hosted a long way from Cork - companies or universities on the other side of the world, that sort of thing. On each of these, run `/usr/sbin/traceroute`. In each case, count the number of hops. (If the output of `traceroute` includes *** entries, ignore them in your hop-count. On the other hand, if `traceroute` starts to display indiviudal asterisks at a rather slow rate, then it is 'getting stuck', in which case choose a different web site.)