CSC 465 Assignment 1

 

Introductory lab exercises

 

Due: end of today’s lab period, January 25, 2001.

 

Some of the exercises require you to answer questions.  Your answers should be recorded using a word processor, then pasted into the body of an email addressed to PeteSanderson@smsu.edu.  Be sure to include your name.  You may alternatively print it and hand it in.

 

Exercise 1:  Log into the online textbook.  Instructions are given on the cardboard insert in the front of your book.  If you do not have one, pair up with someone who does.  If you have not already activated your access, this will require that you:

a.       Turn your browser to http://www.awl.com/kurose-ross

b.      Click on “online book”

c.       Select “register here”

d.      Enter the activation ID and password from your insert.

e.       If this is successful, you will be given an online registration form and among other things will specify a user ID and password for future use.

 

There will be no incentive in this course to need “private” access to the online book, so don’t be afraid to share your ID and password if requested.  I suggest you use “csc465” as the password.  I do not know if the system will allow multiple simultaneous sessions for the same user ID – we’ll cross that bridge if we come to it.

 

 

Exercise 2:  Once you gain access to the online book, go to the table of contents then Chapter 1.  Under Section 1.4, you will find a link to an applet that compares packet-switching with message-switching transmission.  Fire up that applet.  It simulates a network similar to the one we used in the classroom example the other day: two hosts and two routers.  The simulation can be run either with or without propagation delays. 

a.       Check all three propagation delay boxes.

b.      Set the simulation speed to whatever you want.

c.       Run a simulation for a 12 kbit message with 12 kbit packet size – this is message switching.  Note the total time units required.

d.      Run another for 12 kbit message with 6 kbit packet size, and note total time units.

e.       Repeat for 3 kbit packet size.

f.        Repeat for 1 kbit packet size.

g.       From this experiment, what conclusions can you draw about packet size selection?

h.       This applet allows minimum packet size of 1 kbit.  Suppose you could reduce this all the way to 1 bit.  What do you think the results would be?  Why is this not a true reflection of reality (networks do not use 1 bit packets)?

 

 

 

Exercise 3:  Online textbook section 1.4 also contains a simple traceroute exercise.  You specify a server and it will trace the Internet routing that occurs between a machine in Singapore and the machine you specify.  Each line of output represents one router encountered in the path, along with the response time (actually, it does 3 of them so you can compare 3 samples).

a.       Run this program for csc.smsu.edu.

b.      How many machines were encountered?

c.       What was the average response time?

d.      Are there any large “gaps” in response time readings from one router to the next?  Pick one out, describe it, and speculate on why it might be so large.

e.       Repeat for  www.ucla.edu.  Are the results much different?  Explain.

f.        Repeat for www.microsoft.com.  Are the results much different?  Explain.

 

 

Exercise 4:  Chapter 2 describes several common Internet applications and their network protocols.  One of these protocols is HTTP, used for web communication.  In this exercise, you will use a little HTTP to communicate directly with a web server from a command line using TELNET.

a.       Although this can be done from Windows in a command-line (DOS) window, it appears to be much cleaner going from a unix command prompt.  Nearly all of you have login IDs on csc.smsu.edu.  If you don’t, pair up with someone who does – you can also do this from Windows but it seemed uglier when I did it.  Login to csc.smsu.edu.

b.      Try the example from textbook top of page 94.  Online book section 2.2.3.  It is:
telnet  www.eurecom.fr  80
GET  /~ross/index.html  HTTP/1.0
(press Enter key twice)

c.       What is the output of that command?

d.      What happened to the connection?

e.       Look up the same web page using your browser.  Does it contain any pictures?

f.        Was the picture downloaded when you did the GET?

g.       Look at the HTML source code, note the filename of the picture, and download the picture only.

h.       Now download the picture from the command prompt, using the GET command.  What happens?

i.         Download  /~ross/banana.html from the command prompt, using the GET command.  What happens?

j.        Repeat steps b, h, and i using HEAD instead of GET.  What happens?

 

 

EXERCISE 5:  Enter and run the Java TCP client and server programs described in Chapter 2 section 6.  From the online textbook, you can copy and paste the source code.  The programs appear on pages 141 (client) and 145 (server) of the textbook.

 

TCPClient.java accepts a line of text input from the keyboard and transmits it to the server through a TCP socket.  The server responds with the same text converted to upper case.  The client displays this result then terminates.

 

TCPServer.java accepts lines of text from clients (one at a time), converts the text to upper case and returns this result to the client.  The server process does not terminate on its own, but must be terminated by an outside action (such as Ctrl-C).

 

Run these programs (almost) as given.  When you have done this successfully, demonstrate it to me and then you may leave.

 

 

IMPORTANT NOTE:  The value 6789 in these programs is the communication “port.”  Before running the programs, you must change it to a randomly selected value between 1024 and 9999 (both client and server must use same port).  Only one server process on the entire system can be running on a given port at a time (e.g. a port is a global resource).  Also change “hostname” to “localhost”, and run both client and server on the same machine.

 

Java is an object-oriented language, but you will see that TCPClient.java and TCPServer.java are not!

 

Java.

 

The programs have been tested both on Linux and Windows NT systems using Sun's JDK, which is available in several forms:

1.      JDK is installed in all CSC classroom laboratories

2.      JDK installation files are available in folder CSCTOOLS on the Eccentric server.  See the "readme" file for details.  You'll need a ZIP disk.

3.      JDK is available for download from Sun's Java website, java.sun.com.

 

 

Quick primer on jdk use for single file programs.

 

1.      Source code is stored in text file having ".java" extension.  Compose using your favorite text editor.  You should include one class in the file and give the file the same name as the class.

2.      Source code is "compiled" into byte-code with the command: javac  filename.java
Creates byte-code file filename.class.

3.      Once step 2 is completed without error, run the program with command:  java  classname
(good reason for file name to be same as class name).

 

 

Quick primer on testing client-server applications.

 

1.      For testing, you can both the server and the client on the same machine.  In the provided program, the machine name is hardcoded into the client.

2.      If running on an NT system, open up one DOS window for the client and a different DOS window for the server. Run the server program first, then the client.  Note that the server does not terminate, and you can run the client over and over.  Terminate the server with Ctrl-C.

3.      If running on Linux, you can either open up a different window for client and server, or run the server in background.  If you choose the latter, run the server first, and put an "&" as the last character on the command line to run it in the background.  Then run the client.  When finished, terminate the server either by killing its process ID, or by bringing it back to the foreground with the "fg" command then killing it with Ctrl-C.

 


[ assignments | CSC 465 | Peter Sanderson | Computer Science | SMSU ]


Last reviewed: 25 January 2001

Peter Sanderson ( PeteSanderson@smsu.edu )