Transcript project_1
Project 1
HTTP Client/Server
NTU CSIE Computer Networks 2009 Spring
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 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
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?
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
Other
HTTP Server
Your
HTTP Server
a.html
b.html
FireFox / IE
Your
HTTP Client
Saved pages
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
Socket programming
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
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
Max. 2 people in one group
◦ Please tell TA your group members by mail:
[email protected]
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 to
http://www.csie.ntu.edu.tw/~artoo/CN2009/hws.htm
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.
Http Protocol (RFC)
◦ http://www.faqs.org/rfcs/rfc2616.html
Makefile
◦ http://www.csie.cyut.edu.tw/~dywang/linuxProgra
m/node41.html