INF105 gruppetime 08

☛ Handwritten notes can be included in the quizzes

Contents

  1. Recap: client-server
  2. DNS
  3. IP and Routing
  4. Traffic Inspection

Recap: Web client - Web server

Before høstferie, we’ve been working on both client and server parts of your website, polishing HTML/CSS documents and setting up Nginx web servers.

In this seminar, we can help you with any misunderstandings you still have about these topics, or how they should be reflected in the Milestone 1.

These questions may give you a clue of what topics may still require some refining, or where to dig deeper:

  • Find the <title>, the lang attribute, the encoding declaration and the favicon link in the source code of your website. Which of them is missing or still default on your site?

  • Open your own site, go to the Console, and find possible JS errors on your website. Which one of them are crucial for your webpage functionality and why?

  • Which part of the server’s config is responsible for HTTP status codes being sent as a response? Which codes are suitable for your website?

  • Inspect the access logs of your server. Which sources are being requested and what are the status codes the website is returning for them?

DNS

In lecture, we learn that DNS translates readable domain names into IP-addresses. But do you know where this operation happens?

Task. Using commands such as dig, host and ping, find out:

  • Your website’s IP address:
  • The name your domain is an alias for (the CNAME target, the VM’s own name):
  • Is it different from your classmates’ answers? how does anything know which VM is yours? Why do the two names exist at all? (Hint: virtual hosts from Lab07)
  • Which DNS server answered your query? (Look at the end of dig’s output.)
  • How long did it take to get a response?

Discuss in groups: is this DNS server your laptop, your website’s server, or something else?



IP and Routing

IP addresses are used by routers along the path to forward packets. Each network interface of a device (Wi-Fi, Ethernet, a VM’s virtual network card) is assigned its own IP address.

Task. Let’s see which routers your requests actually pass through.

  1. Install the traceroute package.
  2. Trace the route to your website.
  • What is the first jump of the tracing (the one with the fewest time)?
  • At which iteration does the trace left home / campus network?

  • Can you guess in which locations in the world your requests have stopped?

Traffic Inspection

Task. Let’s make a full detective search on how the traffic works for the inf105 website.

  1. Install the wireshark tool on your own PC (wireshark.org).

  2. Capture traffic on your main network interface

  3. Visit www.inf105.org/lab02 on http://

  4. Stop the network capture

  5. Add a filter tcp.port == 80 in the top bar of wireshark
    Try to understand the packets that were involved. Find the three-way SYN - SYN-ACK - ACK handshake, and the data transfer part. How many packets were needed for visiting one page? How many HTTP calls from the client? Can you see the content of the website in the packets?

  6. Now try capturing the packets from https://www.inf105.org/lab02 on https. What’s a good filter to use? Can you see the website content in the packets? Remove all filters and run wireshark a while on your main network interface. List the different protocols you see, and find out a bit about them.

Local VM traffic

Task. Use wireshark to listen to the network traffic of your local virtual machine (not NREC).

  • You have to start the virtual machine first (UTM / VirtualBox), then capture the VM’s network interface, usually called something like “bridge” or “vnet”.

  • Use nc between your own PC and the VM to send simple TCP or UDP packets. Look at the wireshark analysis of those packets. Can you find the IP and TCP / UDP headers in the binary stream?