Sie sind auf Seite 1von 13

Lecture Overview

Lecture 3 ! Last time:


Design Philosophy & » Protocol stacks and layering

Applications » OSI and TCP/IP models


» Application requirements from transport protocols
! Internet Architecture
David Andersen ! Application examples.
» ftp
School of Computer Science
» http
Carnegie Mellon University
! Application requirements.
» “ilities”
15-441 Networking, Spring 2008 » Sharing

http://www.cs.cmu.edu/~dga/15-441/S08/
1 2

Internet Architecture Priorities

! Background ! The effects of the order of items in that list


» “The Design Philosophy of the DARPA Internet are still felt today
Protocols” (David Clark, 1988).
» E.g., resource accounting is a hard, current research
! Fundamental goal: Effective network topic
interconnection
! Let’s look at them in detail
! Goals, in order of priority:
1. Continue despite loss of networks or gateways
2. Support multiple types of communication service
3. Accommodate a variety of networks
4. Permit distributed management of Internet resources
5. Cost effective
6. Host attachment should be easy
7. Resource accountability

3 4
Survivability Fate Sharing
Connection
State No State State
! If network disrupted and reconfigured
» Communicating entities should not care! ! Lose state information for an entity if (and
» No higher-level state reconfiguration only if?) the entity itself is lost.
» Ergo, transport interface only knows “working” and “not
working.” Not working == complete partition. ! Examples:
» OK to lose TCP state if one endpoint crashes
! How to achieve such reliability?
– NOT okay to lose if an intermediate router reboots
» Where can communication state be stored?
» Is this still true in today’s network?
Network Host – NATs and firewalls
Failure handing Replication “Fate sharing” ! Survivability compromise: Heterogenous
Net Engineering Tough Simple network -> less information available to end
hosts and Internet level recovery mechanisms
Switches Maintain state Stateless
Host trust Less More 5 6

Types of Service Varieties of Networks

! Recall from last time TCP vs. UDP ! Discussed a lot of this last time -
» Elastic apps that need reliability: remote login or email » Interconnect the ARPANET, X.25 networks, LANs, satellite
» Inelastic, loss-tolerant apps: real-time voice or video networks, packet networks, serial links…
» Others in between, or with stronger requirements ! Mininum set of assumptions for underlying net
» Biggest cause of delay variation: reliable delivery » Minimum packet size
– Today’s net: ~100ms RTT » Reasonable delivery odds, but not 100%
– Reliable delivery can add seconds. » Some form of addressing unless point to point
! Original Internet model: “TCP/IP” one layer ! Important non-assumptions:
» First app was remote login… » Perfect reliability
» But then came debugging, voice, etc. » Broadcast, multicast
» These differences caused the layer split, added UDP » Priority handling of traffic
! No QoS support assumed from below » Internal knowledge of delays, speeds, failures, etc.
» In fact, some underlying nets only supported reliable delivery ! Much engineering then only has to be done once
– Made Internet datagram service less useful!
» Hard to implement without network support
» QoS is an ongoing debate…
7 8
The “Other” goals Accountability

! Management ! Huge problem.


» Today’s Internet is decentralized - BGP ! Accounting
» Billing? (mostly flat-rate. But phones are moving that way too -
» Very coarse tools. Still in the “assembly language” stage people like it!)
! Cost effectiveness » Inter-provider payments
– Hornet’s nest. Complicated. Political. Hard.
» Economies of scale won out
! Accountability and security
» Internet cheaper than most dedicated networks » Huge problem.
» Packet overhead less important by the year » Worms, viruses, etc.
! Attaching a host – Partly a host problem. But hosts very trusted.
» Authentication
» Not awful; DHCP and related autoconfiguration – Purely optional. Many philosophical issues of privacy vs.
technologies helping. A ways to go, but the path is there security.
! But… ! … Questions before we move on to the project?

9 10

Ftp: Separate Control, Data


FTP: The File Transfer Protocol Connections

! Ftp client contacts ftp server


FTP FTP file transfer
FTP
at port 21, specifying TCP as
user client server transport protocol
interface
user
! Two parallel TCP connections TCP control connection
at host local file remote file opened: port 21
system system » Control: exchange commands,
responses between client, server.
! Transfer file to/from remote host “out of band control” TCP data connection
FTP port 20 FTP
» Data: file data to/from server
! Client/server model client server
» Client: side that initiates transfer (either to/from remote) ! Ftp server maintains “state”:
current directory, earlier
» Server: remote host
authentication
! ftp: RFC 959
! ftp server: port 21

11 12
Ftp Commands, Responses HTTP Basics
Sample Commands: Sample Return Codes
! sent as ASCII text over ! status code and phrase ! HTTP layered over bidirectional byte
control channel ! 331 Username OK, stream
! USER username password required
» Almost always TCP
! PASS password ! 125 data connection
! LIST return list of files in
already open; transfer ! Interaction
starting
current directory » Client sends request to server, followed by
! 425 Can’t open data response from server to client
! RETR filename retrieves connection
(gets) file » Requests/responses are encoded in text
! 452 Error writing file
! STOR filename stores (puts) ! Stateless
file onto remote host » Server maintains no information about past client
requests

13 14

How to Mark End of Message? HTTP Request

! Size of message ! Content-Length


» Must know size of transfer in advance
! Delimiter ! MIME style Content-Type
» Server must “escape” delimiter in content
! Close connection
» Only server can do this

15 16
HTTP Request HTTP Request

! Request line ! Request headers


» Method » Authorization – authentication info
– GET – return URI » Acceptable document types/encodings
– HEAD – return headers only of GET response » From – user email
– POST – send data to the server (forms, etc.) » If-Modified-Since
» URI » Referrer – what caused this page to be requested
– E.g. http://www.intel-iris.net/index.html with a » User-Agent – client software
proxy
– E.g. /index.html if no proxy
! Blank-line
» HTTP version ! Body

17 18

HTTP Request Example HTTP Response

GET / HTTP/1.1 ! Status-line


» HTTP version
Accept: */*
» 3 digit response code
Accept-Language: en-us – 1XX – informational
Accept-Encoding: gzip, deflate – 2XX – success
! 200 OK
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows – 3XX – redirection
NT 5.0) ! 301 Moved Permanently
303 Moved Temporarily
Host: www.intel-iris.net
!

! 304 Not Modified


Connection: Keep-Alive – 4XX – client error
! 404 Not Found
– 5XX – server error
! 505 HTTP Version Not Supported
» Reason phrase

19 20
HTTP Response HTTP Response Example

! Headers HTTP/1.1 200 OK


» Location – for redirection Date: Tue, 27 Mar 2001 03:49:38 GMT
» Server – server software Server: Apache/1.3.14 (Unix) (Red-Hat/Linux) mod_ssl/2.7.1
» WWW-Authenticate – request for authentication OpenSSL/0.9.5a DAV/1.0.2 PHP/4.0.1pl2 mod_perl/1.24
» Allow – list of methods supported (get, head, etc) Last-Modified: Mon, 29 Jan 2001 17:54:18 GMT
» Content-Encoding – E.g x-gzip ETag: "7a11f-10ed-3a75ae4a"
» Content-Length
Accept-Ranges: bytes
» Content-Type
Content-Length: 4333
» Expires
Keep-Alive: timeout=15, max=100
» Last-Modified
Connection: Keep-Alive
! Blank-line
Content-Type: text/html
! Body
…..

21 22

Cookies: Keeping “state” Cookies: Keeping “State” (Cont.)


client Amazon server
Many major Web sites use Cookie file usual http request msg server
en
cookies d a try
creates ID ta in
usual http response + ba ba
Four components: ebay: 8734 se ck
Example: Set-cookie: 1678 1678 for user e nd
1) Cookie header line in the » Susan accesses Internet
HTTP response message always from same PC Cookie file
2) Cookie header line in HTTP » She visits a specific e-
usual http request msg
request message amazon: 1678 cookie-
commerce site for the first cookie: 1678 e ss
3) Cookie file kept on user’s ebay: 8734 specific a cc
time
host and managed by usual http response msg action
» When initial HTTP

ss
user’s browser requests arrives at site, one week later:

ce
ac
4) Back-end database at Web site creates a unique ID
site and creates an entry in Cookie file usual http request msg
backend database for ID cookie-
cookie: 1678
amazon: 1678 specific
ebay: 8734 usual http response msg action

23 24
Typical Workload (Web Pages) HTTP 1.1 - new features

! Multiple (typically small) objects per page ! Newer versions of HTTP add several new
! File sizes features (persistent connections, pipelined
» Why different than request sizes?
transfers) to speed things up.
» Also heavy-tailed ! Let’s detour into some performance
– Pareto distribution for tail evaluation and then look at those features
– Lognormal for body of distribution
! Embedded references
» Number of embedded objects = pareto – p(x) = akax-(a+1)

25 26

Packet Delay Packet Delay


! Sum of a number of different delay components.
! Propagation delay on each link.
» Proportional to the length of the link
Prop + xmit
! Transmission delay on each link.
» Proportional to the packet size and 1/link speed
Store & Forward
2*(Prop + xmit) ! Processing delay on each router.
» Depends on the speed of the router
Cut-through
2*prop + xmit ! Queuing delay on each router.
» Depends on the traffic load and queue size

When does cut-through matter? D B C B A A


Next: Routers have finite speed (processing delay)
Routers may buffer packets (queueing delay) 27 28
A Word about Units Application-level Delay

! What do “Kilo” and “Mega” mean?


» Depends on context
! Storage works in powers of two.
» 1 Byte = 8 bits Delay of
one packet Size
» 1 KByte = 1024 Bytes Delay* +
» 1 MByte = 1024 Kbytes Throughput
! Networks work in decimal units. Average
» Network hardware sends bits, not Bytes sustained
» 1 Kbps = 1000 bits per second throughput
» To avoid confusion, use 1 Kbit/second Units: seconds +
bits/(bits/seconds)
! Why? Historical: CS versus ECE.
* For minimum sized packet
29 30

Some Examples Sustained Throughput


! When streaming packets, the network works like a pipeline.
! How long does it take to send a 100 Kbit file? » All links forward different packets in parallel
» Assume a perfect world
! Throughput is determined by the slowest stage.
» And a 10 Kbit file » Called the bottleneck link
! Does not really matter why the link is slow.
» Low link bandwidth
Throughput » Many users sharing the link bandwidth
Latency 100 Kbit/s 1 Mbit/s 100 Mbit/s
500 µsec 1.0005
0.1005 0.0105
0.1005 0.0006
0.0015
10 msec 0.11
1.01 0.02
0.11 0.0101
0.011 50
37 30 104 59 17 267
100 msec 0.2
1.1 0.11
0.2 0.1001
0.101

31 32
One more detail: TCP HTTP 0.9/1.0

! TCP connections need to be set up ! One request/response per TCP


» “Three Way Handshake”:
connection
» Simple to implement
Client Server
SYN (Synchronize) ! Disadvantages
» Multiple connection setups ! three-way
handshake each time
SYN/ACK (Synchronize + Acknowledgement)
– Several extra round trips added to transfer
ACK » Multiple slow starts

…Data…

2: TCP transfers start slowly and then ramp up the


bandwidth used (so they don’t use too much) 33 34

Single Transfer Example Performance Issues


Server

Client opens TCP


0 RTT Client
SYN
SYN
! Short transfers are hard on TCP
connection 1 RTT » Stuck in slow start
ACK
DAT
Client sends HTTP request Server reads from » Loss recovery is poor when windows are small
ACK
for HTML DAT
disk
2 RTT FIN ! Lots of extra connections
ACK » Increases server state/processing
Client parses HTML FIN
Client opens TCP ACK ! Servers also hang on to connection state
connection SYN
after the connection is closed
SYN
3 RTT ACK
» Why must server keep these?
Client sends HTTP request DAT » Tends to be an order of magnitude greater than # of
for image Server reads from active connections, why?
ACK disk
4 RTT
DAT
Image begins to arrive

35 36
Netscape Solution Persistent Connection Solution

! Mosaic (original popular Web browser) ! Multiplex multiple transfers onto one TCP connection
fetched one object at a time!
! How to identify requests/responses
! Netscape uses multiple concurrent
» Delimiter ! Server must examine response for delimiter string
connections to improve response time » Content-length and delimiter ! Must know size of transfer in
» Different parts of Web page arrive independently advance
» Can grab more of the network bandwidth than other » Block-based transmission ! send in multiple length delimited
users blocks
» Store-and-forward ! wait for entire response and then use
! Doesn’t necessarily improve response time content-length
» TCP loss recovery ends up being timeout dominated » Solution ! use existing methods and close connection
because windows are small otherwise

37 38

Persistent Connection Solution Persistent HTTP

Server Nonpersistent HTTP issues: Persistent without pipelining:


! Requires 2 RTTs per object ! Client issues new request
Client
0 RTT ! OS must work and allocate only when previous
DAT host resources for each response has been
Client sends HTTP request ACK Server reads from TCP connection
for HTML disk received
DAT
! But browsers often open ! One RTT for each
1 RTT ACK parallel TCP connections to referenced object
fetch referenced objects
Client parses HTML DAT
Server reads from Persistent HTTP Persistent with pipelining:
Client sends HTTP request ACK DAT disk ! Default in HTTP/1.1
for image ! Server leaves connection
open after sending ! Client sends requests as
2 RTT response soon as it encounters a
Image begins to arrive ! Subsequent HTTP referenced object
messages between same
! As little as one RTT for all
client/server are sent over
connection the referenced objects

39 40
Persistent Connection
Performance Remaining Problems

! Benefits greatest for small objects ! Serialized transmission


» Up to 2x improvement in response time » Much of the useful information in first few bytes
– May be better to get the 1st 1/4 of all images than one
complete image (e.g., progressive JPEG)
! Server resource utilization reduced due to » Can “packetize” transfer over TCP
fewer connection establishments and fewer – Could use range requests
active connections
! Application specific solution to transport
! TCP behavior improved protocol problems. :(
» Solve the problem at the transport layer
» Longer connections help adaptation to available
bandwidth » Could fix TCP so it works well with multiple
simultaneous connections
» Larger congestion window improves loss recovery – More difficult to deploy

41 42

Back to performance Bandwidth Sharing

! We examined delay, ! Bandwidth received on the


bottleneck link determines
! But what about throughput? end-to-end throughput.
BW
! Router before the
bottleneck link decides 100
! Important factors: how much bandwidth each
» Link capacity user gets.
» Other traffic » Users that try to send at a
higher rate will see packet
loss
! User bandwidth can
fluctuate quickly as flows Time
are added or end, or as
flows change their transmit
rate.

43 44
Fair Sharing of Bandwidth But It is Not that Simple

! All else being equal, fair


means that users get equal
treatment.
BW
» Sounds fair
! When things are not equal, 100
we need a policy that
determines who gets how
much bandwidth. Bottleneck
» Users who pay more get more
bandwidth
» Users with a higher “rank” get
more bandwidth
Time
» Certain classes of applications
get priority

45 46

Network Service Models Other Requirements

! Set of services that the network provides. ! Network reliability.


» Network service must always be available
! Best effort service: network will do an honest
effort to deliver the packets to the destination. ! Security: privacy, DOS, ..
» Usually works ! Scalability.
! “Guaranteed” services. » Scale to large numbers of users, traffic flows, ...
» Network offers (mathematical) performance guarantees ! Manageability: monitoring, control, ..
» Can apply to bandwidth, latency, packet loss, ..
! Requirement often applies not only to the core
! “Preferential” services. network but also to the servers.
» Network gives preferential treatment to some packets
! Requirements imposed by users and network
» E.g. lower queuing delay
managers.
! Quality of Service is closely related to the
question of fairness.
47 48
Readings

! “End-to-end arguments in system design”,


Saltzer, Reed, and Clark, ACM Transactions
on Computer Systems, November 1984.
! “The design philosophy of the DARPA
Internet Protocols”, Dave Clark, SIGCOMM 88.

49

Das könnte Ihnen auch gefallen