interaction protocols
play

Interaction Protocols Martin Thompson - @mjpt777 Code Are - PowerPoint PPT Presentation

Interaction Protocols Martin Thompson - @mjpt777 Code Are protocols the most significant human discovery? protocol noun \ pr -t - k l \ Source: http://www.merriam-webster.com/ protocol noun \ pr -t - k l \ : a code


  1. Interaction Protocols Martin Thompson - @mjpt777

  2. Code

  3. Are protocols the most significant human discovery?

  4. protocol noun \ ˈ prō -t ə - ˌ k ȯ l \ Source: http://www.merriam-webster.com/

  5. protocol noun \ ˈ prō -t ə - ˌ k ȯ l \ : a code prescribing strict adherence to correct etiquette and precedence Source: http://www.merriam-webster.com/

  6. protocol noun \ ˈ prō -t ə - ˌ k ȯ l \ : a code prescribing strict adherence to correct etiquette and precedence : a set of conventions governing the treatment and formatting of data in an electronic communications system Source: http://www.merriam-webster.com/

  7. Evolutionary Biology

  8. Facial Expressions

  9. Etiquette & Manners

  10. Evolution of Communities Hygiene Disease <=> Courtesy Society <=> Norms Trust <=>

  11. Rules of Engagement “What is acceptable” “Good conditions to succeed” “ Jus ad bellum, Jus ad bello ”

  12. Concurrent & Distributed Systems

  13. How to Interact

  14. IETF (Internet Engineering Task Force)

  15. 418 “I'm a teapot”

  16. How should we document our protocols?

  17. API vs Protocol

  18. Open, *[Read | Write], Close

  19. Open, *[Read | Write], Close 1. Open: ... 2. Read: ... 3. Write: ... 4. Close: ...

  20. Think events and then consider: pre, post, and invariant conditions

  21. “What can go wrong?”

  22. Multicast Example

  23. ACK / NAK Implosion

  24. Where should we focus?

  25. Many Aspects to Consider • Layering • Feedback • Versioning • Sequencing • Encoding • Batching • Addressing • Sync/Async • Error Handling • Validation • Flow Control • Trust • Congestion Control • Privacy

  26. Encoding Don’t use text codecs! Please use binary codecs

  27. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-------------------------------------------------------------+ |R| Frame Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-------------------------------+ | Version |B|E| Flags | Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-------------------------------+ |R| Term Offset | +-+-------------------------------------------------------------+ | Session ID | +---------------------------------------------------------------+ | Stream ID | +---------------------------------------------------------------+ | Term ID | +---------------------------------------------------------------+ | Encoded Message ... ... | +---------------------------------------------------------------+

  28. Versioning

  29. Versioning/Identity Protocols: What conversation? •

  30. Versioning/Identity Protocols: What conversation? • Messages: What encoding? •

  31. Versioning/Identity Protocols: What conversation? • Messages: What encoding? • State: What instance? •

  32. MPMC Queue http://www.1024cores.net/

  33. Sync vs Async

  34. Synchronous

  35. Synchronous

  36. Synchronous

  37. Synchronous

  38. Synchronous

  39. Synchronous

  40. Synchronous

  41. Synchronous

  42. Synchronous

  43. Synchronous

  44. Synchronous

  45. Synchronous

  46. Synchronous What’s Happening?

  47. Asynchronous

  48. Asynchronous

  49. Asynchronous

  50. Asynchronous

  51. Asynchronous

  52. Asynchronous

  53. Asynchronous

  54. Asynchronous

  55. Asynchronous

  56. Asynchronous

  57. Asynchronous

  58. Asynchronous

  59. Asynchronous

  60. Asynchronous

  61. Asynchronous What’s Happening?

  62. But, but, synchronous is much easier...

  63. ...it’s all about feedback and managing state

  64. Events model the real world, i.e. it’s distributed

  65. When designing an API provide Async with an Sync wrapper if you must

  66. RPC / HTTP / TCP

  67. TCP → TCP Fast Open → QUIC HTTP/1.1 → SPDY → HTTP/2 TLS 1.2 → TLS 1.3

  68. Batching

  69. Etiquette of a request

  70. 100 GigE ?

  71. Syscalls

  72. Future of Syscalls sndmmsg, rcvmmsg() Onload, VMA DPDK, ef_vi, RDMA Verbs

  73. Natural Batching & Mechanical Sympathy

  74. ORMs vs SQL

  75. Snake Oil Protocols

  76. 2PC / XA

  77. “Two -Phase Commit is not fault tolerant because it uses a single coordinator whose failure can cause the protocol to block”

  78. Protocols requiring arbitration

  79. Guaranteed Delivery™

  80. Applications should have feedback & recovery protocols

  81. Protocol Layering Depend on behaviour, not implementation

  82. Wrapping up…

  83. Are protocols the most significant human discovery?

  84. Question, Hypothesis, Prediction, Experiment, Analysis

  85. Why are protocols not studied and practiced more?

  86. Your next project => 1. Frameworks? ⊕ Protocols? 2. ...

  87. Questions? @mjpt777 https://github.com/real-logic/aeron “A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable.” - Leslie Lamport

Recommend


More recommend