april 5, 2004 cse 123b -- lecture 1 – introduction and review...

8
1 CSE 123b CSE 123b Communications Software Communications Software Spring 2004 Spring 2004 Lecture 2: Internet architecture and Lecture 2: Internet architecture and Internetworking Internetworking Stefan Savage Stefan Savage April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 2 Welcome (day 2) Welcome (day 2) Me: Stefan Savage Office Hours: Tuesdays 3-4pm or by appt TA’s (times TBA) Dipti Borkar (hw) Walter Phillips (projects) Class Web page Up by next class Questions? April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 3 From last time: From last time: Layering by example… Layering by example… ROUGHLY, what happens when I click on a Web page from UCSD? Internet www.yahoo.com ? My computer April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 4 Application layer (HTTP) Application layer (HTTP) Turn click into HTTP request GET http://www.yahoo.com/r/mp HTTP/1.1 Host: www.yahoo.com Connection:keep-alive April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 5 Application layer? Application layer? Name resolution (DNS) Name resolution (DNS) Where is www.yahoo.com ? What’s the address for www.yahoo.com My computer (132.239.9.64) Oh, you can find it at 64.58.76.177 Local DNS server (132.239.51.18) April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 6 Transport layer (TCP) Transport layer (TCP) Break message into packets (TCP segments) Should be delivered reliably & in-order GET http://www.yahoo.com/r/mp HTTP/1.1 Host: www.yahoo.com Connection:keep-alive GET htt 1 “and let me know when they got there” p://www. 2 yahoo.c 3

Upload: others

Post on 20-Feb-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 2cseweb.ucsd.edu/classes/sp04/cse123b/Lec2-6up.pdf6 April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review

1

CSE 123bCSE 123bCommunications SoftwareCommunications Software

Spring 2004Spring 2004

Lecture 2: Internet architecture and Lecture 2: Internet architecture and InternetworkingInternetworking

Stefan SavageStefan Savage

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 2

Welcome (day 2)Welcome (day 2)Me: Stefan Savage

◆ Office Hours: Tuesdays 3-4pm or by apptTA’s (times TBA)

◆ Dipti Borkar (hw)◆ Walter Phillips (projects)

Class Web page◆ Up by next class

Questions?

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 3

From last time:From last time:Layering by example…Layering by example…

ROUGHLY, what happens when I click on a Web page from UCSD?

Internet

www.yahoo.com

?My computer

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 4

Application layer (HTTP)Application layer (HTTP)Turn click into HTTP request

GET http://www.yahoo.com/r/mp HTTP/1.1Host: www.yahoo.comConnection:keep-alive…

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 5

Application layer? Application layer? Name resolution (DNS)Name resolution (DNS)

Where is www.yahoo.com?

What’s the address for www.yahoo.comMy computer(132.239.9.64)

Oh, you can find it at 64.58.76.177

Local DNS server(132.239.51.18)

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 6

Transport layer (TCP)Transport layer (TCP)Break message into packets (TCP segments)Should be delivered reliably & in-order

GET http://www.yahoo.com/r/mp HTTP/1.1Host: www.yahoo.comConnection:keep-alive…

GET htt1

“and let me know when they got there”

p://www.2yahoo.c3

Page 2: April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 2cseweb.ucsd.edu/classes/sp04/cse123b/Lec2-6up.pdf6 April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review

2

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 7

Network layer: IP AddressingNetwork layer: IP AddressingAddress each packet so it can traverse network and arrive at host

My computer(132.239.9.64)

www.yahoo.com(64.58.76.177)

GET htt164.58.76.177 132.239.9.64

Destination Source Data

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 8

Qwest

Network layer: IP RoutingNetwork layer: IP Routing

SprintUUNet

AT&T

UCSDwww.yahoo.com

(64.58.76.177)

Each router forwards packet towards destination

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 9

DatalinkDatalink layer (Ethernet)layer (Ethernet)Too boring for a picture (sorry)

Break message into framesMedia Access Control (MAC)Send frame

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 10

Physical layerPhysical layer

802.11b Wireless Access Point

Ethernet switch/router

To campus backbone

2.4Ghz RadioDS/FH Radio(1-11Mbps)

Cat5 Cable (4 wires)100Base TX Ethernet

100Mbps

62.5/125um 850nm MMF1000BaseSX Ethernet

1000Mbps

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 11

SummarySummaryPackets switching is an efficient and simple architecture for data communications

◆ Gives up guarantees on serviceLayering is a technique for managing complexity in systems

◆ Encapsulate related functionality in a layer and provide an interface to upper and lower layers

◆ A model: implementations do not necessarily respect layers

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 12

Today: InternetworkingToday: InternetworkingFirst some history…First some history…

1968: DARPANET (precursor to Internet)◆ Bob Taylor, Larry Roberts create program to build first wide-

area packet-switched network◆ Why?

1978: new networks emerge◆ SATNet, Packet Radio, Ethernet◆ All islands

Big question: how to connect these networks?

Plug: “Where Wizards Stay Up Late” by Hafner and Lyon is the best account of early Internet History I’ve seen.

Page 3: April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 2cseweb.ucsd.edu/classes/sp04/cse123b/Lec2-6up.pdf6 April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review

3

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 13

Primary Goal: Connect StuffPrimary Goal: Connect Stuff“Effective technique for multiplexed utilization of existing interconnected networks” – David Clark

◆ Minimal assumptions about underlying networks» No support for broadcast, multicast, real-time, reliability» Extra support could actually get in the way (X.25 example)

◆ Packet switched, store and forward» Matched application needs, nets already packet switched» Enables efficient resource sharing/high utilization

◆ “Gateways” interconnect networks» Routers/Switches in today’s nomenclature

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 14

Why is this hard?Why is this hard?Heterogeneity

◆ Addressing» Each network media has a different addressing scheme; routing

protocol◆ Bandwidth

» Modems to terabits ◆ Latency

» Seconds to nanoseconds◆ Packet size

» Dozens to thousands of bytes◆ Loss rates

» Differ by many orders of magnitude◆ Service guarantees

» Send and pray vs reserved bandwidth

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 15

How to connect different How to connect different networks?networks?

Monopoly◆ Re-engineer network to use a single set of protocols everywhere◆ Economic cost

Translation Gateways◆ Translates directly between different network formats◆ O(n2) complexity (n is # of protocols)◆ May not be able to translate perfectly (QoS)

Indirection Gateways◆ Translates between local network format and universal “intermediate”

format ◆ O(n) complexity ◆ May not take advantage of features in underlying network

Note impact of economics on decision. Engineering not science.

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 16

Internetworking Internetworking Cerf & Kahn74, “A Protocol for Packet Network Intercommunication”

◆ Foundation for the Internet

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

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 17

ATMEthernet

Router

IP EthTCPHTTP IP ATMTCPHTTP

data packet data packet

Separate physical networks communicate to form a single logical network

How IP worksHow IP works

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 18

What should the Internet What should the Internet Protocol do?Protocol do?

Packetization?Addressing?Error detection?Reliable transmission?Packet sequencing?QoS?Security?

Decisions informed by the “End-to-End Principle”

Page 4: April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 2cseweb.ucsd.edu/classes/sp04/cse123b/Lec2-6up.pdf6 April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review

4

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 19

Saltzer84:Saltzer84:EndEnd--toto--End PrincipleEnd Principle

Key question: Where should functionality be placed in a communications system? End-to-end argument

◆ Functionality should be implemented at a lower layer iff it can be correctly and completely implemented there

◆ Incomplete versions of a function can be used as a performance enhancement, but not for correctness

Early, and still relevant, example◆ ARPAnet provided reliable link transfers between switches◆ Packets could still get corrupted on host-switch link, or inside

of the switches◆ Hence, still need reliability at higher layers

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 20

Example: Example: Reliable File TransferReliable File Transfer

Host A

Disk

App

OS Disk

App

OS

Host B

Where can data be corrupted?How to tell if data has been corrupted?Is there any value in lower-layer reliability?

1

23

4

5 6

7

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 21

Example: Reliable File TransferExample: Reliable File Transfer

From server disk over network to client diskMany places where errors can be introduced

◆ Disk can introduce bit errors◆ Host I/O bus can introduce bit errors◆ Packets can be corrupted, dropped, reordered at

any nodeConclusion

◆ Still need integrity checks on entire file, at application level, not per packet or per hop

◆ Impossible to design “perfect” layers because perfect requires support from higher layers

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 22

Internet architectureInternet architectureImpose 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

Manage heterogeneity at hosts◆ Adapt to underlying network heterogeneity◆ Re-order packets, detect errors, retransmit lost messages,

etc.◆ Persistent network state only kept in hosts (fate-sharing)

Service model: send and pray

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 23

So what does IP do?So what does IP do?AddressingFragmentation

◆ E.g. FDDI’s maximum packet is 4500 bytes while Ethernet is 1500 bytes, how to manage this?

Some error detectionPotpourri

Routers forward packets to next hop◆ They do not

» Detect data corruption, packet loss, packet duplication» Reassemble or retransmit packets

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 24

Internet AddressingInternet AddressingHierarchical addressing

◆ Global inter-network address◆ Local network-specific address

Why hierarchical?Assumptions about networks?

Network host Identifier8 16

Page 5: April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 2cseweb.ucsd.edu/classes/sp04/cse123b/Lec2-6up.pdf6 April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review

5

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 25

FragmentationFragmentationRouter needs to forward a packet that is too big for the next link it must cross

◆ Router breaks up single IP packet into two or more smaller IP packets

◆ Each fragment is labeled so it can be correctly reassembled

◆ Those fragments can, in turn, be fragmented by later routers

End host receives fragments and reassembles them into original packet

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 26

Error detectionError detectionBit errors

◆ Data-link layer (e.g. Ethernet) generates CRC for each packet

» When packet is received by router or host, it checks packet against CRC for errors

» Why isn’t this enough?

◆ Network-layer (IP) checksum written by sender◆ Checked at each hop and by receiver

» Why not just check at the receiving host?

Packet losses◆ Not part of IP, we’ll deal with this next time

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 27

Today’s IP Packet HeaderToday’s IP Packet Header

length

0 15 16

options (if any)

data (if any)

31

20 bytes

ver HL TOS

identificationRES

MF

DF offset

TTL protocol header checksum

source address

destination address

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 28

Version fieldVersion fieldWhich version of IP is this?

◆ Plan for change◆ Very important!

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

addresses◆ What happened to 5?

Standards body politics.

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 29

Header lengthHeader lengthHow big is IP header?

◆ In bytes/octets◆ Variable length

» Options◆ Engineering

consequences of variable length…

Most IP packets are 20 bytes long

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 30

TypeType--ofof--ServiceServiceHow 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

Page 6: April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 2cseweb.ucsd.edu/classes/sp04/cse123b/Lec2-6up.pdf6 April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review

6

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 31

LengthLengthHow long is whole packet in bytes/octets?

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

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 32

FragmentationFragmentationSender writes unique value in identification fieldIf router fragments packet it copies id into each fragmentOffset field indicates position of fragment in bytes (offset 0 is first)

◆ MoreFragments flag indicates that this isn’t the last fragment

◆ DontFragment flag tells gateway not to fragmentAll routers must support 576 byte packets (MTU)

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 33

Aside: costs of fragmentationAside: costs of fragmentationInterplay between fragmentation and retransmission

Packet must be completely reassembled before it can be consumed on the receiving host

What if a fragment gets lost?

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 34

TTL (TimeTTL (Time--toto--Live)Live)How many more routers can this packet pass through?

◆ Designed to limit packet from looping forever

Each router decrements TTL fieldIf TTL is 0 then router discards packet

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 35

ProtocolProtocolWhich transport protocol is the data using?

◆ i.e. how should a host interpret the data

TCP = 6UDP = 17

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 36

Header checksumHeader checksumDetects errors in IP header

◆ Calculated by sending host

◆ Checked by receiving hostMust be recalculated by router. Why?Only protects header, not data

Page 7: April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 2cseweb.ucsd.edu/classes/sp04/cse123b/Lec2-6up.pdf6 April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review

7

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 37

IP addressingIP addressing32-bits in an IPv4 address

◆ Dotted decimal format a.b.c.d◆ Each represent 8 bits of address

Network part and host part◆ E.g. IP address 132.239.15.3◆ 132.239 refers to the UCSD campus network◆ 15.3 refers to the host gremlin.ucsd.edu

Which part is network vs host?

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 38

ClassClass--based routing (<1993)based routing (<1993)Most significant bits determines “class” of address

Pro: single lookup to find addressCon

◆ Fragmentation◆ Can’t aggregate

Network Host0

Network Host1

Network Host1

160

1 0821

14

Class A

Class B

Class C

127 nets, 16M hosts

16K nets, 64K hosts

2M nets, 254 hosts

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 39

Classless addressing (1993>)Classless addressing (1993>)Classless Inter-Domain Routing (CIDR)

◆ Routes represented by tuple (network prefix/mask)◆ Allows arbitrary allocation between network and

host address

◆ e.g. 10.95.1.2/8: 10 is network and remainder (95.1.2) is host

Pro: Finer grained allocation; aggregationCon: More expensive lookup: longest prefix match

Network Host

Prefix Mask=# significant bits representing prefix

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 40

How is IP changing?How is IP changing?IPv6

◆ 128bit addresses◆ No fragmentation (so no header length), no options per se◆ Flow label◆ 1500 MTU◆ Security and mobility built in

IPSEC◆ Authentication and Encryption of packet◆ Generally implemented end-to-end (at hosts)

Diffserv◆ Reuse ToS bits to indicate (roughly) a local QoS class

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 41

MetaMeta--points…points…The Internet was designed

◆ There is no natural law that says TCP/IP, network routing, etc.. had to look the way it does now

◆ It could well have been done differentlyThe Internet evolves

◆ The Internet today is not the same Internet as 1988, 1973◆ TCP/IP have changed considerably over the years◆ We’re using IPv4, with IPv6 (maybe) being deployed

Many of these design issues are deep◆ Seemingly straightforward decisions can have very subtle

correctness and performance implications◆ E.g. Implications of fragmentation

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 42

Stuff you should definitely Stuff you should definitely rememberremember

End-to-end principle and how its applied

Purpose of the Internet Protocol◆ What problems it solves◆ How it solves them

Page 8: April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 2cseweb.ucsd.edu/classes/sp04/cse123b/Lec2-6up.pdf6 April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review

8

April 5, 2004 CSE 123b -- Lecture 1 – Introduction and Review 43

For Next Time…For Next Time…Reliable Transmission and Flow Control

◆ Some TCP specificsRead 2.5 and Chap 5 up to (but not including) 5.3