lecture 9: networks to internetworks · cse 123 –lecture 9: from networks to internetworks 12....

15
CSE 123: Computer Networks Aaron Schulman Lecture 9: Networks to Internetworks HW 1 due today

Upload: others

Post on 30-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

CSE 123: Computer NetworksAaron Schulman

Lecture 9:Networks to Internetworks

HW 1 due today

Page 2: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

Lecture 9 Overview

! Bridging & switching (cont.)u Spanning Tree

! Internetworkingu Routingu Internet Protocol

2CSE 123 – Lecture 8: From networks to Internetworks

Page 3: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

Spanning Tree! Spanning tree uses

subset of bridges so there are no cyclesu Prune some portsu Only one tree

! Q: How do we find a spanning tree?u Automatically!u Elect root, find paths

B3

A

C

E

DB2

B5

B

B7 K

F

H

B4

J

B1

B6

G

I

3CSE 123 – Lecture 9: From networks to Internetworks

Page 4: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

Spanning Tree Algorithm! Each bridge sends periodic configuration messages

u (RootID, Distance to Root, BridgeID)u All nodes think they are root initially

! Each bridge updates route/Root upon receiptu Smaller root address is betteru Select port with lowest cost to root as “root port”u To break ties, bridge with smaller address is better

! Rebroadcast new config to ports for which we’re “best”u Don’t bother sending config to LANs with better options u Add 1 to distance, send new configs on ports that haven’t told us

about a shorter path to the root! Only forward packets on ports for which we’re on the

shortest path to root (prunes edges to form tree)

4CSE 123 – Lecture 9: From networks to Internetworks

Page 5: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

Spanning Tree Example

! Sample messages to and from B3:

1. B3 sends (B3, 0, B3) to B2 [LAN C] and B5 [LAN A]

2. B3 receives (B2, 0, B2) and (B5, 0, B5) and accepts B2 as root

3. B3 sends (B2, 1, B3) to B54. B3 receives (B1, 1, B2) and (B1, 1,

B5) and accepts B1 as root5. B3 wants to send (B1, 2, B3 ) but

doesn’t as its nowhere “best”6. B3 receives (B1, 1, B2) [LAN C] and

(B1, 1, B5) [LAN A] again and again…

B3 turns off forwarding to LAN A and C

B3

A

C

E

DB2

B5

B

B7 K

F

H

B4

J

B1

B6

G

I

5CSE 123 – Lecture 9: From networks to Internetworks

Page 6: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

Spanning tree poemI think that I shall never seeA graph more lovely than a tree.A tree whose crucial property Is loop-free connectivity.A tree that must be sure to spanSo 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 Algorhyme

6CSE 123 – Lecture 9: From networks to Internetworks

Page 7: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

! What if root bridge fails?u Age configuration info

» If not refreshed for MaxAge seconds then delete root and recalculate spanning tree

» If config message is received with a more recent age, then recalculate spanning tree

u Applies to all bridges (not just root)

! Temporary loopsu When topology changes, takes a bit for new configuration

messages to spread through the systemu Don’t start forwarding packets immediately -> wait some time

for convergence

7

Important Details

CSE 123 – Lecture 9: From networks to Internetworks

Page 8: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

! Hosts directly connected to a bridgeu learning + spanning tree protocol

! Switch supports parallel forwardingu A-to-B and A’-to-B’ simultaneouslyu Generally full duplex as well

! Switch backplane capacity variesu Ideally, nonblockingu I.e., can run at full line rate on all ports

! No longer any shared busu Each link is its own collision domainu Collision detection largely irrelevant

8

Switched Ethernet

CSE 123 – Lecture 9: From networks to Internetworks

Page 9: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

! Create spanning tree across LANsu Learn which ports to use to reach which addresses

! Benefitsu Higher link bandwidth (point-to-point links)u Higher aggregate throughput (parallel communication)u Improved fault tolerance (redundant paths)

! Limitationsu Requires homogeneous link layer (e.g. all Ethernet)u Harder to control forwarding topologyu Security and performance issues (trust is assumed)

! What if we want to connect different link layers?9

Layer-2 Forwarding

CSE 123 – Lecture 9: From networks to Internetworks

Page 10: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

TCP/IP Protocol Stack

HTTP

TCP

IP

Ethernetinterface

HTTP

TCP

IP

Ethernetinterface

IP IP

Ethernetinterface

Ethernetinterface

SONETinterface

SONETinterface

host host

router router

10

Application Layer

Transport Layer

Network Layer

Link Layer

CSE 123 – Lecture 9: From networks to Internetworks

Page 11: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

Combing Networks! Main challenge is heterogeneity of link layers:

u Addressing» Each network media has a different addressing scheme

u Bandwidth» Dial-up modems to terabit optical networks

u Latency» Seconds to nanoseconds

u Frame size» Dozens to thousands of bytes

u Loss rates» Differ by many orders of magnitude

u Service guarantees» “Send and pray” vs reserved bandwidth

11CSE 123 – Lecture 9: From networks to Internetworks

Page 12: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

Internetworking ! Cerf & Kahn74,

“A Protocol for Packet Network Intercommunication”u Foundation for the modern Internet

! Routers forward packets from source to destinationu May cross many separate networks along the way

! All packets use a common Internet Protocolu Any underlying data link protocolu Any higher layer transport protocolu This is the “thin waist”

12CSE 123 – Lecture 9: From networks to Internetworks

Page 13: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

EthernetWiFi

Router

TCP HTTPIPWiFi

data packet data packet

TCP HTTPIPETH

13

IP Networking

CSE 123 – Lecture 9: Internetworking

Page 14: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

Routers! A router is a store-and-forward device

u Routers are connected to multiple networksu On each network, looks just like another hostu A lot like a switch, but supports multiple datalink layers and

makes decisions at the network layer

! Must be explicitly addressed by incoming frames (L2)u Not at all like a switch, which is transparentu Removes link-layer header, parses IP header (L3)

! Looks up next hop, forwards on appropriate networku Each router need only get one step closer to destination

14CSE 123 – Lecture 9: Internetworking

Page 15: Lecture 9: Networks to Internetworks · CSE 123 –Lecture 9: From networks to Internetworks 12. WiFi Ethernet Router WiFi IP TCPHTTP data packet data packet ETH IP TCPHTTP 13 IP

For Next Time

! Read 3.2.5 in P&D

! Homework 1 due TODAY

! Homework 2 out on Monday

! Project 2 out today

15CSE 123 – Lecture 9: Internetworking