Identities of peers in the range

Assignment Help Basic Computer Science
Reference no: EM13307156

  • o If you want to do this but do not have enough time, please post a comment telling me of your intention to answer.
  • o Make a bookmark.
  • o Come back to this question and comment below when you finish.
  • o I shall create a new question for you to post up your answer so you can earn the points you deserve for helping me out! :D

o Project is due in 10 days. Earlier the better. =)
Checks:

  • x Please comment your code so I can read it well.
  • x Please also include link for me to download your .java files (Multiple .java files are okay).
  • x Rating 3* for willingness, 4* for working code, 5* for working code with good comments. Thanks :)
  • x Put any Questions in comments.

 

Steps involved:

  1. 1. Initialization
  2. 2.   Ping Mechanism
  3. 3.   File Request
  4. 4.   Peer Churn.

 

(Example shown in brackets).

 

Input and Initialization Specifications:

  • Takes in 3 integer arguments. (e.g. java cdht 1 42 58)
  • First argument ("1") is the identity of the peer to be initialized
  • Second argument is successor1,
  • Third argument is sucessor2 ("42" and "58") are the two successive peers.

Notes:

  • Max 10 peers.
  • Identities of peers in the range of [0, 255].
  • Use local host as IP Adress ("127.0.0.1")
  • Use UDP protocol at port 50,000 + x for x = peer number (First argument)



Ping Mechanism

  • My understanding is that a peer regularly pings its successive peers (42 and 58) via their port numbers (50,042 and 50,058) and receives back a response.
  • When receiving either a request or response please output a string:
    "A ping response/request was received from peer X" where X is the peer's identity (1, 42, 58)



File Request

  • Assume peer 1 is looking for a file 59, he types the string: request 59.
  • This forwards on to its successor1 (peer 42).
  • Peer 42 checks if 59 < it's successor1 identity (58) --> No.
  • Peer 42 then passes the request to Peer 58.
  • Peer 58 checks 59 against it's successor1 identity (e.g. 63) --> Yes
  • Peer 58 sends a response through its predecessors back to peer 1 saying he has the file.



Peer Churn
Ungraceful Exit

  • o Timeout function required so that if no response is received after 1 second of ping, the program seeks the alive successor's immediate successor. (peer 42 is dead, peer 1 requests peer 58 for its next successor)
  • o   Peer closes connection to dead peer then connects to this new successor and keeps pinging it.
    (I imagine it will have to reshuffle so that peer 58 = successor1 and the new peer = successor2)


Graceful Exit

  • o   Peer types in: quit
  • o   This sends a message to its peers with its successors so they can change accordingly

Reference no: EM13307156

Questions Cloud

Test a program for summing : You are to implement and test a program for summing 1/x as x runs over all approximately eight million (23 fraction bits) single precision floating point numbers in the interval [1, 2). You are to do this on a server, PC (or Mac) of your choice..
What is the speed of the sled right before the team jumps : At the start of a race, a four-man bobsled team pushes their sled as fast as they can along a 50 m flat starting stretch. What is the speed of the sled right before the team jumps on the sled
Calculate the flow rate from the lake and into the aquifer : A geological fault truncates the aquifer at a distance "L" upstream from the river. The hydraulic conductivity of the area between the fault and the river is 50 ft / day and hydraulic conductivity between the lake and the fault is 100 ft / day.
Calculate the buoyant force of the water acting on the man : The man completely exhales and jumps into the deep end of a pool with a depth of 9 feet. Calculate the buoyant force of the water acting on the man with his breath completely exhaled
Identities of peers in the range : I shall create a new question for you to post up your answer so you can earn the points you deserve for helping me out.
Create a program that keeps track : Create a program that keeps track of the following information input by the user: First Name, Last Name, Phone Number, and Age. Now - let's store this in a multidimensional array that will hold 10 of these contacts. So our multidimensional arra..
Determine what is the definition of critical state : what is the definition of critical state. explain at which stage a critical state may be approached in a drained triaxial text on a overconsolidated clay using stress path and strain-strain plot.
Obtain the rms speed of the molecules : A canister containing 115 kg of an ideal gas has a volume of 6.5 m3. what is the rms speed of the molecules
Determine the age of the earth-based twin brother : One 20-year-old twin brother takes a space trip with a speed of 0.80c for 30 years according to a clock on the spaceship, determine the age of the Earth-based twin brother

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Why are they both important to game development explain

In an array of characters we saw that NULL is important in defining where the end of the string is. As we keep looking further and further into strings (both array and string) why is NULL important? With two different types of NULL, why are they both..

  Which installation is suitable for customer tracking system

Which installation options are available for Customer Tracking System? Which would you suggest? How can you determine if implementation has been successful?

  How to convert power to hex

How to Convert 11001010 to the 2nd power to hex

  Finding decimal equivalent of eight bit numbers

Let the two 8-bit numbers A=01000001 and B=10000100. Provide the decimal equivalent of each number.

  Explaining security risks for computing infrastructure

In your new position at XYZ Corporation, you have been asked to lead risk assessment team. As part of project to assess security risks for computing infrastructure.

  The uml class

The UML Class, Sequence Diagrams etc, can be drawn in preferably NetBeans UML, if it is not convenient on that, any other UML tool would do

  Find the deepest value in a binary tree in c++

How do you find the deepest value in a binary tree in C++?

  Compute pressure if temperature and number of moles produces

A container with the ideal gas, temperature, and number of moles produces what pressure? What occurs if source voltage is restored to 12 V, but resistors change?

  Discuss how the it department helps the organization achieve

Discuss how the IT department helps the organization achieve their strategic goals

  What does this value indicate

The value of the Destination Address in a given Ethernet frame contains ff:ff:ff:ff:ff:ff. What does this value indicate?

  Emerging technologies developments

Are you a optimistic or apprehensive about developments in emerging technologies that simulate human experience? Provide examples of a business condition that would benefit from each of the following?

  Can be done with primary keys

Explain what can be done with primary keys to eliminate key ripple effects as a database evolves.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd