King Fahd University of Petroleum Minerals College of

  • Slides: 41
Download presentation
King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information

King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science Department ICS 343 Fundamentals of Computer Networks Domain Name System These slides are based on: Chapter 25, Data Communications and Networking, 4 th Edition

25. 2 Introduction n n n IP address identifies the connection of a host

25. 2 Introduction n n n IP address identifies the connection of a host to the Internet. People prefer names instead of IP. Host file: maps name and address; stored in local disk; Any program can consult the host file. With large number of users, it is not possible to have all the host name mappings in a single file. Divide this huge amount of information into small parts and store each part on a different computer DNS. Namespace: n Names must be unique like IP addresses. n A name space that maps each address to a unique name can be organized as: flat or hierarchical

Figure 25. 1 Example of using the DNS service 25. 3

Figure 25. 1 Example of using the DNS service 25. 3

NAME SPACE To be unambiguous, the names assigned to machines must be carefully selected

NAME SPACE To be unambiguous, the names assigned to machines must be carefully selected from a name space with complete control over the binding between the names and IP addresses. Topics discussed in this section: Flat Name Space Hierarchical Name Space 25. 4

Name Spaces n Flat name space n n A name is assigned to an

Name Spaces n Flat name space n n A name is assigned to an address. Name is a sequence of characters without structure Due to central control for ambiguity, this is not possible on huge networks like Internet. Hierarchical Name space n n n Each name is made of several parts. 1 st part is nature of organization, 2 nd part is name, … Central authority takes control of 1 st and 2 nd part only. No need to worry of internal names or host names. Ex. Kfupm. edu. sa & ccse. kfupm. edu. sa 25. 5

DOMAIN NAME SPACE To have a hierarchical name space, a domain name space was

DOMAIN NAME SPACE To have a hierarchical name space, a domain name space was designed. In this design the names are defined in an inverted-tree structure with the root at the top. The tree can have only 128 levels: level 0 (root) to level 127. Topics discussed in this section: Label Domain Name Domain 25. 6

Label n n Each node in the tree has a label Maximum of 63

Label n n Each node in the tree has a label Maximum of 63 characters. Root label is a null string (empty string). Children of a node have different labels. 25. 7

25. 8 Domain Names and Labels n n Full domain name is a sequence

25. 8 Domain Names and Labels n n Full domain name is a sequence of labels separated by dots. Domain names are always read from the node up to the root. Last label is the label of root (null). So, full domain name always ends in a null label [means dot].

FQDN & PQDN n n Fully Qualified Domain Name (FQDN) n Label is terminated

FQDN & PQDN n n Fully Qualified Domain Name (FQDN) n Label is terminated by a null string. n Contains the full name of a host. Partially Qualified Domain Name (PQDN) n Not terminated by a null string. n PQDN starts from a node, but it does not reach the root. n Used when the name to be resolved belongs to the same site as the client. n Resolver supplies the missing part called as suffix. 25. 9

25. 10 Domains n Domain: n n n Sub-tree of the domain name space.

25. 10 Domains n Domain: n n n Sub-tree of the domain name space. Name of the domain is the domain name of the node at the top of the sub-tree. A domain can be divided into sub-domains.

DISTRIBUTION OF NAME SPACE The information contained in the domain name space must be

DISTRIBUTION OF NAME SPACE The information contained in the domain name space must be stored. However, it is very inefficient and also unreliable to have just one computer store such a huge amount of information. In this section, we discuss the distribution of the domain name space. Topics discussed in this section: Hierarchy of Name Servers Zone Root Server Primary and Secondary Servers 25. 11

Hierarchy of Name Servers n n If information is stored in one machine, the

Hierarchy of Name Servers n n If information is stored in one machine, the requests will overload the machine. Hierarchy of name servers n Distribute among DNS servers. n Let root stand alone and create as many domains (subtrees) as there are first-level nodes. n Each server can be responsible (authoritative) for either a large or a small domain. 25. 12

25. 13 Figure 25. 6 Hierarchy of name servers

25. 13 Figure 25. 6 Hierarchy of name servers

Zones and Domains n Zone n n What a server is responsible for, or

Zones and Domains n Zone n n What a server is responsible for, or has authority over is called zone. If a server accepts responsibility for a domain and does not divide the domain into smaller domains, the domain and the zone refer to the same thing. Server makes a database called a zone file and keeps all the information for every node under the domain. If a sever has sub-domains, information about nodes in subdomains are stored in servers at lower levels, with the original server keeping some sort of reference to these lower-level servers. But responsibility is still with the original server. 25. 14

25. 15 Figure 25. 7 Zones and domains

25. 15 Figure 25. 7 Zones and domains

Hierarchy of Name Servers • Root Server: • Server whose zone consists of the

Hierarchy of Name Servers • Root Server: • Server whose zone consists of the whole tree. It does not usually store information about domains but delegates its authority to other servers. • Keeps reference to other servers. • Servers are distributed all around the world. • Primary server: A primary server stores a local file about the zone for which it is an authority. Responsible for creating, maintaining, and updating the zone file. • Secondary server: Loads all information from the primary server. Neither creates nor updates the zone files; create redundancy. 25. 16

25. 17 Note A primary server loads all information from the disk file; the

25. 17 Note A primary server loads all information from the disk file; the secondary server loads all information from the primary server. When the secondary downloads information from the primary, it is called zone transfer.

DNS IN THE INTERNET DNS is a protocol that can be used in different

DNS IN THE INTERNET DNS is a protocol that can be used in different platforms. In the Internet, the domain name space (tree) is divided into three different sections: generic domains, country domains, and the inverse domain. Topics discussed in this section: Generic Domains Country Domains Inverse Domain 25. 18

DNS in the INTERNET n Generic Domains n n n Registered hosts according to

DNS in the INTERNET n Generic Domains n n n Registered hosts according to their generic behaviour. Each node in the tree defines a domain, which is an index to the domain name space database. First level in the generic domain section allows 14 possible labels. Figure 25. 8 DNS IN THE INTERNET 25. 19

25. 20 Figure 25. 9 Generic domains

25. 20 Figure 25. 9 Generic domains

Table 25. 1 Generic domain labels 25. 21

Table 25. 1 Generic domain labels 25. 21

25. 22 Figure 25. 10 Country domains

25. 22 Figure 25. 10 Country domains

Inverse Domain n n Inverse domain is used to map an address to a

Inverse Domain n n Inverse domain is used to map an address to a name. A server sometimes needs to map a client IP address to a name to check if the client is in the list of authorized clients, this is called inverse mapping. Inverse or pointer query (PTR). Hierarchical: Netid part is at higher level than the subnetid part. 132. 34. 45. 121. 45. 34. 132. in-addr. arpa 25. 23

25. 24 Figure 25. 11 Inverse domain

25. 24 Figure 25. 11 Inverse domain

RESOLUTION Mapping a name to an address or an address to a name is

RESOLUTION Mapping a name to an address or an address to a name is called name-address resolution. Topics discussed in this section: Resolver Mapping Names to Addresses Mapping Addresses to Names Recursive Resolution Caching 25. 25

Resolver n A host that needs to map an address to a name or

Resolver n A host that needs to map an address to a name or a name to an address calls a DNS client named a resolver. n Resolver contacts the closest DNS server for mapping. n If the server has the info, it replies; otherwise, it either refers to the resolver to other servers or asks other servers to provide the information. n After the resolver receives the mapping, it interprets the response to see if it is a real resolution or an error and finally delivers the result to the process that requested it. 25. 26

25. 27 Resolver n n Mapping names to addresses n Resolver gives a domain

25. 27 Resolver n n Mapping names to addresses n Resolver gives a domain name to the server and asks for the corresponding address. n The server checks the generic domains or the country domains to find the mapping. n If the server has the information, it satisfies the resolver, otherwise, it either refers the resolver to other servers or asks other servers to provide the information. Mapping addresses to names (PTR Query) n Client inverts IP and attach the two labels in-addr. arpa. then send inverted IP address to a server to be mapped to a domain name. n DNS uses inverse domain.

25. 28 Resolution n n Recursive Resolution n Resolver can ask for a recursive

25. 28 Resolution n n Recursive Resolution n Resolver can ask for a recursive answer from a name server n Resolver expects the server to supply the final answer. n If server is the authority, it checks its database and replies. n If server is not the authority, it sends the request to another server (the parent usually) and waits for the response. If the parent is the authority, it responds; otherwise, it sends the query to yet another server. n When the query is finally resolved, the response travels back until it finally reaches the requesting client. Iterative Resolution n If server is authority, it sends the answer. n If server is not authority, it returns the IP address of the server that it thinks can resolve the query. n The client is responsible for repeating the query to this second server.

25. 29 Figure 25. 12 Recursive resolution

25. 29 Figure 25. 12 Recursive resolution

Figure 25. 13 Iterative resolution 25. 30

Figure 25. 13 Iterative resolution 25. 30

Caching n n n Reduction of search time would increase efficiency. DNS handles this

Caching n n n Reduction of search time would increase efficiency. DNS handles this with a mechanism called caching. Response is stored in the server’s cache memory before sending it to the client. If another client ask for the same mapping, the cache memory can be referred to give an answer. Response is marked as Unauthoritative Caching speeds up resolution, but can provide an outdated mapping. n n Time to live (TTL): time in seconds [provided by authoritative server] for which the receiving server can cache the information. DNS requires that each server keep a TTL counter for each mapping it caches. 25. 31

DNS MESSAGES DNS has two types of messages: query and response. Both types have

DNS MESSAGES DNS has two types of messages: query and response. Both types have the same format. The query message consists of a header and question records; the response message consists of a header, question records, answer records, authoritative records, and additional records. Topics discussed in this section: Header 25. 32

25. 33 Figure 25. 14 Query and response messages

25. 33 Figure 25. 14 Query and response messages

Header n Header: n Query and response types have same format with some fields

Header n Header: n Query and response types have same format with some fields set to zero for the query messages. n 12 bytes n Identification: Match the response with query. n Flags: Type of msg, type of answers requested, type of desired resolution [recursive or iterative], … n Number of question records n Number of answer records: Zero in query n Number of authoritative records: Zero in query n Number of additional records: Zero in query 25. 34

25. 35 Figure 25. 15 Header format

25. 35 Figure 25. 15 Header format

TYPES OF RECORDS 25. 36 As we saw in Section 25. 6, two types

TYPES OF RECORDS 25. 36 As we saw in Section 25. 6, two types of records are used in DNS. The question records are used in the question section of the query and response messages. The resource records are used in the answer, authoritative, and additional information sections of the response message. Topics discussed in this section: Question Record: Used by clients to get information from a server. Resource Record: Server database consists of RR, this is what is being returned to client.

REGISTRARS How are new domains added to DNS? This is done through a registrar,

REGISTRARS How are new domains added to DNS? This is done through a registrar, a commercial entity accredited by Internet Corporation for Assigned Names and Numbers (ICANN). A registrar first verifies that the requested domain name is unique and then enters it into the DNS database. A fee is charged. 25. 37

DYNAMIC DOMAIN NAME SYSTEM (DDNS) n n 25. 38 In DNS, when there is

DYNAMIC DOMAIN NAME SYSTEM (DDNS) n n 25. 38 In DNS, when there is a change, such as adding a new host, removing a host, or changing an IP address, the change must be made to the DNS master file. Requires lot of manual updating. DDNS [Dynamic DNS]: n n When a binding between a name and address is determined, the information is sent, usually by DHCP to a primary DNS server. Primary server updates the zone. Secondary servers are notified actively or passively. n n n Actively: Primary servers sends a message to secondary server about changes in the zone. Passively: Secondary servers periodically check for any changes. In either case, once notified about change, the secondary server requests for zone transfer.

ENCAPSULATION n n n DNS can use the services of UDP or TCP, using

ENCAPSULATION n n n DNS can use the services of UDP or TCP, using the wellknown port 53. UDP: n If response msg < 512 bytes n If size is unknown n If size increases, the server truncates the msg and resolver now opens a TCP connection and repeats the request to get a full response from the server. TCP: n If response msg > 512 bytes n Zone transfer 25. 39

25. 40 Note DNS can use the services of UDP or TCP using the

25. 40 Note DNS can use the services of UDP or TCP using the well-known port 53.

The end Important to do at home : - read chapter 25 of the

The end Important to do at home : - read chapter 25 of the textbook