Presentation is loading. Please wait.

Presentation is loading. Please wait.

2015/6/271 5.4 Correctness criteria for protocols.

Similar presentations


Presentation on theme: "2015/6/271 5.4 Correctness criteria for protocols."— Presentation transcript:

1 2015/6/271 5.4 Correctness criteria for protocols

2 2015/6/272 Delivery using different clocks

3 2015/6/273 ISIS message delivery

4 2015/6/274 5.5 Group Communication

5 2015/6/275 IPv4 multicast addresses Class D (starts with bit sequence1110) 224.0.0.1 to 239.255.255.255 (about 2 28  268 million) 224.0.0.1 is for “all systems on this subnet” 224.2.0.0 ~ 224.2.127.253 are for multimedia conference calls

6 2015/6/276 Java multicast sender String msg = “This is a test msg.”; InetAddress group=InetAddress.getByName("239.1.2.3"); MulticastSocket s = new MulticastSocket(3456); s.joinGroup(group); DatagramPacket msgOut = new DatagramPacket(msg.getBytes(), msg.length(), group, 3456); s.send(msgOut);

7 2015/6/277 Java multicast receiver byte[ ] buf = new byte[1000]; InetAddress group=InetAddress.getByName("239.1.2.3"); MulticastSocket s = new MulticastSocket(3456); s.joinGroup(group); DatagramPacket msgIn = new DatagramPacket(buf, buf.length); s.receive(msgIn);

8 2015/6/278 How to run

9 2015/6/279 Formal description of ISIS clock ICi P i initializes its clock IC i = [0,…,0]. For each msg sending event by P i  IC i [i]++  P i attaches IC i to message it sends. Upon receiving msg M from P j with M. ts, P i checks if  1) M.ts[j] == IC i [j] + 1 (M is next msg expected from P j )  2) IC i [k]  M.ts[k] for all other k (all msgs from P k that sender P j has received have been received by P i )  If both are satisfied, P i delivers M after IC i [j]++  Otherwise, P i puts M in hold-back Q until they are satisfied.

10 2015/6/2710 Comments 1) M.ts[j] == IC i [j] + 1 (M is next msg expected from P j ) 2) IC i [k]  M.ts[k] for all other k (all msgs from P k that sender P j has received have been received by P i )  If IC i [k] < M.ts[k], then before sending M, sender P j received msg M’ from P k that causally precedes M but M’ hasn’t been received by P i yet. ISIS delivers M before any other msg that is causally preceded by M  delivery respects causality order.

11 2015/6/2711 Example Violation check: M 3.ts[j] > IC 2 [j] for some j (j!=3)? Is there msg that sender knows about but receiver doesn’t? If so, receiver (P 2 ) delays delivery of M 3. M 3. ts[1] = 2 > 0 = IC 2 [1] in above example. “foo to P 2 ” “Do you have foo?” “Given to P 2 (=M 2 )” P1P1 P2P2 P3P3 Time 100 001 201 101 000 M1M1 “Do you have foo?”(=M3) 000 101 202 001

12 2015/6/2712 continued… Migrate foo to P 2 “Where is foo?” “foo is at P 2 ” P1P1 P2P2 P3P3 Time 100001 201 101 000 M1M1 M2M2 M 2.ts[1] > IC 3 [1]+1 Put M 2 in Hold-back Q M1.ts[1] = IC 3 [1]+1 IC 3  101; deliver M 1 IC 3  201; deliver M 2 Note: j th component of M.ts is sequence number of latest msg sent by P j that is known to sender of M

13 2015/6/2713 M’  M if and only if M’.ts < M.ts Assume M’ (M) was sent by P k (P j ), where j=k is possible. [If M’  M then M’.ts < M.ts] is easy to show  P j received M’ before sending M : M’.ts < IC j [ ] < M.ts To show [If M’.ts < M.ts then M’  M], we show instead ![M’  M] then ![M’.ts < M.ts] Assume ![M’  M]  Sender of M ( P j ) didn’t know about M’ at time of sending M.  Thus, M’.ts[k] > M.ts[k], i.e., ![M’.ts < M.ts]

14 2015/6/2714 Safety Sufficient to show that msgs are delivered in timestamp order. Suppose not  Let m (m’) be event of sending message M (M’)  Assume P i delivered msg M (from P k ) before M’ (from P j ), even though M’.ts (= IC j (m’)) < M.ts (=IC k (m)) …….(A) (a) Just before P i delivered M’: IC i [j]+1 = IC j (m’)[j] hence IC i [j] < IC j (m’)[j] (b) Delivery of M would have resulted in IC i [j]* = IC k (m)[j] at time of delivery  (a) and (b) contradict (A) since (b) took place before (a), hence IC i [j]*  IC i [j]

15 2015/6/2715 Liveness

16 2015/6/2716 continued … Assume IC i [k] < M.ts[k] for some k (!=j), i.e., condition (2) is violated; want to derive contradiction from this. Let M’ be latest msg from P k that P j delivered prior to sending M so that M’.ts < M.ts and M’.ts[k] = M.ts[k]. If P i hasn’t delivered copy of msg M’ from P k, then M’ with M’.ts < M.ts is in holdback Q of P i, contradicting assumption that M is not causally preceded by any other msg in holdback Q of P i. So P i must have delivered copy of msg M’ from P k.Thus IC i [k]  M’.ts[k] = M.ts[k], contradicting IC i [k] < M.ts[k] Must give up assumption that P i cannot deliver M.

17 2015/6/2717 Proof illustration PjPj PkPk PiPi M’ M M.ts>M’.ts P i already delivered M’  IC i [k]  M.ts[k]


Download ppt "2015/6/271 5.4 Correctness criteria for protocols."

Similar presentations


Ads by Google