Where we are in the Course Star9ng the Applica9on Layer! Builds - - PowerPoint PPT Presentation

where we are in the course
SMART_READER_LITE
LIVE PREVIEW

Where we are in the Course Star9ng the Applica9on Layer! Builds - - PowerPoint PPT Presentation

Where we are in the Course Star9ng the Applica9on Layer! Builds distributed network services (DNS, Web) on Transport services Applica9on Transport Network Link Physical CSE 461 University of Washington 1 Recall Applica9on


slide-1
SLIDE 1

CSE 461 University of Washington 1

Where we are in the Course

  • Star9ng the Applica9on Layer!

– Builds distributed “network services” (DNS, Web) on Transport services

Physical Link Applica9on Network Transport

slide-2
SLIDE 2

CSE 461 University of Washington 2

Recall

  • Applica9on layer protocols are
  • Oen part of an “app”

– But don’t need a GUI, e.g., DNS

TCP IP 802.11 HTTP app OS User-level (NIC)

slide-3
SLIDE 3

CSE 461 University of Washington 3

Recall (2)

  • Applica9on layer messages are
  • Oen split over mul9ple packets

– Or may be aggregated in a packet …

802.11 IP TCP HTTP 802.11 IP TCP HTTP 802.11 IP TCP HTTP HTTP

slide-4
SLIDE 4

CSE 461 University of Washington 4

Topic

  • The DNS (Domain Name System)

– Human-readable host names, and more – Part 1: the distributed namespace

www.uw.edu? Network

128.94.155.135

slide-5
SLIDE 5

Names and Addresses

  • Names are higher-level iden9fiers for resources
  • Addresses are lower-level locators for resources

– Mul9ple levels, e.g. full name à email à IP address à Ethernet address

  • Resolu9on (or lookup) is mapping a name to an address

CSE 461 University of Washington 5

Directory Name, e.g. “Andy Tanenbaum,”

  • r “flits.cs.vu.nl”

Address, e.g. “Vrijie Universiteit, Amsterdam”

  • r IPv4 “130.30.27.38”

Lookup

slide-6
SLIDE 6

CSE 461 University of Washington 6

Before the DNS – HOSTS.TXT

  • Directory was a file HOSTS.TXT

regularly retrieved for all hosts from a central machine at the NIC (Network Informa9on Center)

  • Names were ini9ally flat, became

hierarchical (e.g., lcs.mit.edu) ~85

  • Neither manageable nor efficient

as the ARPANET grew …

slide-7
SLIDE 7

CSE 461 University of Washington 7

DNS

  • A naming service to map between host

names and their IP addresses (and more)

– www.uwa.edu.au à 130.95.128.140

  • Goals:

– Easy to manage (esp. with mul9ple par9es) – Efficient (good performance, few resources)

  • Approach:

– Distributed directory based on a hierarchical namespace – Automated protocol to 9e pieces together

slide-8
SLIDE 8

DNS Namespace

  • Hierarchical, star9ng from “.” (dot, typically omijed)

CSE 461 University of Washington 8

slide-9
SLIDE 9

TLDs (Top-Level Domains)

  • Run by ICANN (Internet Corp. for Assigned Names and Numbers)

– Star9ng in ‘98; naming is financial, poli9cal, and interna9onal J

  • 22+ generic TLDs

– Ini9ally .com, .edu , .gov., .mil, .org, .net – Added .aero, .museum, etc. from ’01 through .xxx in ’11 – Different TLDs have different usage policies

  • ~250 country code TLDs

– Two lejers, e.g., “.au”, plus interna9onal characters since 2010 – Widely commercialized, e.g., .tv (Tuvalu) – Many domain hacks, e.g., instagr.am (Armenia), goo.gl (Greenland)

CSE 461 University of Washington 9

slide-10
SLIDE 10

DNS Zones

  • A zone is a con9guous por9on of the namespace

CSE 461 University of Washington 10

A zone Delega9on

slide-11
SLIDE 11

CSE 461 University of Washington 11

DNS Zones (2)

  • Zones are the basis for distribu9on

– EDU Registrar administers .edu – UW administers washington.edu – CS&E administers cs.washington.edu

  • Each zone has a nameserver to

contact for informa9on about it

– Zone must include contacts for delega9ons, e.g., .edu knows nameserver for washington.edu

slide-12
SLIDE 12

CSE 461 University of Washington 12

DNS Resolu9on

  • DNS protocol lets a host resolve

any host name (domain) to IP address

  • If unknown, can start with the root

nameserver and work down zones

  • Let’s see an example first …
slide-13
SLIDE 13

DNS Resolu9on (2)

  • flits.cs.vu.nl resolves robot.cs.washington.edu

CSE 461 University of Washington 13

slide-14
SLIDE 14

CSE 461 University of Washington 14

Itera9ve vs. Recursive Queries

  • Recursive query

– Nameserver completes resolu9on and returns the final answer – E.g., flits à local nameserver

  • Itera9ve query

– Nameserver returns the answer or who to contact next for the answer – E.g., local nameserver à all others

slide-15
SLIDE 15

CSE 461 University of Washington 15

Itera9ve vs. Recursive Queries (2)

  • Recursive query

– Lets server offload client burden (simple resolver) for manageability – Lets server cache over a pool of clients for bejer performance

  • Itera9ve query

– Lets server “file and forget” – Easy to build high load servers

slide-16
SLIDE 16

CSE 461 University of Washington 16

Caching

  • Resolu9on latency should be low

– Adds delay to web browsing

  • Cache query/responses to answer

future queries immediately

– Including par9al (itera9ve) answers – Responses carry a TTL for caching

Nameserver query

  • ut

response Cache

slide-17
SLIDE 17

Caching (2)

  • flits.cs.vu.nl now resolves eng.washington.edu

– And previous resolu9ons cut out most of the process

CSE 461 University of Washington 17

1: query 2: query UW nameserver (for washington.edu) 3: eng.washington.edu 4: eng.washington.edu Local nameserver (for cs.vu.nl)

I know the server for washington.edu! Cache

slide-18
SLIDE 18

CSE 461 University of Washington 18

Local Nameservers

  • Local nameservers typically run by

IT (enterprise, ISP)

– But may be your host or AP – Or alterna9ves e.g., Google public DNS

  • Clients need to be able to contact

their local nameservers

– Typically configured via DHCP

slide-19
SLIDE 19

CSE 461 University of Washington 19

Root Nameservers

  • Root (dot) is served by 13 server names

– a.root-servers.net to m.root-servers.net – All nameservers need root IP addresses – Handled via configura9on file (named.ca)

  • There are >250 distributed server instances

– Highly reachable, reliable service – Most servers are reached by IP anycast (Mul9ple loca9ons adver9se same IP! Routes take client to the closest one. See §5.2.9) – Servers are IPv4 and IPv6 reachable

slide-20
SLIDE 20

Root Server Deployment

CSE 461 University of Washington 20 Source: hjp://www.root-servers.org. Snapshot on 27.02.12. Does not represent current deployment.

slide-21
SLIDE 21

CSE 461 University of Washington 21

DNS Protocol

  • Query and response messages

– Built on UDP messages, port 53 – ARQ for reliability; server is stateless! – Messages linked by a 16-bit ID field

Query Response Time

Client Server

ID=0x1234 ID=0x1234

slide-22
SLIDE 22

CSE 461 University of Washington 22

DNS Protocol (2)

  • Service reliability via replicas

– Run mul9ple nameservers for domain – Return the list; clients use one answer – Helps distribute load too

NS for uw.edu?

A B C Use A, B or C

slide-23
SLIDE 23

CSE 461 University of Washington 23

DNS Protocol (3)

  • Security is a major issue

– Compromise redirects to wrong site! – Not part of ini9al protocols ..

  • DNSSEC (DNS Security Extensions)

– Long under development, now par9ally

  • deployed. We’ll look at it later

Um, security??

slide-24
SLIDE 24

CSE 461 University of Washington 24

Topic

  • Performance of HTTP

– Parallel and persistent connec9ons – Caching for content reuse

request

Network

slide-25
SLIDE 25

CSE 461 University of Washington 25

PLT (Page Load Time)

  • PLT is the key measure of web

performance

– From click un9l user sees page – Small increases in PLT decrease sales

  • PLT depends on many factors

– Structure of page/content – HTTP (and TCP!) protocol – Network RTT and bandwidth

slide-26
SLIDE 26

CSE 461 University of Washington 26

Early Performance

  • HTTP/1.0 uses one TCP connec9on

to fetch one web resource

– Made HTTP very easy to build – But gave fairly poor PLT …

Client Server

slide-27
SLIDE 27

CSE 461 University of Washington 27

Early Performance (2)

  • HTTP/1.0 used one TCP connec9on

to fetch one web resource

– Made HTTP very easy to build – But gave fairly poor PLT…

slide-28
SLIDE 28

CSE 461 University of Washington 28

Early Performance (3)

  • Many reasons why PLT is larger than

necessary

– Sequen9al request/responses, even when to different servers – Mul9ple TCP connec9on setups to the same server – Mul9ple TCP slow-start phases

  • Network is not used effec9vely

– Worse with many small resources / page

slide-29
SLIDE 29

CSE 461 University of Washington 29

Ways to Decrease PLT

  • 1. Reduce content size for transfer

– Smaller images, gzip

  • 2. Change HTTP to make bejer

use of available bandwidth

  • 3. Change HTTP to avoid repeated

transfers of the same content

– Caching, and proxies

  • 4. Relocate content to reduce RTT

– CDNs [later]

This 9me Later

slide-30
SLIDE 30

CSE 461 University of Washington 30

Parallel Connec9ons

  • One simple way to reduce PLT

– Browser runs mul9ple (8, say) HTTP instances in parallel – Server is unchanged; already handled concurrent requests for many clients

  • How does this help?

– Single HTTP wasn’t using network much … – So parallel connec9ons aren’t slowed much – Pulls in comple9on 9me of last fetch

slide-31
SLIDE 31

CSE 461 University of Washington 31

Persistent Connec9ons

  • Parallel connec9ons compete with

each other for network resources

– 1 parallel client ≈ 8 sequen9al clients? – Exacerbates network bursts, and loss

  • Persistent connec9on alterna9ve

– Make 1 TCP connec9on to 1 server – Use it for mul9ple HTTP requests

slide-32
SLIDE 32

Persistent Connec9ons (2)

CSE 461 University of Washington 32

Client Server Client Server Client Server Persistent +Pipelining

slide-33
SLIDE 33

Persistent Connec9ons (3)

CSE 461 University of Washington 33

One request per connec9on Sequen9al requests per connec9on Pipelined requests per connec9on

slide-34
SLIDE 34

CSE 461 University of Washington 34

Persistent Connec9ons (4)

  • Widely used as part of HTTP/1.1

– Supports op9onal pipelining – PLT benefits depending on page structure, but easy on network

  • Issues with persistent connec9ons

– How long to keep TCP connec9on? – Can it be slower? (Yes. But why?)

slide-35
SLIDE 35

CSE 461 University of Washington 35

Web Caching

  • Users oOen revisit web pages

– Big win from reusing local copy! – This is caching

  • Key ques9on:

– When is it OK to reuse local copy?

Network Cache Local copies Server

slide-36
SLIDE 36

CSE 461 University of Washington 36

Web Caching (2)

  • Locally determine copy is s9ll valid

– Based on expiry informa9on such as “Expires” header from server – Or use a heuris9c to guess (cacheable, freshly valid, not modified recently) – Content is then available right away

Network Cache Server

slide-37
SLIDE 37

CSE 461 University of Washington 37

Web Caching (3)

  • Revalidate copy with server

– Based on 9mestamp of copy such as “Last-Modified” header from server – Or based on content of copy such as “Etag” header from server – Content is available aOer 1 RTT

Network Cache Server

slide-38
SLIDE 38

Web Caching (4)

  • Pu€ng the pieces together:

CSE 461 University of Washington 38

slide-39
SLIDE 39

CSE 461 University of Washington 39

Web Proxies

  • Place intermediary between pool of

clients and external web servers

– Benefits for clients include greater caching and security checking – Organiza9onal access policies too!

  • Proxy caching

– Clients benefit from a larger, shared cache – Benefits limited by secure and dynamic content, as well as “long tail”

slide-40
SLIDE 40

Web Proxies (2)

  • Clients contact proxy; proxy contacts server

CSE 461 University of Washington 40

Cache Near client Far from client

slide-41
SLIDE 41

CSE 461 University of Washington 41

mod_pagespeed

  • Observa9on:

– The way pages are wrijen affects how quickly they load – Many books on best prac9ces for page authors and developers

  • Key idea:

– Have server re-write (compile) pages to help them load quickly! – mod_pagespeed is an example

slide-42
SLIDE 42

CSE 461 University of Washington 42

mod_pagespeed (2)

  • Apache server extension

– SoOware installed with web server – Rewrites pages “on the fly” with rules based on best prac9ces

  • Example rewrite rules:

– Minify Javascript – Flajen mul9-level CSS files – Resize images for client – And much more (100s of specific rules)