Top Banner
Revision Lecture
36

Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

Mar 28, 2015

Download

Documents

Madeline Byrd
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

Revision Lecture

Page 2: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

2

Topics• Peer-to-peer computing

– Algorithms & issues– Gnutella– Scalability– Security– Freenet– JXTA– BitTorrent

• Agent-based computing– Agent communication– Theory of agency– Game theory– Agreements– Voting– Reverse auctions

Page 3: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

3

Peer-to-peer: Gnutella• How does it work?• What are hops and TTLs?• How are peers discovered via host caches?

Page 4: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

4

Peer-to-peer: Scalability• In what ways are Napster’s centralised directory

and Gnutella’s host caches similar?• How many messages does it take for a file to be

found in a network (with and without super nodes)• Topologies

Page 5: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

5

Peer-to-peer: BitTorrent• How does it work?• What’s “file swarming”?• How are files stored and downloaded?• Advantages and disadvantages?

Page 6: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

6

Peer-to-peer: Freenet• Freenet

– What’s its main difference (w.r.t. other P2P systems)?– Why is security so important in Freenet?– What is document routing? – How does document routing work?

Page 7: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

7

Peer-to-peer: sample questionExplain what the Flooded Request Model for Peer-to-Peer computing is and discuss two of its disadvantages. (2006 paper, 5 marks)

Page 8: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

8

Peer-to-peer: sample answer• Explain what the Flooded Request Model for Peer-

to-Peer computing is and discuss two of its disadvantages. (2006 paper, 5 marks)– Describe peers “passing on” requests to their neighbours

if they do not have the resource asked, mention TTL, mention Gnutella

– Disadvantages:• No guarantee as to how long a search will take;• High bandwidth required to process a search query

Page 9: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

9

ABC: Preliminaries• Software agents vs. conventional software

– Autonomy (little or no human intervention)– Proactiveness (does things without being prompted)– Communication

• Software agents vs. Artificial Intelligence– Related, but not the same

• Agents:– Reflex– Model-based reflex– Model-based utility-based agent

• Intentional stance

Page 10: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

10

ABC: Tools, languages and case studies• Do we need special agent IDEs?

– Communication, visualisation, XML parser, etc.– Was JADE+Eclipse any good?– No need to memorise all the tools we saw…

• Agent-oriented programming– Features needed to program agents (messages)– Are special agent languages needed?

Page 11: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

11

ABC: Agent communication• What’s needed for two agents to communicate?

– Shared syntax– Shared meaning (ontologies)– Shared protocols (types and order of messages)

• Agent communication languages:– Performatives (speech acts)– KQML– FIPA-ACL– Importance of industrial standards

Page 12: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

12

ABC: Agent communication (cont’d)• Protocols:

– Not the same as a communication language!– Types and order of messages (and exceptions)

• Formalisms to represent protocols– Finite automata (pros and cons)– AUML (pros and cons)– Dooley graphs (pros and cons)– Why not Java? Why bother representing protocols?

• Standardised FIPA protocols

Page 13: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

13

ABC: Agent communication (cont’d)• Discuss 3 advantages that AUML has over Finite

Automata to represent conversations between agents, and outline 3 weaknesses of AUML (2006, 6 marks)– 1 mark for each advantage of AUML over Finite

Automata; 1 for each weakness• Advantages:

– AUML is familiar to software engineers– Availability of UML design tools– AUML captures multithreaded agent communication– Communication with all agents taking on some role may

be represented

Page 14: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

14

ABC: Agent communication (cont’d)• Discuss 3 advantages that AUML has over Finite

Automata to represent conversations between agents, and outline 3 weaknesses of AUML (2006, 6 marks)

• Weaknesses:– No existential quantification over agent groups– No representation of evolution of conversation– Only legal moves, no exception handling– Scalability: large conversations can be complex (a danger

of diagram spaghetti)– Maintenance difficulties

Page 15: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

15

ABC: Agent communication (cont’d)• Design a mechanism whereby a broker agent can

manage the allocation of tasks to agents:– Tasks are assumed to be independent (i.e. they can be

executed in parallel without interference) and identical (i.e. they are all the same type of task).

– When requested by the broker, agents will submit proposals to process tasks containing the following information:

• an integer max indicating the maximum number of independent tasks that the agent is prepared to process before the deadline set by the broker in its call for proposals, and

• a cost indicating the price that the broker must pay per task that is allocated to that agent.

– The broker then decides which sets of tasks to be allocated to which agents.

– The agents selected deliver task outputs for those that are complete, and report failure for those tasks that are not complete by the deadline set by the broker.

– Finally, payments are made for each completed task

Page 16: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

16

ABC: Agent communication (cont’d)• Describe protocol for interaction between the

broker and the participating agents.

Page 17: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

17

ABC: Agent communication (cont’d)• What are agent communication languages (ACLs)?• Why are ACLs important for software agents and

multi-agent systems?• How do ACLs relate with communication protocols?• Define the English Auction protocol using one of the

representations for agent communication protocols seen in our lectures

• List one advantage and one disadvantage of the representation you chose in the previous item

Page 18: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

18

ABC: Basic theory of agency• States and actions• Runs• State transformer functions• Agents and systems• Purely reactive agents• Perception• Agents with state• Utilities• Achievement and maintenance tasks

Page 19: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

19

ABC: Basic theory of agency• See item in this week’s practical• Typical question: present a scenario informally and

ask you to formalise– States,– Actions,– State transformer functions,

Page 20: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

20

ABC: Game theory• Outcomes, utility functions• Encounters• State transformer function• Pay-off matrices• Dominant strategies• Nash equilibrium• Competitive and zero-sum interactions• Prisoner’s dilemma/iterated prisoner’s dilemma• Arguments for recovering cooperation• Game of chicken• Stag hunt

Page 21: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

21

ABC: Game theory (cont’d)• See item in this week’s practical

Page 22: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

22

ABC: agreements• Motivation• Mechanism design• Auctions• Negotiation

Page 23: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

23

ABC: agreements (cont’d)• The Vickrey auction is a one-shot, second-price,

sealed-bid price, in which the auctioned item is awarded to the bidder with the highest bid, however the winner pays the second highest bid. Explain why in the Vickrey auction the dominant strategy is to bid truthfully. Hint: Consider the cases of bidders under-bidding and over-bidding and explain their outcomes. (5)

Page 24: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

24

ABC: agreements (cont’d)• An electronic auction house wants to combine the

English (first-price, open cry and ascending price) and Dutch (open cry, descending price) auctions to speed up the process of selling goods, and guarantee the highest price is reached.

• The combined auctions work as follows: – The auctioneer will initially use the English auction

mechanism (with large increases in price) until no-one bids;

– The auctioneer will then start a Dutch auction to find the highest price within the last two price offers (the lowest of which will have a bidder)

Page 25: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

25

ABC: agreements (cont’d)• With this scenario in mind you should:

1. Provide an informal description of the auctioneer’s behaviour, using pseudo-code. (5)

2. Provide an informal description of the bidder’s behaviour using pseudo-code. (5)

3. Define the communication protocol the agents will follow using one of the formalisms presented in our lectures. (5)

4. Using the pseudo-code of the previous items, provide a sample “run” of one auctioneer and two bidders competing for an auctioned good. N.B.: Your run should be non-trivial, that is, the auction should not finish immediately due to no-one bidding. (5)

Page 26: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

26

ABC: negotiation mechanisms

Page 27: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

27

ABC: negotiation mechanisms (cont’d)4.a(i) The conflict deal.• The conflict deal is the allocation of tasks if no

agreement is reached during the negotiation mechanism; i.e. the initial allocation of tasks.

• In this scenario, the conflict deal is FF,VV =

(Fraserburgh, Ellon, Aberdeen, Peterhead),( Inverurie, Ellon, Aberdeen, Peterhead).

Page 28: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

28

ABC: negotiation mechanisms (cont’d)4.a.(ii) An individual rational deal.• An individual rational deal is one that provides an

individual with a utility greater than or equal to zero; i.e. the cost of the agent executing the tasks allocated to it in the deal is less than or equal to the cost of the agent executing the tasks in the conflict deal.

• For example, for FF the deal (Fraserburgh,Ellon),

(Inverurie,Ellon,Aberdeen,Peterhead)is individual rational (it costs less than the conflict deal) because FF doesn’t have to go to Aberdeen or Peterhead.

Page 29: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

29

ABC: negotiation mechanisms (cont’d)4.a.(iii) A Pareto optimal deal.• A Pareto optimal deal is a deal such that there

exists no other deal that weakly dominates it. – In other words, there is no other deal that gives greater

utility to one agent without giving a lower utility to another

• An example of a Pareto optimal deal is(Fraserburgh,Ellon),(Inverurie,Aberdeen,Peterhead)

Page 30: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

30

ABC: negotiation mechanisms (cont’d)4.b. Specify the negotiation set:

(Fraserburgh),(Inverurie,Ellon,Aberdeen,Peterhead),(Fraserburgh,Ellon),(Inverurie,Peterhead,Aberdeen),(Fraserburgh,Aberdeen,Peterhead),(Inverurie,Ellon),

(Fraserburgh,Ellon,Aberdeen,Peterhead),(Inverurie)

Page 31: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

31

ABC: negotiation mechanisms (cont’d)4.c. Freddy and Virginia both employ …• Suppose the deals are labelled as follows:

1=(Fraserburgh),(Inverurie,Ellon,Aberdeen,Peterhead)2=(Fraserburgh,Ellon),(Inverurie, Peterhead,Aberdeen)3=(Fraserburgh,Aberdeen,Peterhead),(Inverurie,Ellon)4=(Fraserburgh,Ellon,Aberdeen,Peterhead),(Inverurie)

• We refer to Freddy as A and Virginia as B• The utilities of these deals for each agent are as

follows:uA(1) = 25 – 12 = 13 uB(1) = 29 – 29 = 0uA(2) = 25 – 14 = 11 uB(2) = 29 – 23 = 6uA(3) = 25 – 21 = 4 uB(3) = 29 – 15 = 14uA(4) = 25 – 25 = 0 uB(4) = 29 – 12 = 17

Page 32: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

32

ABC: negotiation mechanisms (cont’d)• Round 1:

A offers 1 B offers 4• Round 2:

RiskA2 = 13-0/13 = 1

RiskB2 = 17-0/17 = 1

RiskA2 = RiskB

2, so both concedeA offers 2 B offers 3

Page 33: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

33

ABC: negotiation mechanisms (cont’d)• Round 3:

RiskA3 = 11-4/11 = 7/11

RiskB3 = 14-6/14 = 4/7

RiskB3 < RiskA

3, so B concedesA offers 2 B offers 2

Agreement reached; deal = 2

Page 34: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

34

ABC: negotiation mechanisms (cont’d)• We can easily check that this is the correct outcome

by remembering that the negotiation mechanism results in the deal that maximises the product of the individual utilities:uA(1) × uB(1) = 0uA(2) × uB(2) = 66uA(3) × uB(3) = 56uA(4) × uB(4) = 0

Page 35: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

35

Overall questionsTrue or false? Justify!• Software agents are ordinary computer programs (4)• We do not need new languages for programming software

agents (4)• Agent communication languages (ACLs) specify the order

of messages exchanged among agents (4)• Agent communication protocols should not be described

using a programming language such as Java (4)• The English auction protocol isn’t vulnerable to collusions

(3)

Page 36: Revision Lecture. 2 Topics Peer-to-peer computing –Algorithms & issues –Gnutella –Scalability –Security –Freenet –JXTA –BitTorrent Agent-based computing.

36

Finally…

GOOD LUCK!!