100
1 Broadcast

1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

Embed Size (px)

Citation preview

Page 1: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

1

Broadcast

Page 2: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

2

Page 3: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

3

Use a spanning tree

Root

Page 4: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

4

synchronous

•It takes the same time at link to send a message•It takes the same time at each node to process the incoming data

Page 5: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

5

Page 6: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

6

Page 7: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

7

Time complexity:

d levels

n nodes

Message complexity:

)(dO)(nO

Page 8: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

8

asynchronous

Links and nodes may have different delays

Page 9: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

9

Page 10: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

10

slowlink

Page 11: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

11

slowlink

Page 12: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

12

Actualdelivery

Page 13: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

13

Page 14: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

14

Time complexity:

d levels

n nodes

Message complexity:

)(dO)(nO

Page 15: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

15

Convergecast

Page 16: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

16

synchronous

Page 17: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

17

Page 18: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

18

Page 19: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

19

Page 20: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

20

Time complexity:

d levels

n nodes

Message complexity:

)(dO)(nO

Page 21: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

21

asynchronous

Page 22: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

22

Page 23: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

23

Page 24: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

24

Page 25: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

25

Page 26: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

26

Time complexity:

d levels

n nodes

Message complexity:

)(dO)(nO

Page 27: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

27

Building a BFS Spanning Tree

Page 28: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

28

Tree algorithm for node :

Upon receipt of <invitation> messagefrom neighbor node :

If not member of tree:

v

accept invitation by sending <accept> message to ;

u

v (the father)

If member of tree:decline invitation by sending <reject> message to ; v

Send invitations to all neighbors, except v

Page 29: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

29

synchronous

Page 30: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

30

A node initiates the BFS process

<invitation><invitation>

Page 31: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

31

become membersof tree

Page 32: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

32

<accept><accept>

Page 33: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

33

Page 34: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

34

Page 35: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

35

<reject>

Page 36: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

36

Page 37: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

37

Page 38: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

38

<reject>

Page 39: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

39

Page 40: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

40

Page 41: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

41

Alternative solution

Page 42: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

42

Page 43: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

43

reject

Page 44: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

44

Page 45: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

45

Page 46: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

46

Time complexity:

D diameter

n nodes

Message complexity:

)(DO)(mO

m edges

Page 47: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

47

asynchronous

Page 48: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

48

Page 49: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

49

Page 50: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

50

Page 51: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

51

Page 52: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

52

slow node

Page 53: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

53

Page 54: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

54

Page 55: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

55

Page 56: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

56

Page 57: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

57

Page 58: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

58

reject

Page 59: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

59

Page 60: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

60

Page 61: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

61

reject

Page 62: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

62

Page 63: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

63

Time complexity:

D diameter

n nodes

Message complexity:

)(DO)(mO

m edges

Page 64: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

64

The asynchronous algorithm may give deeper trees than the diameter

Example:

Clique graph

Synchronous BFS Asynchronous BFS

Page 65: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

65

Building a DFS Spanning Tree

Page 66: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

66

12

11

2

3

1

23

1

23

1

2

12

34

2

34

Page 67: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

67

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 68: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

68

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 69: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

69

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 70: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

70

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 71: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

71

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 72: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

72

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 73: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

73

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1reject

Page 74: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

74

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 75: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

75

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 76: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

76

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 77: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

77

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 78: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

78

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

reject

Page 79: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

79

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 80: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

80

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

reject

Page 81: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

81

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 82: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

82

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 83: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

83

Time complexity:

n nodes

Message complexity:

)(mO)(mO

m edges 12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

Page 84: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

84

Building a DFS Spanning Treewith no specified root

Page 85: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

85

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

1

Page 86: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

86

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

1

8

1

Page 87: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

87

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

1

8

181

Page 88: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

88

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

1

8

181

Page 89: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

89

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

1

8

881

Page 90: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

90

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

1

8

881

Page 91: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

91

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

1

8

881

reject

Page 92: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

92

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

1

8

881

Page 93: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

93

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

8

8

881

Page 94: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

94

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

8

8

881

8

Page 95: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

95

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

8

8

881

8

8

Page 96: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

96

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

8

8

881

8

8

Page 97: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

97

12

11

2

3

1

23

1

23

1

2

12

34

2

34

8

8

8

8

881

8

8

Page 98: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

98

12

11

2

3

1

23

1

23

1

2

12

34

2

34

8

8

8

8

881

8

8

Page 99: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

99

12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

8

8

881

8

8

root

Page 100: 1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process

100

Time complexity:

n nodes

Message complexity:

)(mO)( mnO

m edges 12

11

2

3

1

23

1

23

1

2

12

34

2

34

1

8

8

8

881

8

8

root