10 DNS HTTP Unix Socket Programming DNS Domain
![10. DNS, HTTP, Unix Socket Programming DNS (Domain Name Service) Domain Name Resolution HTTP 10. DNS, HTTP, Unix Socket Programming DNS (Domain Name Service) Domain Name Resolution HTTP](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-1.jpg)
![DNS Overview • Attributes of an object – name – address – itself • DNS Overview • Attributes of an object – name – address – itself •](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-2.jpg)
![Properties • • • Names versus addresses Location transparent versus location-dependent Flat versus hierarchical Properties • • • Names versus addresses Location transparent versus location-dependent Flat versus hierarchical](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-3.jpg)
![Examples • Hosts cheltenham. cs. princeton. edu 192. 12. 69. 17 80: 23: A Examples • Hosts cheltenham. cs. princeton. edu 192. 12. 69. 17 80: 23: A](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-4.jpg)
![Examples (cont) • Mailboxes 2 cs. princeton. edu Name server User 1 user @ Examples (cont) • Mailboxes 2 cs. princeton. edu Name server User 1 user @](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-5.jpg)
![Domain Naming System • Hierarchy • Name chinstrap. cs. princeton. edu 6 Domain Naming System • Hierarchy • Name chinstrap. cs. princeton. edu 6](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-6.jpg)
![Name Servers • Partition hierarchy into zones edu princeton … mit cs ee com Name Servers • Partition hierarchy into zones edu princeton … mit cs ee com](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-7.jpg)
![Resource Records • Each name server maintains a collection of resource records (Name, Value, Resource Records • Each name server maintains a collection of resource records (Name, Value,](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-8.jpg)
![Root Server (princeton. edu, cit. princeton. edu, NS, IN) (cit. princeton. edu, 128. 196. Root Server (princeton. edu, cit. princeton. edu, NS, IN) (cit. princeton. edu, 128. 196.](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-9.jpg)
![Princeton Server (cs. princeton. edu, optima. cs. princeton. edu, NS, IN) (optima. cs. princeton. Princeton Server (cs. princeton. edu, optima. cs. princeton. edu, NS, IN) (optima. cs. princeton.](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-10.jpg)
![CS Server (cs. princeton. edu, optima. cs. princeton. edu, MX, IN) (cheltenham. cs. princeton. CS Server (cs. princeton. edu, optima. cs. princeton. edu, MX, IN) (cheltenham. cs. princeton.](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-11.jpg)
![Name Resolution • Strategies – iterative – recursive Client 1 cicada. cs. princeton. edu Name Resolution • Strategies – iterative – recursive Client 1 cicada. cs. princeton. edu](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-12.jpg)
![HTTP • Message format: START_LINE <CRLF> MESSAGE_HEADER <CRLF> MESSAGE_BODY <CRLF> • Request GET http: HTTP • Message format: START_LINE <CRLF> MESSAGE_HEADER <CRLF> MESSAGE_BODY <CRLF> • Request GET http:](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-13.jpg)
![HTTP Methods in Request – – – – GET: retrieve document HEAD: retrieve meta-information HTTP Methods in Request – – – – GET: retrieve document HEAD: retrieve meta-information](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-14.jpg)
![HTTP • Response HTTP/1. 1 404 Not Found HTTP/1. 1 200 OK Server: Netscape-Enterprise/4. HTTP • Response HTTP/1. 1 404 Not Found HTTP/1. 1 200 OK Server: Netscape-Enterprise/4.](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-15.jpg)
![HTTP • Persistent Connection in HTTP/1. 1 – Image files – Cost of TCP HTTP • Persistent Connection in HTTP/1. 1 – Image files – Cost of TCP](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-16.jpg)
![Socket Programming API • Server Side (passive open) – – Bind Listen Accept Close Socket Programming API • Server Side (passive open) – – Bind Listen Accept Close](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-17.jpg)
- Slides: 17
![10 DNS HTTP Unix Socket Programming DNS Domain Name Service Domain Name Resolution HTTP 10. DNS, HTTP, Unix Socket Programming DNS (Domain Name Service) Domain Name Resolution HTTP](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-1.jpg)
10. DNS, HTTP, Unix Socket Programming DNS (Domain Name Service) Domain Name Resolution HTTP (Hyper Text Transfer Protocol) Request Response Persistent Connection Socket Programming API 1
![DNS Overview Attributes of an object name address itself DNS Overview • Attributes of an object – name – address – itself •](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-2.jpg)
DNS Overview • Attributes of an object – name – address – itself • Name space – defines set of possible names – consists of a set of name to value bindings 2
![Properties Names versus addresses Location transparent versus locationdependent Flat versus hierarchical Properties • • • Names versus addresses Location transparent versus location-dependent Flat versus hierarchical](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-3.jpg)
Properties • • • Names versus addresses Location transparent versus location-dependent Flat versus hierarchical Global versus local Absolute versus relative Unique versus ambiguous 3
![Examples Hosts cheltenham cs princeton edu 192 12 69 17 80 23 A Examples • Hosts cheltenham. cs. princeton. edu 192. 12. 69. 17 80: 23: A](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-4.jpg)
Examples • Hosts cheltenham. cs. princeton. edu 192. 12. 69. 17 80: 23: A 8: 33: 5 B: 9 F • Files /usr/llp/tmp/foo (server, fileid) • Users Larry Peterson llp@cs. princeton. edu 4
![Examples cont Mailboxes 2 cs princeton edu Name server User 1 user Examples (cont) • Mailboxes 2 cs. princeton. edu Name server User 1 user @](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-5.jpg)
Examples (cont) • Mailboxes 2 cs. princeton. edu Name server User 1 user @ cs. princeton. edu Mail program 192. 12. 69. 5 3 4 TCP 192. 12. 69. 5 5 IP • Services nearby ps printer with short queue and 2 MB 5
![Domain Naming System Hierarchy Name chinstrap cs princeton edu 6 Domain Naming System • Hierarchy • Name chinstrap. cs. princeton. edu 6](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-6.jpg)
Domain Naming System • Hierarchy • Name chinstrap. cs. princeton. edu 6
![Name Servers Partition hierarchy into zones edu princeton mit cs ee com Name Servers • Partition hierarchy into zones edu princeton … mit cs ee com](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-7.jpg)
Name Servers • Partition hierarchy into zones edu princeton … mit cs ee com gov cisco … yahoo nasa … nsf mil org arpa … navy acm … ieee net uk fr physics ux 01 ux 04 • Each zone implemented by two or more name servers Root name server Princeton name server CS name server … … Cisco name server EE name server 7
![Resource Records Each name server maintains a collection of resource records Name Value Resource Records • Each name server maintains a collection of resource records (Name, Value,](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-8.jpg)
Resource Records • Each name server maintains a collection of resource records (Name, Value, Type, Class, TTL) • Name/Value: not necessarily host names to IP addresses • Type – NS: Value gives domain name for host running name server that knows how to resolve names within specified domain. – CNAME: Value gives canonical name for particle host; used to define aliases. – MX: Value gives domain name for host running mail server that accepts messages for specified domain. • Class: allow other entities to define types • TTL: how long the resource record is valid 8
![Root Server princeton edu cit princeton edu NS IN cit princeton edu 128 196 Root Server (princeton. edu, cit. princeton. edu, NS, IN) (cit. princeton. edu, 128. 196.](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-9.jpg)
Root Server (princeton. edu, cit. princeton. edu, NS, IN) (cit. princeton. edu, 128. 196. 128. 233, A, IN) (cisco. com, thumper. cisco. com, NS, IN) (thumper. ciscoe. com, 128. 96. 32. 20, A, IN) … 9
![Princeton Server cs princeton edu optima cs princeton edu NS IN optima cs princeton Princeton Server (cs. princeton. edu, optima. cs. princeton. edu, NS, IN) (optima. cs. princeton.](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-10.jpg)
Princeton Server (cs. princeton. edu, optima. cs. princeton. edu, NS, IN) (optima. cs. princeton. edu, 192. 12. 69. 5, A, IN) (ee. princeton. edu, helios. ee. princeton. edu, NS, IN) (helios. ee. princeton. edu, 128. 196. 28. 166, A, IN) (jupiter. physics. princeton. edu, 128. 196. 4. 1, A, IN) (saturn. physics. princeton. edu, 128. 196. 4. 2, A, IN) (mars. physics. princeton. edu, 128. 196. 4. 3, A, IN) (venus. physics. princeton. edu, 128. 196. 4. 4, A, IN) 10
![CS Server cs princeton edu optima cs princeton edu MX IN cheltenham cs princeton CS Server (cs. princeton. edu, optima. cs. princeton. edu, MX, IN) (cheltenham. cs. princeton.](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-11.jpg)
CS Server (cs. princeton. edu, optima. cs. princeton. edu, MX, IN) (cheltenham. cs. princeton. edu, 192. 12. 69. 60, A, IN) (che. cs. princeton. edu, cheltenham. cs. princeton. edu, CNAME, IN) (optima. cs. princeton. edu, 192. 12. 69. 5, A, IN) (opt. cs. princeton. edu, optima. cs. princeton. edu, CNAME, IN) (baskerville. cs. princeton. edu, 192. 12. 69. 35, A, IN) (bas. cs. princeton. edu, baskerville. cs. princeton. edu, CNAME, IN) 11
![Name Resolution Strategies iterative recursive Client 1 cicada cs princeton edu Name Resolution • Strategies – iterative – recursive Client 1 cicada. cs. princeton. edu](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-12.jpg)
Name Resolution • Strategies – iterative – recursive Client 1 cicada. cs. princeton. edu 192. 12. 69. 60 8 Local name server • Local server – need to know root at only one place (not each host) – site-wide cache Root 2 name u server. ed n 3 o 3 et 8. 2 nc i 2 r. 1 3. p 96. cs 1 a. ad 28 , 1 cic u d n. e o t e 4 nc i r p cicada. cs. princeton. edu Princeton name server cs. princeton. edu, 192. 12. 69. 5 5 cic ad a. c cic s. p 19 ada rin 2. 1. c ce 2. 6 s. pr ton 9. 6 inc. ed 6 e 0 ton u. ed u, 7 CS name server 12
![HTTP Message format STARTLINE CRLF MESSAGEHEADER CRLF MESSAGEBODY CRLF Request GET http HTTP • Message format: START_LINE <CRLF> MESSAGE_HEADER <CRLF> MESSAGE_BODY <CRLF> • Request GET http:](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-13.jpg)
HTTP • Message format: START_LINE <CRLF> MESSAGE_HEADER <CRLF> MESSAGE_BODY <CRLF> • Request GET http: //www. cs. princeton. edu/index. html HTTP/1. 0 GET /index. html HTTP/1. 1 Host: www. cs. princeton. edu 13
![HTTP Methods in Request GET retrieve document HEAD retrieve metainformation HTTP Methods in Request – – – – GET: retrieve document HEAD: retrieve meta-information](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-14.jpg)
HTTP Methods in Request – – – – GET: retrieve document HEAD: retrieve meta-information POST: give information to server PUT: store document under specified URL DELETE: delete specified URL TRACE: loopback request message CONNECT: for use by proxies OPTIONS: request information about available options 14
![HTTP Response HTTP1 1 404 Not Found HTTP1 1 200 OK Server NetscapeEnterprise4 HTTP • Response HTTP/1. 1 404 Not Found HTTP/1. 1 200 OK Server: Netscape-Enterprise/4.](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-15.jpg)
HTTP • Response HTTP/1. 1 404 Not Found HTTP/1. 1 200 OK Server: Netscape-Enterprise/4. 1 Date: … Expires: … CONTENTS of the FILE 15
![HTTP Persistent Connection in HTTP1 1 Image files Cost of TCP HTTP • Persistent Connection in HTTP/1. 1 – Image files – Cost of TCP](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-16.jpg)
HTTP • Persistent Connection in HTTP/1. 1 – Image files – Cost of TCP connections – Persistent connection: KEEP-ALIVE 16
![Socket Programming API Server Side passive open Bind Listen Accept Close Socket Programming API • Server Side (passive open) – – Bind Listen Accept Close](https://slidetodoc.com/presentation_image/62b63c0a802528b56a5655164540c92b/image-17.jpg)
Socket Programming API • Server Side (passive open) – – Bind Listen Accept Close • Client Side (active open) – Bind – Connect – Close 17
Http unix socket
Socket programming in c
Udp socket programming in java
Socket programming
Bind function in socket programming
Gqoute
Socket programing
Bsd socket interface
R socket programming
Linux raw sockets
Unix network programming
Unix programming
Unix programming
Canonical name in dns
The hacks
Codomain vs domain
Z domain to frequency domain
Time domain and frequency domain