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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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