Application Layer
Domain Name System
Domain Name System (DNS) Problem – Want to go to but don’t know the IP addresswww.google.com Solution – DNS queries “Name Servers” to get correct IP address Essentially the Internet “phonebook”… – Tree structure
DNS Hierarchy comnet edu wsu eecs wwwmail jpcnorggovde google wwwmail uidaho
DNS Terminology Domain – subtree of domain space Zone – server has responsibility over a “zone” Root Server – has “domain” of entire tree DNS – Generally delegates authority to other servers – 13 total Primary Server – stores information about its domain (sub tree) – Maintain “zone files”
Resource Records Each domain a record called “resource record” – Information returned to client for DNS request Record types – A – IP address – AAAA – IPv6 address – NS – Name server – MX – Mail server – CNAME – canonical name (alias/nickname)
Resolution Types Recursive – Initial resolver responsible for finding correct response Iterative – Client chases down own DNS response by querying additional servers Caching – Names servers may “cache” results – Speeds up response – Length of time determined by “Time to Live (TTL)”
How do find randomsite’s IP? Router Internet Destination Network Local Network Router
Recursive DNS Resolution Example Internet RandomSite.com Network Local Network Root Name Server Local Name Server RandomSite.com Name Server Com Name Server 4 5
Iterative DNS Resolution Example Internet RandomSite.com Network Local Network Root Name Server Local Name Server RandomSite.com Name Server Com Name Server 4 5
DNS Examples Dig Wireshark
HyperText Transfer Protocol
HyperText Transfer Protocol (HTTP) Used to support retrieval of web content/pages from web server – Examples include HTML (Hypertext Markup language) files (.html) Javascript (.js) Media (.jpg,.gif,.swf) Style sheets (.css) Client-Server architecture – Ports HTTP: TCP 80 HTTPS: TCP 443
HTTP Request 3 components – HTTP verbs (GET, POST, HEAD, DELETE, PUT, ….) – HTTP version (e.g., HTTP/1.0, HTTP/1.1) – Uniform Resource Locators (URL) Used to identify the location of some web resource on a server Example: Protocol Server Address Filename Maps to some web server file directory (e.g., /var/www)
HTTP Verb GET – retrieve the URL from there server – Also can be used to post data through … GET index.html?varible1=value1&…….. HTTP/1.1 Variable More Variables Verb Page Version POST – submits data to the server – Generally results in data being retrieved as well Many infrequently used verbs – HEAD, TRACE, PUT, DELETE.. POST index.html HTTP/1.1 Content Length: …. variable1=value1&…. Variable Variables Verb Page
HTTP Response Status Code – 2xx – Success – 3xx – Redirect – 4xx - Client Error (e.g., 404 –file not found) – 5xx – Server Error Content-type – type of data returned – Examples (text/html, image/gif) Content-Length- number of bytes
HTTP 1.0 – New TCP connection with each HTTP requests – Page has many different objects Images, Javascript, Html documents. HTTP 1.0
HTTP 1.1 Persistent connections – multiple requests within same Http request – Reduces HTTP connection overhead
More HTTP Authentication: – Digest vs Basic – used to authenticate web requests No longer commonly used Caching – Supports caching of response data to reduce bandwidth requirements – Caching locations: browsers, web proxies Cookies – HTTP naturally stateless – Cookies enable stateful communication by storing variables on browsers – Examples Session tokens – random identifier used to correlate uniquely identify session after authentication Remember data from website visit (e.g., Amazon purchases)