Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays...

31
Internet Routing Internet Routing COS 598A COS 598A Jennifer Rexford Jennifer Rexford http://www.cs.princeton.edu/~jrex/ http://www.cs.princeton.edu/~jrex/ teaching/spring2005 teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm Tuesdays/Thursdays 11:00am-12:20pm
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    218
  • download

    1

Transcript of Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays...

Page 1: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Internet Routing Internet Routing COS 598ACOS 598A

Jennifer RexfordJennifer Rexford

http://www.cs.princeton.edu/~jrex/teaching/http://www.cs.princeton.edu/~jrex/teaching/spring2005spring2005

Tuesdays/Thursdays 11:00am-12:20pmTuesdays/Thursdays 11:00am-12:20pm

Page 2: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Who am I, and Who are You?

• Who am I?– Joined the CS faculty in Feb 2005 (i.e.,

today)– Worked for 8.5 years at AT&T Labs—

Research– Research on routing protocols, network

measurement, and network operations

• Who are you, and what do you do?– Introductions…

Page 3: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

What is Internet Routing?

• The glue that holds the Internet together

• How routers know where to forward packets

• How operators control the load on their links

• How networks achieve business relationships

1

2

34

5

67

Client Web server

Page 4: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

What Does This Course Cover?

• Internet architecture– Best-effort packet-delivery service– Intradomain and interdomain routing

• Network topology– Inside a network, and between networks

• Traffic engineering– Getting the traffic to go where you want

• Convergence– Delay to respond to change– Whether the protocol ever converges

Page 5: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

What Does the Course Cover? (Continued)

• Routers– Router hardware and software– Router configuration– Scaling to many destinations, routers, &

networks

• Measurement– Monitoring the routing protocols– Characterizing the routing system– Troubleshooting routing problems

• Routing protocol security• New architectural directions

Page 6: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Emphasis of the Course

• Not so much on the protocols– …though we will cover BGP, OSPF, IS-IS,

MPLS, and various other acronyms of the day

• Or on the routers– …though we will talk about how routers work

• But more on how people manage routing– Selecting which protocols to use– Deciding how to set the parameters– Troubleshooting problems as they arise– Preventing attacks– …

Page 7: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Structure of the Course

• Classroom time– Mixture of lecture and discussion of papers

• Readings– Selected research papers and surveys– Videocasts of presentations (e.g., from NANOG)– Optional short “food for thought” reading each week

• Course project– Literature survey, measurement or simulation study,

protocol design, theoretical analysis, etc.

• Grading– Final course project (written report and oral

presentation)– Class participation (written reviews, class discussion,

etc.)

Page 8: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Today, and Thursday

• Goal– Explain IP best-effort delivery model

• Today– What is the service model?– How can you do anything useful with this?

• Thursday– How do the routers support the service

model?– How do the routing protocols work?

Page 9: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

IP Service Model: Best-Effort Packet Delivery

• Packet switching– Send data in packets– Header with source & destination address

• Best-effort delivery– Packets may be lost– Packets may be corrupted– Packets may be delivered out of order

source destination

IP network

Page 10: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

IP Service Model: Why Packets?

• Data traffic is bursty– Logging in to remote machines– Exchanging e-mail messages

• Don’t want to waste reserved bandwidth– No traffic exchanged during idle periods

• Better to allow multiplexing– Different transfers share access to same links

• Packets can be delivered by most anything– RFC 2549: IP over Avian Carriers (aka birds)

• … still, packet switching can be inefficient– Extra header bits on every packet

Page 11: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

04/18/23

IP Packet Structure

4-bitVersion

4-bitHeaderLength

8-bitType of Service

(TOS)16-bit Total Length (Bytes)

16-bit Identification3-bitFlags 13-bit Fragment Offset

8-bit Time to Live (TTL) 8-bit Protocol 16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Payload

20-byte20-byteHeaderHeader

usually IPv4 usually 20 bytes

fragments

more later

errorcheckheader

Page 12: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

IP Service Model: Why Best-Effort?

• It’s easier not to make promises– Don’t need to reserve bandwidth and memory– Don’t need to do error detection & correction– Don’t need to remember from one packet to

next

• Easier to survive failures– Transient disruptions are okay during failover

• … but, applications do want efficient, accurate transfer of data in order, in a timely fashion

Page 13: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

IP Service Model: Best-Effort is Enough

• No error detection or correction– Higher-level protocol can provide error checking

• Successive packets may not follow the same path– Not a problem as long as packets reach the

destination

• Packets can be delivered out-of-order– Receiver can put packets back in order (if

necessary)

• Packets may be lost or arbitrarily delayed– Sender can send the packets again (if desired)

• No network congestion control (beyond “drop”)– Sender can slow down in response to loss or delay

Page 14: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Layering in the IP Protocols

Internet Protocol

Transmission ControlProtocol (TCP)

User Datagram Protocol (UDP)

TelnetHTTP

SONET ATMEthernet

RTPDNSFTP

Page 15: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Transmission Control Protocol (TCP)

• Communication service (socket)– Ordered, reliable byte stream– Simultaneous transmission in both directions

• Key mechanisms at end hosts– Retransmit lost and corrupted packets– Discard duplicate packets and put packets in order– Flow control to avoid overloading the receiver buffer– Congestion control to adapt sending rate to network

load

source network destination

TCP connection

Page 16: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Source and Destination Port Numbers

• Motivation for port numbers– Unique identifier of the TCP connection on each end– Necessary to (de)multiplex packets at the end-

points

• Assigning port numbers– Port numbers below 1024 are assigned– Well-known port numbers for common applications

• Web client contacting a web server– Browser click results in creation of a TCP socket– Client machine assigns an available port (>=1024)– Client machine requests a connection with the

server– Open TCP connection to port 80 at the server

Page 17: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Opening and Closing a TCP Connection

• Three-way handshake to establish connection– Host A sends a SYN to the host B– Host B returns a SYN and acknowledgement– Host A sends an ACK to acknowledge the SYN ACK

• Four-way handshake to close the connection– Finish (FIN) to close and receive remaining bytes , or– Reset (RST) to close and not receive remaining bytes

SYN

SYN

AC

K

AC

KD

ata

FIN

AC

K

AC

K

timeA

B

FIN

AC

K

Page 18: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Lost and Corrupted Packets

• Detecting corrupted and lost packets– Error detection via checksum on header and data

– Sender sends packet, sets timeout, and waits for ACK

– Receiver sends ACKs for received packets

– Sender infers loss from timeout or duplicate ACKs

• Retransmission by sender– Sender retransmits lost/corrupted packets

– Receiver reassembles and reorders packets

– Receiver discards corrupted and duplicated packets

Page 19: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

TCP Flow and Congestion Control

• Window-based flow control– Sender limits number of outstanding bytes (window size)– Receiver window ensures data does not overflow receiver

• Adapting to network congestion– Congestion window tries to avoid overloading the network

(increase with successful delivery, decrease with loss)– TCP connection starts with small initial congestion window

timecon

gesti

on

win

dow

slow start

congestion avoidance

Page 20: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

User Datagram Protocol (UDP)

• Some applications do not want or need TCP– Avoid overhead of opening/closing a connection

– Avoid recovery from lost/corrupted packets

– Avoid sender adaptation to loss/congestion

• Example applications that use UDP– Multimedia streaming applications

– Domain Name System (DNS) queries/replies

• Dealing with the growth in UDP traffic– Interference with TCP performance

– Pressure to apply congestion control

– Future routers may enforce “TCP-friendly” behavior

Page 21: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Domain Name System (DNS)

• Properties of DNS– Hierarchical name space divided into zones– Translation of names to/from IP addresses– Distributed over a collection of DNS servers

• Client application– Extract server name (e.g., from the URL)– Invoke system call to trigger DNS resolver code– E.g., gethostbyname() on “www.foo.com”

• Server application– Extract client IP address from socket– Optionally invoke system call to translate into name– E.g., gethostbyaddr() on “12.34.158.5”

Page 22: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Domain Name System

com edu org ac uk zw arpa

unnamed root

bar

west east

foo my

ac

cam

usr

in-addr

12

34

56

generic domains country domains

my.east.bar.edu usr.cam.ac.uk

12.34.56.0/24

Page 23: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

DNS Resolver and Local DNS Server

Application

DNS resolver

Local DNSserver

1 10

DNS cache

DNS query

2

DNS response 9

Root server

3

4

Top-leveldomain server

5

6

Second-leveldomain server

7

8

Caching based on a time-to-live (TTL) assigned by the DNS server responsible for the host name to reduce latency in DNS translation.

Page 24: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Application-Layer Protocols

• Messages exchanged between applications– Syntax and semantics of the messages between hosts

– Tailored to the specific application (e.g., Web, e-mail)

– Messages transferred over transport connection (e.g., TCP)

• Popular application-layer protocols– Telnet, FTP, SMTP, NNTP, HTTP, …

Client Server

GET /index.html HTTP/1.1

HTTP/1.1 200 OK

Page 25: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Example: Many Steps in Web Download

Browser cache

DNSresolution

TCPopen

1st byteresponse

Last byteresponse

Sources of variability of delay• Browser cache hit/miss, need for cache

revalidation• DNS cache hit/miss, multiple DNS servers,

errors• Packet loss, high RTT, server accept queue• RTT, busy server, CPU overhead (e.g., CGI

script)• Response size, receive buffer size, congestion• … downloading embedded image(s) on the

page

Page 26: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

IP Suite: End Hosts vs. Routers

HTTP

TCP

IP

Ethernetinterface

HTTP

TCP

IP

Ethernetinterface

IP IP

Ethernetinterface

Ethernetinterface

SONETinterface

SONETinterface

host host

router router

HTTP message

TCP segment

IP packet IP packetIP packet

This course focuses on the routers…

Page 27: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Happy Routers Make Happy Packets

• Routers forward packets– Forward incoming packet to outgoing link– Store packets in queues– Drop packets when necessary

• Routers compute paths– Routers run routing protocols– Routers compute forwarding tables

• A famous quotation from RFC 791– “A name indicates what we seek.

An address indicates where it is. A route indicates how we get there.” -- Jon Postel

Page 28: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Reading for Thursday

• Two classic papers– End-to-end arguments in system design

(1984)– Design philosophy of the DARPA Internet

protocols (1988)

• New perspectives on success of the Internet– Tussle in cyberspace: Defining tomorrow’s

Internet (2002)

Page 29: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Backup Slides

• TTL and traceroute

Page 30: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Time-to-Live Field

• Potential robustness problem– Routing loops can cause packets to cycle

forever– Confusing if the packet arrives much later

• Time-to-live field in packet header– TTL field decremented by each router on the

path– Packet is discarded when TTL field reaches

0…– …and send “timer expired” message to

source

Page 31: Internet Routing COS 598A Jennifer Rexford jrex/teaching/spring2005 Tuesdays/Thursdays 11:00am-12:20pm.

Traceroute: Measuring the Forwarding Path

• Time-To-Live field in IP packet header– Source sends a packet with a TTL of n– Each router along the path decrements the

TTL– “TTL exceeded” sent when TTL reaches 0

• Traceroute tool exploits this TTL behavior

source destination

TTL=1

Time exceeded

TTL=2

Send packets with TTL=1, 2, 3, … and record source of “time exceeded” message