8 - Tokenloss and traversal Flashcards

1
Q

What is the purpose of tokens (in a ring topo)?

A

It is used in termination detection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In what kind of DA network structure do we expect to use tokens?

A

unidirectional ring topologies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How many tokens are required to detect tokenlosses?

A

at least two.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain the main idea of token loss detection.

A
  • when token t0 passes through some node P for the second time in a row
  • while in the meantime t1 has not passed through P
  • and in the meantime t0 and t1 have not met in another node
  • then t1 has been los
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What value(s) need to be tracked by each node in order to detect missing tokens?

A
  1. The counter value of the last token that has passed through the node
  2. Which tokens are currently present in the node.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the psudo code for receiving a token in a ring.

A
upon receipt of (token;j,c) do
    token_present[j]= 1
    m[j] = c
    if ( (token_present[1-j]) or (l=c) ) then
        m[j] = c + sign(c) 
        m[1-j] = -m[j] 
        token_present[1-j] = 1
    endif
enddo
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the psudo code for sending a token in a ring.

A
when (token_present[j] and C(i,j)) do
    token_present[j]= 0
    send(token;j,m[j])
    l = m[j]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain why tokens are only noticed by one node to be ‘missing’, and not by all nodes.

A

That node will regenerate new counter value for both tokens, meaning that the counter comparison in the other nodes will not ‘fail’ again.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the goal of a traversal algorithm?

A

To construct a subnetwork of a network that contains all nodes and is a spanning tree.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In traversal algorithms, what is set U ?

A

It is a set of a node’s links on which it has not yet sent the token. Set U also excludes any parent links (/nodes).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Explain the rules of Tarry’s algorithm.

A

Upon node receival:
1. if U is not empty, it sends the token on any link in U
2. if U is empty, it sends the token to its parent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How many times is a token send in the graph using Tarry’s algorithm? explain

A

2 |E|
Each node will receive a token over a link at least once, and therefor also has to send a token over each node once. Hence each link is used twice.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the time complexity of Tarrys algorithm?

A

2 |E|

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In Traversal algorithms, how does a node decide its parent?

A

It decides that from whoever it receives a token first, becomes that node’s parent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the biggest drawback for tarry’s algorithm?

A

Number of messages send is very large, which makes it innefficient and time consuming.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is an DFS algorithm?

A

Depth-First Search algorithm

17
Q

Explain the rules of Cheung’s DFS (v1) algorithm.

A
  1. Upon receiving the token for the first time or
    on a link not in U:
    a. if U is not empty, send the token on any link in U
    b. if U is empty, return the token to parent.
  2. Upon receiving the token not for the first time and on a link in U: reflect the token back on the same link.
18
Q

Explain what reflecting is in cheung’s DFS (v1) algorithm.

A

Upon receiving the token not for the first time and on a link in U (so on an unused link), it sends the token back on the same link.

19
Q

How many messages are send in Cheung’s DFS algorithm?

A

2|E|

20
Q

Explain the rules of Cheung’s DFS (v2) algorithms

A
  1. Upon receiving the token for the first time or receiving an echo:
    a. if U is not empty, send the token an any link in U
    b. if U is empty, send an echo to its parent
  2. Upon receiving the token not for the first time, send an echo back
21
Q

Wha tis the time complexity of Cheung’s DFS algorithm?

A

2|E|

22
Q

Explain Awerbuch’s DFS algorithm.

A

It is an adaption from Cheung’s DFS algorithm. Each node will ask some of its neighbours if a token has already visited that neighbour. It will only forward the token to neighbours that have not yet had the token.

23
Q

What are the consequences of Awerbuch’s DFS algorithm? (compared to Cheung’s)

A
  1. It reduces the amount of times the token is transferred (only meaningful transfers happen).
  2. Each node can conclude if it has received the token for the second time, its from its child.
  3. Higher message complexity overall.
24
Q

What is the message complexity of Awerbuch’s DFS algorithm?

A

2(|V|-1) + 4 |E|

(The first part describes the token traversion through the tree, the second part describes the ‘visited’ messages)

25
Q

What is the time complexity of Awerbuch’s DFS algorithm?

A

4(|V|-1)

26
Q

Explain Cidon’s DFS algorithm.

A

Its an adaption of Awerbuch.
Whenever a process receives the token, it sends a “visited” signal to its neighbours. It then forwards the token to a link it has not received a “visited” from. ( And not its parent. ). The token still gets returned to the parent after no links are suitable for token transfer.

27
Q

How is Cidon’s DFS algorithm protected against deadlocks?

A

When process Q sends the token to R, it sends a “visited” to P. R then sends the token to P. However, the token arrives earlier to P then the “visited” from Q. In this case P could send the token to Q. Afterwards it receives the visited. This normally would result in a incomplete tree/deadlock. However, P tracks its sents and visited, thus realising its mistake. It generates a new token and continues building the spanning tree.