In this puzzle you will take your proxy from last puzzle and port it to a network simulator. If you follow the instructions carefully this should be easy. The network simulator you will use is called Entrapid. It was developed here at Cornell last year. It emulates a complete UNIX (FreeBSD) kernel on each node in the simulated network. The programs you use to configure each node are literally the same as used to configure real networks. You will therefore gain very valuable experience in configuring real networks - which will help you to understand the basics of networking as it is done today.
The main goal of this puzzle is for you to learn how to use the simulator. From the questionnaires we learned that most of you have little or no experience with UNIX systems. You will have good time in this puzzle to gain necessary experience on UNIX to be able to complete all following puzzles of this course.
The remaining puzzles will all be in the simulator and they are much harder than this one so you should use this opportunity to get comfortable with UNIX and Entrapid.
We have prepared a tutorial for the simulator. Follow it carefully, step-by-step, before starting doing the assignment.
Additional documentation for the simulator is at http://www.ensim.com/documentation/. There you will find more detailed information on how to use the simulator and man pages for all supported system-calls. To get access to the online documentation you have to register (of course it is free) at http://www.ensim.com/support/register.html.
The assignment is to take your proxy from last assignment and compile it on babbage.csuglab.cornell.edu such that it can be used in the Entrapid network simulator. We will provide source code for a simple web client and a web server that will compile on babbage such that it is usable in the simulator. You will similarly compile your proxy from puzzle 1. Then you will run your proxy and three instances of our webserver in the simulator. You can test your proxy by using the webclient we provide.
Before you start doing the real assignment you should spend a good amount of time getting comfortable with the simulator. You should follow the instructions in the online Tutorial. If you have any problems completing the steps in the Tutorial please contact Snorri (snorri@cs.cornell.edu). You will not be able to continue the assignment before you can complete all the steps. Unless any unexpected problems arise you should be able to complete this in less than 20 minutes. You should then go through all the steps again and think about what is actually happening in each step. All the configuration files are human-readable. Take a look at them. All commands used to configure the network are standard UNIX commands. Read about them in the man pages (note: some options for the commands may vary between UNIX implementations. And babbage is running Solaris but the simulator nodes run FreeBSD. The online man pages are more accurate).
Even though you do not really need to understand what all the commands do to complete this puzzle you will definitely need that for the remaining puzzles. You should therefore use this opportunity to learn as much now as possible.
For this example we provide sources for a simple web client and a simple web server. First you have to copy the sources to your directory:
Currently more than one make programs are installed on babbage. You should use the gnu make. It is located on babbage at "/usr/local/gnu/make-3.74/bin/". Do "which make" to see which make is the one you are using. Do not use the one located at "/usr/ccs/bin/make".
The simulator needs g++ 2.8.1. Do "which g++" and "g++ -v" to locate g++ and see the version number. Adm had promised us that g++ 2.8.1 would be installed before we this assignment was handed out. When those word are written it has not been done. g++ 2.8.1 is installed locally on the cs519 home directory. You can add /home/cs519/bin at the beginning of your PATH (do rehash after you change the path to update you lookup hash table).
Adm has installed g++ 2.8.1 on babbage. To use them type g++-2.8 or gcc-2.8 (instead of the usual g++ or gcc). Report any problems using the compilers directly to adm. You can change your makefile to use g++-2.8 and gcc-2.8 (set the CC and CPP variables).
Initialize (create directory and copy files) another directory for the web client. You will find the sources in /home/cs519/entrapid/webclient/.
Before running the webserver/webclient you must start up the simulator and initialize it with a topology. You should be familiar with the simulator by now and know how to run it successfully. Run it and initialize it exactly the same way you did in the Tutorial using the same network topology.
Run 3 instances of the webserver, one on m3, one on m4, and one on m5. To run the webserver on m3 you should type (you only type the boldface text):
% webserver 80
Waiting for connection...
You should open a new window to babbage.csuglab.cornell.edu for each instance of the webserver. Make sure to set up the environment for the simulator in each window (especially the NETEZ_PORT environment variable).
Now all the three servers should be waiting for connection from a client.
Run the webclient. The synopsis for the webclient is:
webclient [-proxy <machine> <proxy-port>] <url>
Examples (no proxy used)
webclient http://m3/page1.html
will run the webclient on m0 and connect to port 80 on m3 and send a GET request for "http://m3/page1.html".
webclient -proxy m2 18000 http://m4/page2.html
will run the webclient on m1 and connect to port 18000 on a proxy running on m2 and send it a GET request for "http://m4/page2.html". The proxy on m2 should connect to port 80 on m4 and forward the request (just like in last puzzle).
Next you should compile your web proxy. You will find a Makefile you can use in /home/cs519/entrapid/webproxy/. Generally you should be able to make the proxy just by running make (note: I expect the name of the proxy to be webproxy.cpp not proxy.cpp as in the last assignment). Currently not all UNIX system and library calls are supported. All system calls we recommended in puzzle 1 are supported. You should also be aware of that include paths may vary between different UNIX platforms. The simulator is running FreeBSD but babbage is running Solaris. Most include files you need to use are in /home/cs519/entrapid/include/.
We have been able to compile large and complicated network management programs like ping, netstat, arp, route and routed with none or very few minor changes.
If you run into trouble compiling your webproxy you should study the webserver and webclient programs. You should find enough help in those programs.
You should be able to run your webproxy just like you did in the last assignment.
% webproxy <proxy-port>
Remeber to set necessary environment variables before running the webproxy (see the tutorial)
You should test your proxy by running the webclient using the -proxy argument.
Example:
% webclient -proxy m2 18000 http://m4/page2.html
The webclient will run on the machine specified in NETEZ_MACHINE and use the proxy running on m2 on port 18000.
This will of course only work if the webservers and the proxy are running. You should have the proxy print out status information similar to what is done both in the webserver and the webclient.
In this section you will find known problems using the simulator and porting programs to it. We will add to this list whenever we find new problems. Please check this list if you have problems.
Please first read the overall submission instructions. In addition, please follow these instructions:
Similar to what you did last time you should mail the source file (webproxy.cpp) to snorri@cs.cornell.edu as plain ASCII text (no attachments).
Before you send me your code, please mail it first to yourself. Extract the code and compile it. This way you will find out if your mailer is wrapping lines, replacing characters, etc. Or use the mailx program to send mail (see man page)
The subject line must be: CS519: Homework 2
NEW: Put a one line comment at the top of your code with your
name and Cornell ID (6 digits) with the prefixes "Student:" and
"CornellID:".
Example:
/* Student: John Doe CornellID: 123456 */
Your proxy.cpp should compile with the provided Makefile without any warnings. I will modify the provided webserver and webclient slightly (to test the select function). If the webclient can fetch a requested page from the webserver using your proxy you will get full grade. If it fails you can come to the TA's office hour and explain what went wrong. If the problem is minor then you'll get 80% otherwise 0.
This page was last updated on 01/01/02 06:40 PM