1 of 36

CS168: Discussion 1

Intro to the Internet

Spring 2024

2 of 36

Agenda

  • Introductions
  • Terms
  • Poking the Internet

Light discussion today

3 of 36

Introductions

4 of 36

Hi, I’m Bryce! (he/him)

I’m a 5th year EECS Masters student from the Bay Area with an emphasis in computer security. Previously, I’ve been a head TA for CS 61A.

I enjoy playing rhythm games (osu!), following (e)sports, and lots of cute stuff (Pokemon, cat videos, etc.)

My office hours: Wednesday 2pm-3pm in Soda 347.

My email: brywong@berkeley.edu (Edstem is faster though)

5 of 36

About You

Show of hands survey

  • Major?
  • Year?
  • Where you’re from?
  • Why you’re taking this class?

6 of 36

Slides / Resources

  • Section Resources: http://tinyurl.com/bryce-168-sp24
    • Slides / Worksheets are also available on the main 168 website
    • Will upload written notes from future sections here

7 of 36

Questions from Lecture

8 of 36

Terms

9 of 36

Terms

  • Routers/Switches: Devices that forward packets arriving on one link to another link. We make no distinction between routers/switches at this point

  • End-host: a device attached to the network that sends or receives packets.
  • Examples: mobile phone, laptop, security camera, smart fridge

10 of 36

Terms

  • Packets: A Bags of bits with a
    • Header-- info for network and network stack to make decisions
    • Body-- contains a payload. Ex. A file, image, an application header
      • The network doesn’t really care about what’s in the payload.

Header

“Go Bears”

Body

11 of 36

Terms

  • Naming:
    • Network name: which host it is
    • Network address: where host is located
    • When you move a server to a new building, its name does not change but its address does

Name: mywebsite.com

Addr: 142.250.72.206

Name: mywebsite.com

Addr: 208.117.236.69

12 of 36

Terms

  • Network “Stack”: Networking SW on host.
    • Replicates some router/switch functionality and adds some additional functionality before passing the body of packets to the application

13 of 36

Terms (cont’d)

  • ISP (Internet Service Provider): A network of packet switches and links that provide network access (i.e. Comcast, ATT, Sonic)
  • ASes (Autonomous Systems): Groups of routers under the same control
    • Usually each ISP has one AS, but may have multiple ASes
    • Routers within the same AS will have information about each other

14 of 36

Poking the Internet

15 of 36

Ping, Traceroute, Dig

  • Internet is large and complex. Network engineers and researchers have built some handy tools to get some insight into what is going on inside and across the internet.
  • We’re going to play around with them a little bit

Think of this as a “tinker discussion” - you aren’t expected to know any of these concepts yet. We’ll learn about them throughout the semester.

16 of 36

Ping, Traceroute, Dig

  • Simple utility that lets you “poke” a website and see if it moves (spoiler: most do!)
  • You say hi and see if the server says hi back
    • This by itself is not super interesting
  • Ping also tells you how long the reply took to come back
    • This is more interesting!
  • Let’s try out a few websites.

17 of 36

Ping, Traceroute, Dig

Predictions?

  • berkeley.edu
  • google.com
  • csail.mit.edu (MIT’s CS department)
  • lmu.de (University of Munich)

18 of 36

Ping: A prediction

  • We’ve pinged a couple websites and seen pretty significant differences in latency.
    • Latency is the time between when a request is sent and when the response is heard.
  • What about differences in latency for the same website, but in different regions?
  • We’ve pinged google.com and seen its latency.
    • How many times longer will it take for a ping to google.co.uk to come back?

19 of 36

Ping, Traceroute, Dig

  • Tool to trace the route that packets take from your computer to the destination.
    • Specifically lets you see the routers/switches that are forwarding your packets.

1

2

20 of 36

Ping, Traceroute, Dig

Demo, pick your favorite(s):

  • berkeley.edu
  • google.com
  • csail.mit.edu (MIT’s CS department)
  • lmu.de (University of Munich)

Now let’s visualize it online at geotraceroute.com

21 of 36

Traceroute: Notice anything?

  • Traceroute gives us a lot more interesting feedback than ping.
    • Latency to every step along the way.
      • Can see a breakdown of latencies!
    • Router names.
      • Often have locations in them (i.e. city name)
      • Can roughly trace packet path on a map!
    • Weird stars
      • Some routers just don’t respond ⁻\_(ツ)_/⁻

22 of 36

How does Traceroute work?

  • Traceroute gives you the path of routers and switches your packets take.
  • How?
    • Takes advantage of something called a TTL in the packet IP header.
    • TTL denotes how many times a packet should be forwarded before it is discarded.
      • Why does this exist?
        • To stop the internet from collapsing! (We’ll cover this when we get to routing)
    • Sets the TTL to 1, 2, 3, etc
    • When packets are dropped because of TTL expiring, most routers send back a message telling us.
    • Use the source of this notification to identify the routers along the packet’s path.

23 of 36

Ping, Traceroute, Dig

  • When humans want to go to a website, we think in terms of names
    • i.e. google.com
  • The internet does not think this way, it thinks in terms of addresses
    • i.e. “1.2.3.4”
  • It’s like the postal service
    • You wouldn’t just write “To: Alice” on a letter
    • You would look up Alice’s address in some directory
      • Then mail the letter to her address
  • Dig lets you lookup the address of a website by its name
    • Command line interface to the Domain Name Service (DNS)

24 of 36

Ping, Traceroute, Dig

Demo

  • berkeley.edu
  • google.com
  • csail.mit.edu (MIT’s CS department)
  • lmu.de (University of Munich)

(optionally see approximate physical location at https://www.iplocation.net/)

25 of 36

Dig: A breakdown

  • When using the +trace option, there was a lot more information
  • We could see the steps that were taken when resolving the names
    • First, the ‘root’ servers were queried
    • Then, the TLD (top level domain) server was queried
    • After that, successive servers were asked until the IP was found
  • More on how this works when we discuss DNS

26 of 36

Bonus: What’s your IP Address?

On a Mac, go to System Preferences -> Network -> Advanced -> TCP/IP:

27 of 36

Emergency Screenshots

28 of 36

29 of 36

30 of 36

31 of 36

32 of 36

33 of 36

34 of 36

35 of 36

36 of 36