27
CSM13 CSM13 Software Agents Software Agents Seminar 5: Agents and P2P Seminar 5: Agents and P2P Networks Networks [email protected] http://www.computing.surrey.ac.uk/personal/ st/N.Antonopoulos

Agents and P2P Networks

Embed Size (px)

Citation preview

CSM13CSM13

Software AgentsSoftware Agents

Seminar 5: Agents and P2P NetworksSeminar 5: Agents and P2P Networks

[email protected]

http://www.computing.surrey.ac.uk/personal/st/N.Antonopoulos

AcknowledgementsSome of the slides in this presentation are taken or adapted from:

Sebastien Baehni. “Introduction to P2P and the JXTA framework”http://www.ece.rutgers.edu/~parashar/Classes/03-04/ece451-566/slides/p2p.pdf

Frans Kaashoek et al. “Peer-to-Peer computing research: a fad?” http://project-iris.net/talks/dht-toronto-03.ppt

Vinod Muthusamy. “An Introduction to Peer-to-Peer Networks”http://www.eecg.toronto.edu/~jacobsen/mie456/slides/p2p-mie.pdf

Network Architectures

Client/Server Pure Peer-to-Peer• Clients send requests to/via a

central server• Small #messages• Single point of failure• Problem: Extreme scalability

• No central server• Clients connected to

one or more peers• Resilient• Large #messages

Hybrid Peer-to-Peer Networks

• Some nodes act as group managers/routers• More robust than client/server• Potentially lower #messages than pure P2P

Characteristics of a P2P Network• Nodes can act as clients and servers• No centralised server/authority

– In Pure P2P Networks• Network is highly dynamic

– Nodes join and leave regularly• Large-scale

– Potentially millions of nodes• Nodes are autonomous

– But co-operate to share/retrieve resources

Benefits of P2P Networks

• Efficient use of resources• Scalability• Reliability• Ease of administration

but• Increased message costs• More complicated than client/server interaction

The Agent Relationship• How does this relate to agents?

– P2P network platform for mobile agents– Access agents over P2P network– Agents administer P2P network

• P2P Networks are useless if agents, users and applications cannot find resources they require– Queries can be represented as agents

Research Question

How can we efficiently and accurately discover resources and services in a P2P network?

Solution 1: Introduce some centralisationSolution 2: Introduce some structure

“centralisation” and “structure” define two dimensions for classifying P2P networks

Napster• Lists of files are uploaded

to Napster server• Queries contain various

keywords of required file• Server returns IP address

of user machines having the file

• Client chooses user machine and sets up connection to it

• File transfer is direct

NapsterCentralised modelNapster server ensures correct resultsOnly used for finding the location of the files

Scalability bottleneckSingle point of failureDenial of Service attacks possibleLawsuits

Gnutella• Decentralised search – no

central server• Queries are sent to the

neighbour nodes• Neighbours ask their own

neighbours, etc.• Time To Live (TTL) field to

prevent loops• File transfer is direct

Gnutella

Decentralised modelNo single point of failureLess susceptible to denial of service

SCALABILITY (flooding)Cannot ensure correct results: “query

horizon”

KaZaA• Hybrid of Napster and Gnutella• Super-peers act as local search hubs

– Each super-peer is like a constrained Napster server– Automatically chosen based on capacity and availability

• Lists of files are uploaded to a super-peer• Super-peers periodically exchange file lists• Queries are sent to super-peers

Freenet• Ensures anonymity• Decentralised search• Queries are sent to the

neighbour nodes• Neighbours ask their

own neighbours, etc.• The query process is

sequential• Learning ability• Files propagate back

along query route

• Second generation P2P (overlay) networks

• Self-organizing

• Load balanced

• Fault-tolerant

• Guarantees on numbers of hops to answer a query

• Based on a distributed hash table interface

Structured P2P

• Distributed version of a hash table data structure

• Stores (key, value) pairs

• Goal: Efficiently insert/lookup/delete (key, value) pairs

• Each peer stores a subset of (key, value) pairs in the system

• Core operation: Find node responsible for a key• Map key to node• Efficiently route insert/lookup/delete request to this node

Distributed Hash Tables (DHT)

• Node id: m-bit identifier (similar to an IP address)

• Key: sequence of bytes

• Value: sequence of bytes

put(key, value) Store (key,value) at the node responsible for the key

value = get(key) Retrieve value associated with key (from the appropriate node)

DHT Generic Interface

• File sharing

• Databases

• Service discovery

• Chat service

• Publish/subscribe networks

DHT Applications

• Keys mapped evenly to all nodes in the network

• Each node maintains information about only a few other nodes

• Efficient routing of messages to nodes

• Node insertion/deletion only affects a few nodes

DHT Desirable Properties

Node id: m-bit identifier (similar to an IP address)

Key: m-bit identifier (hash of a sequence of bytes)

Value: sequence of bytes

API• insert(key, value)• lookup(key)• update(key, newval)• join(n)• leave()

Chord API

Chord Operation• Nodes form a circle

based on node identifiers

• Each node is responsible in storing a portion of the keys

• Hash function ensures even distribution of keys and nodes in the circle

Chord Operation

Chord Operation

• Lookup the furthest node that precedes the key

• Query reaches target node in O(logN) hops

Chord PropertiesIn a system with N nodes and K keys:

Each node manages at most K/N keysBounded routing information stored in every

nodeLookups resolved with O(logN) hops

Poor network locality

Network LocalityNodes close on ring can be far in the network

Issues in P2P/Agents

• P2P applications cannot (usually) communicate with each other

• Agent collaboration over P2P networks• Enhancements to existing P2P protocols using

agents• Enhance agent co-ordination schemes using

P2P co-ordination mechanisms• Self organisation of P2P networks

Summary • P2P can be used for sharing resources• Removes need for central management• Large scale, dynamic networks• Efficient information organisation and retrieval• P2P can enhance agent systems• Agents can enhance P2P• Focus gradually moves towards the coordinated

use of versatile, distributed computing resources