Top Banner
CSE 123: Computer Networks Stefan Savage Lecture 10: Internetworking
26

Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Sep 23, 2018

Download

Documents

truongxuyen
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

CSE 123: Computer Networks Stefan Savage

Lecture 10:Internetworking

Page 2: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Lecture 10 Overview

●  Finish bridging ◆  Spanning Tree

●  Internet Protocol ◆  Service model ◆  Packet format

2 CSE 123 – Lecture 10: Internetworking

Page 3: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Learning bridges recap●  Each bridge keeps a list mapping link-layer destination

address to port number (what are the directions to this destination?)

●  This list is populated by looking at the source address of each packet it receives on a given port and entering those values in the table (if a packet from A came from port x, then packets to A should be sent on part x)

●  If a packet arrives with a destination address not in the table, then send on all ports (except the one it came on)

●  Simple, automatic , self healing 3

Page 4: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

●  Linear organization ◆  Inter-bridge hubs (e.g. CS)

are single points of failure ◆  Unnecessary transit

(e.g. EE<->SE must traverse CS)

●  Backbone/tree ◆  Can survive LAN failure ◆  Manages all inter-LAN

communication ◆  Requires more ports

4

Network Topology

CSE 123 – Lecture 9: Bridging & Switching

Page 5: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

●  Learning works well in tree topologies

●  But trees are fragile ◆  Net admins like

redundant/backup paths

●  How to handle Cycles? ◆  Where should B1

forward packets destined for LAN A?

B3

A

C

E D

B2

B5

B

B7 K F

H

B4

B1

B6

G

5

An Issue: Cycles

CSE 123 – Lecture 9: Bridging & Switching

Page 6: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Spanning Tree●  Spanning tree uses

subset of bridges so there are no cycles ◆  Prune some ports ◆  Only one tree

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

B3

A

C

E D

B2

B5

B

B7 K F

H

B4

J

B1

B6

G

I

6 CSE 123 – Lecture 9: Bridging & Switching

Page 7: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Spanning Tree Algorithm●  Each bridge sends periodic configuration messages

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

●  Each bridge updates route/Root upon receipt ◆  Smaller root address is better ◆  Select port with lowest cost to root as “root port” ◆  To break ties, bridge with smaller address is better

●  Rebroadcast new config to ports for which we’re “best” ◆  Don’t bother sending config to LANs with better options ◆  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)

7 CSE 123 – Lecture 10: Internetworking

Page 8: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Spanning Tree Example ●  Sample messages to and from B3:

1.  B3 sends (B3, 0, B3) to B2 and B5 2.  B3 receives (B2, 0, B2) and (B5, 0,

B5) and accepts B2 as root 3.  B3 sends (B2, 1, B3) to B5 4.  B3 receives (B1, 1, B2) and (B1, 1,

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

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

B5) again and again…

Data forwarding is turned off for LAN A

B3 A

C

E D

B2 B5

B

B7 K F

H

B4 J

B1

B6

G

I

8 CSE 123 – Lecture 10: Internetworking

Page 9: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

●  What if root bridge fails? ◆  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

◆  Applies to all bridges (not just root)

●  Temporary loops ◆  When topology changes, takes a bit for new configuration

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

for convergence

9

Important Details

CSE 123 – Lecture 10: Internetworking

Page 10: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

●  Hosts directly connected to a bridge ◆  learning + spanning tree protocol

●  Switch supports parallel forwarding ◆  A-to-B and A’-to-B’ simultaneously ◆  Generally full duplex as well

●  Switch backplane capacity varies ◆  Ideally, nonblocking ◆  I.e., can run at full line rate on all ports

●  No longer any shared bus ◆  Each link is its own collision domain ◆  Collision detection largely irrelevant

10

Switched Ethernet

CSE 123 – Lecture 10: Internetworking

Page 11: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

●  Create spanning tree across LANs ◆  Learn which ports to use to reach which addresses

●  Benefits ◆  Higher link bandwidth (point-to-point links) ◆  Higher aggregate throughput (parallel communication) ◆  Improved fault tolerance (redundant paths)

●  Limitations ◆  Requires homogeneous link layer (e.g. all Ethernet) ◆  Harder to control forwarding topology

●  What if we want to connect different link layers?

11

Layer-2 Forwarding

CSE 123 – Lecture 10: Internetworking

Page 12: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Combing Networks●  Main challenge is heterogeneity of link layers:

◆  Addressing »  Each network media has a different addressing scheme

◆  Bandwidth »  Modems to terabits

◆  Latency »  Seconds to nanoseconds

◆  Frame size »  Dozens to thousands of bytes

◆  Loss rates »  Differ by many orders of magnitude

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

12 CSE 123 – Lecture 10: Internetworking

Page 13: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

internetworking ●  Cerf & Kahn74,

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

●  Routers forward packets from source to destination ◆  May cross many separate networks along the way

●  All packets use a common Internet Protocol ◆  Any underlying data link protocol ◆  Any higher layer transport protocol

13 CSE 123 – Lecture 10: Internetworking

Page 14: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

TCP/IP Protocol Stack

HTTP

TCP

IP

Ethernet interface

HTTP

TCP

IP

Ethernet interface

IP IP

Ethernet interface

Ethernet interface

SONET interface

SONET interface

host host

router router

14

Application Layer

Transport Layer

Network Layer

Link Layer

CSE 123 – Lecture 10: Internetworking

Page 15: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

FDDI Ethernet

Router

TCP HTTP IP Eth

data packet data packet

TCP HTTP IP FDDI

15

IP Networking

CSE 123 – Lecture 10: Internetworking

Page 16: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

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

◆  Routers are connected to multiple networks ◆  On each network, looks just like another host ◆  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) ◆  Not at all like a switch, which is transparent ◆  Removes link-layer header, parses IP header (L3)

●  Looks up next hop, forwards on appropriate network ◆  Each router need only get one step closer to destination

16 CSE 123 – Lecture 10: Internetworking

Page 17: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

●  Impose few demands on network ◆  Make few assumptions about what network can do ◆  No QoS, no reliability, no ordering, no large packets ◆  No persistent state about communications; no connections

●  Manage heterogeneity at hosts (not in network) ◆  Adapt to underlying network heterogeneity ◆  Re-order packets, detect errors, retransmit lost messages… ◆  Persistent network state only kept in hosts (fate-sharing)

●  Service model: best effort, a.k.a. send and pray

17

IP Philosophy

CSE 123 – Lecture 10: Internetworking

Page 18: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

length

0 15 16

options (if any)

data (if any)

31

20 bytes

ver HL TOS

identification R E S

M F

D F

offset

TTL protocol header checksum

source address

destination address

IP Packet Header

18 CSE 123 – Lecture 10: Internetworking

Page 19: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Version field●  Which version of IP is

this? ◆  Plan for change ◆  Very important!

●  Current versions ◆  4: most of Internet today ◆  6: new protocol with larger

addresses ◆  What happened to 5?

Standards body politics.

19 CSE 123 – Lecture 10: Internetworking

Page 20: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Header length●  How big is IP header?

◆  Counted in 32-bit words ◆  Variable length

» Options ◆  Engineering

consequences of variable length…

●  Most IP packet headers are 20 bytes long

20 CSE 123 – Lecture 10: Internetworking

Page 21: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Type-of-Service●  How should this packet

be treated? ◆  Care/don’t care for delay,

throughput, reliability, cost ◆  How to interpret, how to

apply on underlying net? ◆  Largely unused until 2000

(hijacked for new purposes, ECN & Diffserv)

21 CSE 123 – Lecture 10: Internetworking

Page 22: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Length●  How long is whole packet

in bytes? ◆  Includes header ◆  Limits total packet to 64K ◆  Redundant?

22 CSE 123 – Lecture 10: Internetworking

Page 23: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

TTL (Time-to-Live)●  How many more routers

can this packet pass through? ◆  Designed to limit packet

from looping forever ●  Each router decrements

TTL field ●  If TTL is 0 then router

discards packet

23 CSE 123 – Lecture 10: Internetworking

Page 24: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

Protocol●  Which transport protocol

is the data using? ◆  i.e. how should a host

interpret the data

●  TCP = 6 ●  UDP = 17

24 CSE 123 – Lecture 10: Internetworking

Page 25: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

IP Checksum●  Header contains simple checksum

◆  Validates content of header only

●  Recalculated at each hop ◆  Routers need to update TTL ◆  Hence straightforward to modify

●  Ensures correct destination receives packet

25 CSE 123 – Lecture 10: Internetworking

Page 26: Lecture 10: Internetworking - University of California ... · Lecture 10 Overview Finish bridging Spanning Tree Internet Protocol Service model Packet format CSE 123 – Lecture 10:

For Next Time (Monday)

●  No class Friday

●  Read 3.2.5-6, 9.3.1 in P&D

●  Homework 2 due next Wednesday

●  Project 1 due next Friday

26 CSE 123 – Lecture 10: Internetworking