verifying the cpa
play

Verifying the CPA Networking Stack using SPIN/Promela Kevin - PowerPoint PPT Presentation

Verifying the CPA Networking Stack using SPIN/Promela Kevin Chalmers and Jon Kerridge Edinburgh Napier University Breakdown Introduction and Motivation CPA Networking Stack Architecture Operation SPIN Model of the CPA


  1. Verifying the CPA Networking Stack using SPIN/Promela Kevin Chalmers and Jon Kerridge Edinburgh Napier University

  2. Breakdown • Introduction and Motivation • CPA Networking Stack • Architecture • Operation • SPIN Model of the CPA Networking • Processes • Architecture • Results • Conclusions and Future Work

  3. Motivation • CPA Networking Stack developed from JCSP Networking • net2 package • Original JCSP Networking had poor error handling • Errors in the stack not sent to application layer • Verify CPA Networking Stack operates under certain conditions • Bufferring • Network failure

  4. SPIN/Promela • SPIN (Simple Promela INterpreter) provides state space checking • Assertion checking • Deadlock • Liveness • Language to build SPIN models is Promela (PROcess MEta LAnguage) • Similar semantics to CSP • Components as processes • Processes communicate via channels • Choice between events • Provides channel mobility (CPA Networking Stack currently relies on channel mobility internally)

  5. CPA Networking Stack • CPA Networking Stack developed from JCSP Networking • Goal is to provide a method to allow multiple platform / framework communication in a transparent CPA manner • Networked channels • Networked barriers • Development of standard components and protocol • Take two views • Layered architecture • High-level component architecture

  6. Layered Architecture • Application layer Application • User level processes E vent Interfaces R untime Data Types • Event layer Virtual Numbering E vent • Networked C hannel & Link C onnection C P A Networking Protocol synchronization primitives Link Node Addressing • Link layer C onnection S tream R aw Data • Connections to other C ommunication S pecific C ommunication Addressing nodes C ommunication S pecific Messaging • Communication layer • Underlying I/O mechanism

  7. High Level Architecture Application Application Process Process • Link • LinkTx for outgoing messages • LinkRx for incoming messages – protocol Net Channel Net Channel Input Output implemented here • Networked channels • Output provides a writing Link end • Input provides a reading LinkRx LinkTx end • Other components for management, barriers

  8. Protocol • Message defined by a triple (with possible data load) • (<type>, <attr1>, <attr2>, [<data>]) • Basic channel messages • (SEND, <dest>, <source>, <data>) • (ACK, <dest>, null) • (REJECT_CHANNEL, <dest>, null) • (POISON, <dest>, <strength>) • (LINK_LOST, <null>, <null>) • (ASYNC_SEND, <dest>, <source>, <data>)

  9. SEND/ACK Operation 3. bytes 2. SEND|97|45|[data] 4. SEND|97|45|[data] LinkTx LinkRx 1. write 5. read Application Net Channel Net Channel Application Process Output (45) Input (97) Process 6. [data] 10. end write LinkRx LinkTx 9. ACK|45|-1 8. bytes 7. ACK|45|-1

  10. SEND/REJECT Operation 3. bytes 2. SEND|97|45|[data] LinkTx LinkRx 1. write Application Net Channel 4. REJECT_CHANNEL|45|-1 Process Output (45) 7. exception LinkRx LinkTx 6. REJECT_CHANNEL|45|-1 5. bytes

  11. SEND/LINK_LOST • One of the biggest issues in JCSP Networking • Link failure caused resources to remain and messages to disappear • LINK_LOST message now informs all outgoing channels of link failure • Two possibilities • Prior to a write, link goes down. SEND message immediately replied with LINK_LOST • Mid-write link goes down. All output channels connected to link are sent LINK_LOST

  12. Building a SPIN Model of CPA Networking • Only five messages of interest from protocol • ASYNC_SEND cannot be checked as sender waits for no ACK – infinite state space • Promela uses mtype to define message types mtype = { SEND , ACK , REJECT_CHANNEL , POISON , LINK_LOST };

  13. Channel States • INACTIVE • OK_INPUT POISONED • OK_OUTPUT POISON or POISON or poison() • POISONED poison() REJECT_CHANNEL or • DESTROYED LINK_LOST create() create() • BROKEN OK_INPUT INACTIVE OK_OUTPUT BROKEN typedef CHANNEL_DATA destroy() destroy() { byte vcn ; DESTROYED byte state = INACTIVE ; chan toChannel ; };

  14. NetChannelOutput • Use channels to simulate method calls • Three operations write • Write poison toLinkTx • Poison NetChannelOutput • Destroy destroy ackChannel • NetChannelOutput callReturn connected to a LinkTx • Incoming acknowledgement channel

  15. NetChannelInput • Five operations • Read read • Start Read and End startRead Read • Extended rendezvous endRead fromLink • Poison NetChannelInput poison • Destroy destroy • NetChannelInput has callReturn an incoming channel for messages

  16. Link Process • Link contains two sub- processes • LinkTx • LinkRx – see paper for toNetwork toLinkTx full Promela code Link fromNetwork • Incoming link from event processes • Connection to the network

  17. InputNode InputNode Link NetChannelInput Receiver

  18. OutputNode OutputNode Sender NetChannelOutput Link

  19. Network Process • Network process simply forward messages from the InputNode to the OutputNode and vice-versa • To simulate failure, the Network process can non- deterministically fail • See paper for Network process code • Sending and receiving modelled as atomic – the underlying communication mechanism is assumed to deal with incomplete messages • Exceptional behaviour

  20. SPIN Model of CPA Networking • Model has one OutputNode connected to one InputNode • The OutputNode can have multiple output channels OutputNode Network InputNode • InputNode channel has a buffer • Discussed later • Flag used to determine link failure

  21. Initial Findings • Single NetChannelOutput connected to a single NetChannelInput with single space buffer successful • Basic assumption • Link informing NetChannelOutputs of link failure solves link failure problems • Original JCSP Networking did not lock state of a networked channel • Never experienced but would lead to a failed channel being sent a message and no error raised • State of a channel is now locked – no race hazard!

  22. Verifying the Model - Assumptions • CPA Networking works on the premise that for every connected network output to a network input, one space is required in the input channel buffer • For implementation purposes, a channel has an “infinite” buffer • To check this, we need to examine the relationship between the number of connected outputs to a network input and the buffer size

  23. Results NUMBER_OUTPUTS 1 2 3 4 BUFFER_SIZE 0 FAIL FAIL FAIL FAIL 𝟒. 𝟏𝟕 × 𝟐𝟏 𝟔 𝒕𝒖𝒃𝒖𝒇𝒕 1 FAIL FAIL FAIL 𝟒𝟔𝟐 𝒆𝒇𝒒𝒖𝒊 𝟑. 𝟖𝟗 × 𝟐𝟏 𝟔 𝒕𝒖𝒃𝒖𝒇𝒕 𝟒. 𝟖𝟐 × 𝟐𝟏 𝟖 𝒕𝒖𝒃𝒖𝒇𝒕 2 FAIL FAIL 𝟒𝟔𝟐 𝒆𝒇𝒒𝒖𝒊 𝟒𝟑𝟕𝟓 𝒆𝒇𝒒𝒖𝒊 𝟒. 𝟖𝟐 × 𝟐𝟏 𝟖 𝒕𝒖𝒃𝒖𝒇𝒕 𝟑. 𝟖𝟗 × 𝟐𝟏 𝟔 𝒕𝒖𝒃𝒖𝒇𝒕 3 PASS* FAIL 𝟒𝟔𝟐 𝒆𝒇𝒒𝒖𝒊 𝟒𝟑𝟕𝟓 𝒆𝒇𝒒𝒖𝒊 𝟑. 𝟖𝟗 × 𝟐𝟏 𝟔 𝒕𝒖𝒃𝒖𝒇𝒕 𝟒. 𝟖𝟐 × 𝟐𝟏 𝟖 𝒕𝒖𝒃𝒖𝒇𝒕 4 PASS* PASS* 𝟒𝟑𝟕𝟓 𝒆𝒇𝒒𝒖𝒊 𝟒𝟔𝟐 𝒆𝒇𝒒𝒖𝒊

  24. Conclusions • CPA Networking Stack is deadlock free even under network failure • Removed the lack of state protection in the original JCSP implementation • Buffer size has a relation to number of incoming networked outputs • Infinite buffer should ensure deadlock freedom

  25. Future Work • Really need to show that the networked channel behaves as a standard channel • Refinement check • SPIN doesn’t support refinement checks • Temporal logic capabilities • Simplify the model and check – but would remove most behaviour • Current plan is to move to a networking stack that can sit atop MPI • Reengineering and further verification would be required

  26. Questions?

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend