1. Homepage
  2. Programming
  3. COMP212 Assignment: Ring of Rings Network

COMP212 Assignment: Ring of Rings Network

Engage in a Conversation
LiverpoolCOMP212Distributed SystemsLCRLeader ElectionJavaDistributed Algorithms

1 Overall marking scheme CourseNana.COM

The coursework for COMP212 consists of two assignments contributing altogether 30% of the final mark. The contribution of the individual assignments is as follows: CourseNana.COM

Assignment 1 15% Assignment 2 15% TOTAL 30% CourseNana.COM

2 Objectives CourseNana.COM

This assignment requires you to design and implement in Java a distributed algorithm for leader election in a ring of rings network and then to experimentally validate its correctness and evaluate its performance. CourseNana.COM

3 Description of coursework CourseNana.COM

The network considered in this assignment is a ring of rings, defined as follows (see Figure 1 for an illustration while reading the definition). There is a main ring G of n processors V = {u1, u2, . . . , un}. There is a non-empty subset V 0 V of interface processors, such that every v 2 V 0 is associated with a distinct ring subnetwork Rv. We call the remaining processors non-interface processors; these are the non-interface processors of G and the processors of the ring subnetworks. Initially, every non-interface processor u has a unique id stored in a variable myIDu, while every interface processor v has myIDv := 1 to denote that its id is to be determined through its subnetwork. The subnetworks are not connected to the main ring via communication links, instead every Rv is implicitly connected to its interface v via shared variables. In particular, we make the assumption that whenever an elected processor w of Rv sets the value of a variable leaderIDw, then myIDv := leaderIDw, that is, as soon as a processor w is elected in Rv, the interface v knows the id of the elected processor through the shared variable leaderIDw. It follows, that every interface processor can eventually obtain an elected id from its subnetwork. CourseNana.COM

In our setting, the processors do not know the number of processors in the main ring or in any of the subnetworks in advance, but they do know the general structure of the network and all but the interface processors are equipped with unique ids. The ids are not necessarily consecutive and for simplicity you can assume that they are chosen from {1, 2, . . . , N }, where 1 is a small constant and N is the total number of non-interface processors (e.g., for = 3, the N non-interface processors will be every time assigned unique ids from {1, 2, . . . , 3N 1, 3N }). Processors execute in synchronous rounds, as in every example we have discussed so far in class. CourseNana.COM

Figure 1: A ring of rings network. The red nodes represent the interface processors whose ring subnetwork is included within the dashed area. The white nodes represent the N non- interface processors and each of those has initially a unique id. The goal of a leader-election algorithm in a ring of rings is to eventually elect the maximum id over all the initial ids of the non-interface nodes. CourseNana.COM

3 CourseNana.COM

3.1 Implementing the Asynchronous-Start and Terminating LCR Algorithm—30% of the assignment mark CourseNana.COM

As a first step, you are required to implement a variant of the LCR algorithm for leader election in a ring network (not in a ring of rings yet). The pseudocode of the standard LCR can be found in the lecture notes and is also given here for convenience (Algorithm 1). CourseNana.COM

Algorithm 1 LCR (synchronous-start and non-terminating version) Ring network
Code for processor
ui, i 2 {1,2,...,n}: CourseNana.COM

Initially:
ui knows its own unique id stored in myIDi sendIDi := myIDi
statusi := “unknown CourseNana.COM

1: 2: 3: 4: 5: 6: 7: 8: 9: CourseNana.COM

10: 11: 12: 13: CourseNana.COM

if round = 1 then
send hsendIDii to clockwise neighbour CourseNana.COM

else// round > 1
upon receiving
hinIDi from counterclockwise neighbour if inID > myIDi then CourseNana.COM

sendIDi := inID CourseNana.COM

send hsendIDii to clockwise neighbour else if inID = myIDi then CourseNana.COM

statusi := “leader
else if inID < myIDi then CourseNana.COM

do nothing CourseNana.COM

end if end if CourseNana.COM

You are required to implement an asynchronous-start and terminating ver- sion of the LCR algorithm in which additionally to the standard LCR: CourseNana.COM

1. Every processor ui has an associated start round ri 1, such that the processor wakes up and starts executing the algorithm at the beginning of round ri. Before round ri, processor ui is asleep and any message transmitted to it is lost. CourseNana.COM

2. All processors eventually terminate and know the elected id. CourseNana.COM

3.2 Implementing a Leader-Election Algorithm for Rings of Rings—40% of the assignment mark CourseNana.COM

Next, you are required to come up with and implement an algorithm for leader election on a ring of rings network. Your algorithm should make use of the asynchronous-start and CourseNana.COM

4 CourseNana.COM

terminating variant of the LCR algorithm that you developed in the previous step. It should eventually elect the maximum id over all ids assigned initially, let all processors of the main ring know of the elected id, and have all processors of the main ring terminate. CourseNana.COM

Hint. The ring subnetworks will be executing the terminating LCR, while the main ring will be executing its asynchronous-start variant. You are also allowed to assume that all rings are bidirectional with the processors still having a sense of clockwise (counter-clockwise, respectively) orientation. You could make use of this in order to avoid some message re- transmissions, but doing so is not a requirement. CourseNana.COM

3.3 Experimental Evaluation & Report—30% of the assignment mark CourseNana.COM

After implementing the leader-election algorithm for a ring of rings, the next step is to conduct an experimental evaluation of its correctness and performance. CourseNana.COM

Correctness and Performance. Execute your algorithm in networks of increasing size (up to reasonable execution times, depending on your equipment) and varying structure (parameters to consider: number and positioning of interface nodes, size of subnetworks) and starting from various id assignments for each given setting. For instance, you could execute your algorithm on both specifically constructed id assignments (e.g., ids ascending clockwise or counterclockwise) and random id assignments. In each execution, your simulator should check that eventually the maximum id over all initial ids is elected. Of course, this will not be a replacement of a formal proof that your algorithm is correct as you won’t be able to test it on all possible input configurations, but at least it will be a first indication that it might do as intended. In each execution, your simulator should also record the number of rounds and the total number of messages transmitted until termination. CourseNana.COM

After gathering the simulation data, plot them as follows. For each chosen combination of network structure and type of id assignment (e.g., fixed number, size, and positioning of subnetworks and random ids) the x-axis will represent an increasing parameter of size (e.g., the size n of the main ring or the number N of non-interface nodes) and the y-axis will represent the complexity measure (number of rounds or number of messages). Your plots can also compare against standard complexity functions, like n, n log n, or n2, so that it will become as clear as possible what are the asymptotic complexities of the algorithm. Generate at least 4 plots (each studying a dierent combination of parameters) that will help you draw meaningful conclusions about the time and communication complexities of your algorithm. You can use gnuplot, JavaPlot or any other plotting software that you are familiar with. CourseNana.COM

The final crucial step is to prepare a concise report (at most 5 pages including plots) clearly describing your algorithms, the main functionality of your simulator, the set of ex- periments conducted, and the findings of your experimental evaluation. In particular, in CourseNana.COM

5 CourseNana.COM

CourseNana.COM

the latter part you should try to draw conclusions about (i) the algorithm’s correctness and (ii) its performance w.r.t. time and messages (e.g., what was the worst/best/average performance of the algorithm as a function of n?). CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
Liverpool代写,COMP212代写,Distributed Systems代写,LCR代写,Leader Election代写,Java代写,Distributed Algorithms代写,Liverpool代编,COMP212代编,Distributed Systems代编,LCR代编,Leader Election代编,Java代编,Distributed Algorithms代编,Liverpool代考,COMP212代考,Distributed Systems代考,LCR代考,Leader Election代考,Java代考,Distributed Algorithms代考,Liverpoolhelp,COMP212help,Distributed Systemshelp,LCRhelp,Leader Electionhelp,Javahelp,Distributed Algorithmshelp,Liverpool作业代写,COMP212作业代写,Distributed Systems作业代写,LCR作业代写,Leader Election作业代写,Java作业代写,Distributed Algorithms作业代写,Liverpool编程代写,COMP212编程代写,Distributed Systems编程代写,LCR编程代写,Leader Election编程代写,Java编程代写,Distributed Algorithms编程代写,Liverpoolprogramming help,COMP212programming help,Distributed Systemsprogramming help,LCRprogramming help,Leader Electionprogramming help,Javaprogramming help,Distributed Algorithmsprogramming help,Liverpoolassignment help,COMP212assignment help,Distributed Systemsassignment help,LCRassignment help,Leader Electionassignment help,Javaassignment help,Distributed Algorithmsassignment help,Liverpoolsolution,COMP212solution,Distributed Systemssolution,LCRsolution,Leader Electionsolution,Javasolution,Distributed Algorithmssolution,