Session Types for the Transport Layer: Towards an Implementation of TCP (2404.05478v1)
Abstract: Session types are a typing discipline used to formally describe communication-driven applications with the aim of fewer errors and easier debugging later into the life cycle of the software. Protocols at the transport layer such as TCP, UDP, and QUIC underpin most of the communication on the modern Internet and affect billions of end-users. The transport layer has different requirements and constraints compared to the application layer resulting in different requirements for verification. Despite this, to our best knowledge, no work shows the application of session types at the transport layer. In this work, we discuss how multiparty session types (MPST) can be applied to implement the TCP protocol. We develop an MPST-based implementation of a subset of a TCP server in Rust and test its interoperability against the Linux TCP stack. Our results highlight the differences in assumptions between session type theory and the way transport layer protocols are usually implemented. This work is the first step towards bringing session types into the transport layer.
- In Bartek Klin, Slawomir Lasota & Anca Muscholl, editors: 33rd International Conference on Concurrency Theory, CONCUR 2022, September 12-16, 2022, Warsaw, Poland, LIPIcs 243, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, pp. 35:1–35:25, 10.4230/LIPICS.CONCUR.2022.35.
- In Luís Caires, editor: Programming Languages and Systems - 28th European Symposium on Programming, ESOP 2019, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2019, Prague, Czech Republic, April 6-11, 2019, Proceedings, Lecture Notes in Computer Science 11423, Springer, pp. 583–610, 10.1007/978-3-030-17184-1_21.
- Scott O. Bradner (1996): The Internet Standards Process – Revision 3. RFC 2026, 10.17487/RFC2026. Available at https://www.rfc-editor.org/info/rfc2026.
- Matthew Alan Le Brun & Ornela Dardha (2023): MAGπ𝜋\piitalic_π: Types for Failure-Prone Communication. In Thomas Wies, editor: Programming Languages and Systems - 32nd European Symposium on Programming, ESOP 2023, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2023, Paris, France, April 22-27, 2023, Proceedings, Lecture Notes in Computer Science 13990, Springer, pp. 363–391, 10.1007/978-3-031-30044-8_14.
- Dagstuhl Artifacts Ser. 7(2), pp. 02:1–02:3, 10.4230/DARTS.7.2.2.
- Wesley Eddy (2022): Transmission Control Protocol (TCP). RFC 9293, 10.17487/RFC9293. Available at https://www.rfc-editor.org/info/rfc9293.
- Heather Flanagan (2019): Fifty Years of RFCs. RFC 8700, 10.17487/RFC8700. Available at https://www.rfc-editor.org/info/rfc8700.
- Simon Fowler (2016): An Erlang Implementation of Multiparty Session Actors. In Massimo Bartoletti, Ludovic Henrio, Sophia Knight & Hugo Torres Vieira, editors: Proceedings 9th Interaction and Concurrency Experience, ICE 2016, Heraklion, Greece, 8-9 June 2016, EPTCS 223, pp. 36–50, 10.4204/EPTCS.223.3.
- Simon Gay, Vasco Vasconcelos & António Ravara (2003): Session Types for Inter-Process Communication. Available at https://www.dcs.gla.ac.uk/~simon/publications/TR-2003-133.pdf.
- Kohei Honda, Vasco T. Vasconcelos & Makoto Kubo (1998): Language primitives and type discipline for structured communication-based programming. In Chris Hankin, editor: Programming Languages and Systems, Springer Berlin Heidelberg, Berlin, Heidelberg, pp. 122–138, 10.1007/BFb0053567.
- Kohei Honda, Nobuko Yoshida & Marco Carbone (2008): Multiparty Asynchronous Session Types. In: Proc. of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’08, Association for Computing Machinery, New York, NY, USA, pp. 273–284, 10.1145/1328438.1328472.
- Raymond Hu, Nobuko Yoshida & Kohei Honda (2008): Session-Based Distributed Programming in Java. In Jan Vitek, editor: ECOOP 2008 – Object-Oriented Programming, Springer Berlin Heidelberg, Berlin, Heidelberg, pp. 516–541, 10.1007/978-3-540-70592-5_22.
- Thomas Bracht Laumann Jespersen, Philip Munksgaard & Ken Friis Larsen (2015): Session Types for Rust. In: Proceedings of the 11th ACM SIGPLAN Workshop on Generic Programming, WGP 2015, Association for Computing Machinery, New York, NY, USA, pp. 13–22, 10.1145/2808098.2808100.
- Wen Kokke (2019): Rusty Variation: Deadlock-free Sessions with Failure in Rust. Electronic Proceedings in Theoretical Computer Science 304, pp. 48–60, 10.4204/eptcs.304.4.
- Wen Kokke & Ornela Dardha (2021): Deadlock-free session types in linear Haskell. In: Haskell 2021: Proceedings of the 14th ACM SIGPLAN International Symposium on Haskell, Virtual Event, Korea, August 26-27, 2021, ACM, pp. 1–13, 10.1145/3471874.3472979.
- In: Proceedings of the 18th International Symposium on Principles and Practice of Declarative Programming, Edinburgh, United Kingdom, September 5-7, 2016, ACM, pp. 146–159, 10.1145/2967973.2968595.
- Sci. Comput. Program. 155, pp. 52–75, 10.1016/J.SCICO.2017.10.006.
- Nicolas Lagaillardie, Rumyana Neykova & Nobuko Yoshida (2022): Stay Safe Under Panic: Affine Rust Programming with Multiparty Session Types (Artifact). Dagstuhl Artifacts Ser. 8(2), pp. 09:1–09:16, 10.4230/DARTS.8.2.9.
- Sam Lindley & J. Garrett Morris (2015): A Semantics for Propositions as Sessions. In Jan Vitek, editor: Programming Languages and Systems - 24th European Symposium on Programming, ESOP 2015, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2015, London, UK, April 11-18, 2015. Proceedings, Lecture Notes in Computer Science 9032, Springer, pp. 560–584, 10.1007/978-3-662-46669-8_23.
- Sam Lindley & J. Garrett Morris (2016): Talking bananas: structural recursion for session types. In Jacques Garrigue, Gabriele Keller & Eijiro Sumii, editors: Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming, ICFP 2016, Nara, Japan, September 18-22, 2016, ACM, pp. 434–447, 10.1145/2951913.2951921.
- In: Proceedings of the Applied Networking Research Workshop, Association for Computing Machinery, New York, NY, USA, p. 25–31, 10.1145/3404868.3406671.
- In: Proceedings of the IFIP Networking Conference, pp. 1–9, 10.23919/IFIPNetworking52078.2021.9472829.
- Matthias Neubauer & Peter Thiemann (2004): An Implementation of Session Types. In Bharat Jayaraman, editor: Practical Aspects of Declarative Languages, 6th International Symposium, PADL 2004, Dallas, TX, USA, June 18-19, 2004, Proceedings, Lecture Notes in Computer Science 3057, Springer, pp. 56–70, 10.1007/978-3-540-24836-1_5.
- Nicholas Ng & Nobuko Yoshida (2016): Static deadlock detection for concurrent go by global session graph synthesis. In Ayal Zaks & Manuel V. Hermenegildo, editors: Proceedings of the 25th International Conference on Compiler Construction, CC 2016, Barcelona, Spain, March 12-18, 2016, ACM, pp. 174–184, 10.1145/2892208.2892232.
- Nicholas Ng, Nobuko Yoshida & Kohei Honda (2012): Multiparty Session C: Safe Parallel Programming with Message Optimisation. In Carlo A. Furia & Sebastian Nanz, editors: Objects, Models, Components, Patterns, Springer Berlin Heidelberg, Berlin, Heidelberg, pp. 202–218, 10.1007/978-3-642-30561-0_15.
- Luca Padovani (2017): A simple library implementation of binary sessions. J. Funct. Program. 27, p. e4, 10.1017/S0956796816000289.
- Vern Paxson (1997): Automated packet trace analysis of TCP implementations. In: Proceedings of the ACM SIGCOMM’97 conference on Applications, technologies, architectures, and protocols for computer communication, pp. 167–179, 10.1145/263105.263160.
- Riccardo Pucella & Jesse A. Tov (2008): Haskell session types with (almost) no class. In Andy Gill, editor: Proceedings of the 1st ACM SIGPLAN Symposium on Haskell, Haskell 2008, Victoria, BC, Canada, 25 September 2008, ACM, pp. 25–36, 10.1145/1411286.1411290.
- Pete Resnick (2014): On Consensus and Humming in the IETF. RFC 7282, 10.17487/RFC7282. Available at https://www.rfc-editor.org/info/rfc7282.
- Alceste Scalas & Nobuko Yoshida (2019): Less is More: Multiparty Session Types Revisited. Proc. ACM Program. Lang. 3(POPL), 10.1145/3290343.
- Scapy community: Scapy. https://scapy.net/.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.