Lab 6: Using the network

Due Tuesday, October 1, at 10:30 AM


As usual, place the commands you used to solve each of the 5 problems into a file called lab6. For this lab, some of the questions won't have been covered very well in class, so I'll give a brief explanation at the beginning of lab.
  1. Use wget to download this lab assignment. You can address the machine using either localhost, the IP address, or isoptera.lcsc.edu.
  2. Use netcat (nc) to open a port and listen for incoming connections.
  3. Use nmap to show that you have successfully opened a port (answering #2). It will be easiest to open a second terminal for this purpose, although you could use screen or background the listening process.
  4. Use netcat and cat to pipe a file into the port you have opened, so that it appears in the terminal you have netcat listening in. Note that using nmap as in problem 3 will stop netcat from listening, and you will have to start it again for this question.
  5. Use traceroute to determine the route from your computer or tux to a server located on another continent. Be careful, major websites tend to have servers in North America in addition to other places, and will redirect your query a nearer server. Check http://www.whois.sc/ for reverse DNS lookup (type an IP address into the box, and you will see a listing of information about the ownership of that IP. As a reminder, the answer to this question is a command using traceroute.
  6. Optimization flags can be given to the C and C++ compilers. Use the time command to time 4 things: Time taken to compile quicksort.cpp with and without -O3, and also how long the complete demo takes to run with and without -O3. Should be well under a second to compile in either scenario. Running the demo will take longer than compiling it.
Turn in your lab by creating a file named "lab6" with no extension in your home directory, with permissions set so that only you can view the file. This assignment is worth 35 points, 5 from correct naming and permissions permissions, and 5 from each of the problems above.