let's understand what content distribution networks are.
I'm planning a holiday trip to India fairly
soon and let's say on the holiday trip I record some nice videos of some
of the places that I went sightseeing. And let's say I call the content that
I generated thusly. [INAUDIBLE] India trip. To
keep it simple, let me call the node
ID of my computer as 80. And I want to publish this video that I generated of my
interesting visits to some of the sights and sounds of (no period) India on the
Internet, so that anyone on the Internet can
find it and download it. Now, how do
I name the content of my video? Well,
textual names may not be very meaningful, because there
could be name collisions. So what I'm going to do
is, I'm going to create a content hash of the
video, and let's say my content. Hash has enough bits
to ensure uniqueness of the hash string that I generated, I'll
call that the key. Now I have key value pair
the key is a bit string that is a hash
of the content of what I want to store and
make available to everybody, and the value is my node ID
where the content is stored. let's say that the content turned out to be 149, and
my node ID is of course 80. So the key value pair that I've generated for
my interesting video is 149, 80. 149 is the
key, and 80 is the value. Which essentially is the node ID
of my computer where I have the content. In other words the key 149,
Is a unique name that I've generated for the content
which I want to distribute to others that may be interested in looking at this
particular content. Now if you get this key value pair
149, 80, you know that 149 is the key
that uniquely names my video it shows India trip and
80 is the value which says where you can get this particular video from. So
you can then come to my node and get it from me. Now the question is. Where to
store this key value pair, so that anybody
can discover this key value pair. If they
are looking for Kishore's India trip, maybe I
published the fact that Kishore's India trip unique name
is 149 somewhere. And so now, if, anybody wants to find a way of locating the
server from which they can download the content
they need to get this key value pair.
So, when I created this particular, key value pair, I have to find a way to
place it in the internet. So that anybody can get these key value pair, and from
that, know the node from which they can download
the content. Now we cannot put this on a
central name cell because it does not scale. Because
user generated content is proliferating on the internet. So
using a central server to store. All the key-value
pairs is just not scalable. We need a distributed
solution. And this is where the idea of DHT,
or distributed hash table, comes into play. The idea
is quite simple. Anyone who generates a key value
pair has to find a location. Where they can
store it so that intuitively, anybody that is looking
for that particular key will be able to discover
it. So if I want to store a key value there, what I'm going to do is find a node
who's ID is exactly the same as the key itself. Or if not, close enough to
the key that I want to store. So in
this case, the key that I generated, which is
a content hash of my India video, is 149.
And looking on the internet, I find that there
is a node whose node ID is 150. Close
enough to 149, and therefore, I'm going to store
this key value pair 149,80. In this particular node
150. Now, if you're looking for my India trip
video, you know that the unique signature associated with that
is 149, and you will know because of the structure
of the DHT that the place to look for the
signature 149, or the key 149, Is a node whose address
is also equal to this key value or close enough.
150 is the one that is close enough so you'll
go to 150 and from 150 you will get this
key value pair, and once you get this key value pair,
you will know that all the content is stored in node 80 and
then you come to me and get the content from me. This is
how content distribution networks exploit the
distributed hash table technology to store content
on the internet. So that they can be discovered and disseminated to the users.