so we're just going to talk for a moment
about peer-to-peer architectures and how
they're different and some advantages
that they have the one of the main
differences in a peer-to-peer
architecture is that there's no always
on uber fast
uber uber ha storage server it's kind of
like everybody's a server and so
everybody's the server and everybody's a
client in the end system can communicate
with any other end system arbitrarily
they can connect will bring in a
client-server scenario the in the end
systems only connect to a server which
is usually just in one spot it has a lot
greater resources in terms of speed and
capacity one of the challenges that and
properties of this p2p architecture is
that there may be changes in the
connectivity of the devices right where
if you you might move your computer from
one place to another place and get a
different IP address when you go to a
different network that doesn't happen to
a server because the server always stays
though hmm one thought we're going to
consider what's that's a file one
problem that we're going to consider is
file distribution and that means how do
we get this file from this computer to
all the other computers so how do we
download a file and get it our one copy
on my computer to all the computers in
this system so what we're going to do is
we're going to see we're going to
mathematically model that in a
client-server scenario and in a
peer-to-peer scenario and see how they
compare based on some different factors
so we're going to call you sub s the
server upload speed we're going to call
you so by the upload bandwidth of each
of the peers with each of the hosts
those regular computers and we're going
to call D sub I the download speed for
each of the computers
do these make sense well we're going to
sell you out in big in total clients in
the system okay so given this set up
what are the limiting factors so
depending on what these values are we're
gonna have different things that could
occur um
one situation is that kind of the
bottleneck what could be the bottlenecks
in this situation can you think about it
like that
well actually what we're just talking
about client server did I say that
sorry okay so that's a great response
because I didn't clear so let's just
consider client server first all right
client server should be the simple
scenario there's clients and servers so
what factors would in a client-server
setup cause the system to be
bottlenecked well we're only sending the
file from the server to all the clients
the client download speeds may be a
factor so what's that and how fast the
server so if we had really fast clients
but the server has a slow upload speed
the server's can't get out the upper
body so we kind of have two different
scenarios and that's what this equation
represents so the distribution time in a
client-server scenario is whichever one
of these is bigger we've got these two
quantities okay the first quantity these
are easy to understand the first
quantity is related to the server how
many bits does the server have to put
out there well it has to put out the
whole file that's F in Tom's because
it's got to send a complete copy of the
file to every single
client but the server has to send the
file the whole file in Tom's so this is
how many bits and s to send in F and how
fast is this and it sends at a speed it
up close at a speed of us so in F us is
the speed that at the time that's going
to take the server to send that file out
that many times does that make sense so
if the server is the slow part then this
is going to be the bigger time and it's
that's going to determine how much time
it takes to get the file distributed the
other hand on the other hand it might be
that we just have a super slow client
and he's holding everybody back it makes
sense if you've got one got out here
that can only download it you know a 56k
modem then the server can send it out to
everybody but this guy's he's just still
waiting on this guy to finish that makes
sense so we found the minimum di that's
the minimum download speed of all of the
clients and we take the file size
divided by that speed so this is the
time that takes the slowest client to
download the file once hmm
so those are two potential bottlenecks
whichever one of those is bigger is what
the time to distribute the file is in a
client-server scenario does that math
make sense it's pretty straightforward
I'm so depending on what these values
are that could be it could look very
different but this is a scenario that
models it so now we're going to do the
same thing in client in and peer-to-peer
so we're gonna have these two
constraints and peer to peer which is
how long does it take to upload the file
to everybody and how long does it take
this slowest got to download it but we
have one more scenario right because in
peer to peer everybody's a server clear
what that is No
let's look at it like this so if
everybody can be a client and a server
then the server just has to upload it
once so that somebody else gets a copy
of it and then that guy can upload it to
somebody else makes sense this whole
setup does assume that all the computers
just magically know who to connect to
and in actuality that couldn't happen
right they'd have to know I need to talk
to this guy to get this part of the file
but we're going to kind of assume it in
an ideal case so now we have three
quantities the first quantity is this is
how long it takes the server to upload
the file once so that's the full file F
mints divided by the server's upload
speed so this is an improvement from
before because the server doesn't have
to upload it in Tom's just has to do it
once and then sharing the load of the
additional distributions to other
clients we've got the same one which is
whoever the slowest client is the has to
download the file once so that's F
divided by the minimum di and the new
one that's interesting to us is we know
that the file has to be distributed from
every person to all the bits have to be
distributed to everyone so the total
number of bits is in F but we get to
share the upload capacity of the whole
network and the upload capacity of the
network is the server's upload speed
plus a sum of all the upload speeds of
all the clients so this is what makes it
peer-to-peer is that we don't just have
to upload it from the server and that's
the only choice but everybody can upload
and that means other people could
download from that other sort of other
clients other people could download from
that other clients upload and in that
case where that client is acting like a
server that's peer-to-peer so this is
the interesting part is that we are as
we add more computers to the network in
the client-server scenario that just
gets works right because the more you
have the more times you have to
distribute that's more load on the
server whereas in a p2p scenario the
more servers that the more clients that
you add yeah you have to distribute
more but you get their capacity also
added in there upload capacity that
makes sense so kind of you get this
trade-off effect so now I'm going to
show you this graph which they authors
chose some reasonable amounts for F
divided by U so that's the time that
takes the the download time for a client
they're gonna assume for this that all
clients have the same download speed so
all the D is and all that you learn all
the UI's are the same so it takes if
after about about you is one hour and us
is ten use so that the server has 10
times the upload speed of the clients
and we're assuming that the minimum
download speed is greater than the
upload speed of the server which that's
probably reasonable too then this is the
graph that we get which should make
sense that as we add more and more
devices to the system right the client
server continues up linearly all right
let's go back and look at that equation
to make sense of that but as this gets
as we had more and more clients which
one of these terms dominates in M right
there's no end in this so it's gonna be
kind of fixed with respect to n so as we
add more and more clients this thing
just blows up right it just increases
linearly because there's a in there what
do we see here linear increase make
sense right so in a client-server
scenario the time to distribute this
file that's the minimum distribution
time increases linearly in the number of
computers in the network however we get
this nice looking chart here for
peer-to-peer where as we add more
systems to the network the minimum
distribution time doesn't go up linearly
and why does it not go up linearly and
kind of sum up we said hmm
sharing the bandwidth of sharing that
upload responsibility
so that's peer-to-peer and you see how
with a large number of n we get a nice
payoff well and with these particular
value stud does that make sense so this
kind of shared responsibility and
sharing the bandwidth and often saving
time right making it more efficient to
distribute this file is why p2p has been
popular