15-829A/18-849B/95-811A/19-729A Internet-Scale Sensor Systems: Design and Policy Lecture 9 – Lookup Algorithms (DNS & DHTs)

Slides:



Advertisements
Similar presentations
Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan MIT and Berkeley presented by Daniel Figueiredo Chord: A Scalable Peer-to-peer.
Advertisements

Peer to Peer and Distributed Hash Tables
CHORD: A Peer-to-Peer Lookup Service CHORD: A Peer-to-Peer Lookup Service Ion StoicaRobert Morris David R. Karger M. Frans Kaashoek Hari Balakrishnan Presented.
1 Computer Networks Application layer. 2 Application Layer So far –Socket programming, Network API Today –Application layer functions –Specific applications.
1 Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications Robert Morris Ion Stoica, David Karger, M. Frans Kaashoek, Hari Balakrishnan.
Topics in Reliable Distributed Systems Lecture 2, Fall Dr. Idit Keidar.
1 Domain Name System (DNS). 2 DNS: Domain Name System Internet hosts, routers: –IP address (32 bit) - used for addressing datagrams –“name”, e.g., gaia.cs.umass.edu.
Distributed Lookup Systems
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek and Hari alakrishnan.
Topics in Reliable Distributed Systems Fall Dr. Idit Keidar.
1 CS 194: Distributed Systems Distributed Hash Tables Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer.
CS 268: Overlay Networks: Distributed Hash Tables Kevin Lai May 1, 2001.
15-744: Computer Networking L-13 Naming. L -13; © Srinivasan Seshan, Naming DNS Service location protocols Assigned reading [MD88] P. Mockapetris.
Peer To Peer Distributed Systems Pete Keleher. Why Distributed Systems? l Aggregate resources! –memory –disk –CPU cycles l Proximity to physical stuff.
Peer-to-Peer Networks Slides largely adopted from Ion Stoica’s lecture at UCB.
CPSC 441: DNS1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes derived.
1CS 6401 Peer-to-Peer Networks Outline Overview Gnutella Structured Overlays BitTorrent.
Computer Networking Lecture 13 – DNS. Lecture 13: Outline DNS Design DNS Today.
1 Domain Name System (DNS) Professor Hui Zhang. 2 Hui Zhang Names, Addresses, Mapping  Binding Names to Objects  ARP: mapping between layer 2 address.
CS640: Computer Networks Aditya Akella Lecture 17 Naming and the DNS.
Computer Networking DNS. Lecture 13: Naming How do we efficiently locate resources? DNS: name  IP address Service location: description.
NET0183 Networks and Communications Lecture 25 DNS Domain Name System 8/25/20091 NET0183 Networks and Communications by Dr Andy Brooks.
CS 4396 Computer Networks Lab
1 Domain Name System (DNS). 2 DNS: Domain Name System Internet hosts: – IP address (32 bit) - used for addressing datagrams – “name”, e.g.,
Computer Networking Lecture 13 – DNS Dejian Ye, Liu Xin.
Domain Name System (DNS)
Ch-9: NAME SERVICES By Srinivasa R. Gudipati. To be discussed.. Fundamentals of Naming Services Naming Resolution The Domain Name System (DNS) Directory.
Computer Networks Mozafar Bag-Mohammadi Lecture 5 Naming and the DNS.
DNS: Domain Name System
1 DNS: Domain Name System People: many identifiers: m SSN, name, Passport # Internet hosts, routers: m IP address (32 bit) - used for addressing datagrams.
Example applications Symbolic names and the Domain Name System (DNS)
1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.
DHTs and Peer-to-Peer Systems Supplemental Slides Aditya Akella 03/21/2007.
Introduction of P2P systems
CS640: Computer Networks Aditya Akella Lecture 17 Naming and the DNS.
October 8, 2015 University of Tulsa - Center for Information Security Microsoft Windows 2000 DNS October 8, 2015.
Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Xiaozhou Li COS 461: Computer Networks (precept 04/06/12) Princeton University.
Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan MIT and Berkeley presented by Daniel Figueiredo Chord: A Scalable Peer-to-peer.
Internet and Intranet Protocols and Applications Lecture 5 Application Protocols: DNS February 20, 2002 Joseph Conron Computer Science Department New York.
CPSC 441: DNS 1. DNS: Domain Name System Internet hosts: m IP address (32 bit) - used for addressing datagrams m “name”, e.g., - used by.
SIGCOMM 2001 Lecture slides by Dr. Yingwu Zhu Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications.
Peer to Peer A Survey and comparison of peer-to-peer overlay network schemes And so on… Chulhyun Park
15-744: Computer Networking L-22: P2P. Lecture 22: Peer-to-Peer Networks Typically each member stores/provides access to content Has quickly.
EE 122: Lecture 20 (Domain Name Server - DNS) Ion Stoica Nov 15, 2001 (* based on the some on-line slides of J. Kurose & K. Rose and of Raj Jain)
15-744: Computer Networking L-14 Naming. L -14; © Srinivasan Seshan, Naming DNS Assigned reading [JSBM01] DNS Performance and the Effectiveness.
Computer Networking P2P. Why P2P? Scaling: system scales with number of clients, by definition Eliminate centralization: Eliminate single point.
15-744: Computer Networking L-22: P2P. L -22; © Srinivasan Seshan, P2P Peer-to-peer networks Assigned reading [Cla00] Freenet: A Distributed.
Peer-to-peer systems (part I) Slides by Indranil Gupta (modified by N. Vaidya)
CS 268: Computer Networking
LOOKING UP DATA IN P2P SYSTEMS Hari Balakrishnan M. Frans Kaashoek David Karger Robert Morris Ion Stoica MIT LCS.
15-744: Computer Networking L-23: P2P. L -23; © Srinivasan Seshan, P2P Peer-to-peer networks Assigned reading [Cla00] Freenet: A Distributed.
Computer Networking Lecture 13 – DNS. Midterm Results Average71.9 Median69.5 Std.Dev.13.9!!! Max97 Min40 Available after class today 10/18/07 Lecture.
P2P Search COP P2P Search Techniques Centralized P2P systems  e.g. Napster, Decentralized & unstructured P2P systems  e.g. Gnutella.
Today’s Lecture P2P and DNS Required readings Peer-to-Peer Systems Do incentives build robustness in BitTorrent? Optional readings DNSCaching, Coral CDN,
15-829A/18-849B/95-811A/19-729A Internet-Scale Sensor Systems: Design and Policy Review.
15-744: Computer Networking L-17 DNS. This lecture Domain Name System (DNS) Content Delivery Networks (CDN) Extension mechanisms for DNS (EDNS)
Chord: A Scalable Peer-to-Peer Lookup Service for Internet Applications * CS587x Lecture Department of Computer Science Iowa State University *I. Stoica,
DNS and the Web David Andersen. DNS ● Purpose: – Map from a human-readable name to a (human- unfriendly) IP address ● Let's look at a bit of history.
A Survey of Peer-to-Peer Content Distribution Technologies Stephanos Androutsellis-Theotokis and Diomidis Spinellis ACM Computing Surveys, December 2004.
15-744: Computer Networking
Chapter 9: Domain Name Servers
BitTorrent Vs Gnutella.
CS 268: Lecture 22 (Peer-to-Peer Networks)
Mozafar Bag-Mohammadi Lecture 5 Naming and the DNS
EE 122: Peer-to-Peer (P2P) Networks
CS 268: Peer-to-Peer Networks and Distributed Hash Tables
CS 162: P2P Networks Computer Science Division
DNS: Domain Name System
The Application Layer: Sockets, DNS
Computer Networking Lecture 13 – DNS.
Presentation transcript:

15-829A/18-849B/95-811A/19-729A Internet-Scale Sensor Systems: Design and Policy Lecture 9 – Lookup Algorithms (DNS & DHTs)

Lecture # Overview Lookup Overview Hierarchical Lookup: DNS Routed Lookups  Chord  CAN

Lecture # The Lookup Problem Internet N1N1 N2N2 N3N3 N6N6 N5N5 N4N4 Publisher Key=“title” Value=MP3 data… Client Lookup(“title”) ? Problem in DNS, P2P, routing, etc. Sensor networks: how to find sensor readings?

Lecture # Centralized Lookup (Napster) Client Lookup(“whale”) N6N6 N9N9 N7N7 DB N8N8 N3N3 N2N2 N1N1 SetLoc(“whale”, N4) Simple, but O( N ) state and a single point of failure Key=“whale” Value=image data… N4N4

Lecture # Hierarchical Queries (DNS) N4N4 Client N6N6 N9N9 N7N7 N8N8 N3N3 N2N2 N1N1 Scalable (log n), but could be brittle Key=“whale” Value=image data… Lookup(“whale”) Root

Lecture # Flooded Queries (Gnutella, /etc/hosts) N4N4 Client N6N6 N9N9 N7N7 N8N8 N3N3 N2N2 N1N1 Robust, but worst case O( N ) messages per lookup Key=“whale” Value=image data… Lookup(“whale”)

Lecture # Routed Queries (DHTs) N4N4 Publisher Client N6N6 N9N9 N7N7 N8N8 N3N3 N2N2 N1N1 Lookup(“whale”) Key=“whale” Value=image data… Scalable (log n), but limited search styles

Lecture # Overview Lookup Overview Hierarchical Lookup: DNS Routed Lookups  Chord  CAN

Lecture # Obvious Solutions (1) Objective: provide name to address translations Why not centralize DNS? Single point of failure Traffic volume Distant centralized database Single point of update Doesn’t scale!

Lecture # Obvious Solutions (2) Why not use /etc/hosts? Original Name to Address Mapping  Flat namespace  /etc/hosts  SRI kept main copy  Downloaded regularly Count of hosts was increasing: machine per domain  machine per user  Many more downloads  Many more updates

Lecture # Domain Name System Goals Basically building a wide area distributed database Scalability Decentralized maintenance Robustness Global scope  Names mean the same thing everywhere Don’t need  Atomicity  Strong consistency

Lecture # DNS Records RR format: (class, name, value, type, ttl) DB contains tuples called resource records (RRs)  Classes = Internet (IN), Chaosnet (CH), etc.  Each class defines value associated with type FOR IN class: Type=A  name is hostname  value is IP address Type=NS  name is domain (e.g. foo.com)  value is name of authoritative name server for this domain Type=CNAME  name is an alias name for some “canonical” (the real) name  value is canonical name Type=MX  value is hostname of mailserver associated with name

Lecture # DNS Design: Hierarchy Definitions root edunet org ukcom gwuucbcmubu mit cs ece cmcl Each node in hierarchy stores a list of names that end with same suffix Suffix = path up tree E.g., given this tree, where would following be stored: Fred.com Fred.edu Fred.cmu.edu Fred.cmcl.cs.cmu.edu Fred.cs.mit.edu

Lecture # DNS Design: Zone Definitions root edunet org ukcom ca gwuucbcmubu mit cs ece cmcl Single node Subtree Complete Tree Zone = contiguous section of name space E.g., Complete tree, single node or subtree A zone has an associated set of name servers

Lecture # DNS Design: Cont. Zones are created by convincing owner node to create/delegate a subzone  Records within zone stored multiple redundant name servers  Primary/master name server updated manually  Secondary/redundant servers updated by zone transfer of name space Zone transfer is a bulk transfer of the “configuration” of a DNS server – uses TCP to ensure reliability Example:  CS.CMU.EDU created by CMU.EDU administrators

Lecture # Servers/Resolvers Each host has a resolver  Typically a library that applications can link to  Local name servers hand-configured (e.g. /etc/resolv.conf) Name servers  Either responsible for some zone or…  Local servers Do lookup of distant host names for local hosts Typically answer queries about local zone

Lecture # DNS: Root Name Servers Responsible for “root” zone Approx. dozen root name servers worldwide  Currently {a-m}.root- servers.net Local name servers contact root servers when they cannot resolve a name  Configured with well- known root servers

Lecture # Lookup Methods Recursive query: Server goes out and searches for more info (recursive) Only returns final answer or “not found” Iterative query: Server responds with as much as it knows (iterative) “I don’t know this name, but ask this server” Workload impact on choice? Local server typically does recursive Root/distant server does iterative requesting host surf.eurecom.fr gaia.cs.umass.edu root name server local name server dns.eurecom.fr authoritative name server dns.cs.umass.edu intermediate name server dns.umass.edu 7 8 iterated query

Lecture # Typical Resolution Client Local DNS server root & edu DNS server ns1.cmu.edu DNS server NS ns1.cmu.edu NS ns1.cs.cmu.edu A www=IPaddr ns1.cs.cmu.edu DNS server

Lecture # Typical Resolution Steps for resolving  Application calls gethostbyname() (RESOLVER)  Resolver contacts local name server (S 1 )  S 1 queries root server (S 2 ) for (  S 2 returns NS record for cmu.edu (S 3 )  What about A record for S 3 ? This is what the additional information section is for (PREFETCHING)  S 1 queries S 3 for  S 3 returns A record for Can return multiple A records  what does this mean?

Lecture # Workload and Caching What workload do you expect for different servers/names?  Why might this be a problem? How can we solve this problem? DNS responses are cached  Quick response for repeated translations  Other queries may reuse some parts of lookup NS records for domains DNS negative queries are cached  Don’t have to repeat past mistakes  E.g. misspellings, search strings in resolv.conf Cached data periodically times out  Lifetime (TTL) of data controlled by owner of data  TTL passed with every record

Lecture # Prefetching Name servers can add additional data to any response Typically used for prefetching  CNAME/MX/NS typically point to another host name  Responses include address of host referred to in “additional section”

Lecture # Typical Resolution Client Local DNS server root & edu DNS server ns1.cmu.edu DNS server NS ns1.cmu.edu NS ns1.cs.cmu.edu A www=IPaddr ns1.cs.cmu.edu DNS server

Lecture # Subsequent Lookup Example Client Local DNS server root & edu DNS server cmu.edu DNS server cs.cmu.edu DNS server ftp.cs.cmu.edu ftp=IPaddr ftp.cs.cmu.edu

Lecture # Reliability DNS servers are replicated  Name service available if ≥ one replica is up  Queries can be load balanced between replicas UDP used for queries  Need reliability  must implement this on top of UDP!  Why not just use TCP? Try alternate servers on timeout  Exponential backoff when retrying same server Same identifier for all queries  Don’t care which server responds Is it still a brittle design?

Lecture # Overview Lookup Overview Hierarchical Lookup: DNS Routed Lookups  Chord  CAN

Lecture # Routing: Structured Approaches Goal: make sure that an item (file) identified is always found in a reasonable # of steps Abstraction: a distributed hash-table (DHT) data structure  insert(id, item);  item = query(id);  Note: item can be anything: a data object, document, file, pointer to a file… Proposals  CAN (ICIR/Berkeley)  Chord (MIT/Berkeley)  Pastry (Rice)  Tapestry (Berkeley)

Lecture # Routing: Chord Associate to each node and item a unique id in an uni-dimensional space Properties  Routing table size O(log(N)), where N is the total number of nodes  Guarantees that a file is found in O(log(N)) steps

Lecture # Aside: Consistent Hashing [Karger 97] N32 N90 N105 K80 K20 K5 Circular 7-bit ID space Key 5 Node 105 A key is stored at its successor: node with next higher ID

Lecture # Routing: Chord Basic Lookup N32 N90 N105 N60 N10 N120 K80 “Where is key 80?” “N90 has K80”

Lecture # Routing: Finger table - Faster Lookups N80 ½ ¼ 1/8 1/16 1/32 1/64 1/128

Lecture # Routing: Chord Summary Assume identifier space is 0…2 m Each node maintains  Finger table Entry i in the finger table of n is the first node that succeeds or equals n + 2 i  Predecessor node An item identified by id is stored on the successor node of id

Lecture # Routing: Chord Example Assume an identifier space 0..8 Node n1:(1) joins  all entries in its finger table are initialized to itself i id+2 i succ Succ. Table

Lecture # Routing: Chord Example Node n2:(3) joins i id+2 i succ Succ. Table i id+2 i succ Succ. Table

Lecture # Routing: Chord Example Nodes n3:(0), n4:(6) join i id+2 i succ Succ. Table i id+2 i succ Succ. Table i id+2 i succ Succ. Table i id+2 i succ Succ. Table

Lecture # Routing: Chord Examples Nodes: n1:(1), n2(3), n3(0), n4(6) Items: f1:(7), f2:(2) i id+2 i succ Succ. Table i id+2 i succ Succ. Table i id+2 i succ Succ. Table 7 Items 1 i id+2 i succ Succ. Table

Lecture # Routing: Query Upon receiving a query for item id, a node Check whether stores the item locally If not, forwards the query to the largest node in its successor table that does not exceed id i id+2 i succ Succ. Table i id+2 i succ Succ. Table i id+2 i succ Succ. Table 7 Items 1 i id+2 i succ Succ. Table query(7)

Lecture # Overview Lookup Overview Hierarchical Lookup: DNS Routed Lookups  Chord  CAN

Lecture # CAN Associate to each node and item a unique id in an d- dimensional space  Virtual Cartesian coordinate space Entire space is partitioned amongst all the nodes  Every node “owns” a zone in the overall space Abstraction  Can store data at “points” in the space  Can route from one “point” to another Point = node that owns the enclosing zone Properties  Routing table size O(d)  Guarantees that a file is found in at most d*n 1/d steps, where n is the total number of nodes

Lecture # CAN E.g.: Two Dimensional Space Space divided between nodes All nodes cover the entire space Each node covers either a square or a rectangular area of ratios 1:2 or 2:1 Example:  Assume space size (8 x 8)  Node n1:(1, 2) first node that joins  cover the entire space n1

Lecture # CAN E.g.: Two Dimensional Space Node n2:(4, 2) joins  space is divided between n1 and n n1 n2

Lecture # CAN E.g.: Two Dimensional Space Node n2:(4, 2) joins  space is divided between n1 and n n1 n2 n3

Lecture # CAN E.g.: Two Dimensional Space Nodes n4:(5, 5) and n5:(6,6) join n1 n2 n3 n4 n5

Lecture # CAN E.g.: Two Dimensional Space Nodes: n1:(1, 2); n2:(4,2); n3:(3, 5); n4:(5,5);n5:(6,6) Items: f1:(2,3); f2:(5,1); f3:(2,1); f4:(7,5); n1 n2 n3 n4 n5 f1 f2 f3 f4

Lecture # CAN E.g.: Two Dimensional Space Each item is stored by the node who owns its mapping in the space n1 n2 n3 n4 n5 f1 f2 f3 f4

Lecture # CAN: Query Example Each node knows its neighbors in the d-space Forward query to the neighbor that is closest to the query id Example: assume n1 queries f n1 n2 n3 n4 n5 f1 f2 f3 f4

Lecture # Routing: Concerns Each hop in a routing-based lookup can be expensive  No correlation between neighbors and their location  A query can repeatedly jump from Europe to North America, though both the initiator and the node that store the item are in Europe!  Solutions: Tapestry takes care of this implicitly; CAN and Chord maintain multiple copies for each entry in their routing tables and choose the closest in terms of network distance What type of lookups?  Only exact match!  no beatles.*

Lecture # Summary The key challenge of building wide area P2P systems is a scalable and robust location service Solutions covered in this lecture  Naptser: centralized location service  Gnutella: broadcast-based decentralized location service  Freenet: intelligent-routing decentralized solution  DHTs: structured intelligent-routing decentralized solution

Lecture # Overview Centralized/Flooded Lookups

Lecture # Centralized: Napster Simple centralized scheme  motivated by ability to sell/control How to find a file:  On startup, client contacts central server and reports list of files  Query the index system  return a machine that stores the required file Ideally this is the closest/least-loaded machine  Fetch the file directly from peer

Lecture # Centralized: Napster Advantages:  Simple  Easy to implement sophisticated search engines on top of the index system Disadvantages:  Robustness, scalability  Easy to sue!

Lecture # Flooding: Gnutella On startup, client contacts any servent (server + client) in network  Servent interconnection used to forward control (queries, hits, etc) Idea: broadcast the request How to find a file:  Send request to all neighbors  Neighbors recursively forward the request  Eventually a machine that has the file receives the request, and it sends back the answer  Transfers are done with HTTP between peers

Lecture # Flooding: Gnutella Advantages:  Totally decentralized, highly robust Disadvantages:  Not scalable; the entire network can be swamped with request (to alleviate this problem, each request has a TTL)  Especially hard on slow clients At some point broadcast traffic on Gnutella exceeded 56kbps – what happened? Modem users were effectively cut off!

Lecture # Flooding: Gnutella Details Basic message header  Unique ID, TTL, Hops Message types  Ping – probes network for other servents  Pong – response to ping, contains IP addr, # of files, # of Kbytes shared  Query – search criteria + speed requirement of servent  QueryHit – successful response to Query, contains addr + port to transfer from, speed of servent, number of hits, hit results, servent ID  Push – request to servent ID to initiate connection, used to traverse firewalls Ping, Queries are flooded QueryHit, Pong, Push reverse path of previous message

Lecture # Flooding: Gnutella Example Assume: m1’s neighbors are m2 and m3; m3’s neighbors are m4 and m5;… A B C D E F m1 m2 m3 m4 m5 m6 E? E E E

Lecture # Flooding: FastTrack (aka Kazaa) Modifies the Gnutella protocol into two-level hierarchy  Hybrid of Gnutella and Napster Supernodes  Nodes that have better connection to Internet  Act as temporary indexing servers for other nodes  Help improve the stability of the network Standard nodes  Connect to supernodes and report list of files  Allows slower nodes to participate Search  Broadcast (Gnutella-style) search across supernodes Disadvantages  Kept a centralized registration  allowed for law suits 