Homework Assignments: 22C:178 & 055:134

Computer Communications Spring 1998

Assignment 4

[3 February]

Here are a few more commands that may give interesting results. Can you explain the results of the following commands?

nslookup www.lycos.com
traceroute www.lycos.com
ping www.lycos.com
Download this file and name it reping in your directory. Then enter the command sh reping. Why does the output change sometimes and not change other times?
Chapter 6 ends with an illustration of how to use nslookup to find other name servers. Use nslookup to find authoritative nameservers for the purdue.edu domain.
How many hosts are currently defined in the cis.ksu.edu domain? This question can be answered using the nslookup command in the interactive mode (but it's not straightforward).
As you may have seen from trying ping with certain non-existing addresses, it is necessary to use control-c to stop the program. This is because ping does not quickly abandon its task. Suppose ping were rewritten to automatically quit if it did not get a response within ten seconds. Then we would say ping has a ten second timeout . Timeouts are necessary in many network applications. To learn how timeouts work, copy the sigtime.c program to your directory and compile it (with the command gcc -o sigtime sigtime.c). When you run sigtime, you can either wait for thirty seconds and the program will quit, or give it some keyboard input. Each time you give the program input, the timeout timer is reset.

After you have experimented with the program, use man signal, man alarm, and man sigaction to learn about Unix signals. Then edit the program and comment out the doSigSet() call in the main program, recompile and test it -- this shows what happens when an alarm signal occurs but a program has not prepared for such a signal.

For those of you with advanced Unix experience, you might try starting another window, use ps to find the process running sigtime, and observe that you can force timeouts ahead of the actual wait time using the kill command to manually send an ALRM signal to the process.

Ted Herman