SlideShare a Scribd company logo
For any Assignment related queries, Call us at : - +1 678 648 4277
You can mail us at : - support@computernetworkassignmenthelp.com or
reach us at : - https://www.computernetworkassignmenthelp.com/
Problem 1. Leader Election in a Synchronous Ring
Consider a collection of n identical processes arranged in a synchronous ring network.
Each process has two sets of ports, one to each of its immediate neighbors, with its
ports to its clockwise neighbor named left and its ports to its counterclockwise neighbor
named right. Thus, the processes have a common sense of orientation.
The goal is for the processes to elect a single leader: exactly one process should
eventually output LEADER.
(a) First suppose that the processes are deterministic, and that they know n (the size of
the ring). Either give a correct leader election algorithm for this case, or prove that
no such algorithm exists. If you give an algorithm, analyze its time and message
complexity.
Solution: Impossible. Suppose for contradiction that such an algorithm exists. We can
use a standard inductive symmetry argument. Namely, prove by induction on the
number r of rounds that, after r rounds, all the processes are in identical states. Since
the algorithm must solve the leader election problem, eventually, one process outputs
LEADER. But then all processes do the same thing, in the same round
computernetworkassignmenthelp.com
(b) Now suppose that the processes are probabilistic (i.e., randomized), and that they know
n. We would like an algorithm that (a) never elects more than one leader, and (b) with
probability 1, eventually elects a leader. Either give an algorithm satisfying these
properties, or prove that none exists. If you give an algorithm, analyze its time and message
complexity. Your analysis should relate the complexity to the success probability.
Specifically, for any ε, 0 < ε < 1, you should provide bounds on the time and message
complexity that hold with probability at least 1 − ε.
Solution: Here a simple algorithm exists.
Lemma, similar to one from class: If n processes choose ids uniformly at random,
independently, from {1, . . . , n2}, then with probability at least 1/2, the chosen numbers
are all distinct.
Algorithm: The algorithm works in a series of phases. In each phase, all processes choose
random ids from a sufficiently large space, defined as in the lemma as {1, ..., n2}. Then they
all send their ids around the ring, (say) in the clockwise direction. After exactly n steps,
every process examines the sequence of ids that it has received. There are three cases:
1. If the maximum id in the sequence is not unique, it abandons this phase and goes on to
the next.
computernetworkassignmenthelp.com
2. If the maximum id in the sequence is unique and is the process’ own id, then it
outputs LEADER and halts.
3. If the maximum id in the sequence is unique and is not the process’ own id, then it
just halts.
It should be clear that, at the first phase where all the processes choose distinct ids,
exactly one process elects itself the leader, and then the algorithm halts. So certainly
the algorithm never elects more than one leader.
At each phase, with probability at least 1/2, all the chosen ids are distinct and the
algorithm terminates. Since the choices in different phases are independent, the
probability that the algorithm finishes within h phases is at least 1 − 2 1 h . Thus, with
probability 1, it eventually finishes.
We analyze the time and message complexity. Each phase consists of n rounds, and
sends n2 (single-hop) messages. Consider any ε, 0 < ε < 1. Choose h to be the smallest
integer such that 2 1 h ≤ ε, that is, h = ilg (1/ε)l. Then with probability at least 1 − δh ≥ 1
− ε, the algorithm finishes within h phases, using n · h rounds and n2 · h messages. That
is, with probability at least 1 − ε, the time complexity is at most nilg (1/ε)l and the
message complexity is at most n2ilg (1/ε)l.
computernetworkassignmenthelp.com
(c) Finally suppose that the processes are probabilistic and they do not know n. That is,
the same algorithm must work regardless of the size of the ring in which the processes
are placed. We would again like an algorithm that (a) never elects more than one leader,
and (b) with probability 1, eventually elects a leader. Either give an algorithm satisfying
these properties, or prove that none exists. If you give an algorithm, analyze its time and
message complexity as described in Part (b).
Solution: This is impossible. Suppose for contradiction that such an algorithm exists.
Consider the algorithm operating in a ring S of size n, for any particular value of n.
Number the processes of S as 1, . . . , n based on their positions in the ring, counting
clockwise. Since the algorithm eventually elects a leader in ring S with probability 1,
there must be at least one execution α of S that leads to some process j outputting
LEADER. That is, there is some particular mapping from processes to sequences of
random choices such that, in the execution α in which these choices are made, some
process j is elected leader.
Now consider a ring R of size 2n consisting of two half-rings R1 and R2, each of size n.
Number the processes of R as 1, . . . , 2n. Then there is an execution α' of R in which
processes i and n + i in R happen to make the same random choices as process i in S. In
execution α' , processes i and n+i behave exactly like process i in execution α of S. Since
process j outputs LEADER in execution α, both processes j and n + j output LEADER in
execution α' . This contradicts problem requirement (a). Notice that this proof shows
that we can’t achieve any positive election probability ε, not just probability 1.
computernetworkassignmenthelp.com
Problem 2. Breadth-First Search in an Asynchronous Network
The asynchronous Breadth-First Search algorithm presented in class involves corrections
that could trigger the sending of many messages, resulting in worst-case message
complexity O(nE) and worst-case time complexity O(diam · n · d), until all nodes’ parent
variables have stabilized to correct parents in a breadth-first spanning tree. (We are not
considering individual processes’ parent outputs here, nor global termination. We are also
ignoring local processing time.)
This problem involves designing a better asynchronous Breadth-First Search algorithm, one
that does not make any corrections. Thus, once a process sets its parent variable, it can
output the value since that is its final decision.
Assume that the network graph is connected and contains at least two nodes.
(a) Describe carefully, in words, an algorithm in which the root node v0 coordinates the
construction of the tree, level by level. Your algorithm should take time O(diam2 · d)
until all the parent variables are set.
(Hint: The root node can conduct broadcast-convergecast waves to build the successive
levels in the tree. Four types of messages should be enough, e.g., search messages that
test for new nodes, parent(b) (b a Boolean) for parent/nonparent responses, and ready
and done messages for broadcasting and convergecasting signals on the tree.)
computernetworkassignmenthelp.com
Solution: Node v0 initiates successive phases of the algorithm. At each phase d, exactly
the nodes at distance d from v0 get incorporated into the BFS tree.
At phase 1:
Node v0 sends search messages to all its neighbors. The neighbors record v0 as their
parent, record that they are new nodes, and send parent responses back to v0. When v0
receives parent responses from all its neighbors, it is ready to start phase 2.
At phase d, d ≥ 2:
Node v0 broadcasts ready messages down all the branches of the tree built so far, until
they reach the new nodes. Each new node sends search messages to all its neighbors.
When a node receives a search message, if it does not already have a parent, it sets its
parent variable to the sender’s id, records that it is new, and sends a parent response. If
it already has a parent, it sends a nonparent response.
When a new node has received responses to all its search messages, it sends a done(b)
message to its parent, where b = TRUE if the node has received at least one parent
response, = FALSE otherwise. The done messages get convergecast up the tree; each
node sets the bit b in the message it sends to its parent to the “or” of the bits it received
from its children.
When node v0 has received done messages from all its children, it begins phase d + 1 if
any of the messages contain value 1; otherwise it halts.
computernetworkassignmenthelp.com
(b) Analyze the time and communication complexity of your algorithm, and compare them
to the costs of the asynchronous BFS algorithm presented in class.
Solution: The time complexity is O(diam2 · d). Each phase takes time O(diam · d), and there
are O(diam) phases.
The message complexity is O(E + diam · n). Each edge is traversed once in each direction
with search and parent messages. The ready and done messages traverse tree edges only, so
there are O(n) of these per phase.
Solution: If it is instructive here is some code for part (a) that we think might help
understand this problem more deeply.
Process v0
State variables:
Transitions:
computernetworkassignmenthelp.com
for each v ∈ Γ(v0), send(v), a queue, initially
(search) responded ⊆ Γ(v0), initially ∅ newinfo,
a Boolean, initially false
computernetworkassignmenthelp.com
input receive(search)v,v0 , v ∈ Γ(v0) Effect: add
parent(false) to send(v) input
receive(parent(true))v,v0 , v ∈ Γ(v0) Effect:
responded := responded ∪ {v} if responded =
Γ(v0) then for each w ∈ Γ(v0), add ready to
send(w) responded := ∅
newinfo := false input receive(done(b))v,v0 , b
a Boolean, v ∈ Γ(v0) Effect: responded :=
responded ∪ {v} newinfo := newinfo ∨ b if
responded = Γ(v0) and newinfo then for each
w ∈ Γ(v0), add ready to send(w) responded :=
∅ newinfo := false output send(m)v,v0 , m a
message, v ∈ Γ(v0) Precondition: m =
head(send(v)) Effect: remove head of send(v)
Process u, u = v0
State variables:
parent ∈ Γ(u) ∪ {⊥}, initially ⊥ children ⊆ Γ(u),
initially ∅ newnode a Boolean, initially false for
each v ∈ Γ(u), send(v), a queue,
Transitions:
computernetworkassignmenthelp.com
input receive(search)v,u, v ∈ Γ(u) Effect: if
parent = ⊥ then parent := v newnode := true
add parent(true) to send(v) else add
parent(false) to send(v)
initially empty responded ⊆ Γ(u), initially ∅
newinfo, a Boolean, initially false
input receive(parent(b))v,u, b a Boolean, v ∈
Γ(u) Effect: if b then children := children ∪ {v}
newinfo := true responded := responded ∪ {v}
if responded = Γ(u) then add done(newinfo) to
send(parent)
input receive(ready)v,u, v ∈ Γ(u) Effect: if
newnode then for each w ∈ Γ(u), add search to
send(w) else for each w ∈ children, add ready
to send(w) responded := ∅ newinfo := false
input receive(done(b))v,u, b a Boolean, v ∈ Γ(u
computernetworkassignmenthelp.com
) Effect: responded := responded ∪ {v} newinfo
:= newinfo ∨ b if responded = children then
add done(newinfo) to send(parent) output
send(m)u,v, m a message, v ∈ Γ(u)
Precondition: m = head(send(v)) Effect:
remove head of send(v)

More Related Content

Similar to Computer Network Assignment Help

DSA Complexity.pptx What is Complexity Analysis? What is the need for Compl...
DSA Complexity.pptx   What is Complexity Analysis? What is the need for Compl...DSA Complexity.pptx   What is Complexity Analysis? What is the need for Compl...
DSA Complexity.pptx What is Complexity Analysis? What is the need for Compl...
2022cspaawan12556
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
Mallikarjun Biradar
 
Lecture 8 dynamic programming
Lecture 8 dynamic programmingLecture 8 dynamic programming
Lecture 8 dynamic programmingOye Tu
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexityAnkit Katiyar
 
Greedy Algorithms with examples' b-18298
Greedy Algorithms with examples'  b-18298Greedy Algorithms with examples'  b-18298
Greedy Algorithms with examples' b-18298
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
design and analysis of algorithm
design and analysis of algorithmdesign and analysis of algorithm
design and analysis of algorithm
Muhammad Arish
 
Design and Analysis of algorithms
Design and Analysis of algorithmsDesign and Analysis of algorithms
Design and Analysis of algorithms
Dr. Rupa Ch
 
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWERUndecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
muthukrishnavinayaga
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
KokilaK25
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
Tanya Makkar
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
appasami
 
DATA STRUCTURE.pdf
DATA STRUCTURE.pdfDATA STRUCTURE.pdf
DATA STRUCTURE.pdf
ibrahim386946
 
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURE
RobinRohit2
 
9. chapter 8 np hard and np complete problems
9. chapter 8   np hard and np complete problems9. chapter 8   np hard and np complete problems
9. chapter 8 np hard and np complete problems
Jyotsna Suryadevara
 
Data Structures - Lecture 8 - Study Notes
Data Structures - Lecture 8 - Study NotesData Structures - Lecture 8 - Study Notes
Data Structures - Lecture 8 - Study NotesHaitham El-Ghareeb
 
Anu DAA i1t unit
Anu DAA i1t unitAnu DAA i1t unit
Anu DAA i1t unit
GANDIKOTA2012
 
Computer Science Exam Help
Computer Science Exam Help Computer Science Exam Help
Computer Science Exam Help
Programming Exam Help
 
Data_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.pptData_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.ppt
ISHANAMRITSRIVASTAVA
 

Similar to Computer Network Assignment Help (20)

DSA Complexity.pptx What is Complexity Analysis? What is the need for Compl...
DSA Complexity.pptx   What is Complexity Analysis? What is the need for Compl...DSA Complexity.pptx   What is Complexity Analysis? What is the need for Compl...
DSA Complexity.pptx What is Complexity Analysis? What is the need for Compl...
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
Lecture 8 dynamic programming
Lecture 8 dynamic programmingLecture 8 dynamic programming
Lecture 8 dynamic programming
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
Greedy Algorithms with examples' b-18298
Greedy Algorithms with examples'  b-18298Greedy Algorithms with examples'  b-18298
Greedy Algorithms with examples' b-18298
 
design and analysis of algorithm
design and analysis of algorithmdesign and analysis of algorithm
design and analysis of algorithm
 
algorithm unit 1
algorithm unit 1algorithm unit 1
algorithm unit 1
 
Design and Analysis of algorithms
Design and Analysis of algorithmsDesign and Analysis of algorithms
Design and Analysis of algorithms
 
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWERUndecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
 
Searching techniques
Searching techniquesSearching techniques
Searching techniques
 
DATA STRUCTURE.pdf
DATA STRUCTURE.pdfDATA STRUCTURE.pdf
DATA STRUCTURE.pdf
 
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURE
 
9. chapter 8 np hard and np complete problems
9. chapter 8   np hard and np complete problems9. chapter 8   np hard and np complete problems
9. chapter 8 np hard and np complete problems
 
Data Structures - Lecture 8 - Study Notes
Data Structures - Lecture 8 - Study NotesData Structures - Lecture 8 - Study Notes
Data Structures - Lecture 8 - Study Notes
 
Anu DAA i1t unit
Anu DAA i1t unitAnu DAA i1t unit
Anu DAA i1t unit
 
Computer Science Exam Help
Computer Science Exam Help Computer Science Exam Help
Computer Science Exam Help
 
Data_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.pptData_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.ppt
 

More from Computer Network Assignment Help

Elevate Your Networking Game with Expert Computer Network Assignment Help
Elevate Your Networking Game with Expert Computer Network Assignment HelpElevate Your Networking Game with Expert Computer Network Assignment Help
Elevate Your Networking Game with Expert Computer Network Assignment Help
Computer Network Assignment Help
 
Get 15% off on Computer Network Assignment Help
Get 15% off on Computer Network Assignment HelpGet 15% off on Computer Network Assignment Help
Get 15% off on Computer Network Assignment Help
Computer Network Assignment Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
Computer Network Assignment Help
 
Advanced Computer Network Assignment Help
Advanced Computer Network Assignment HelpAdvanced Computer Network Assignment Help
Advanced Computer Network Assignment Help
Computer Network Assignment Help
 
Computer Network Assignment Help.pptx
Computer Network Assignment Help.pptxComputer Network Assignment Help.pptx
Computer Network Assignment Help.pptx
Computer Network Assignment Help
 
Computer Network Homework Help
Computer Network Homework HelpComputer Network Homework Help
Computer Network Homework Help
Computer Network Assignment Help
 
Computer Network Homework Help
Computer Network Homework HelpComputer Network Homework Help
Computer Network Homework Help
Computer Network Assignment Help
 
Online Computer Network Security Assignment Help
Online Computer Network Security Assignment HelpOnline Computer Network Security Assignment Help
Online Computer Network Security Assignment Help
Computer Network Assignment Help
 
Computer Network Homework Help
Computer Network Homework HelpComputer Network Homework Help
Computer Network Homework Help
Computer Network Assignment Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
Computer Network Assignment Help
 
Networking Assignment Help
Networking Assignment HelpNetworking Assignment Help
Networking Assignment Help
Computer Network Assignment Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
Computer Network Assignment Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
Computer Network Assignment Help
 
Design & Analysis of Algorithms Assignment Help
Design & Analysis of Algorithms Assignment HelpDesign & Analysis of Algorithms Assignment Help
Design & Analysis of Algorithms Assignment Help
Computer Network Assignment Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
Computer Network Assignment Help
 
Proficient Computer Network Assignment Help
Proficient Computer Network Assignment HelpProficient Computer Network Assignment Help
Proficient Computer Network Assignment Help
Computer Network Assignment Help
 
Computer Networking Assignment Help
Computer Networking Assignment HelpComputer Networking Assignment Help
Computer Networking Assignment Help
Computer Network Assignment Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
Computer Network Assignment Help
 
Computer Networking Assignment Help
Computer Networking Assignment HelpComputer Networking Assignment Help
Computer Networking Assignment Help
Computer Network Assignment Help
 

More from Computer Network Assignment Help (19)

Elevate Your Networking Game with Expert Computer Network Assignment Help
Elevate Your Networking Game with Expert Computer Network Assignment HelpElevate Your Networking Game with Expert Computer Network Assignment Help
Elevate Your Networking Game with Expert Computer Network Assignment Help
 
Get 15% off on Computer Network Assignment Help
Get 15% off on Computer Network Assignment HelpGet 15% off on Computer Network Assignment Help
Get 15% off on Computer Network Assignment Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
 
Advanced Computer Network Assignment Help
Advanced Computer Network Assignment HelpAdvanced Computer Network Assignment Help
Advanced Computer Network Assignment Help
 
Computer Network Assignment Help.pptx
Computer Network Assignment Help.pptxComputer Network Assignment Help.pptx
Computer Network Assignment Help.pptx
 
Computer Network Homework Help
Computer Network Homework HelpComputer Network Homework Help
Computer Network Homework Help
 
Computer Network Homework Help
Computer Network Homework HelpComputer Network Homework Help
Computer Network Homework Help
 
Online Computer Network Security Assignment Help
Online Computer Network Security Assignment HelpOnline Computer Network Security Assignment Help
Online Computer Network Security Assignment Help
 
Computer Network Homework Help
Computer Network Homework HelpComputer Network Homework Help
Computer Network Homework Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
 
Networking Assignment Help
Networking Assignment HelpNetworking Assignment Help
Networking Assignment Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
 
Design & Analysis of Algorithms Assignment Help
Design & Analysis of Algorithms Assignment HelpDesign & Analysis of Algorithms Assignment Help
Design & Analysis of Algorithms Assignment Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
 
Proficient Computer Network Assignment Help
Proficient Computer Network Assignment HelpProficient Computer Network Assignment Help
Proficient Computer Network Assignment Help
 
Computer Networking Assignment Help
Computer Networking Assignment HelpComputer Networking Assignment Help
Computer Networking Assignment Help
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
 
Computer Networking Assignment Help
Computer Networking Assignment HelpComputer Networking Assignment Help
Computer Networking Assignment Help
 

Recently uploaded

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 

Recently uploaded (20)

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 

Computer Network Assignment Help

  • 1. For any Assignment related queries, Call us at : - +1 678 648 4277 You can mail us at : - support@computernetworkassignmenthelp.com or reach us at : - https://www.computernetworkassignmenthelp.com/
  • 2. Problem 1. Leader Election in a Synchronous Ring Consider a collection of n identical processes arranged in a synchronous ring network. Each process has two sets of ports, one to each of its immediate neighbors, with its ports to its clockwise neighbor named left and its ports to its counterclockwise neighbor named right. Thus, the processes have a common sense of orientation. The goal is for the processes to elect a single leader: exactly one process should eventually output LEADER. (a) First suppose that the processes are deterministic, and that they know n (the size of the ring). Either give a correct leader election algorithm for this case, or prove that no such algorithm exists. If you give an algorithm, analyze its time and message complexity. Solution: Impossible. Suppose for contradiction that such an algorithm exists. We can use a standard inductive symmetry argument. Namely, prove by induction on the number r of rounds that, after r rounds, all the processes are in identical states. Since the algorithm must solve the leader election problem, eventually, one process outputs LEADER. But then all processes do the same thing, in the same round computernetworkassignmenthelp.com
  • 3. (b) Now suppose that the processes are probabilistic (i.e., randomized), and that they know n. We would like an algorithm that (a) never elects more than one leader, and (b) with probability 1, eventually elects a leader. Either give an algorithm satisfying these properties, or prove that none exists. If you give an algorithm, analyze its time and message complexity. Your analysis should relate the complexity to the success probability. Specifically, for any ε, 0 < ε < 1, you should provide bounds on the time and message complexity that hold with probability at least 1 − ε. Solution: Here a simple algorithm exists. Lemma, similar to one from class: If n processes choose ids uniformly at random, independently, from {1, . . . , n2}, then with probability at least 1/2, the chosen numbers are all distinct. Algorithm: The algorithm works in a series of phases. In each phase, all processes choose random ids from a sufficiently large space, defined as in the lemma as {1, ..., n2}. Then they all send their ids around the ring, (say) in the clockwise direction. After exactly n steps, every process examines the sequence of ids that it has received. There are three cases: 1. If the maximum id in the sequence is not unique, it abandons this phase and goes on to the next. computernetworkassignmenthelp.com
  • 4. 2. If the maximum id in the sequence is unique and is the process’ own id, then it outputs LEADER and halts. 3. If the maximum id in the sequence is unique and is not the process’ own id, then it just halts. It should be clear that, at the first phase where all the processes choose distinct ids, exactly one process elects itself the leader, and then the algorithm halts. So certainly the algorithm never elects more than one leader. At each phase, with probability at least 1/2, all the chosen ids are distinct and the algorithm terminates. Since the choices in different phases are independent, the probability that the algorithm finishes within h phases is at least 1 − 2 1 h . Thus, with probability 1, it eventually finishes. We analyze the time and message complexity. Each phase consists of n rounds, and sends n2 (single-hop) messages. Consider any ε, 0 < ε < 1. Choose h to be the smallest integer such that 2 1 h ≤ ε, that is, h = ilg (1/ε)l. Then with probability at least 1 − δh ≥ 1 − ε, the algorithm finishes within h phases, using n · h rounds and n2 · h messages. That is, with probability at least 1 − ε, the time complexity is at most nilg (1/ε)l and the message complexity is at most n2ilg (1/ε)l. computernetworkassignmenthelp.com
  • 5. (c) Finally suppose that the processes are probabilistic and they do not know n. That is, the same algorithm must work regardless of the size of the ring in which the processes are placed. We would again like an algorithm that (a) never elects more than one leader, and (b) with probability 1, eventually elects a leader. Either give an algorithm satisfying these properties, or prove that none exists. If you give an algorithm, analyze its time and message complexity as described in Part (b). Solution: This is impossible. Suppose for contradiction that such an algorithm exists. Consider the algorithm operating in a ring S of size n, for any particular value of n. Number the processes of S as 1, . . . , n based on their positions in the ring, counting clockwise. Since the algorithm eventually elects a leader in ring S with probability 1, there must be at least one execution α of S that leads to some process j outputting LEADER. That is, there is some particular mapping from processes to sequences of random choices such that, in the execution α in which these choices are made, some process j is elected leader. Now consider a ring R of size 2n consisting of two half-rings R1 and R2, each of size n. Number the processes of R as 1, . . . , 2n. Then there is an execution α' of R in which processes i and n + i in R happen to make the same random choices as process i in S. In execution α' , processes i and n+i behave exactly like process i in execution α of S. Since process j outputs LEADER in execution α, both processes j and n + j output LEADER in execution α' . This contradicts problem requirement (a). Notice that this proof shows that we can’t achieve any positive election probability ε, not just probability 1. computernetworkassignmenthelp.com
  • 6. Problem 2. Breadth-First Search in an Asynchronous Network The asynchronous Breadth-First Search algorithm presented in class involves corrections that could trigger the sending of many messages, resulting in worst-case message complexity O(nE) and worst-case time complexity O(diam · n · d), until all nodes’ parent variables have stabilized to correct parents in a breadth-first spanning tree. (We are not considering individual processes’ parent outputs here, nor global termination. We are also ignoring local processing time.) This problem involves designing a better asynchronous Breadth-First Search algorithm, one that does not make any corrections. Thus, once a process sets its parent variable, it can output the value since that is its final decision. Assume that the network graph is connected and contains at least two nodes. (a) Describe carefully, in words, an algorithm in which the root node v0 coordinates the construction of the tree, level by level. Your algorithm should take time O(diam2 · d) until all the parent variables are set. (Hint: The root node can conduct broadcast-convergecast waves to build the successive levels in the tree. Four types of messages should be enough, e.g., search messages that test for new nodes, parent(b) (b a Boolean) for parent/nonparent responses, and ready and done messages for broadcasting and convergecasting signals on the tree.) computernetworkassignmenthelp.com
  • 7. Solution: Node v0 initiates successive phases of the algorithm. At each phase d, exactly the nodes at distance d from v0 get incorporated into the BFS tree. At phase 1: Node v0 sends search messages to all its neighbors. The neighbors record v0 as their parent, record that they are new nodes, and send parent responses back to v0. When v0 receives parent responses from all its neighbors, it is ready to start phase 2. At phase d, d ≥ 2: Node v0 broadcasts ready messages down all the branches of the tree built so far, until they reach the new nodes. Each new node sends search messages to all its neighbors. When a node receives a search message, if it does not already have a parent, it sets its parent variable to the sender’s id, records that it is new, and sends a parent response. If it already has a parent, it sends a nonparent response. When a new node has received responses to all its search messages, it sends a done(b) message to its parent, where b = TRUE if the node has received at least one parent response, = FALSE otherwise. The done messages get convergecast up the tree; each node sets the bit b in the message it sends to its parent to the “or” of the bits it received from its children. When node v0 has received done messages from all its children, it begins phase d + 1 if any of the messages contain value 1; otherwise it halts. computernetworkassignmenthelp.com
  • 8. (b) Analyze the time and communication complexity of your algorithm, and compare them to the costs of the asynchronous BFS algorithm presented in class. Solution: The time complexity is O(diam2 · d). Each phase takes time O(diam · d), and there are O(diam) phases. The message complexity is O(E + diam · n). Each edge is traversed once in each direction with search and parent messages. The ready and done messages traverse tree edges only, so there are O(n) of these per phase. Solution: If it is instructive here is some code for part (a) that we think might help understand this problem more deeply. Process v0 State variables: Transitions: computernetworkassignmenthelp.com for each v ∈ Γ(v0), send(v), a queue, initially (search) responded ⊆ Γ(v0), initially ∅ newinfo, a Boolean, initially false
  • 9. computernetworkassignmenthelp.com input receive(search)v,v0 , v ∈ Γ(v0) Effect: add parent(false) to send(v) input receive(parent(true))v,v0 , v ∈ Γ(v0) Effect: responded := responded ∪ {v} if responded = Γ(v0) then for each w ∈ Γ(v0), add ready to send(w) responded := ∅ newinfo := false input receive(done(b))v,v0 , b a Boolean, v ∈ Γ(v0) Effect: responded := responded ∪ {v} newinfo := newinfo ∨ b if responded = Γ(v0) and newinfo then for each w ∈ Γ(v0), add ready to send(w) responded := ∅ newinfo := false output send(m)v,v0 , m a message, v ∈ Γ(v0) Precondition: m = head(send(v)) Effect: remove head of send(v) Process u, u = v0 State variables: parent ∈ Γ(u) ∪ {⊥}, initially ⊥ children ⊆ Γ(u), initially ∅ newnode a Boolean, initially false for each v ∈ Γ(u), send(v), a queue,
  • 10. Transitions: computernetworkassignmenthelp.com input receive(search)v,u, v ∈ Γ(u) Effect: if parent = ⊥ then parent := v newnode := true add parent(true) to send(v) else add parent(false) to send(v) initially empty responded ⊆ Γ(u), initially ∅ newinfo, a Boolean, initially false input receive(parent(b))v,u, b a Boolean, v ∈ Γ(u) Effect: if b then children := children ∪ {v} newinfo := true responded := responded ∪ {v} if responded = Γ(u) then add done(newinfo) to send(parent) input receive(ready)v,u, v ∈ Γ(u) Effect: if newnode then for each w ∈ Γ(u), add search to send(w) else for each w ∈ children, add ready to send(w) responded := ∅ newinfo := false input receive(done(b))v,u, b a Boolean, v ∈ Γ(u
  • 11. computernetworkassignmenthelp.com ) Effect: responded := responded ∪ {v} newinfo := newinfo ∨ b if responded = children then add done(newinfo) to send(parent) output send(m)u,v, m a message, v ∈ Γ(u) Precondition: m = head(send(v)) Effect: remove head of send(v)