51
1 CMPE 150- Introduction to Computer Networks CMPE 150 Fall 2005 Lecture 28 Introduction to Computer Networks

CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 28 Introduction to Computer Networks

  • View
    220

  • Download
    1

Embed Size (px)

Citation preview

1CMPE 150- Introduction to Computer Networks

CMPE 150

Fall 2005Lecture 28

Introduction to Computer Networks

2CMPE 150- Introduction to Computer Networks

Announcements• Homework 5 posted.

– Due, Mon, 12.05.• Final exam: December 7th. 4-7pm

– In class.– Closed books/notes.– Comprehensive.

• Discussion session:– Monday, 12.05 @ 2pm.– Jack’s lounge.– Questions by e-mail.

• Course evaluation.– Today.

• CE 151 will be offered in Winter 06!– Likely TTh 4-5:45.

3CMPE 150- Introduction to Computer Networks

Today

• Transport Layer (Cont’d).– Chapter 6 of Tanenbaum.

• Application layer.

4CMPE 150- Introduction to Computer Networks

TCP Congestion Control

5CMPE 150- Introduction to Computer Networks

Network dynamics

load

throughput

load

delay

6CMPE 150- Introduction to Computer Networks

TCP Self-Clocking

PrPb

Ar

Ab

receiversender

As

7CMPE 150- Introduction to Computer Networks

Congestion Control Design

• Avoidance or detection/recovery? – Avoidance keeps system at knee of curve

• Requires some congestion signal.

– Detection/recovery responds to loss after the fact.

• TCP– Which is TCP?

• Congestion detection/recovery.

– How does TCP do it?• Slow start, congestion avoidance, exponential backoff.

8CMPE 150- Introduction to Computer Networks

TCP congestion control basics

• Like, flow control, also window based.– Sender keeps congestion window (cwin).

– Each sender keeps 2 windows: receiver’s advertised window and congestion window.

– Sender’s maximum window: min(advertised window, cwin).

• Sender’s actual window:– Max window - unacknowledged segments.

9CMPE 150- Introduction to Computer Networks

TCP congestion control mechanisms

• Collection of interrelated mechanisms:– Slow start.

– Congestion avoidance.

– Accurate retransmission timeout estimation.

– Fast retransmit.

– Fast recovery.

10CMPE 150- Introduction to Computer Networks

TCP congestion window

• New congestion window cwnd.– What the network can handle,

– versus flow control window (wnd): what the other end can handle.

• Actual congestion window:– min (wnd, cwnd).

11CMPE 150- Introduction to Computer Networks

How to adjust window?

• When to increase/decrease?

• A control theory problem:– Observe network.

– Reduce window if congested.

– Increase window if not congested.

• Constraints:– Efficiency.

– Fairness.

– Stability (too much oscillation is bad).

– Out-of-date info• RTT is fundamental

limit to how quickly you can react

12CMPE 150- Introduction to Computer Networks

Slow start [Jacobson 1988]

• How do we get this self-clocking behavior to start?– Initialize cwnd = 1.– Upon receipt of every ack, cwnd = cwnd + 1

• Implications– Window actually increases in RTT * log2W (exponential

increase).– Can overshoot window and cause packet loss.

Connection’s congestion window starts at 1 segment.

13CMPE 150- Introduction to Computer Networks

Slow start example

1

one RTT

one pkt time

0R

21R

3

42R

567

83R

91011

1213

1415

1

2 3

4 5 6 7

14CMPE 150- Introduction to Computer Networks

When to End Slow-Start?

• Want to end when the pipe is full.– When cwnd > ssthresh.– Start with large ssthresh, but then refine it.

• On packet loss.– cwnd=1 and go back to slow start.– ssthresh = cwnd / 2

• assume that pipe size was somewhere between last good window (cwnd/2) and current window (cwnd).

• Eventually, ssthresh is right and transition to congestion avoidance without packet loss.

15CMPE 150- Introduction to Computer Networks

Congestion avoidance

Upon receiving ACK Increase cwnd by 1/cwnd. This is additive increase.

Why not multiplicative increase? Growing too fast in equilibrium =>

oscillations

16CMPE 150- Introduction to Computer Networks

TCP Congestion Control: Operation

threshold

timeout

threshold

cwin

time

17CMPE 150- Introduction to Computer Networks

TCP Retransmission Timer

• When segment sent, retransmission timer starts.

– If segment ACKed, timer stops.

– If time out, segment retransmitted and timer starts again.

18CMPE 150- Introduction to Computer Networks

How to set timer?

• Based on round-trip time: time between a segment is sent and ACK comes back.

• If timer is too short, unnecessary retransmissions.

• If timer is too long, long retransmission delay.

19CMPE 150- Introduction to Computer Networks

Jacobson’s Algorithm

• Determining the round-trip time:– TCP keeps RTT variable.

– When segment sent, TCP measures how long it takes to get ACK back (M).

– RTT = alpha*RTT + (1-alpha)M.

– alpha: smoothing factor; determines weight given to previous estimate.

– Typically, alpha=7/8.

20CMPE 150- Introduction to Computer Networks

Jacobson’s Algorithm (Cont’d)

• Determining timeout value:– Measure RTT variation, or |RTT-M|.

– Keeps smoothed value of cumulative variation D=alpha*D+(1-alpha)|RTT-M|.

– Alpha may or may not be the same as value used to smooth RTT.

– Timeout = RTT+4*D.

21CMPE 150- Introduction to Computer Networks

Karn’s Algorithm

• How to account for ACKs of retransmitted segments?

– Count it for first or second transmission?

– Karn proposed not to update RTT on any retransmitted segment.

– Instead RTT is doubled on each failure until segments get through.

22CMPE 150- Introduction to Computer Networks

Application Layer

• Tanenbaum, Chapter 7.

23CMPE 150- Introduction to Computer Networks

DNS

24CMPE 150- Introduction to Computer Networks

What’s DNS?

• Domain Name System.• What does it do?

– Maps host names to IP addresses, and

– Vice-versa.

25CMPE 150- Introduction to Computer Networks

Some History

• Original approach (ARPANET, 1970’s):– File hosts.txt listed all hosts and their IP

addresses.

– Every night every host fetches file from central repository.

– OK for a few hundred hosts.

– Scalability?

• File size.• Centrally managed.

26CMPE 150- Introduction to Computer Networks

DNS

• Hierarchical name space.

• Distributed database.

• RFCs 1034 and 1035.

27CMPE 150- Introduction to Computer Networks

How is it used?

• Client-server model.– Client DNS (running on client hosts), or “resolver”.

– Application calls “resolver” with name.

– “Resolver” contacts local DNS server (using UDP) passing the name.

– Server returns corresponding IP address.

28CMPE 150- Introduction to Computer Networks

DNS Name Space

• A portion of the Internet domain name space.

29CMPE 150- Introduction to Computer Networks

Name Space Structure

• Top-level domains:– Generic.– Countries.

• Leaf domains: no sub-domains.• In practice all US organizations are under a

generic domain, while everything outside the US is under the corresponding country domain.

30CMPE 150- Introduction to Computer Networks

DNS Names

• Domain names:– Concatenation of all domain names starting from

its own all the way to the root separated by “.”.

– Refers to a tree node and all names under it.

– Case insensitive.

– Components up to 63 characters.

– Full name less than 255 characters.

31CMPE 150- Introduction to Computer Networks

Name Space Management

• Domains are autonomous.– Organizational boundaries.

– Each domain manages its own name space independently of other domains.

• Delegation:– When creating new domain: register with parent

domain.

• For name uniqueness.• For name resolution.

32CMPE 150- Introduction to Computer Networks

Name Servers

• Entire database in a single name server.– Practical?

– Why?

• DNS database is partitioned into zones.

• Each zone contains part of the DNS tree.

• Zone <-> name server.– Each zone may be served by more than 1 server.

– A server may serve multiple zones.

• Primary and secondary name servers.

33CMPE 150- Introduction to Computer Networks

Name Servers

• Part of the DNS name space showing the division into zones.

34CMPE 150- Introduction to Computer Networks

Name Resolution • Application wants to resolve name.• Resolver sends query to local name server.

– Resolver configured with list of local name servers.– Select servers in round-robin fashion.

• If name is local, local name server returns matching authoritative RRs.– Authoritative RR comes from authority managing

the RR and is always correct.– Cached RRs may be out of date.

35CMPE 150- Introduction to Computer Networks

Name Resolution (Cont’d)• If information not available locally (not even cached), local NS will have to ask someone

else.– It asks the server of the top-level domain of the name requested.

36CMPE 150- Introduction to Computer Networks

More on Name Resolution

• How a resolver looks up a remote name in eight steps.

37CMPE 150- Introduction to Computer Networks

Recursive Resolution

• Recursive query:– Each server that doesn’t have info forwards it to

someone else.– Response finds its way back.

• Alternative:– Name server not able to resolve query, sends

back the name of the next server to try.– Some servers use this method.– More control for clients.

38CMPE 150- Introduction to Computer Networks

Example

• Suppose resolver on flits.cs.vu.nl wants to resolve linda.cs.yale.edu.

– Local NS, cs.vu.nl, gets queried but cannot resolve it.– It then contacts .edu server.– .edu server forwards query to yale.edu server.– yale.edu contacts cs.yale.edu, which has the authoritative

RR.– Response finds its way back to originator.– cs.vu.nl caches this info.

• Not authoritative (since may be out-of-date).• RR TTL determines how long RR should be

cached.

39CMPE 150- Introduction to Computer Networks

Resource Records

• Entry in the DNS database.• Several types of entries or RRs.• Example: RR “A” contains IP address.• Name <-> several resource records.• RR format: five-tuple.

– Name.– TTL (in seconds).– Class (usually “IN” for Internet info).– Type: type of RR.– Value.

40CMPE 150- Introduction to Computer Networks

Resource Records

• The principal DNS resource records types.

41CMPE 150- Introduction to Computer Networks

The Web and HTTP

42CMPE 150- Introduction to Computer Networks

Some History Started in 1989 at CERN, European

center for nuclear research, in Switzerland.

Original motivation: need for scientists around the world to collaborate and share multi-media information.

Tim Berners-Lee came up with initial proposal of a web of linked documents

43CMPE 150- Introduction to Computer Networks

More History… First text-based prototype demo in

12.91. Release of first graphical interface,

Mosaic, in 02.93 at NCSA by M. Andreessen.

In 1994, Andreessen creates Netscape. In 1994, CERM and MIT set up the

WWW Consortium to further develop the Web. www.w3.org for more information.

44CMPE 150- Introduction to Computer Networks

The Web

• WWW, or the world-wide web is a resource discovery service.– Resource space is organized hierarchically,

and resources are linked to one another according to some relation.

– Hypertext organization: link “granularity”; allows links within documents.

– Graphical user interface.

45CMPE 150- Introduction to Computer Networks

The client side

• Users perceive the Web as a vast collection of information.– Page is the Web’s information transfer unit.

– Each page may contain links to other pages.

– Users follow links by clicking on them which takes them to the corresponding page.

– This process can go on indefinetly, traversing several pages located in different places.

46CMPE 150- Introduction to Computer Networks

The browser

• Program running on client that retrieves and displays pages.– Interacts with server of page.

– Interprets commands and displays page.

• Examples: Mosaic, Netscape’s Navigator and Communicator, Microsoft Internet Explorer.

• Other features: back, forward, bookmark, caching, handle multimedia objects.

47CMPE 150- Introduction to Computer Networks

The Server Side

• Web site has Web server running that answers requests for pages locally served.– Web server listens to port 80 for requests.

– When request from client arrives, connection is set up.

– Server replies.

– Connection released.

48CMPE 150- Introduction to Computer Networks

Example

• User clicked on www.w3.org/hypertext/WWW/TheProject.html.

49CMPE 150- Introduction to Computer Networks

Example (cont’d)

• Browser asks DNS to resolve www.w3.org.• DNS replies with 18.23.0.23.• Browser sets up connection to 18.23.0.23 port 80.• Browser sends GET /hypertext/WWW/TheProject.html.• www.w3.org server sends TheProject.html file.• Connection released.• Browser displays TheProject.html, fetching and displaying

all embedded objects (images, etc).

50CMPE 150- Introduction to Computer Networks

Observations

• Many browsers display status information at bottom of the screen.

• For each embedded object (in-line image like icon, picture, etc), browser establishes new connection.– Performance hit.– Revisions to protocol (HTTP) address

this.

51CMPE 150- Introduction to Computer Networks

More Observations…

• Server’s response specifies object type (using MIME) followed by object body.

• For example: – Content-Type: Image/GIF

– Content-Type: Text/html