Peer-to-peer and agent-based computing P2P Algorithms.

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

Virtual Trunk Protocol
Requirements Engineering Process
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
C. Mastroianni, D. Talia, O. Verta - A Super-Peer Model for Resource Discovery Services in Grids A Super-Peer Model for Building Resource Discovery Services.
0 - 0.
So far Binary numbers Logic gates Digital circuits process data using gates – Half and full adder Data storage – Electronic memory – Magnetic memory –
Peer-to-peer and agent-based computing Basic Theory of Agency (Contd)
Construction process lasts until coding and testing is completed consists of design and implementation reasons for this phase –analysis model is not sufficiently.
1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Peer-to-Peer and Social Networks An overview of Gnutella.
Chapter 10 Real world security protocols
1 Wireless and Mobile Networks Part 2 November 25, 2008 Department of Electrical and Computer Engineering University of Western Ontario ECE 436a Networking:
CMPT 401 Dr. Alexandra Fedorova Lecture III: OS Support.
Database System Concepts and Architecture
Lecture 7: Software Design (Part II)
Processes Management.
Executional Architecture
Intelligent Architectures for Electronic Commerce Part 1.5: Symbolic Reasoning Agents.
Peer-to-peer and agent- based computing “Implementation” of Auctions.
EEE 435 Principles of Operating Systems Structure of I/O Software Pt II (Modern Operating Systems & 5.3.4)
CS 240 Computer Programming 1
® Microsoft Office 2010 Browser and Basics.
Chapter 10: The Traditional Approach to Design
Systems Analysis and Design in a Changing World, Fifth Edition
Global States.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Link-State Routing Protocols Routing Protocols and Concepts – Chapter.
INF 123 SW ARCH, DIST SYS & INTEROP LECTURE 12 Prof. Crista Lopes.
Interprocess Communication CH4. HW: Reading messages: User Agent (the user’s mail reading program) is either a client of the local file server or a client.
Remote Procedure Call (RPC)
1 An Overview of Gnutella. 2 History The Gnutella network is a fully distributed alternative to the centralized Napster. Initial popularity of the network.
Developers: Alexey Rastvortsev, Ilya Kolchinsky Supervisors: Roy Friedman, Alex Kogan.
Gnutella 2 GNUTELLA A Summary Of The Protocol and it’s Purpose By
Rheeve: A Plug-n-Play Peer- to-Peer Computing Platform Wang-kee Poon and Jiannong Cao Department of Computing, The Hong Kong Polytechnic University ICDCSW.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
Erlang concurrency. Where were we? Finished talking about sequential Erlang Left with two questions  retry – not an issue; I mis-read the statement in.
ICMP: Internet Control Message Protocol used by hosts, routers, gateways to communication network-level information –error reporting: unreachable host,
Gnutella, Freenet and Peer to Peer Networks By Norman Eng Steven Hnatko George Papadopoulos.
1 Seminar: Information Management in the Web Gnutella, Freenet and more: an overview of file sharing architectures Thomas Zahn.
1CS 6401 Peer-to-Peer Networks Outline Overview Gnutella Structured Overlays BitTorrent.
Fundamentals of Python: From First Programs Through Data Structures
P2P File Sharing Systems
Freenet. Anonymity  Napster, Gnutella, Kazaa do not provide anonymity  Users know who they are downloading from  Others know who sent a query  Freenet.
1 Napster & Gnutella An Overview. 2 About Napster Distributed application allowing users to search and exchange MP3 files. Written by Shawn Fanning in.
Introduction Widespread unstructured P2P network
ECE 544 Project3 Kush Patel Siddharth Paradkar Ke Dong.
Gnutella2: A Better Gnutella?
1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services.
CMPT 471 Networking II Address Resolution IPv4 ARP RARP 1© Janice Regan, 2012.
© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology The Client-Server Architecture A distributed system is a system in.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
FastTrack Network & Applications (KaZaA & Morpheus)
1 Peer-to-Peer Technologies Seminar by: Kunal Goswami (05IT6006) School of Information Technology Guided by: Prof. C.R.Mandal, School of Information Technology.
Client-Server Model of Interaction Chapter 20. We have looked at the details of TCP/IP Protocols Protocols Router architecture Router architecture Now.
The Problems HTTP is disconnected So many database vendors Create a simple consistent versatile interface on the data Look at ADO.NET classes OleDb SQL.
Chapter 22 Bootstrap and Auto configuration (DHCP) History of Bootstrap -Bootstrap is used to assign IP address to the computer. -Constant changes in the.
HTTP evolution - TCP/IP issues Lecture 4 CM David De Roure
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Web Services An Introduction Copyright © Curt Hill.
INTERNET TECHNOLOGIES Week 10 Peer to Peer Paradigm 1.
A PC Wakes Up A STORY BY VICTOR NORMAN. Once upon a time…  a PC (we’ll call him “H”) is connected to a network and turned on. Aside: The network looks.
Marco Conti, Enrico Gregori, Giovanni Turi Istituto di Informatica e Telematica – CNR MobiHoc ‘ Jongsoo Lee
Last Class: Introduction
An overview of Gnutella
Introduction to Computer Programming
Peer-to-Peer and Social Networks
Coding Concepts (Basics)
COMPUTER NETWORKS PRESENTATION
Presentation transcript:

peer-to-peer and agent-based computing P2P Algorithms

peer-to-peer and agent-based computing – wamberto vasconcelos 2 A word on algorithms An algorithm is a description of a procedure: –Not an implementation (but close to it) –Not in any particular programming language (but close to some/many of them) An algorithm must –Have a finite number of steps –Each step must be computable within a finite amount of time –Have all the information it needs to work –Describe all circumstances in which it may run Algorithms may need to run forever –Loops are not always bad (e.g., your OS) –If some algorithms stop then problems arise...

peer-to-peer and agent-based computing – wamberto vasconcelos 3 A word on algorithms (2) Example: algorithm to multiply two matrices 1.Read matrix A 2.Read matrix B 3.C := A B 4.return C

peer-to-peer and agent-based computing – wamberto vasconcelos 4 A word on algorithms (3) Example: algorithm to multiply two matrices Input: Matrices A p ×q and B q ×r (with dimensions p ×q and q ×r) Output: Matrix C p ×r resulting from the product A B MatrixMultiply(A p ×q, B q ×r ) 1.for i 1 to p 2.for j 1 to r 3. C [i, j] 0 4. for k 1 to q 5. C [i, j] C [i, j] + A[i, k] B [k, j] 6.return C

peer-to-peer and agent-based computing – wamberto vasconcelos 5 A word on algorithms (4) How much detail is needed? –Depends on who will read the algorithm! –Reading a matrix is not a big problem... However, if you were asked to propose an algorithm to read a matrix, you would need to –Propose a representation for the matrix (line by line, or row by row, XML, etc.) –Use known constructs (if-then-else, while loops, etc.) to define the logic of the algorithm Ultimately, understanding an algorithm is a human process and hence subjective –What you understand easily may not be so easy for others to understand –More details may be required, depending on who will consume the algorithm

peer-to-peer and agent-based computing – wamberto vasconcelos 6 A word on P2P algorithms P2P algorithms are distributed –Some of their information comes from other (similar) algorithms –No shared memory, though! –The only means to obtain information is message- passing P2P algorithms: –Follow protocols (types & order of messages) –Have some logic to decide What to do when/if a message is received When to send messages

peer-to-peer and agent-based computing – wamberto vasconcelos 7 Algorithm for the discovery of peers Flooded request model: –How does a peer join a network? –What information does it need? –What messages does it send/receive? –Does the discovery process ever stop? The peer who initiated may stop, but will this perturbation create a ripple effect in the network which will never end (that is, itll go on forever)? Very important: –Unreliable communication – people you send messages to may never reply to you –Dont count on anyone!

peer-to-peer and agent-based computing – wamberto vasconcelos 8 Algorithm for discovery of peers (2) First attempt 1.begin 2. send ping message to peers 3. receive replies 4. build a list of neighbours 5.end Which peers? How do we know who is in the network? What if there are no replies?

peer-to-peer and agent-based computing 9 Gnu Cache Discovery of peers via host caches User A 1. User A connects to GnuCache to request available servents 2. GnuCache returns a servent (User B) to connect to Gnutella Network User B User X User C 3. User A contacts User B with ping 4. User B responds with pong 5. User B forwards As ping to User X 7. User X forwards As ping to User C 6. User X sends pong back to A via B; User X becomes As neighbour 8. User C sends pong back to A via X and B; User C becomes As neighbour

peer-to-peer and agent-based computing – wamberto vasconcelos 10 Discovery of peers via host caches (2) Assumptions: –There is a server you first contact to join the P2P network (is this cheating?) –All peers will work exactly like you (more on this later...)

peer-to-peer and agent-based computing – wamberto vasconcelos 11 Discovery of peers via host caches (3) 1.Introduce yourself to the server 2.Receive N peer ids (name, IP and Port No.) 3.Send ping message to all peers in the list 4.Receive pong messages 5.End (with N neighbours) Issues: –What if there are no peers (network is empty)? –What if no-one replies? –What if you get a ping message (instead of a pong)? –What if you get a pong message from someone you did not send a ping message to? –What if you keep getting pong messages after you completed your desired N neighbours?

peer-to-peer and agent-based computing – wamberto vasconcelos 12 Discovery of peers via host caches (5) Second attempt 1.send message to cache/server 2.receive N peer ids (name, IP and Port No.) 3.PIds {P 1, P 2,..., P n } // PIds: set of peers 4.for each P in PIds 1.send ping message to P 5.Ns {} // initialise set of neighbours 6.do 1.Receive pong from P 2.Ns Ns {P} 7.until |Ns| = 8 // with 8 neighbours...

peer-to-peer and agent-based computing – wamberto vasconcelos 13 Discovery of peers via host caches (5) Third attempt 1.send message to cache/server 2.receive N peer ids (name, IP and Port No.) 3.PIds {P 1, P 2,..., P n } // PIds is the set of peer ids/info 4.for each P in PIds 1.send ping message to P 5.Ns {} // initialise set of neighbours 6.do 1.if a message M (from P) arrives // non-blocking receive 2.case of M 1.pong 1.if M from someone in PIds then Ns Ns {P} 2.else ignore M 2.ping 1.send pong back to P and Ns Ns {P} 3.otherwise 1.ignore M 7.until |Ns| = 8 or fedup

peer-to-peer and agent-based computing – wamberto vasconcelos 14 Pending issues If it finishes with fedup and Ns = {} –No neighbours... –Change the loop to at least 1 peer AND fedup If it finishes with fedup and Ns {} –Peer goes on to search/offer files, –Ping message may arrive (forward to Ns) –Pong messages may also arrive (add to Ns)

peer-to-peer and agent-based computing – wamberto vasconcelos 15 Searching for files Parameters –Set of neighbours Ns –Set of file names Fs2Get –Set of files Fs2Share

peer-to-peer and agent-based computing – wamberto vasconcelos 16 Searching for files Share(Ns, Fs2Get, Fs2Share) 1.for all N Ns do // request to all my neighbours 1.for all F Fs2Get do // the files I want to get 1.send query to N for F 2.while true do // loop forever 1.if a message M arrives // non-blocking receive message 2.case M of 1.query-ref // a reply to one of my requests? 1.if N and F of query-ref one I sent then download F 2.else ignore M 2.query // someone is asking me for files 1.if F of query in Fs2Share then send query-ref back 2.else for each N Ns do forward query to N 3.ping // someone is pinging me! 1.if |Ns| < 8 then send pong back and Ns Ns {P} 2.else for each N Ns do forward ping to N 4.pong // someone is ponging me! 1.if |Ns| < 8 and I had pinged this peer, then Ns Ns {P} 2.else ignore M 3.end

peer-to-peer and agent-based computing – wamberto vasconcelos 17 Pending issues What about TTL (Time-to-live)? What if the algorithm were to be embedded in a GUI? –New files (to share) coming in –New request of files coming in What if all your neighbours are disconnected? –How could we keep a record on whos connected? –How could the information flow on the network?

peer-to-peer and agent-based computing – wamberto vasconcelos 18 Lessons Distributed algorithms share information via message-passing –No global variables and no central control –Realistic scenarios – no complete information nor full control! Algorithms should be, as much as possible –Loosely coupled (no blocking commands) –Information-light (messages carry all info) Exceptions in P2P: Peer should ignore the event Peers are stateless –They dont remember what they have done –All they need to know to decide what to do is encoded in the message