cs522 logo
rainbow animatio

Solution to CS522 F2006 Homework#3:  Protocol Verifiation/Implementation


Goal: Assignment Date: 9/26/2006
Due Day:10/2/2006 part1; 10/9/2006 part2
Description:

Part1. Protocol Verification

Exercise 1a. Reachability Analysis


Note you can use a tool called setool to verify your reachability analysis result. The web page for using setool is at http://cs.uccs.edu/~cs522/hw/hwF2004/setool.htm

Exercise 2. Understand the protocol behavior of Alternating Bit Protocol.

  • Given the alternating bit protocol,

  • altbit protocol
  • Describe the event sequence, starting from initial states, of the alternating bit protocol, if both channels lose the even messages, i.e., they lose the 2nd, 4th, 6th,... messages appears on channels. Each event can be identified as starting global state--machine:transition->ending global state. For example, (1,1,E,E)--S:NewData-->(2,1,E,E) is the first event.

  • Include events up to the one that successfully delivers A1 to the Sender.

    Ans: The event sequence is as follows:

    1.  (1, 1, E, E)—S:New Dataà(2, 1, E, E)

    2.  (2, 1, E, E)—S:-D0à(3, 1, D0, E)
    3. (3, 1, D0, E) —R: +D0
    à(3, 2, E, E)
    4. (3, 2, E, E)—R: Deliver Data
    à(3, 3, E, E)
    5. (3, 3, E, E)—R:-A0
    à(3, 4, E, A0)

    6. (3, 4, E, A0)—A:+A0à(4, 4, E, E)

    7. (4, 4, E, E)—S:New Dataà(5, 4, E, E)

    8. (5, 4, E, E)—S:-D1à(6, 4, D1, E)

    9. (6, 4, D1, E) —C1:Second Msg, loses D1à(6, 4, E, E)

    10. (6, 4, E, E)—S:timeoutà(8, 4, E, E)

    11. (8, 4, E, E)—S:-D1à(6, 4, D1, E) # this is a retransmission of D1

    12. (6, 4, D1, E)—R: +D1à(6, 5, E, E) # 3rd msg on C1, C1delivers D1

    13. (6, 5, E, E)—R:Deliver Dataà(6, 6, E, E)

    14. (6, 6, E, E)—R:-A1à(6, 1, E, A1)
    15. (6, 1, E, A1)—C2: Second Msg, Lose A1
    à(6, 1, E, E)
    16. (6, 1, E, E)—S:timeout
    à(8, 1, E, E)
    17. (8, 1, E, E)—S:-D1
    à(6, 1, D1, E)

    18. (6, 1, D1, E)—C1:4th Msg, loses D1à(6, 1, E, E)

    19. (6, 1, E, E)—S:timeoutà(8, 1, E, E)
    20. (8, 1, E, E)—S:-D1
    à(6, 1, D1, E)
    21. (6, 1, D1, E)—R:+D1
    à(6, 8, E, E) # 5th msg on C1, C1 delivers D1
    22. (6, 8, E, E)—R:-A1
    à(6, 1, E, A1) # retransmission of A1

    23. (6, 1, E, A1)—S:+A1à(1, 1, E, E) # This completes the first cycle of Senser's CFSM

 

Exercise 1c. Byte Ordering in Communications.

Part2. Protocol Implementation.

Exercise 2a: