اعداد / يوسف عبدالله الشمراني 423101390 اشراف / د 0 هشام ابو عوده.
DNS & P2P A PPLICATIONS د. عـــادل يوسف أبو القاسم.
-
Upload
johnathan-warner -
Category
Documents
-
view
231 -
download
0
Transcript of DNS & P2P A PPLICATIONS د. عـــادل يوسف أبو القاسم.
DNS & P2P APPLICATIONS
القاسم. د أبو يوسف عـــادل
DNS: DOMAIN NAME SYSTEM
People: have many identifiers:SSN, name, passport , National Number
Internet hosts, routers:IP address (32 bit) - used for addressing
datagrams“name”, e.g., www.yahoo.com - used by humans
Q: how to map between IP addresses and names ?
3
DNS: DOMAIN NAME SYSTEM
Domain Name System: distributed database implemented in hierarchy of
many name servers DNS is Hierarchical Why not centralize DNS?
single point of failure traffic volume distant centralized database maintenance doesn‘t scale!
4
DNS SERVICESHostname to IP address translationHost aliasing
Canonical and alias namesMail server aliasingLoad distribution
Replicated Web servers: set of IP addresses for one canonical name
5
Root DNS Servers
com DNS servers org DNS servers edu DNS servers
poly.eduDNS servers
umass.eduDNS servers
yahoo.comDNS servers
amazon.comDNS servers
pbs.orgDNS servers
DISTRIBUTED, HIERARCHICAL DATABASE
Client wants IP for www.amazon.com; 1st approx: Client queries a root server to find “com” DNS server Client queries com DNS server to get “amazon.com”
Authoritative DNS server Client queries amazon.com DNS server to get IP address
for “www.amazon.com”
6
DNS: ROOT NAME SERVERS contacted by local name server that can not resolve Top_Level name (eats
in www.macdonalds.eats) Originally there were 7 Top-Level domains (com, org, edu, mil, gov, info,
arpa) Now there are hundreds ( us, uk, cn, tv, name, ...) ICANN assigns domain names (www.icann.org)
13 root name servers worldwideb USC-ISI Marina del Rey, CA
l ICANN Los Angeles, CA
e NASA Mt View, CAf Internet Software C. Palo Alto, CA (and 17 other locations)
i Autonomica, Stockholm (plus 3 other locations)
k RIPE London (also Amsterdam, Frankfurt)
m WIDE Tokyo
a Verisign, Dulles, VAc Cogent, Herndon, VA (also Los Angeles)d U Maryland College Park, MDg US DoD Vienna, VAh ARL Aberdeen, MDj Verisign, ( 11 locations)
7
TLD AND AUTHORITATIVE SERVERS
Top-level domain (TLD) servers: responsible for com, org, net, edu, etc, and all top-level country domains uk, fr, ca, Network Solutions, Inc. maintains servers for com TLDEducause maintains servers for edu TLD
Authoritative DNS servers: organization’s DNS servers, providing authoritative hostname to IP mappings for organization’s servers (e.g., Web and mail).Can be maintained by organization or service providerEvery “Autonomous System” (AS) must have two
(backup).
8
LOCAL NAME SERVER Local DNS servers: organization’s DNS servers located on
various subnets to provide DNS lookups for hosts on the subnet. May not be accessible from outside the subnet. Their IP addresses are part of the host's network configuration (manual or DHCP).
Does not strictly belong to hierarchy Each ISP (residential ISP, company, university) has one.
Also called “default name server” or “resolver” When a host makes a DNS query, query is sent to its local
DNS serverActs as a proxy, forwards query into hierarchy.Today a DNS proxy (resolver) is built into most
DSL and cable-modem routers
06
a D
NS.p
pt
9
requesting hostcis.poly.edu
gaia.cs.umass.edu
root DNS server
local DNS serverdns.poly.edu
1
23
4
5
6
authoritative DNS serverdns.cs.umass.edu
78
TLD DNS server
EXAMPLE
$ nslookup gaia.cs.umass.edu answer 128.119.245.12
Host at cis.poly.edu wants IP address for gaia.cs.umass.edu
Host sends a "recursion-requested" query request to dns.poly.edu.
[Host is doing a non-recursive search]
Local DNS server does a "recursive" search. This requires contacting several other DNS servers before the final answer is given to host.
06a DNS.ppt
10
requesting hostcis.poly.edu
gaia.cs.umass.edu
root DNS serverA3.NSLTD.COM
local DNS serverdns.poly.edu
1
2
4
5
6
authoritative DNS server
NS1.umass.edu3
NON-RECURSIVE QUERIES norecurse or "iterated"
query:contacted server
replies with name of server to contact
“I don’t know this name, but ask this server”
$ nslookup -norecurse -v gaia.cs.umass.edu$ nslookup -norecurse -v gaia.cs.umass.edu A3.NSLTD.COM $ nslookup -norecurse -v gaia.cs.umass.edu NS1.umass.com answer 128.119.245.12
11
DNS: CACHING AND UPDATING RECORDS
once (any) name server learns a mapping, it caches the mapping (Domain’s DNS = IP) cache entries timeout (disappear) after some
time (usually 20 minutes)TLD servers typically cached longer in local name
serversThus root name servers not often visited
12
DNS RECORDSDNS: distributed db storing resource records (RR)
Type=NS name is domain (e.g. foo.com) value is hostname of
authoritative name server for this domain
RR format: (name, value, type, ttl)
Type=A (AAAA for IPv6) name is hostname value is IP address
Type=CNAME name is alias name for some
“canonical” (the real) name www.ibm.com is really servereast.backup2.ibm.com value is canonical name
Type=MX value is name of mail server
associated with name
06
a D
NS.p
pt
13
DNS PROTOCOL, MESSAGES
DNS protocol : query and reply messages, both with same message format
msg header identification: 16 bit #
for query, reply to query uses same #
flags: query or reply recursion desired recursion available reply is authoritative
14
DNS PROTOCOL, MESSAGES
Name, type fields for a query
RRs in responseto query
records forauthoritative servers
additional “helpful”info that may be used
*
15
INSERTING RECORDS INTO DNS Example: just created startup “Network Utopia” Register name networkuptopia.com at a registrar
(e.g., Network Solutions)Need to provide registrar with names and IP addresses of
your authoritative name server (primary and secondary)Registrar inserts two RRs into the .com TLD server:
(networkutopia.com, dns1.acme.com, NS)(dns1.acme.com, 212.212.212.1, A)
Put in authoritative server Type A record for www.networkuptopia.com and Type MX record for networkutopia.com into dns1.acme.com (DNS service)
P2P File Sharing
17
P2P FILE SHARING
Example Alice runs P2P client application on her notebook
computer Intermittently connects to Internet; gets new IP address
for each connection Asks for “Hey Jude” Application displays other peers that have copy of Hey
Jude.
Alice chooses one of the peers, Bob.
File is copied from Bob’s PC to Alice’s notebook: HTTP
While Alice downloads, other users uploading from Alice.
Alice’s peer is both a Web client and a transient Web server.
All peers are servers = highly scalable!
18
P2P: CENTRALIZED DIRECTORY
original “Napster” design1) when peer connects, it
informs central server: IP address content
2) Alice queries for “Hey Jude”3) Alice requests file from Bob
centralizeddirectory server
peers
Alice
Bob
1
1
1
12
3
19
P2P: PROBLEMS WITH CENTRALIZED DIRECTORY
Single point of failure Performance bottleneck Copyright infringement
20
QUERY FLOODING: GNUTELLA fully distributed
no central server public domain protocol many Gnutella clients
implementing protocol
overlay network: graph edge between peer X and Y if there’s a TCP connection all active peers and edges is overlay net Edge is not a physical link Given peer will typically be connected with < 10 overlay
neighbors
21
GNUTELLA: PROTOCOL
Query
QueryHit
Query
Query
QueryHit
Query
Query
QueryHit
File transfer:HTTP
Query messagesent over existing TCPconnections peers forwardQuery message QueryHit sent over reversepath
Scalability:limited scopeflooding
22
GNUTELLA: PEER JOINING1. Joining peer X must find some other peer in
Gnutella network: use list of candidate peers2. X sequentially attempts to make TCP with
peers on list until connection setup with Y3. X sends Ping message to Y; Y forwards Ping
message. 4. All peers receiving Ping message respond with
Pong message5. X receives many Pong messages. It can then
setup additional TCP connections
2: Application Layer
23
EXPLOITING HETEROGENEITY: KAZAA Each peer is either a
group leader or assigned to a group leader.TCP connection between
peer and its group leader.TCP connections
between some pairs of group leaders.
Group leader tracks the content in all its children.
ordinary peer
group-leader peer
neighoring re la tionshipsin overlay network
2: Application Layer 24
KAZAA: QUERYING
Each file has a hash and a descriptorClient sends keyword query to its group
leaderGroup leader responds with matches:
For each match: metadata, hash, IP addressIf group leader forwards query to other
group leaders, they respond with matchesClient then selects files for downloading
HTTP requests using hash as identifier sent to peers holding desired file
Questions