Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

P2P Simulating using PeerSim Use PeerSim to implement a Chord network with a key space of size n = 2128 ie, each key consists of

image text in transcribed

P2P Simulating using PeerSim Use PeerSim to implement a Chord network with a key space of size n = 2128 ie, each key consists of 128 bits. The Chord overlay is used to serve as distributed DNS servers. Each node will store a set of URLs When a user ask for a URL the system will look up for that URL form the Chord Overlay first, if he does not fined it he will get it from a centralized DNS server (known server). Initially no machine has any URL, when the system works each machine ask for a URL the system will store that URL on the machine that he is responsible for. Place 5000 nodes (machines) on the network and name each machine with a string from MachinesName.txt file. Use the out of the MD5 hash function of machine name as the id of each machine. Also use the out of the MD5 hash function of URL name only as the key for each URL URLs can be found on the DNS-DataBase.txt file For each cycle of the simulation, each peer in the network chooses a URL randomly from the DNS DataBase.txt. Then he uses the chord routing algorithm to find the peer that is responsible for, if he does not find it, he uses the insert algorithm to store that URL on the responsible machine What to out: For each peer in each cycle record in a text file the number of messages need for look up for a URL and if it hit or miss (a separate line for each peer) (hit mean that he found the URL in the chord, miss he does not find it). The last line of the file will have the average number of lookup messages for all peers in the network and the total number of hit. Finally draw a graph between cycles and average look up and a graph between cycles and number of hits. Note you will have a number of text file out equal to the number of ycles that you run the simulation. The simulation shout run not less than 24 cycles A java Implementation of the MD5 Hash Function, you can embedded in your code import java.security.*; import ava.math.*; public class ShowUncheckedWarning f public static void main(String[] args) throws Exception ( String s-"String to be hashed"; sageDigest m=MessageDigest.getInstance ("MD5"); m.update(s.getBytes(),0,s.length()); System.out.println("MD5: "+new BigInteger(1,m.digest)).toString (16)); Web site has an implementation example of P2P using PeerSim http://peersim.sourceforge.net#code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions