Transcript Document

Network Technologies essentials
Week 9: Applications: DNS and HTTP
Note that videos are numbered 8-*
Compilation made by Tim Moors, UNSW Australia
Original slides by David Wetherall, University of Washington
ISBN-10: 0133766624 © 2014
For the book A. Tanenbaum and D. Wetherall: Computer Networks, 5th ed, Prentice-Hall, 2011
Names and Addresses
• Names are higher-level identifiers for resources
• Addresses are lower-level locators for resources
– Multiple levels, e.g. full name  email  IP address  Ethernet address
• Resolution (or lookup) is mapping a name to an address
Name, e.g.
“Andy Tanenbaum,”
or “flits.cs.vu.nl”
Lookup
Address, e.g.
“Vrije Universiteit, Amsterdam”
or IPv4 “130.30.27.38”
Directory
Computer Networks
8-2.3
2
DNS Zones
• A zone is a contiguous portion of the namespace
Delegation
Computer Networks
A zone
8-2.8
3
DNS Resource Records (2)
Name server
IP addresses
of computers
Mail gateways
Computer Networks
8-2.11
4
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
Client
Query Server
ID=0x1234
Time
ID=0x1234
Response
CSE 461 University of Washington
8-3.13
5
DNS Resolution (2)
• flits.cs.vu.nl resolves robot.cs.washington.edu
CSE 461 University of Washington
8-3.5
6
Iterative vs. Recursive Queries
• Recursive query
– Nameserver completes resolution
and returns the final answer
– E.g., flits  local nameserver
• Iterative query
– Nameserver returns the answer or
who to contact next for the answer
– E.g., local nameserver  all others
CSE 461 University of Washington
8-3.6
7
Caching (2)
• flits.cs.vu.nl now resolves eng.washington.edu
– And previous resolutions cut out most of the process
I know the server for
washington.edu!
1: query
4: eng.washington.edu
Cache
Local nameserver
(for cs.vu.nl)
CSE 461 University of Washington
2: query
3: eng.washington.edu
UW nameserver
(for washington.edu)
8-3.9
8
Fetching a Web page with HTTP
• Start with the page URL:
http://en.wikipedia.org/wiki/Vegemite
Protocol
Server
Page on server
• Steps:
– Resolve the server to IP address (DNS)
– Set up TCP connection to the server
– Send HTTP request for the page
– (Await HTTP response for the page)
– Execute / fetch embedded resources / render
**
– Clean up any idle TCP connections
Computer Networks
8-4.6
9
HTTP Protocol (2)
• Commands used in the request
Fetch
page
Upload
data
Method
GET
HEAD
POST
PUT
DELETE
TRACE
CONNECT
OPTIONS
Computer Networks
Description
Read a Web page
Read a Web page's header
Append to a Web page
Store a Web page
Remove the Web page
Echo the incoming request
Connect through a proxy
Query options for a page
8-4.10
10
HTTP Protocol (3)
• Codes returned with the response
Code
Meaning
Examples
1xx Information 100 = server agrees to handle client's request
Yes!
2xx Success
200 = request succeeded; 204 = no content present
3xx Redirection 301 = page moved; 304 = cached page still valid
4xx Client error 403 = forbidden page; 404 = page not found
5xx Server error 500 = internal server error; 503 = try again later
Computer Networks
8-4.11
11
Early Performance (3)
• Many reasons why PLT is larger than
necessary
– Sequential request/responses, even
when to different servers
– Multiple TCP connection setups to
the same server
– Multiple TCP slow-start phases
• Network is not used effectively
– Worse with many small resources / page
Computer Networks
8-5.6
12
Persistent Connections
• Parallel connections compete with
each other for network resources
– 1 parallel client ≈ 8 sequential clients?
– Exacerbates network bursts, and loss
• Persistent connection alternative
– Make 1 TCP connection to 1 server
– Use it for multiple HTTP requests
Computer Networks
8-5.9
13
Persistent Connections (3)
One request per connection
Computer Networks
Sequential requests
per connection
Pipelined requests
per connection
8-5.11
14
END
© 2013 D. Wetherall
Slide material from: TANENBAUM, ANDREW S.; WETHERALL, DAVID J., COMPUTER NETWORKS, 5th Edition, © 2011.
Electronically reproduced by permission of Pearson Education, Inc., Upper Saddle River, New Jersey
Computer Networks
15