CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP...

51
CSE 461 FINAL EXAM REVIEW

Transcript of CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP...

Page 1: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

CSE 461 FINAL EXAM REVIEW

Page 2: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

HELP YOURSELF TO SNACKS

Page 3: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

FINAL OVERVIEW

• Online final (through Catalyst)

• Starts Friday, late night

• Due by Monday, 5:00PM (hard deadline)

• Open book, open notes, open internet, but not open people

• Covers topics in lectures, project, and textbook/homework; emphasis on second half of quarter

• Questions about the test should be sent to JZ/TAs by e-mail

• When appropriate, we’ll post on Catalyst

• Bonus Question: What are my office hour times?

• Wednesdays, 1:10 to 3:00 (but not anymore!)

Page 4: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

FIRST HALF OF THE QUARTER

• Network layers & encapsulation

• Types of addresses • Ports and sockets • TCP vs. UDP

• Sliding window • Analysis metrics

• Error handling • Projects 0 and 1 • See midterm review slides

for more

Page 5: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

MEDIUM ACCESS CONTROL (1)

• Pure ALOHA Protocol

• Used random access (collisions inevitable but traffic infrequent)

• Central station rebroadcasts received frames

• Frames with bad checksums are thrown away

• If you don’t hear your frame, wait a random amount of time and try again

Page 6: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

MEDIUM ACCESS CONTROL (2)

• Slotted ALOHA Protocol

• Time is divided into discrete “slots”

• You have to wait until the beginning of a new slot to transmit

• Decreases likelihood of collisions, but they’ll still happen

Page 7: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

CARRIER SENSE MULTIPLE ACCESS WITH COLLISION DETECTION (CSMA/CD)

• Nodes detect traffic on the line and wait to transmit until it’s clear

• Collisions are detected, and a random amount of time is waited before a retransmit

• Bonus question: Why doesn’t Ethernet use this anymore?

• Hosts can communicate directly with Ethernet switches, completely avoiding collisions.

Page 8: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

BINARY EXPONENTIAL BACKOFF

• Wait a random number of slots between 0 and n

• n starts at 1 and doubles each time there’s a collision

Page 9: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

WIRELESS (802.11) MULTIPLE ACCESS

• 802.11 (wireless) nodes use CSMA/CA (Collision Avoidance), which listens for a signal and holds off on transmitting until there is no traffic

• Bonus question: why does 802.11 use a variable bitrate, while Ethernet’s bitrate is constant once configured?

• 802.11’s maximum bitrate can change easily; Ethernet’s cannot.

Page 10: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

HIDDEN TERMINAL PROBLEM

• Issue that can cause wireless interference • Bonus Question: what are some ways to mitigate this?

• RTS/CTS, power increases, and relocating the node/obstacles

Page 11: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

TOKEN RING NETWORKS

• Nodes are arranged in a ring

• Nodes take turns, passing around a token

• The node with the token can talk

• If a token hasn’t been seen recently, it may have been lost

• When a new token needs to be generated, one node (the “active monitor”) regenerates it

• If this fails, stations will contend to be the new active monitor

• Bonus Question: How do you determine who gets to be the new active monitor?

• Node with the highest MAC address wins.

Page 12: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

LAN HUBS AND SWITCHES

• Bonus question: what’s the difference between a switch and a hub?

• Hubs are logically equivalent to a long cable

• Switches keep wires separate

Page 13: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

LAN BRIDGING

• Allows two or more network segments to create an aggregate network

• Simply forward received frames (as opposed to routers, which route them)

Page 14: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

SPANNING TREE ALGORITHM

• Creates a loop-free connected graph for bridges to communicate

• Node with lowest MAC is root; low MAC addresses break ties

• Each node remembers shortest path to the root it sees

Page 15: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

SPANNING TREE POEM: “ALGORHYME”

I think that I shall never see

A graph more lovely than a tree.

A tree whose crucial property

Is loop-free connectivity.

A tree that must be sure to span

So packets can reach every LAN.

First, the root must be selected.

By ID, it is elected.

Least-cost paths from root are traced.

In the tree, these paths are placed.

A mesh is made by folks like me,

Then bridges find a spanning tree.

-Radia Perlman

Page 16: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

RFID

• Store a serial number or other small amount of data

• Passive tags: reflect back radio waves

• Active tags: broadcast signals when woken up by nearby readers

Page 17: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

ROUTING BASICS

• Distributed algorithm to determine efficient paths in a network

• Distributed approach

• Distance vector algorithm

• Link-state algorithm

Page 18: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

DISTANCE VECTOR ALGORITHM

• Uses Bellman-Ford algorithm

• Each node maintains a table of the shortest path to each node through each node

• Nodes send their full routing table to their neighbors only

• When a node receives tables from its neighbors, it recalculates the shortest paths

• Algorithm stops when all of the routing tables have converged

• Requires lots of space for routing table storage

Page 19: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

LINK-STATE ALGORITHM

• Each node floods out packets identifying its neighbors and the metrics for the link with each neighbor (its “link state”)

• Nodes construct a map of network connectivity

• Nodes calculate the shortest path to every possible destination (usually with Dijkstra’s algorithm)

• These paths are put into a routing table

• Requires more processing power/logic to calculate link properties/metrics

Page 20: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

BORDER GATEWAY PROTOCOL (BGP)

• Deals with routes between “autonomous systems”

• Routers exchange information about routes to nodes

• Routers maintain a shortest path vector for other routers

• BGP must be manually configured; no discovery, and often based on policy

Page 21: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

CLASSLESS INTER-DOMAIN ROUTING (CIDR)

• Designates subnets within the IP address space

• IP address of subnet followed by the number of bits that are used for routing (32 minus the number of bits free for subnet addressing)

• Note: the first address in a subnet is used as the subnet address (seldom actually used), and the last address is the broadcast address.

• Bonus Question: What would the broadcast address be for the subnet 24.18.4.0/24?

• 24.18.4.255

Page 22: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

GETTING ADDRESSES WITH ARP AND DHCP

• ARP (Address Resolution Protocol) allows hosts to convert an IP address to a MAC address

• DHCP allows hosts that’ve just joined a network to receive an IP address

• Bonus Question: how could a hacker use ARP maliciously? • By ARPing IP addresses it hears with its

own MAC address, or with non-existent MAC addresses.

Page 23: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

NETWORK ADDRESS TRANSLATION (NAT)

• Allows computers connected to a router with a single IP address to be addressed by an IP address/port pair

• Bonus Question: If Alice is connecting to Bob, how can Alice and Bob tell if Alice is on a NAT?

• Alice sends a packet to Bob with a payload containing a hash of her own source IP address and port. Bob hashes the source IP address and port, and sees if that hash matches the payload hash.

Page 24: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

PROJECT 2: HTTP AND TCP

• What an HTTP proxy does and how it works

• What HTTP packet format looks like (generally)

• Why we manipulated packets to turn off keep-alive

• Some basic errors that happen with TCP and how they can be mitigated

Page 25: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

PROJECT 3: TOR61

• How Tor (or Tor61) works

• How nodes establish connections to each other

• How nodes extends work

• How Tor provides privacy

• Possible causes for deadlock in networked systems like Tor

Page 26: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

PROJECT 4: BITCOINS

• How public/private key encryption works

• What a cryptographic hash is

• How cryptographic signatures work

• General format of Bitcoin block chain

• What would make a transaction invalid

• How Bitcoin mining works

• How Merkle trees work

Page 27: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

NETWORK-RELATED STORY TIME

• Cool feature: The Hidden • Small developer in Scotland

Page 28: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

SAMPLE PROBLEM: CIDR

What is the maximum number of hosts that a subnet can handle, if its network prefix is 192.168.176.0/20 ?

Page 29: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

SAMPLE PROBLEM: CIDR (SOLUTION)

The routing prefix is 20, which means that there are 12 bits of data that is unmasked and can be used for the network. 12 bits of data can provide 2^12, or 4096, different hosts. (Or 4094, if you don’t count the first and last addresses.)

Page 30: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

SAMPLE PROBLEM: CIDR

A router has the following CIDR entries in its forwarding table:

Address/mask Next hop

135.46.56.0/22 Interface A

135.46.60.0/22 Interface B

135.46.40.0/23 Interface C

Default Interface D

If a packet with the IP address 135.46.63.10 arrives, where does the router forward it?

Page 31: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

SAMPLE PROBLEM: CIDR (SOLUTION)

Address/mask Address Range Next hop

135.46.56.0/22 135.46.56.0 – 135.46.59.255

Interface A

135.46.60.0/22 135.46.60.0 – 135.46.63.255

Interface B

135.46.40.0/23 135.46.40.0 – 135.46.41.255

Interface C

Default Everything else Interface D

So a packet addressed to 135.46.63.10 would be forwarded onto interface B.

Page 32: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

SAMPLE PROBLEM: DISTANCE-VECTOR ROUTING

Each node maintains a vector of distances (and next hops) to all destinations

1. Initialize vector with 0 (zero) cost to self, ∞ (infinity) to other destinations

2. Periodically send vector to neighbors

3. Update vector for each destination by selecting the shortest distance heard, after adding cost of neighbor link

• Use the best neighbor for forwarding

Page 33: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

Problem • What will A’s routing table look like when it converges?

– Can only talk to nodes B and E

CSE 461 University of Washington 33

A B

C

D

E

F

G

H

2

1

10

2

2

4

2

4

4

3

3

3

To Cost

A 0

B ∞

C ∞

D ∞

E ∞

F ∞

G ∞

H ∞

Initial vector

Page 34: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

Step 1 • First exchange with B, E; learn best 1-hop routes

CSE 461 University of Washington 34

A B

C

D

E

F

G

H

2

1

10

2

2

4

2

4

4

3

3

3

A’s

Cost

A’s

Next

0 --

4 B

∞ --

∞ --

10 E

∞ --

∞ --

∞ --

To B

says

E

says

A ∞ ∞

B 0 ∞

C ∞ ∞

D ∞ ∞

E ∞ 0

F ∞ ∞

G ∞ ∞

H ∞ ∞

B

+4

E

+10

∞ ∞

4 ∞

∞ ∞

∞ ∞

∞ 10

∞ ∞

∞ ∞

∞ ∞

Learned better route

Page 35: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

Step 2 • Second exchange; learn best 2-hop routes

CSE 461 University of Washington 35

A B

C

D

E

F

G

H

2

1

10

2

2

4

2

4

4

3

3

3

A’s

Cost

A’s

Next

0 --

4 B

6 B

12 E

8 B

7 B

7 B

∞ --

To B

says

E

says

A 4 10

B 0 4

C 2 1

D ∞ 2

E 4 0

F 3 2

G 3 ∞

H ∞ ∞

B

+4

E

+10

8 20

4 14

6 11

∞ 12

8 10

7 12

7 ∞

∞ ∞

Page 36: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

Step 3 • Third exchange; learn best 3-hop routes

CSE 461 University of Washington 36

A B

C

D

E

F

G

H

2

1

10

2

2

4

2

4

4

3

3

3

A’s

Cost

A’s

Next

0 --

4 B

6 B

8 B

7 B

7 B

7 B

9 B

To B

says

E

says

A 4 8

B 0 3

C 2 1

D 4 2

E 3 0

F 3 2

G 3 6

H 5 4

B

+4

E

+10

8 18

4 13

6 11

8 12

7 10

7 12

7 16

9 14

Page 37: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

Step 4 • Subsequent exchanges; converged

CSE 461 University of Washington 37

A B

C

D

E

F

G

H

2

1

10

2

2

4

2

4

4

3

3

3

A’s

Cost

A’s

Next

0 --

4 B

6 B

8 B

8 B

7 B

7 B

9 B

To B

says

E

says

A 4 7

B 0 3

C 2 1

D 4 2

E 3 0

F 3 2

G 3 6

H 5 4

B

+4

E

+10

8 17

4 13

6 11

8 12

7 10

7 12

7 16

9 14

Page 38: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

TEAM COMPETITION

• Form groups of ~3 people • Each group shares one sheet of

paper • No looking up answers! • 16 questions total • Winning team gets prizes

Page 39: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

QUESTION 1

• What are the three non-overlapping 802.11 channels supported by most wireless devices?

Page 40: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

QUESTION 2

• What short-lived, text-based alternative to the World Wide Web was invented in 1991, and was named after the University of Minnesota mascot?

Page 41: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

QUESTION 3

• What was the first video game console with a built-in modem?

Page 42: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

QUESTION 4

• For most organizations, a class A network, with 16 million addresses is too big, and a class C network, with 256 addresses is too small. A class B network, with 65536 addresses is just right. What is the name for this problem?

Page 43: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

QUESTION 5

• To the nearest second, what is the RTT for a laser pulse from the Earth to the Moon and back?

Page 44: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

QUESTION 6

• What does HTTP Status 418 mean? It was developed for the facetious “Hyper Text Coffee Pot Control Protocol,” but never implemented.

Page 45: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

QUESTIONS 7 THROUGH 16: ABBREVIATIONS

7. URL

8. UDP

9. RFC

10. CRC

11. DHCP

12. WEP

13. WPA

14. ICMP

15. DSL

16. RSA

Page 46: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

FINISHED!

• Switch papers with another team to do scoring

Page 47: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

ANSWERS

1. 1, 6, and 11

2. Gopher

3. Dreamcast

4. Three Bears Problem

5. 3s (actually ~2.56s)

6. I’m a Teapot

7. Uniform Resource Locator

8. User Datagram Protocol

9. Request for Comments

10. Cyclic Redundancy Check

11. Dynamic Host Configuration Protocol

12. Wired Equivalent Privacy

13. Wi-Fi Protected Access

14. Internet Control Message Protocol

15. Digital Subscriber Line

16. Rivest, Shamir, Adleman

Page 48: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

JOKES

• How do you catch an ether bunny?

• With an ether net!

• What did the ARP request order at McDonald's?

• A big MAC

• HTTP Error 413: That’s what she said

• Why did the IPv4 addresses take a nap?

• They were exhausted!

• I'd tell you a joke about CIDR, but you're too classy.

Page 49: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

BEYOND 461: MORE COOL NETWORK STUFF (1)

• Learn how distributed systems work

• Last year’s CSE 552 is online:

• http://courses.cs.washington.edu/courses/csep552/13sp/

• http://courses.cs.washington.edu/courses/csep552/13sp/video/

• BitTorrent is a really cool protocol; look it up!

• Build a wireless sensor network

• This book is pretty good: http://shop.oreilly.com/product/9780596807740.do

Page 51: CSE 461 - University of Washington › courses › cse461... · CSE 461 FINAL EXAM REVIEW . HELP YOURSELF TO SNACKS . FINAL OVERVIEW • Online final (through Catalyst) • Starts

ANY QUESTIONS?