Building Communication Systems from Components Ensemble and Nuprl - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Building Communication Systems from Components Ensemble and Nuprl

Description:

VLSI uses component based approach to build larger systems ... Simple, lends itself deriving properties (such as FIFOness) Not executable. Concrete spec ... – PowerPoint PPT presentation

Number of Views:160
Avg rating:3.0/5.0
Slides: 21
Provided by: compu62
Category:

less

Transcript and Presenter's Notes

Title: Building Communication Systems from Components Ensemble and Nuprl


1
Building Communication Systems from Components
(Ensemble and Nuprl)
2
Key observations
  • VLSI uses component based approach to build
    larger systems
  • Why cant we mimic that for software systems?
  • Problems
  • Layering inefficiencies
  • Additional function calls
  • Loss of locality
  • Redundant code and unused header fields
  • Separate compilation leading to poor optimization

3
Advantages of components
  • Easy to design, test, optimize individual
    components
  • More readily adapted and tuned for new
    environments than monolithic systems
  • Facilitates evolution since easily extensible
    with additional components
  • How can we get the advantages without
    sacrificing performance?
  • Put theory and practice together

4
Cornell experiment
  • Ensemble
  • Protocol stack built using micro-protocols
  • OCaml (see Caml origin) used as the programming
    language
  • Formal semantics
  • Efficient machine code
  • Specification using IOA
  • Syntax close to C
  • Allows composition of subsystems specified using
    IOA
  • Formal methods using Nuprl
  • Logic system for program development,
    verification, and optimization
  • Understands IOA spec and OCaml code
  • Correctness can be verified
  • Code can be optimized

5
Justification
  • Ensemble has over 60 components
  • Set of micro-protocols (sliding window,
    fragmentation/reassembly, flow control,
    encryption, )
  • Can be composed to realize a variety of
    communication protocol stacks (eg. TCP/IP)
  • Micro-protocol interface structure
  • Top level to talk to layer above
  • Bottom level to talk to layer below
  • Event driven interface

6
  • OCaml
  • Leads to compact code
  • High level ops on data structures
  • Automatic memory allocation, GC, marshaling
  • Programmability compared to C
  • Precise definition leading verifiability of code
  • IOA
  • Gives high level logical spec of micro-protocol
    components
  • Nuprl
  • Tools convert OCaml code to Nuprl and vice versa
  • Translated OCaml code can be reasoned and
    evaluated

7
Specification and Implementation
  • Properties spec
  • E.g. in order delivery
  • Behavioral spec
  • E.g. ack every packet
  • Abstract behavior spec
  • Simple, lends itself deriving properties (such as
    FIFOness)
  • Not executable
  • Concrete spec
  • Close to implementation
  • Implementation
  • Small difference from concrete spec
  • Order of execution of actions
  • Condition checking for specific actions

8
Two abstract specs
FIFO network
Lossy network
9
Concrete Specification FIFO on lossy network
10
Putting them all together
11
Synthesizing stacks
  • Given a behavior spec
  • Can a stack (composed of Ensemble
    micro-protocols) be synthesized?
  • Brute force will not work, why?
  • Ensemble approach
  • Algorithm that synthesizes a stack given set of
    properties (currently 24 props) and designers
    knowledge
  • No guarantee that the stack is correct!
  • while possible not yet automated
  • Beware of bugs in the above code I have only
    proved it correct, not tried it!! -- Donald Knuth

12
Optimization opportunities in Ensemble
  • Use internal explicit memory management than
    OCaml implicit GC
  • Avoid marshaling and unmarshaling across layers
  • Buffering in parallel with xmission
  • Identifying and colocating common code path
    across layers for locality
  • Header compression to eliminate redundant or
    unnecessary fields

13
Formal optimization using Nuprl
  • Common Case Predicate (CCP)
  • State of protocol and input event
  • E.g. deliver event if sequence number of received
    packet equals that expected
  • Synthesized from the conditional statements in a
    micro-protocol
  • Generate bypass code if CCP true
  • Can bypass several layers
  • Can compress headers

14
Nuprl methodology
  • Static level
  • Depends on the micro-protocol code
  • Semi-automatic with designer help
  • Dynamic level
  • Completely automated
  • Composes layers
  • Generates bypass code
  • Optimization vs. verification?

15
Static optimization
  • Layer by layer
  • Code transformations
  • Function inlining
  • Directed equality substitutions
  • Specific to functional programming leading to
    code simplicity
  • Context dependent simplifications
  • Helps in synthesizing code for the CCP bypass

16
Dynamic optimization
  • Optimization across several layers
  • Fully automated
  • Optimization theorem
  • Proves equivalence of CCP bypass code to the
    ensemble protocol stack
  • Optimization theorem generated automatically
  • Final step
  • Results of all the optimization theorems
    converted to OCaml code
  • Resultant program equivalent to original stack
    but more efficient

17
Big picture
18
Performance
  • Four versions
  • IMP imperative (normal) version
  • FUNC functional composition version
  • HAND hand optimized bypass code for special
    stacks
  • MACH Nuprl methodology to generate this machine
    optimized stack

19
Results
300 MHZ UltraSparc 100 Mbps Ethernet
Sensitivity to message size
20
Connections to other work we have already seen
  • Specializing is not new
  • Done in SPIN, Exokernel, Thekkath and Levys work
  • What are the similarities?
  • What are the differences?
Write a Comment
User Comments (0)
About PowerShow.com