Hashing in Networked Systems COS 461: Computer Networks Spring 2011 Mike Freedman LB Server.

Slides:



Advertisements
Similar presentations
CAN 1.Distributed Hash Tables a)DHT recap b)Uses c)Example – CAN.
Advertisements

Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan MIT and Berkeley presented by Daniel Figueiredo Chord: A Scalable Peer-to-peer.
Scalable Content-Addressable Network Lintao Liu
P2P Systems and Distributed Hash Tables Section COS 461: Computer Networks Spring 2011 Mike Freedman
Precept 6 Hashing & Partitioning 1 Peng Sun. Server Load Balancing Balance load across servers Normal techniques: Round-robin? 2.
1 Server Selection & Content Distribution Networks (slides by Srini Seshan, CS CMU)
Technische Universität Chemnitz Kurt Tutschku Vertretung - Professur Rechner- netze und verteilte Systeme Chord - A Distributed Hash Table Yimei Liao.
1 1 Chord: A scalable Peer-to-peer Lookup Service for Internet Applications Dariotaki Roula
Distributed Hash Tables CPE 401 / 601 Computer Network Systems Modified from Ashwin Bharambe and Robert Morris.
Common approach 1. Define space: assign random ID (160-bit) to each node and key 2. Define a metric topology in this space,  that is, the space of keys.
P2p, Spring 05 1 Topics in Database Systems: Data Management in Peer-to-Peer Systems March 29, 2005.
1 Internet Networking Spring 2004 Tutorial 13 LSNAT - Load Sharing NAT (RFC 2391)
Internet Networking Spring 2006 Tutorial 12 Web Caching Protocols ICP, CARP.
Other File Systems: AFS, Napster. 2 Recap NFS: –Server exposes one or more directories Client accesses them by mounting the directories –Stateless server.
Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications Stoica et al. Presented by Tam Chantem March 30, 2007.
P2P: Advanced Topics Filesystems over DHTs and P2P research Vyas Sekar.
A Scalable Content-Addressable Network Authors: S. Ratnasamy, P. Francis, M. Handley, R. Karp, S. Shenker University of California, Berkeley Presenter:
1 Spring Semester 2007, Dept. of Computer Science, Technion Internet Networking recitation #13 Web Caching Protocols ICP, CARP.
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.
Internet Networking Spring 2002 Tutorial 13 Web Caching Protocols ICP, CARP.
Chord-over-Chord Overlay Sudhindra Rao Ph.D Qualifier Exam Department of ECECS.
Topics in Reliable Distributed Systems Fall Dr. Idit Keidar.
Peer To Peer Distributed Systems Pete Keleher. Why Distributed Systems? l Aggregate resources! –memory –disk –CPU cycles l Proximity to physical stuff.
COS 461: Computer Networks
Wide-area cooperative storage with CFS
1 The Mystery of Cooperative Web Caching 2 b b Web caching : is a process implemented by a caching proxy to improve the efficiency of the web. It reduces.
1 Spring Semester 2007, Dept. of Computer Science, Technion Internet Networking recitation #12 LSNAT - Load Sharing NAT (RFC 2391)
A Scalable, Commodity Data Center Network Architecture.
1CS 6401 Peer-to-Peer Networks Outline Overview Gnutella Structured Overlays BitTorrent.
1 Content Distribution Networks. 2 Replication Issues Request distribution: how to transparently distribute requests for content among replication servers.
INTRODUCTION TO PEER TO PEER NETWORKS Z.M. Joseph CSE 6392 – DB Exploration Spring 2006 CSE, UT Arlington.
Network Layer (3). Node lookup in p2p networks Section in the textbook. In a p2p network, each node may provide some kind of service for other.
Chapter 1: Introduction to Web Applications. This chapter gives an overview of the Internet, and where the World Wide Web fits in. It then outlines the.
Chord & CFS Presenter: Gang ZhouNov. 11th, University of Virginia.
Overlay network concept Case study: Distributed Hash table (DHT) Case study: Distributed Hash table (DHT)
2: Application Layer1 Chapter 2 outline r 2.1 Principles of app layer protocols r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail r 2.5 DNS r 2.6 Socket.
Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Xiaozhou Li COS 461: Computer Networks (precept 04/06/12) Princeton University.
The Inter-network is a big network of networks.. The five-layer networking model for the internet.
A Scalable Content-Addressable Network (CAN) Seminar “Peer-to-peer Information Systems” Speaker Vladimir Eske Advisor Dr. Ralf Schenkel November 2003.
Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
SIGCOMM 2001 Lecture slides by Dr. Yingwu Zhu Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications.
Jennifer Rexford Princeton University MW 11:00am-12:20pm Measurement COS 597E: Software Defined Networking.
Networking Fundamentals. Basics Network – collection of nodes and links that cooperate for communication Nodes – computer systems –Internal (routers,
Peer to Peer A Survey and comparison of peer-to-peer overlay network schemes And so on… Chulhyun Park
P2P Group Meeting (ICS/FORTH) Monday, 28 March, 2005 A Scalable Content-Addressable Network Sylvia Ratnasamy, Paul Francis, Mark Handley, Richard Karp,
Lecture 12 Distributed Hash Tables CPE 401/601 Computer Network Systems slides are modified from Jennifer Rexford.
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 2: Distributed Hash.
Peer to Peer Network Design Discovery and Routing algorithms
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Distributed Hash Tables Steve Ko Computer Sciences and Engineering University at Buffalo.
LOOKING UP DATA IN P2P SYSTEMS Hari Balakrishnan M. Frans Kaashoek David Karger Robert Morris Ion Stoica MIT LCS.
Two Peer-to-Peer Networking Approaches Ken Calvert Net Seminar, 23 October 2001 Note: Many slides “borrowed” from S. Ratnasamy’s Qualifying Exam talk.
Distributed systems. distributed systems and protocols distributed systems: use components located at networked computers use message-passing to coordinate.
CSCI 599: Beyond Web Browsers Professor Shahram Ghandeharizadeh Computer Science Department Los Angeles, CA
Aditya Akella The Web Aditya Akella 18 Apr, 2002.
CSE 486/586 Distributed Systems Distributed Hash Tables
Chord: A Scalable Peer-to-Peer Lookup Service for Internet Applications * CS587x Lecture Department of Computer Science Iowa State University *I. Stoica,
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 24 – Introduction to Peer-to-Peer (P2P) Systems Klara Nahrstedt (presented by Long Vu)
CSE 486/586 Distributed Systems Distributed Hash Tables
Distributed Hash Tables
COS 461: Computer Networks
Internet Networking recitation #12
Accessing nearby copies of replicated objects
P2P Systems and Distributed Hash Tables
EECS 498 Introduction to Distributed Systems Fall 2017
COS 461: Computer Networks
Consistent Hashing and Distributed Hash Table
CSE 486/586 Distributed Systems Distributed Hash Tables
Presentation transcript:

Hashing in Networked Systems COS 461: Computer Networks Spring 2011 Mike Freedman LB Server Cluster Switches

Hashing Hash function – Function that maps a large, possibly variable-sized datum into a small datum, often a single integer that serves to index an associative array – In short: maps n-bit datum into k buckets (k << 2 n ) – Provides time- & space-saving data structure for lookup Main goals: – Low cost – Deterministic – Uniformity (load balanced) 2

Today’s outline Uses of hashing – Equal-cost multipath routing in switches – Network load balancing in server clusters – Per-flow statistics in switches (QoS, IDS) – Caching in cooperative CDNs and P2P file sharing – Data partitioning in distributed storage services Various hashing strategies – Modulo hashing – Consistent hashing – Bloom Filters 3

Uses of Hashing 4

Equal-cost multipath routing (ECMP) ECMP – Multipath routing strategy that splits traffic over multiple paths for load balancing Why not just round-robin packets? – Reordering (lead to triple duplicate ACK in TCP?) – Different RTT per path (for TCP RTO)… – Different MTUs per path 5

Equal-cost multipath routing (ECMP) Path-selection via hashing – # buckets = # outgoing links – Hash network information (source/dest IP addrs) to select outgoing link: preserves flow affinity 6

Now: ECMP in datacenters Datacenter networks are multi-rooted tree – Goal: Support for 100,000s of servers – Recall Ethernet spanning tree problems: No loops – L3 routing and ECMP: Take advantage of multiple paths 7

Network load balancing Goal: Split requests evenly over k servers – Map new flows to any server – Packets of existing flows continue to use same server 3 approaches – Load balancer terminates TCP, opens own connection to server – Virtual IP / Dedicated IP (VIP/DIP) approaches One global-facing virtual IP represents all servers in cluster Hash client’s network information (source IP:port) NAT approach: Replace virtual IP with server’s actual IP Direct Server Return (DSR) 8

Load balancing with DSR Servers bind to both virtual and dedicated IP Load balancer just replaces dest MAC addr Server sees client IP, responds directly – Packet in reverse direction do not pass through load balancer – Greater scalability, particularly for traffic with assymmetric bandwidth (e.g., HTTP GETs) LB Server Cluster Switches 9

Per-flow state in switches Switches often need to maintain connection records or per-flow state – Quality-of-service for flows – Flow-based measurement and monitoring – Payload analysis in Intrusion Detection Systems (IDSs) On packet receipt: – Hash flow information (packet 5-tuple) – Perform lookup if packet belongs to known flow – Otherwise, possibly create new flow entry – Probabilistic match (false positives) may be okay 10

Cooperative Web CDNs Tree-like topology of cooperative web caches – Check local – If miss, check siblings / parent One approach – Internet Cache Protocol (ICP) – UDP-based lookup, short timeout Alternative approach – A priori guess is siblings/children have content – Nodes share hash table of cached content with parent / siblings – Probabilistic check (false positives) okay, as actual ICP lookup to neighbor could just return false 11 public Internet Parent webcache

Hash tables in P2P file-sharing Two-layer network (e.g., Gnutella, Kazaa) – Ultrapeers are more stable, not NATted, higher bandwidth – Leaf nodes connect with 1 or more ultrapeers Ultrapeers handle content searchers – Leaf nodes send hash table of content to ultrapeers – Search requests flooded through ultrapeer network – When ultrapeer gets request, checks hash tables of its children for match 12

Data partitioning Network load balancing: All machines are equal Data partitioning: Machines store different content Non-hash-based solution – “Directory” server maintains mapping from O(entries) to machines (e.g., Network file system, Google File System) – Named data can be placed on any machine Hash-based solution – Nodes maintain mappings from O(buckets) to machines – Data placed on the machine that owns the name’s bucket 13

Examples of data partitioning Akamai – 1000 clusters around Internet, each >= 1 servers – Hash (URL’s domain) to map to one server – Akamai DNS aware of hash function, returns machine that 1.is in geographically-nearby cluster 2.manages particular customer domain Memcached (Facebook, Twitter, …) – Employ k machines for in-memory key-value caching – On read: Check memcache If miss, read data from DB, write to memcache – On write: invalidate cache, write data to DB 14

How Akamai Works – Already Cached End-user 15 cnn.com (content provider)DNS root serverAkamai server 12 Akamai high-level DNS server Akamai low-level DNS server Nearby hash-chosen Akamai server GET index. html GET /cnn.com/foo.jpg Cluster

Hashing Techniques 16

Basic Hash Techniques Simple approach for uniform data – If data distributed uniformly over N, for N >> n – Hash fn = mod n – Fails goal of uniformity if data not uniform Non-uniform data, variable-length strings – Typically split strings into blocks – Perform rolling computation over blocks CRC32 checksum Cryptographic hash functions (SHA-1 has 64 byte blocks) 17

Applying Basic Hashing Consider problem of data partition: – Given document X, choose one of k servers to use Suppose we use modulo hashing – Number servers 1..k – Place X on server i = (X mod k) Problem? Data may not be uniformly distributed – Place X on server i = hash (X) mod k Problem? – What happens if a server fails or joins (k  k±1)? – What is different clients has different estimate of k? – Answer: All entries get remapped to new nodes! 18

Consistent hashing partitions key-space among nodes Contact appropriate node to lookup/store key – Blue node determines red node is responsible for key 1 – Blue node sends lookup or insert to red node key 1 key 2 key 3 key 1 =value insert(key 1,value) 19 Consistent Hashing lookup(key 1 )

Partitioning key-space among nodes – Nodes choose random identifiers:e.g., hash(IP) – Keys randomly distributed in ID-space: e.g., hash(URL) – Keys assigned to node “nearest” in ID-space – Spreads ownership of keys evenly across nodes URL 1 URL 2 URL Consistent Hashing

Bucket 14 Construction – Assign n hash buckets to random points on mod 2 k circle; hash key size = k – Map object to random position on circle – Hash of object = closest clockwise bucket – successor (key)  bucket Desired features – Balanced: No bucket has disproportionate number of objects – Smoothness: Addition/removal of bucket does not cause movement among existing buckets (only immediate buckets) – Spread and load: Small set of buckets that lie near object 21

Bloom Filters Data structure for probabilistic membership testing – Small amount of space, constant time operations – False positives possible, no false negatives – Useful in per-flow network statistics, sharing information between cooperative caches, etc. Basic idea using hash fn’s and bit array – Use k independent hash functions to map item to array – If all array elements are 1, it’s present. Otherwise, not 22

Start with an m bit array, filled with 0s. To insert, hash each item k times. If H i (x) = a, set Array[a] = To check if y is in set, check array at H i (y). All k values must be Possible to have a false positive: all k values are 1, but y is not in set. Bloom Filters 23

Today’s outline Uses of hashing – Equal-cost multipath routing in switches – Network load balancing in server clusters – Per-flow statistics in switches (QoS, IDS) – Caching in cooperative CDNs and P2P file sharing – Data partitioning in distributed storage services Various hashing strategies – Modulo hashing – Consistent hashing – Bloom Filters 24