Recitation 11: Computer Networks

Preparation

First, complete Unit 4’s Lab 1: Computer Networks. The discussion and written activities are optional, but recommended. The lab focuses on the software involved in running the internet.

Next, watch this video: How Does the Internet Work?. The video focuses on the internet’s hardware.

After reviewing these materials, you should have a basic understanding of how the internet works.

Finally, in preparation for recitation, if you don’t already have Google Chrome installed on your device, please install it.

At Recitation

You can complete this activity either individually or with a partner.

Activity 1: Loading data over the network

This activity will demonstrate Snap’s ability to load data over the network.

First, open the HTML Demo project.

Next, click the laptop. The program will load and display the HTML code for the snap.berkeley.edu website.

Click “Stop” to end the program, and click “Minimize” to view the Snap program’s code. The Snap program’s code is quite simple: the HTML code is loaded over the network, then each line is printed using the for each loop. Right-click on the url block, then select “Help.” As described in the “Help” window, technical limitations prevent the url block from loading data from other websites (i.e., websites other than snap.berkeley.edu). This makes it difficult to use the url block for interesting programs, so we won’t use it further in this course.

Finally, perform a simple experiment. Click the clear screen block to reset the program. Next, turn off your laptop’s WiFi. Then, click the laptop sprite. What happens? Hopefully this convinces you that the url block can indeed load data over the network!

As you saw in the previous activity, the physical network connection of your device (i.e., WiFi) affects your ability to load data over the network. In this activity, you will see how the speed of your network connection and the complexity of webpages affects your ability to use them.

For this activity, we will use a network testing feature built into Google Chrome. Follow these steps:

When you have finished, your settings should look like this:

Network settings in the Chrome inspector. Cache has been disabled, and 'No throttling' has been changed to 'Slow 3G'.

With these settings enabled, your browser will behave as if you were using a slow 3G cellular connection.

Next, load a website. For example, the snap.berkeley.edu website:

Network traffic data for snap.berkeley.edu, showing the resources loaded, their size, and how long they took to load.

The network traffic inspector shows which resources were loaded as part of loading the page, the size of each resource, and how long each resource took to load. An important takeaway is that a single webpage is usually made up of multiple resources. For example, loading the webpage for snap.berkeley.edu required loading the page’s HTML code, image files, and more!

At the bottom of the window, a summary of the network requests is displayed. In particular, pay attention to:

Next, you should measure these statistics for five different websites. Test a variety of websites, so you can look for patterns in what makes a website load faster or slower. Fill in the template shown below.

Finally, after completing the activity remember to re-enable caching and turn off throttling, so webpages will loading fast again.

Submit

Ensure that all teammates submit to Moodle. You should both upload a PDF containing:

Template

Webpage URL Total Number of Requests Data Transferred Time Taken
https://snap.berkeley.edu/ 70 3.6 MB 1.3 min
       
       
       
       
       

Further Reading (Optional)