Lab#1 HTTP and basic tools Previous reading: •

Kurose Section 2.2

Additional info: •

HTTP: http://www.rfc-editor.org/rfc/rfc2616.txt



Wireshark user guide: http://www.wireshark.org/docs/

Work environment •

Logging on the lab PC: Linux



Lab Server: zoltar.redes.upv.es

netcat usage (see Appendix A) •

connect as a client to zoltar.redes.upv.es o www.upv.es: echo (7) daytime (13)



use netcat for a full connection, both server and client: sample case “chat” between two PCs: server: nc -l 9999 client: nc localhost 9999



Exercise#1: Using netcat send a GET HTTP request to the university web server (www.upv.es) to obtain the main page. Try both, HTTP/1.0 and HTTP/1.1. ▪ How is it signaled the end of the headers in the client request? And in the server response? ▪ What headers are mandatory in client request for each HTTP version?

1

Protocol analyzers •

What is it we can listen using promiscuous mode in our network card? (use of switches and sample case of our lab)



HTTP with Wireshark ◦ What Follow TCP Stream is for?



Exercise#2. Access this page with your brower while capturing the session with Wireshark: http://www.redes.upv.es/redes/Wireshark/HTTP-wireshark-file1.html Answer the following questions: ▪ Is your browser using HTTP 1.0 or 1.1? What HTTP version is the server using? ▪ What is the preferred language your browser is telling the server it can accept? ▪ What is the client IP address? What is the server IP address? ▪ When was the last time HTML file was modified? What is the difference between Date and Last-modified headers? ▪ What is the size of the page sent by the server?



Exercise#3. Repeat the same capture again and compare the differences, if any, in the request and response headers. ▪ What differences do you notice?



Exercise#4. Access to this other page while capturing the traffic: http://www.redes.upv.es/redes/Wireshark/HTTP-wireshark-file3.html Once the transfer is over, keep the capture open till you can see segments marked with FIN tag (that signals the end of a TCP connection). Answer the following questions: ▪ How many GET request have been sent? ▪ How many TCP segments have been needed for HTTP response?

2

Advanced exercises: (close your browser and delete its cache) •

Exercise#5. Study the access to this page: http://www.redes.upv.es/redes/Wireshark/HTTP-wireshark-file5.html and answer the following questions: ▪ How many GET requests are made? What are the IP addresses of the servers? ▪ Can you tell if your browser downloaded two images in parallel or sequentially from two different web servers? ▪ Were persistent connections being used? ▪ Who is closing the connection (server or client)?



Exercise#6. Type about:config in Firefox address bar and look for network.http.version. Change it to 1.0. Repeat exercise#5 and see the differences.



Exercise#7. Visit with your browser www.upv.es. Have a look at the type of connections being used here.

3

Appendix A Netcat usage: usage: nc [-46DdhklnrStUuvzC] [-i interval] [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol] [-x proxy_address[:port]] [hostname] [port[s]] Command Summary: -4 Use IPv4 -6 Use IPv6 -D Enable the debug socket option -d Detach from stdin -h This help text -i secs Delay interval for lines sent, ports scanned -k Keep inbound sockets open for multiple connects -l Listen mode, for inbound connects -n Suppress name/port resolutions -P proxyuser Username for proxy authentication -p port Specify local port for remote connects -q secs quit after EOF on stdin and delay of secs (-1 to not quit) -r Randomize remote ports -S Enable the TCP MD5 signature option -s addr Local source address -T ToS Set IP Type of Service -C Send CRLF as line-ending -t Answer TELNET negotiation -U Use UNIX domain socket -u UDP mode -v Verbose -w secs Timeout for connects and final net reads -X proto Proxy protocol: "4", "5" (SOCKS) or "connect" -x addr[:port] Specify proxy address and port -z Zero-I/O mode [used for scanning] Port numbers can be individual or ranges: lo-hi [inclusive]

4

Lab#1

Work environment. • Logging on the lab PC: Linux. • Lab Server: zoltar.redes.upv.es netcat usage( see Appendix A). • connect as a client to zoltar.redes.upv.es o www.upv.es: echo (7) daytime (13). • use netcat for a full connection, both server and client: sample case “chat” between two PCs: server: nc -l 9999 client: nc ...

84KB Sizes 2 Downloads 212 Views

Recommend Documents

No documents