1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

21
1 Application Layer Application Layer Lecture 6 Lecture 6 Imran Ahmed Imran Ahmed University of Management & Technology University of Management & Technology

Transcript of 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

Page 1: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

1

Application LayerApplication LayerLecture 6Lecture 6

Imran AhmedImran AhmedUniversity of Management & TechnologyUniversity of Management & Technology

Page 2: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

2

Agenda

• Principles of network applications

• Web and HTTP

• FTP

• Electronic Mail– SMTP, POP3, IMAP

• DNS

Page 3: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

3

DNS: Domain Name System

• Computers use addresses.

• Humans cannot remember IP addresses – need names.

• Simplest solution: Each computer has a unique name and has a build in table of name to address translation.

• Problem: Not scalable.

• Solution: DNS (adopted in 1983)

Domain Name System:• distributed database

implemented in hierarchy of many name servers.

• application-layer protocol host, routers, name servers to communicate to resolve names (address/name translation).– note: core Internet function,

implemented as application-layer protocol

– complexity at network’s “edge”

Page 4: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

4

Domain Name System (DNS)

• In the Internet, the domain name space (tree) is divided into three different sections:-– Generic domains– Country domains– Inverse domains

Page 5: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

5

DNS in the Internet

Page 6: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

6

Domain Name System (DNS)

• Generic domains:– It defines registered hosts according to their

generic behavior.– Each node in a tree defines a domain, which is

an index to the domain name space database.

Page 7: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

7

Generic Domains

Page 8: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

8

DNS• Country Domain:

– It follows the same format as the generic domains but uses two-character country abbreviations (e.g., “pk” or Pakistan) in place of the three-character organizational abbreviations at the first level.

• Inverse Domain:– It is used to map an address to a name.– This may happen, for example, when a server has received a

request from a client to do a task.– Whereas the server has a file that contains a list of authorized

clients, the server lists only the IP address of the client (extracted from the received IP packet).

– To determine, if the client is on the authorized list, it can send a query to the DNS server and ask for a mapping of address to name.

Page 9: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

9

Country Domains

Page 10: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

10

Inverse Domain

Page 11: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

11

DNS Name Servers

• Local Name Servers:– Each ISP, company has local (default) name

server.– Host DNS query first goes to local name server.

• Authoritative Name Server:– For a host – stores that host’s IP address, name.– It can perform name/address translation for that

host’s name.

Page 12: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

12

DNS Name Servers

• Root Name Servers:– It contacts authoritative name server, if name

mapping is not known.– Gets mapping and returns to local name server.

Page 13: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

13

Page 14: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

14

Simple DNS Example

• Host surf.eurecom.fr wants IP address of gaia.cs.umass.edu.

1. Contacts its local DNS server, dns.eurecom.fr

2. dns.eurecom.fr contacts root name servers, if necessary

3. Root name server contacts authoritative name server, dns.umass.edu, if necessary

Page 15: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

15

DNS Example

Page 16: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

16

DNS Example (Cont.)

• Root Name Server:– May not know authoritative name server– May know intermediate name server – who to

contact to find authoritative name server

Page 17: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

17

Page 18: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

18

DNS Queries

• Recursive query:– Puts burden of name resolution on contacted

name server– Heavy load?

• Iterated query:– Contacted server replies with name of server to

contact– “I don’t know this name, but ask this server”

Page 19: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

19

Page 20: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

20

DNS: Cashing & Updating Records

• Once (any) name server learns mapping, it caches mapping.– Cache entries timeout (disappear) after some

time.

• Update/notify mechanisms under design by IETF.– RFC 2136– http://www.ietf.org/html.charters/dnsind-sharter.html

Page 21: 1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.

21

DNS Records• Distributed db storing resource

records (RR)• Type=A

– Name is hostname– Value is IP address

• Type=NS– Name is domain (e.g., foo.com)– Value is IP address of authoritative

name server for this domain• Type=CNAME

– Name is alias name for some “cannonical” (the real) name (e.g., ww.ibm.com is real & servereasr.backup2.ibm.com is cannonical)

– Value is cannonical name• Type=MX

– Value is name of mailserver associated with name