CS 336/621 PROJECT #1 Due: 7:30pm, Tuesday 03/10/09 The purpose of this project is to introduce students to programming of network applications in C/C++ using the Berkeley sockets API. PROBLEM STATEMENT This project asks the student to write an application program named 'showpath.cpp' which uses the sockets API to implement a much simplified version of the standard 'traceroute' algorithm, based on sending out UDP datagrams to a specified destination and obtaing the intermediate router addresses as ancillary data provided by the 'recvmsg()' socket function. REQUIREMENTS The user of your 'showpath' utility should be allowed to supply the hostname (or IP-address) of a target station as a command-line argument, like this: $ ./showpath sfsu.edu At a minimum, your 'showpath' utility should display IP-addresses of the routers encountered along a network path toward your user's destination, as for example: tracing a network path to sfsu.edu (130.212.10.239) ttl= 1 hop: 138.202.171.254 ttl= 2 hop: 138.202.128.202 ttl= 3 hop: 137.164.38.80 ttl= 4 hop: 137.164.24.2 ttl= 5 hop: 137.164.22.33 ttl= 6 hop: 137.164.40.82 ttl= 7 hop: 130.212.253.68 ttl= 8 hop: 130.212.199.252 ttl= 9 hop: 130.212.10.239 You will need to decide how to handle any cases when a specifed station cannot be reached. EXTRA CREDIT You have several opportunities to add your own enhancements to the basic functionality required for 'showpath.cpp' -- if you want to learn more about network programming and earn extra credit. (You can examine the official Linux 'traceroute' tool for some ideas along this line, or Linux's alternative 'tracepath' utility.) For enhancements you add, be sure to include a brief statement in your source-file's 'comments' that explains how a particular enhancement makes your utility more useful. WHAT TO SUBMIT Your project-submission has two required parts: (1) a printout of your source-file (i.e., 'showpath.cpp'); (2) electronic copies of all of your program-files; Use our 'ljpages' utility-program (under 'System Software' on our cs336 website) to produce your printout on a laserprinter in our classroom or in one of the Harney Fifth-Floor CS Labs -- Be sure your printout shows YOUR NAME as the project's programmer -- and turn in your 'printout' to your instructor's mailbox (Mathematics Office: Harney-222) or in class. Submit project files ('showpath.cpp' and 'showpath') electronically, by copying them into your cs336 '/submit' directory, where your instructor can access them for doing testing and grading: $ cp showpath* /home/submit/cs336//. ________________________________________________________________________ Allan B. Cruse University of San Francisco Spring 2009