cmpt 371
Download
Skip this Video
Download Presentation
CMPT 371

Loading in 2 Seconds...

play fullscreen
1 / 37

CMPT 371 - PowerPoint PPT Presentation


  • 123 Views
  • Uploaded on

CMPT 371. Data Communications and Networking DNS. jpl.nasa.gov. . edu. gov. us. com. ca. uk. arpa. fr. In-addr. ny. sun. hp. nasa. ca. sfu . bc. fraser. jpl. fraser. cs. Zone. An administrative division of the domain name tree

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' CMPT 371' - mary


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
cmpt 371

CMPT 371

Data Communications and Networking

DNS

jpl nasa gov
jpl.nasa.gov.

.

edu

gov

us

com

ca

uk

arpa

fr

In-addr

ny

sun

hp

nasa

ca

sfu

bc

fraser

jpl

fraser

cs

slide3
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
dns name tree zones
DNS Name Tree: zones

.ca

.ca domain

.ca zone

ab

sk

on

bc

qc

qc.ca zone

sk.ca zone

authority for the dns namespace
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
operation of a dns server
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
operation of a dns server1
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
caching and ttl
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

authoritative responses
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
slide10
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
a host submitting a query 1
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.
    • 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)
a host submitting a query 2
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.
query from local dns server
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)
query from the local dns server 2
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.
query from the local dns server 3
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
dns query

Local DNS server

Root DNS server

Referred to .org

DNS server for .org

Referred to isc.org

DNS server for isc.org

IP Address of ftp.isc.org

Recursive query

Recursive reply

Iterative query

Application or user

DNS Query

all queries/replies are for the address of ftp.isc.org

using the cache subsequent queries 1
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 queries

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 information

using the cache subsequent queries 2
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 information

recursive requests
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

domain server message
Domain Server Message
  • Messages exchanged between clients and servers

Comer 2000: fig 24.5

example using dig 1
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.

example using dig 2
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

cmpt 3711

CMPT 371

Data Communications and Networking

P2P

comparison
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.

how long one server to n clients
How long? One server to N clients

U1

US

U2

D1

DR1

Internet

DN

D2

DR2

UN

D3

U5

D4

U3

D5

U4

how long to send to all clients
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 Us.
    • Each copy will take F/ Us seconds to transmit into the internet.
    • Transmitting all N copies will take N*F/Us seconds
  • But the clients also need to receive their copies
how long to receive all copies
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 Dmin.
    • This host will take F/Dmin 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/Dmin seconds
how long 1 server nclients
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/Dmin 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/ Us the time taken to transmit the N copies of the file

Download Time = max {F/Dmin , N*F/ Us }

how long p2p
How long? P2P

U1

US

U2

D1

DR1

Internet

DN

D2

DR2

UN

D3

U5

D4

U3

D5

U4

how long to send using p2p
How long to send using P2P

The server must send at least one copy of the file to the peers. This takes F/Us seconds

The slowest peer must have time to download all the bits in the file. This takes F/Dmin seconds

The fastest that any host can receive uploads is

so the fastest all hosts can receive the uploaded files is

bit torrent trade data chunks
Bit torrent: TRADE DATA CHUNKS

tracker: tracks peers

participating in torrent

NEWEST HOST IN TORRENT

what is a bit torrent
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

how does a torrent work 1
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
how does a torrent work 2
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
acquiring chunks
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)
trading algorithm tit for tat
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

ad