M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and...
-
Upload
mirabelle-lamotte -
Category
Documents
-
view
106 -
download
2
Transcript of M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and...
![Page 1: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/1.jpg)
M2-Internet 1
Chapter 2: Application layer
2.1 Principles of network applications
2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail
SMTP, POP3, IMAP
2.5 DNS
2.6 P2P applications 2.7 Socket
programming with UDP
2.8 Socket programming with TCP
H. Fauconnier
![Page 2: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/2.jpg)
M2-Internet 2
P2P file sharing
Example Alice runs P2P client
application on her notebook computer
Intermittently connects to Internet; gets new IP address for each connection
Asks for “Hey Jude” Application displays
other peers that have copy of Hey Jude.
Alice chooses one of the peers, Bob.
File is copied from Bob’s PC to Alice’s notebook: HTTP
While Alice downloads, other users uploading from Alice.
Alice’s peer is both a Web client and a transient Web server.
All peers are servers = highly scalable!
H. Fauconnier
![Page 3: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/3.jpg)
M2-Internet 3
Pair à pair
quelques principes les nœuds offrent des fonctionnalités identiques (pair) volatilité importante (apparition/disparition) grande échelle et dispersion géographique dynamicité importante
applications partage de fichiers messagerie téléphone (Skype) …
différent du client-serveur
H. Fauconnier
![Page 4: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/4.jpg)
M2-Internet 4
Partage de fichiers
Communication basée sur deux types de protocoles différents découverte et localisation des fichiers
• recherche des données• mettre en contact deux (ou plusieurs) utilisateurs
parmi des millions téléchargement des fichiers
H. Fauconnier
![Page 5: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/5.jpg)
M2-Internet 5
Découverte-localisation
Base publication des fichiers partagés avec des
méta-données découverte des fichiers disponibles localisation des sources à télécharger (En plus
• identification des doublons• détection des fichiers corrompus• forums)
H. Fauconnier
![Page 6: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/6.jpg)
M2-Internet 6
Architecture du réseau
Centralisée: un serveur ou un cluster sur lequel les clients se connectent (Napster)
Décentralisée: il n'y a que des clients (Gnutella)
Faiblement centralisée: des clients et des serveurs (Edonkey)
Hybride: les clients peuvent devenir des serveurs
H. Fauconnier
![Page 7: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/7.jpg)
M2-Internet 7
P2P: problems with centralized directory
Single point of failure Performance
bottleneck Copyright
infringement
file transfer is decentralized, but locating content is highly centralized
H. Fauconnier
![Page 8: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/8.jpg)
M2-Internet 8
Pure P2P architecture
no always-on server arbitrary end systems
directly communicate peers are intermittently
connected and change IP addresses
Three topics: File distribution Searching for information Case Study: Skype
peer-peer
H. Fauconnier
![Page 9: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/9.jpg)
M2-Internet 9
File Distribution: Server-Client vs P2PQuestion : How much time to distribute file
from one server to N peers?
us
u2d1 d2u1
uN
dN
Server
Network (with abundant bandwidth)
File, size F
us: server upload bandwidth
ui: peer i upload bandwidth
di: peer i download bandwidth
H. Fauconnier
![Page 10: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/10.jpg)
M2-Internet 10
File distribution time: server-client
us
u2d1 d2u1
uN
dN
Server
Network (with abundant bandwidth)
F server
sequentially sends N copies: NF/us time
client i takes F/di
time to download
increases linearly in N(for large N)
= dcs = max { NF/us, F/min(di) }i
Time to distribute F to N clients using
client/server approach
H. Fauconnier
![Page 11: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/11.jpg)
M2-Internet 11
File distribution time: P2P
us
u2d1 d2u1
uN
dN
Server
Network (with abundant bandwidth)
F server must send one
copy: F/us time
client i takes F/di time to download
NF bits must be downloaded (aggregate) fastest possible upload rate: us + ui
dP2P = max { F/us, F/min(di) , NF/(us + ui) }i
H. Fauconnier
![Page 12: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/12.jpg)
M2-Internet 12
0
0.5
1
1.5
2
2.5
3
3.5
0 5 10 15 20 25 30 35
N
Min
imu
m D
istr
ibut
ion
Tim
e P2P
Client-Server
Server-client vs. P2P: example
Client upload rate = u, F/u = 1 hour, us = 10u, dmin ≥ us
H. Fauconnier
![Page 13: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/13.jpg)
Quelques exemples
M2-Internet 13H. Fauconnier
![Page 14: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/14.jpg)
M2-Internet 14
Query flooding: Gnutella
fully distributed no central server
public domain protocol
many Gnutella clients implementing protocol
overlay network: graph edge between peer X
and Y if there’s a TCP connection
all active peers and edges is overlay net
Edge is not a physical link
Given peer will typically be connected with < 10 overlay neighbors
H. Fauconnier
![Page 15: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/15.jpg)
M2-Internet 15
Gnutella: protocol
Query
QueryHit
Query
Query
QueryHit
Query
Query
QueryHit
File transfer:HTTP
Query messagesent over existing TCPconnections peers forwardQuery message QueryHit sent over reversepath
Scalability:limited scopeflooding
H. Fauconnier
![Page 16: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/16.jpg)
M2-Internet 16
Gnutella: Peer joining
1. Joining peer X must find some other peer in Gnutella network: use list of candidate peers
2. X sequentially attempts to make TCP with peers on list until connection setup with Y
3. X sends Ping message to Y; Y forwards Ping message.
4. All peers receiving Ping message respond with Pong message
5. X receives many Pong messages. It can then setup additional TCP connections
H. Fauconnier
![Page 17: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/17.jpg)
M2-Internet 17
Exploiting heterogeneity: KaZaA
Each peer is either a group leader or assigned to a group leader. TCP connection
between peer and its group leader.
TCP connections between some pairs of group leaders.
Group leader tracks the content in all its children.
ordinary peer
group-leader peer
neighoring re la tionshipsin overlay network
H. Fauconnier
![Page 18: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/18.jpg)
M2-Internet 18
KaZaA: Querying
Each file has a hash and a descriptor Client sends keyword query to its group
leader Group leader responds with matches:
For each match: metadata, hash, IP address If group leader forwards query to other
group leaders, they respond with matches
Client then selects files for downloading HTTP requests using hash as identifier sent
to peers holding desired file
H. Fauconnier
![Page 19: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/19.jpg)
M2-Internet 19
KaZaA tricks
Limitations on simultaneous uploads Request queuing Incentive priorities Parallel downloading
H. Fauconnier
![Page 20: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/20.jpg)
M2-Internet 20
File distribution: BitTorrent
tracker: tracks peers participating in torrent
torrent: group of peers exchanging chunks of a file
obtain listof peers
trading chunks
peer
P2P file distribution
H. Fauconnier
![Page 21: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/21.jpg)
M2-Internet 21
BitTorrent (1)
file divided into 256KB chunks. peer joining torrent:
has no chunks, but will accumulate them over time
registers with tracker to get list of peers, connects to subset of peers (“neighbors”)
while downloading, peer uploads chunks to other peers.
peers may come and go once peer has entire file, it may (selfishly) leave
or (altruistically) remainH. Fauconnier
![Page 22: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/22.jpg)
M2-Internet 22
BitTorrent (2)
Pulling Chunks at any given time,
different peers have different subsets of file chunks
periodically, a peer (Alice) asks each neighbor for list of chunks that they have.
Alice sends requests for her missing chunks rarest first
Sending Chunks: tit-for-tat Alice sends chunks to four
neighbors currently sending her chunks at the highest rate re-evaluate top 4 every 10
secs every 30 secs: randomly select
another peer, starts sending chunks newly chosen peer may join
top 4 “optimistically unchoke”
H. Fauconnier
![Page 23: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/23.jpg)
M2-Internet 23
BitTorrent: Tit-for-tat(1) Alice “optimistically unchokes” Bob
(2) Alice becomes one of Bob’s top-four providers; Bob reciprocates(3) Bob becomes one of Alice’s top-four providers
With higher upload rate, can find better trading partners & get file faster!
H. Fauconnier
![Page 24: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/24.jpg)
Rechercher
M2-Internet 24H. Fauconnier
![Page 25: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/25.jpg)
M2-Internet 25
Recherche par diffusion simple les clients ne publient rien et ne font
que des requêtes une requête est diffusée à tous les clients:
• avec une limite de portée (TTL)• en évitant les cycles (identification unique de la
requête, la requête contient le son chemin …)• recherche en profondeur ou en largeur
un client répond par le chemin emprunté par la requête
H. Fauconnier
![Page 26: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/26.jpg)
M2-Internet 26
Filtres de Bloom
Principe:un ensemble E de n élémentsune fonction de hachage de E sur {1,m}un vecteur de m bits (le filtre) tester si x appartient à E
• si le bit h(x)=0 non• si le bit h(x)=1 oui (mais peut être faux-
positif)on peut diminuer les faux positifs en
utilisant plusieurs fonctions de hachage• Pour m et n donné le k optimal est m/n ln 2 et la
probabilité de faux-positifs est (1/2)k
H. Fauconnier
![Page 27: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/27.jpg)
Filtres de Bloom
Utilisation: Si le client possède le document les bits des
mot-clés correspondant sont à 1 Les clients s'échangent les filtres Les requêtes ne sont propagées que vers les
clients qui ont le bon filtre
M2-Internet 27H. Fauconnier
![Page 28: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/28.jpg)
M2-Internet 28
Recherche par indexation
Les clients publient les fichiers qu'ils partagent sur les serveurs sur lesquels ils sont connectés
Les serveurs indexent les descriptions des fichiers
Les clients envoient des requêtes aux serveurs pour trouver les fichiers et les localiser
H. Fauconnier
![Page 29: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/29.jpg)
M2-Internet 29
Recherche par DHT
Distributed hash table:Des nœuds et des données
• Un espace de clés (exemple clés de 160 bits)
• Un répartition des clés (qui possède les clés?)
• Un "overlay" de connexion entre les nœuds pour qui permet de savoir quel nœud possède quelle clé.
H. Fauconnier
![Page 30: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/30.jpg)
DHT
Stocker un fichier f de contenu data: Un hachage (SHA1 par exemple) produit
une clé de 160 bits k à partir du nom f Par un put(k, data) sur l'overlay trouver le
nœud responsable pour la clé k et lui transférer les donnés
Rechercher un fichier f: Par hachage (SHA1) obtenir la clé k associée
à f Rechercher sur l'overlay le nœud
responsable de k et récupérer les données
M2-Internet 30H. Fauconnier
![Page 31: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/31.jpg)
DHT: hachage consistant
On associe à chaque document (ou mot-clé) un identificateur unique (hachage)
On associe à chaque client un identificateur unique de même taille ID
On définit une métrique pour définir la distance d entre les clés-ID
Un nœud ID i possède les clés j telles que d(j,i) est minimal parmi les ID (chaque nœud possède les clés les plus proches)
Un retrait ou l'ajout d'un nœud ne modifie que les voisins
M2-Internet 31H. Fauconnier
![Page 32: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/32.jpg)
Distributed Hash Table (DHT)
DHT = distributed P2P database Database has (key, value) pairs;
key: ss number; value: human name key: content type; value: IP address
Peers query DB with key DB returns values that match the key
Peers can also insert (key, value) peers
H. Fauconnier 32M2-Internet
![Page 33: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/33.jpg)
DHT Identifiers
Assign integer identifier to each peer in range [0,2n-1]. Each identifier can be represented by n bits.
Require each key to be an integer in same range.
To get integer keys, hash original key. eg, key = h(“Led Zeppelin IV”) This is why they call it a distributed “hash” table
H. Fauconnier 33M2-Internet
![Page 34: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/34.jpg)
How to assign keys to peers?
Central issue: Assigning (key, value) pairs to peers.
Rule: assign key to the peer that has the closest ID.
Convention in lecture: closest is the immediate successor of the key.
Ex: n=4; peers: 1,3,4,5,8,10,12,14; key = 13, then successor peer = 14 key = 15, then successor peer = 1
H. Fauconnier 34M2-Internet
![Page 35: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/35.jpg)
DHT
exemple Chord: points sur un cercle la distance est la longueur
de l'arc orienté. L'espace des clés est décomposé en segments. Si i et j sont des nœuds adjacents, i a toutes les clés comprises entre i et j
Anneau de taille 2m (clés de 0 à 2m-1) Hachage par SHA1 (ID-clés réparties de façon
uniforme) Chaque nœud maintient une liste de K
successeurs et K prédécesseurs sur l'anneau
M2-Internet 35H. Fauconnier
![Page 36: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/36.jpg)
ChordChercher le successeur de k pour nœud n: Soit C(k) le premier nœud successeur de
(n+ 2 k-1) mod 2 m
Si k appartient à ]n, successor]: trouvé Sinon transmettre la demande au plus près
prédecesseur f de k dans C(k)
Si les nœuds sont répartis uniformément on y arrive en m étapes (log(2m)) à chaque appel la distance entre le nœud et k
M2-Internet 36H. Fauconnier
![Page 37: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/37.jpg)
Circle DHT
0001
0011
0100
0101
10001010
1100
1111
Who’s resp for key 1110 ?
I am
O(N) messageson avg to resolvequery, when thereare N peers
1110
1110
1110
1110
1110
1110
Define closestas closestsuccessor
H. Fauconnier 37M2-Internet
![Page 38: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/38.jpg)
Circular DHT with Shortcuts
Each peer keeps track of IP addresses of predecessor, successor, short cuts.
Reduced from 6 to 2 messages. Possible to design shortcuts so O(log N) neighbors,
O(log N) messages in query
1
3
4
5
810
12
15
Who’s resp for key 1110?
H. Fauconnier 38M2-Internet
![Page 39: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/39.jpg)
Peer Churn
Peer 5 abruptly leaves Peer 4 detects; makes 8 its immediate successor;
asks 8 who its immediate successor is; makes 8’s immediate successor its second successor.
What if peer 13 wants to join?
1
3
4
5
810
12
15
•To handle peer churn, require each peer to know the IP address of its two successors. • Each peer periodically pings its two successors to see if they are still alive.
H. Fauconnier 39M2-Internet
![Page 40: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/40.jpg)
M2-Internet 40
Téléchargement
protocoles ad-hoc (Edonkey, Bittorrent) ou http
Swarming (essaim) téléchargement d'un fichier en
téléchargeant différentes parties en parallèle depuis plusieurs clients
téléchargement multiple le fichier est décomposé en n blocs calcul du hachage de chaque bloc fichier est identifié par le hachage des blocs
H. Fauconnier
![Page 41: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/41.jpg)
M2-Internet 41
Succès…
www.slyck.com June 19, 2005 - 23:00 Network Users eDonkey2K 4,379,883 FastTrack 2,482,130 Gnutella 1,598,329 Overnet 745,472 DirectConnect 294,255 MP2P 251,137 Filetopia 3,455
H. Fauconnier
![Page 42: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/42.jpg)
M2-Internet 42
Quelques réseaux
Napster (historique) Protocole:
• architecture centralisée• recherche par indexation
Fasttrack clients: Kazaa Mldonkey architecture hybride recherche par indexation et diffusion entre ultrapeers identification faible des fichiers (MD5 sur 300ko puis
hachage sur 32 bits) http (+ swarming)
H. Fauconnier
![Page 43: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/43.jpg)
M2-Internet 43
Quelques réseaux
Edonkey Clients: Edonkeys, Emule protocole
• faiblement centralisée• recherche par indexation TCP• recherche multi-serveurs par UDP• téléchargement en duplex avec bitmaps, streaming et
swarming (Bittorrent dans les dernières versions)• système de crédits pour inciter au partage
Overnet/Kad télécharement Edonkey décentralisé DHT (Kademlia)
H. Fauconnier
![Page 44: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/44.jpg)
M2-Internet 44
Quelques réseaux
Gnutella architecture hybride Recherche par diffusion courte (TTL <8) avec filtres
de Bloom Gnutella et Gnutella2 téléchargement par http avec possibilité de swarming
Bittorrent pas de découverte, un fichier .torrent contient les
infos sur le fichier localisation centralisée pour chaque fichier (tracker) téléchargementavec bitmaps
• le client commence à forunir du contenu à ses voisins• au bout d'un certain temps il bloque les voisins qui ne
répondent pas et conserve les quatre meilleurs
H. Fauconnier
![Page 45: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/45.jpg)
M2-Internet 45
Quelques réseaux
Freenet complètement distribué publication par copie recherche par diffusion en profondeur protocole et contenu cryptés documents signés par signature digitale axé sur l'anonymat
H. Fauconnier
![Page 46: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/46.jpg)
M2-Internet 46
P2P Case study: Skype
inherently P2P: pairs of users communicate.
proprietary application-layer protocol (inferred via reverse engineering)
hierarchical overlay with SNs
Index maps usernames to IP addresses; distributed over SNs
Skype clients (SC)
Supernode (SN)
Skype login server
H. Fauconnier
![Page 47: M2-Internet 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail SMTP, POP3, IMAP.](https://reader034.fdocuments.us/reader034/viewer/2022051614/551d9da2497959293b8d272e/html5/thumbnails/47.jpg)
M2-Internet 47
Peers as relays
Problem when both Alice and Bob are behind “NATs”. NAT prevents an
outside peer from initiating a call to insider peer
Solution: Using Alice’s and Bob’s
SNs, Relay is chosen Each peer initiates
session with relay. Peers can now
communicate through NATs via relay
H. Fauconnier