Reaves.dev

v0.1.0

built using

Phoenix v1.7.12

CDN

Stephen M. Reaves

::

2024-04-26

Notes about Lecture 9c for CS-6210

Summary

DHT

Distrubted Hash Table

<key, value> = hash of content and node_id where content is stored

For DHT, key  node id \text{key } \simeq \text{ node id}

So if content was stored in node 80, and the hash == 149, we would store <149, 80> in node 150

DHT Details

Namespaces:

APIs

CDN as an Overlay Network

cdn

Overlay Networks in General

Examples:

DHTs and CDNs

Placement

Retrieval of value given key

Traditional Approach

Place <key, value> in node n, where n ~ key

retrieve: given key, goto node n (closest to k)

Greedy Approach Leads to Metadata Server Overload

Nothing is stopping the hashes from all going to the same nodes

Origin Server Overload

Nothing is stopping the content from all going to the same node

Central authority could mirror content and redirect requests, but that is not simple

Greedy Approach Leads to Tree Saturation

Place <key, value> in node n, where n ~ key is a hint, not absolute

Coral DHT

Rationale

How?

Key Based Routing

Gn001120304051607180n:n->n:nn:n->n:nssrcs->n:nddstd->n:0

Greedy intuition is to get as close to the dest in node_id

Coral Key Base Routing

Gn001120304051607180n:n->n:nn:n->n:nn:n->n:nssrcs->n:nddstd->n:0

Each hop go to some node about halfway to dst

In actuality, if the halfway point isn’t there, you go to the next closer one to the dst

After you make multiple hops, you learn the path traveled and add it to you routing table

Coral Sloppy DHT

Primitives

Full

Loaded

If any step along the way is Full or Loaded, assume the rest is Full or Loaded and place kv pair on last successful node

Coral In Action

Even though an individual request may increase latency, the tradeoff is that multiple servers can dynamically become proxies which lowers the demand of the origin server