CS1102 Lab 7

This week's work

Below, there are 5 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).

Some of the activities can be run from the Windows command line. You usually bring this up as follows: Start > All programs > Accessories > Command prompt. These activities are labelled "(Windows)" below.

But most of the activities are run from our Linux file server, cosmos.ucc.ie. These activities are labelled "(cosmos)" below. You don't need to reboot your PC to enjoy these activities! Simply use the Secure Shell Client (ssh), which we used when changing our Unix passwords during Induction Week. From Windows choose All programs > SSH Secure Shell > Secure Shell Client. Choose Quick Connect. In the dialog that pops up, the host name needs to be cosmos.ucc.ie and the port number must be 22. Then click Connect. You'll be prompted for your password. Afterwards, if another dialog pops up, click OK.

Before you proceed, let me remind you of UCC's Acceptable Usage Policy. Do not misuse your new-found knowledge. If you do, we will have no option but to come down hard on you!

Activity 1

(Windows) You can find out a lot of information about how your desktop PC is connected to the Internet by running a utility called ipconfig. Type the following at the command prompt:

ipconfig /all
Look at the output, and answer these questions:
  1. What is the hostname of the PC you are using?
  2. What is the physical address (also known as MAC address) of its connection to the campus Ethernet LAN?
  3. What is its IP address?
  4. Has its IP address been assigned statically or dynamically? (Hint: We discussed the distinction in lectures. If you can recall the name of the protocol that is used for dynamic assignment, then you'll be able to answer the question. If you can't recall the name of the protocol, then use, e.g., Google, to find it.)
  5. From lectures, you know an IP address can be split into a network identifier and a host identifier. What is the network identifier for this IP address? (Hint: Use the Subnet mask.)
  6. Similarly, what is the host identifier for this IP address?
  7. What do you think the Default Gateway is: is it a hub, a switch, a repeater, a bridge or a router?
  8. How many local DNS servers does your PC have addresses for?

Activity 2

netstat is another utility that gives some interesting information. In fact, it gives overwhelming amounts of information. Run it as follows to get a summary:

 netstat -s

(Windows) By all means run it at the Windows command prompt.

(cosmos) But run it on cosmos too, read through the output, and use it to answer the following questions:

  1. How many TCP segments has cosmos retransmitted?
  2. Have any packets been sent using UDP?

Activity 3

(cosmos) Network administrators often need to check whether two hosts can communicate. A basic way to do this is to use the ping utility. ping uses a protocol called ICMP to repeatedly send echo request packets to the target host; the target host sends echo reply packets back. ping estimates the round-trip time (rtt) and any packet loss.

ping either TCD's web server ( or UCD's ( or NUIG's ( or UL's ( Pick one at random, and only ping it once: we do not want to be accused of attacking their systems! Type ping followed by the IP address.

If cosmos can communicate with this host, lots of output will appear. Interrupt ping (using Ctrl+C) after about 10 lines. Some summary statistics will be displayed.

  1. Which host did you ping?
  2. How many packets were sent?
  3. How many were lost?
  4. What was the average round trip time?

Here's a couple of optional, 'fun' activities:

Activity 4

(Windows or cosmos) You can run nslookup to ask DNS to find the IP address that corresponds to a given domain name, e.g.

nslookup www.tcd.ie

Read the output carefully when answering these questions.

  1. What is the IP address for 4c.ucc.ie?
  2. What is the IP address for 5c.ucc.ie?
  3. Compare the IP addresses for www.ryanair.com and the IP address for www.ryanair.ie. What has this company done and why? (Use your browser to visit these two hosts, if it helps.)
  4. Use nslookup on www.google.ie. What has this company done and why?

Activity 5

(Windows or cosmos) If you give nslookup an IP address instead of a domain name, it may also perform the reverse mapping, e.g.

  1. What is the domain name for
  2. What is the domain name for

(Digression. On machines running Unix/Linux, such as cosmos, the commands host and dig are also available to do much the same thing that nslookup does. Try them if you like.)