130 likes | 148 Views
Project 1 HTTP Client/Server. NTU CSIE Computer Networks 2009 Spring. Project Goal. In this Project 1, students are asked to get familiar with packet sniffing tool (Wireshark) and socket programming by implementing a simple HTTP client/server. Wireshark.
E N D
Project 1 HTTP Client/Server NTU CSIE Computer Networks 2009 Spring
Project Goal • In this Project 1, students are asked to get familiar with packet sniffing tool (Wireshark) and socket programming by implementing a simple HTTP client/server.
Wireshark • “Wireshark is a free packet sniffer computer application. It is used for network troubleshooting, analysis, software and communications protocol development, and education.”-- Wikipedia http://en.wikipedia.org/wiki/Wireshark • Wireshark
Goal 1: Monitor Your Internet Traffic • Use Wireshark to capture packets when you are using Internet • 5 minutes is enough • Try to describe those packets • Where does a packet come from? • Using a pie chart to show what % of packets using a specific protocol (TODO: 放圖) • Etc. • Pick at least one HTTP traffic and analyze it • What does each packet do?
Goal 2: Build an HTTP server and client • HTTP server • Waits for requests on specific port • Sends back web pages • HTTP client • Read an URL, send requests to the server • Save the retrieved web pages to disk
File system a.html b.html Project Scenario Other HTTP Server Your HTTP Server Saved pages FireFox / IE YourHTTP Client
Requirements • Write your programs on R217 workstations • The page saved by client should be the same as the one on server • Normal web browsers should work with your server (at least FireFox and IE) • Your client should work with other websites (e.g. http://www.csie.ntu.edu.tw ) • Every request URL would have following form: • http://some.server.name:port/file.name
Intro. to Socket Programming • Socket programming
Tips • Use Wireshark to see how web browsers communicate with web servers • Also use it to debug when things go wrong • You cannot do packet sniffing on R217 workstations • Run on Cygwin
Score • Basic function – 60% • Makefile and command – 10% • make clean // clean obj(*.o) and executable • make // compile source code • ./http_client URL file_to_save // Run client • ./http_server port_no // Run server • Report (.pdf) – 30% • Wireshark monitoring results, and • Report of your HTTP client/server
File format • Max. 2 people in one group • Please tell TA your group members by mail:artoo@csie.ntu.edu.tw • Tar your file • tar zcvf bXXXXXXXX_bOOOOOOOO_prj1.tar.gz Makefile report.pdf file1 file2 … • Use “bXXXXXXXX_prj1.tar.gz” if you do not team with others • DO NOT have any directory in .tar file; all files should be extract to current directory when using “tar zxvf bXXXXXXXX_prj1.tar.gz” • Send your file tohttp://www.csie.ntu.edu.tw/~artoo/CN2009/hws.htm
Deadline • 2009/4/7 24:00 • There WOULD BE penalty for late submission. The penalty for the first day is 10 points, the second day is 20 points, etc. Please turn in your code in time.
References • Http Protocol (RFC) • http://www.faqs.org/rfcs/rfc2616.html • Makefile • http://www.csie.cyut.edu.tw/~dywang/linuxProgram/node41.html