Presentation is loading. Please wait.

Presentation is loading. Please wait.

© Janice Regan, CMPT 128, 2007-2012 CMPT 371 Data Communications and Networking DNS 0.

Similar presentations


Presentation on theme: "© Janice Regan, CMPT 128, 2007-2012 CMPT 371 Data Communications and Networking DNS 0."— Presentation transcript:

1 © Janice Regan, CMPT 128, 2007-2012 CMPT 371 Data Communications and Networking DNS 0

2 jpl.nasa.gov. Janice Regan © 2007-2012 1. cs arpa com edu gov us uk ca fr bc sfu fraser In-addr ny ca sun nasa jpl hp fraser

3 Zone  An administrative division of the domain name tree  Each zone is the responsibility of one administrative authority  A zone may include hosts and sub-domains  Sub domains in a zone may or may not have authority delegated to other administrative authorities. Any subset of sub-domains may be delegated Janice Regan © 2007-2012 2

4 DNS Name Tree: zones Janice Regan © 2007-2012 3 bc ab on qc.ca.ca domain sk sk.ca zone qc.ca zone.ca zone

5 Authority for the DNS namespace  A particular DNS name server will service a zone. Its database of zone information will contain  entries for any hosts or subdomains in the zone  delegation information for subdomains or zones that have been delegated to other authorities (form their own zones) Includes the address of (pointer to) the DNS servers for the delegated domains or zones excludes information about further delegation of authority in delegated zones or hosts in delegated domains Janice Regan © 2007-2012 4

6 Operation of a DNS server  A DNS name server is initialized knowing the contents of its zone information database.  The zone information database includes  Address (A) and possible alias (CNAME) records for each host in the serviced zones  Name Server (NS) records for each DNS server in the zone  Mail server (MX) records specify hosts that will process and forward mail for the zone and their priority  Each record includes a time to live (TTL) Lifetime (TTL) of each record is set by administrator Janice Regan © 2007-2012 5

7 Operation of a DNS server  When a request is made to a DNS server the answer it supplies consists of some of the records in the zone information database  The TTL of each supplied record tells the requestor how long the information in that record will remain valid Janice Regan © 2007-2012 6

8 Caching and TTL  Each DNS server uses a cache to improve its efficiency  At initialization time the cache is empty  Each time a DNS query is made by the DNS server, the records in the resulting response are cached  Over time the size of the cache increases as more information from varied queries is added.  To keep the size of the cache manageable and the contents of the cache up to date (information is dynamic and changes over time) each entry in the cache must eventually (after the TTL has expired) be removed from the cache Janice Regan © 2007-2012 7

9 Authoritative responses  Each time a DNS query is received by the server  The records in the cache are searched  The zone database is searched  The longest match is found (either from the database or the cache) and returned to the source of the query  If the answer is returned from the zone database the answer is known as an authoritative response  If the answer is returned from the cache it is NOT authoritative Janice Regan © 2007-2012 8

10 DNS  There are two approaches to answering a query  Iterative: the name server receiving the query responds with either the IP address of the host or the name of the next server it would consult (next higher server in the tree)  Recursive: the name server will, if necessary, directly query the next name server, and will return the final answer Janice Regan © 2007-2012 9

11 A host submitting a query (1)  An application or user on host Drab, in domain cs.sfu.ca requests IP address for ftp.isc.org  The application or user or the user expects to receive the IP address of ftp.isc.org without making additional queries.ftp.isc.org  The application will make a request by calling a function ( gethostbyname() ) OR  the user will make a request using a resolver (resolving software such as dig or nslookup) Janice Regan © 2007-2012 10

12 A host submitting a query (2)  An application or user on host Drab, in domain cs.sfu.ca sends a request to the local DNS server for the IP address for ftp.isc.org  This request may require the local DNS server (may or may not be on host drab) to  Make an additional request or requests.  Analyze the reply or replies to the request/s  Supply the resulting IP address and potentially other related information to the requesting process or user. Janice Regan © 2007-2012 11

13 Query from local DNS server  Assume that we begin with a cache containing only the addresses of the root servers.  The local DNS server must then determine the desired IP address. It will make a series of iterative requests for information on the address of ftp.isc.org.  The local DNS server will send a request to one of the root servers. The longest match the root server can make will be to the TLD.org (as.org has been delegated) The root server will send back a response with the IP address and name of an authoritative server for the.org domain (plus other information) Janice Regan © 2007-2012 12

14 Query from the local DNS server: 2  The local DNS server will process the returned data, add the record for the DNS server for the.org domain to the cache, and formulate a request to the DNS server for the.org domain  The local DNS server will send a request to one of the DNS servers for the domain.org  The DNS server for the domain.org will send back a response with the IP address and name (plus other information) of an authoritative server for the isc.org domain. The isc.org domain has been delegated by the.org DNS server to the ISC, so no longer domain name match can be made. Janice Regan © 2007-2012 13

15 Query from the local DNS server: 3  The local DNS server will process the returned data, add the DNS server for the isc.org domain to the cache, and formulate a request to the DNS server for the isc.org domain  The local DNS server will send a request to one of the DNS servers for the domain isc.org  The DNS server for the domain isc.org will send back a response with the IP address and name (plus other information) of ftp.isc.org.  The local DNS server will process the returned data,  add an entry for the ftp.isc.org to the cache  formulate and send a reply to the original request from host Drab Janice Regan © 2007-2012 14

16 DNS Query Janice Regan © 2007-2012 15 Iterative query Application or user Local DNS server Root DNS server DNS server for.org DNS server for isc.org Referred to.org Referred to isc.org IP Address of ftp.isc.org Recursive reply Recursive query all queries/replies are for the address of ftp.isc.org

17 Using the Cache: subsequent queries (1)  A later query to ftp.isc.org will find the IP address available in the local DNS servers cache. The DNS server will send back the results without making further queriesftp.isc.org  A later query to ftp2.isc.org will find the entry for isc.org DNS server in the cache of the local DNS server. A single query to the isc.org DNS server will provide the needed informationftp2.isc.org Janice Regan © 2007-2012 16

18 Using the Cache: subsequent queries (2)  A later query to fbt.nas.org will find the entry for org DNS server in the cache of the local DNS server. A query to the org DNS server will provide the address of the nas.org server and a request tho the nas.org server will supply the needed informationfbt.nas.org Janice Regan © 2007-2012 17

19 Recursive Requests  In the example above the process or user on the host made a recursive request, and the DNS server made only iterative requests.  DNS servers can also make recursive requests. However, busy DNS servers are often configured to accept only iterative requests. (this way they do not need to process the returning results as well, this reduces load on the busy server). Therefore, the iterative approach is more commonly used by DNS servers Janice Regan © 2007-2012 18

20 Domain Server Message  Messages exchanged between clients and servers Janice Regan © 2007-2012 19 Comer 2000: fig 24.5

21 Example using dig: 1 jregan15: dig ftp.isc.org ; > DiG 9.2.1 > ftp.isc.org ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33180 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 5 ;; QUESTION SECTION: ;ftp.isc.org. IN A ;; ANSWER SECTION: ftp.isc.org. 2898 IN A 204.152.184.110 ;; AUTHORITY SECTION: isc.org. 2898 IN NS ns-ext.lga1.isc.org. isc.org. 2898 IN NS ns-ext.nrt1.isc.org. isc.org. 2898 IN NS ns-ext.sth1.isc.org. isc.org. 2898 IN NS ns-ext.isc.org. Janice Regan © 2007-2012 20

22 Example using dig: 2 ;; ADDITIONAL SECTION: ns-ext.lga1.isc.org. 75012 IN A 192.228.91.19 ns-ext.nrt1.isc.org. 75012 IN A 192.228.90.19 ns-ext.sth1.isc.org. 75012 IN A 192.228.89.19 ns-ext.isc.org. 29497 IN A 204.152.184.64 ns-ext.isc.org. 155246 IN AAAA 2001:4f8:0:2::13 ;; Query time: 1 msec ;; SERVER: 199.60.1.1#53(199.60.1.1) ;; WHEN: Fri Nov 5 06:21:09 2004 ;; MSG SIZE rcvd: 236 Janice Regan © 2007-2012 21

23 © Janice Regan, CMPT 128, 2007-2012 CMPT 371 Data Communications and Networking P2P 22

24 Comparison  All the application layer protocols considered so far use client server architecture  Now let’s consider peer to peer architecture  To understand why we would want to take this alternate approach lets consider transmitting a large file from one host to several others using both approaches. Janice Regan © 2007-2012 23

25 How long? One server to N clients Janice Regan © 2007-2012 24 DR1 U1U1 DR2 Internet USUS U2U2 U3U3 U4U4 U5U5 UNUN D1D1 D2D2 D3D3 D4D4 D5D5 DNDN …

26 How long to send to all clients  The server must send one copy of the file to each of the clients. The file has F bits and the rate of transmission from the server to the internet is U s.  Each copy will take F/ U s seconds to transmit into the internet.  Transmitting all N copies will take N*F/ U s seconds  But the clients also need to receive their copies Janice Regan © 2007-2012 25

27 How long to receive all copies  The longest time for any particular host to download the file from the internet is for the host with the slowest download rate D min.  This host will take F/D min seconds to download  If we send to each host at the rate that host can receive (alternating blocks of bits between hosts) then the maximum download time for all files is F/D min seconds Janice Regan © 2007-2012 26

28 How long 1 server - nclients  Consider that the server distributes its delivery of bits in proportion the download rate of each host.  If the host that has the longest download time receives bits at a minimum of the download rate then the time to distribute the file to all clients is F/D min seconds  If bits arrive more slowly that the download rate of the slowest downloading host then the time to distribute the file to all hosts will be N*F/ U s the time taken to transmit the N copies of the file Download Time = max {F/D min, N*F/ U s } Janice Regan © 2007-2012 27

29 How long? P2P Janice Regan © 2007-2012 28 DR1 U1U1 DR2 Internet USUS U2U2 U3U3 U4U4 U5U5 UNUN D1D1 D2D2 D3D3 D4D4 D5D5 DNDN …

30 How long to send using P2P  The server must send at least one copy of the file to the peers. This takes F/U s seconds  The slowest peer must have time to download all the bits in the file. This takes F/D min seconds  The fastest that any host can receive uploads is so the fastest all hosts can receive the uploaded files is Janice Regan © 2007-2012 29

31 Janice Regan © 2007-2012 30 From Kurose and Ross

32 Bit torrent: TRADE DATA CHUNKS Janice Regan © 2007-2012 31 NEWEST HOST IN TORRENT tracker: tracks peers participating in torrent

33 What is a bit torrent  A TORRENT is a group of peers exchanging portions (chunks) of a file  A Torrent is controlled by a TRAKKER, a host managing the peers trading chunks of file  The file being exchanged is divided into chunks (512K)  Peers taking part in the trading of chunks may join the group at and time and leave the group after obtaining all or any part of the file Janice Regan © 2007-2012 32

34 How does a torrent work (1)  A peer “Mew” joins a torrent to obtain a file  “Mew” starts with none of the chunks of the file  She registers with the tracker  She gets list of potential peers from the tracker. The trakker selects a subset of all available peers.  She tries to establish TCP connections with all of the peers from the list the tracker supplied  She establishes connection with a subset of the peers from the list the tracker provided. Call these peers the neighboring peers Janice Regan © 2007-2012 33

35 How does a torrent work (2)  As time passes  The peer “Mew” will periodically check with t he tracker to confirm she is still part of the torrent  The peer “Mew” will acquire chunks of the file by downloading them from other neighboring peers  The peer “Mew” will upload chunks of the file it already has to neighboring peers that need those chunks  Chunks are not necessarily acquired or supplied in order Janice Regan © 2007-2012 34

36 Acquiring Chunks  At a particular time different peers will each have a different subset of the chunks of the file  At any time a peer can obtain a list of which available chunks from each neighboring peer  The peer “Mew” can thus find the chunks she needs  The peer “Mew” can obtain the chunks she needs by sending requests to the neighboring peers that have those chunks  Peers will usually request the chunks that are hardest to find first (to equalize the availability of those chunks) Janice Regan © 2007-2012 35

37 Trading Algorithm (tit for tat)  Every 10 seconds “Mew” measures which four neighboring peers are supplying her data at the highest rate  “Mew” unchokes those four neighboring peers by sending them chunks they have requested.  Every 30 seconds she also optimistically unchokes one randomly chosen neighboring peer by sending that peer chunks  The optimistically unchoked neighboring peer may then become one of “Mew”s trading partners Janice Regan © 2007-2012 36


Download ppt "© Janice Regan, CMPT 128, 2007-2012 CMPT 371 Data Communications and Networking DNS 0."

Similar presentations


Ads by Google