Higher-Order and Symbolic Computation

, Volume 14, Issue 4, pp 309–356 | Cite as

A Network Protocol Stack in Standard ML

  • Edoardo Biagioni
  • Robert Harper
  • Peter Lee
Open Access


The FoxNet is an implementation of the standard TCP/IP networking protocol stack using the Standard ML (SML) language. SML is a type-safe programming language with garbage collection, a unique and advanced module system, and machine-independent semantics. The FoxNet is a user-space implementation of TCP/IP that is built in SML by composing modular protocol elements; each element independently implements one of the standard protocols. One specific combination of these elements implements the standard TCP/IP stack. Other combinations are also possible and can be used to easily and conveniently build custom, non-standard networking stacks. This paper describes in detail the final design and implementation of the FoxNet, including many of the details that are crucially affected by the choice of SML as the programming language.

Standard ML computer networks modules signatures types 


  1. 1.
    Appel, A. Compiling with Continuations. Cambridge University Press, Cambridge, 1992.Google Scholar
  2. 2.
    Appel, A. and MacQueen, D. Standard ML of New Jersey. In Third International Symposium on Programming Languages Implementation and Logic Programming, J. Maluszynski and M. Wirsing (Eds.). New York, 1991, pp. 1-13.Google Scholar
  3. 3.
    Bershad, B., Chambers, C., Eggers, S., Maeda, C., McNamee, D., Pardyak, P., Savage, S., and Sirer, E. SPIN-An extensible microkernel for application-specific operating system services. In SIGOPS 1994 European Workshop. Dagstuhl, Germany, 1994.Google Scholar
  4. 4.
    Biagioni, E. A structured TCP in Standard ML. In Proceedings, 1994 SIGCOMM Conference, London, UK, 1994, pp. 36-45.Google Scholar
  5. 5.
    Biagioni, E., Cline, K., Haines, N., and Milnes, B. FoxNet performance test code. Available at∼esb/prof/foxtest200004.tar.gz.Google Scholar
  6. 6.
    Biagioni, E., Cline, K., Lee, P., Okasaki, C., and Stone, C. Safe-for-space threads in Standard ML. Higher-Order and Symbolic Computation, 11(2) (1998).Google Scholar
  7. 7.
    Biagioni, E., Harper, R., Lee, P., and Milnes, B. Signatures for a network protocol stack-a systems application of Standard ML. In 1994 ACM Conference on Lisp and Functional Programming, Orlando, FL, 1994.Google Scholar
  8. 8.
    Clark, D. The structuring of systems using upcalls. In Proceedings of the 10th SOSP, Orcas Island, Washington, 1985, pp. 171-180.Google Scholar
  9. 9.
    Cooper, E. and Morrisett, J.G. Adding threads to Standard ML. Technical Report CMU-CS-90-186, Carnegie Mellon University, 1990.Google Scholar
  10. 10.
    Day, J.D. and Zimmerman, H. The OSI reference model. In Proceedings of the IEEE, 71(12), (1983) 1334-1340.Google Scholar
  11. 11.
    Derby, H. The performance of FoxNet 2.0. Technical Report CMU-CS-99-137, School of Computer Science, Carnegie Mellon University, 1999.Google Scholar
  12. 12.
    Dijkstra, E.W. Recursive programming. In Numerische Mathematik. 1960, pp. 312-318.Google Scholar
  13. 13.
    Ford, B., Back, G., Benson, G., Lepreau, J., Lin, A., and Shivers, O. The Flux OSKit: A substrate for kernel and language research. In Proceedings of the Sixteenth ACM Symposium on Operating Systems Principles (SOSP-16), Saint-Malo, France.Google Scholar
  14. 14.
    Fu, G. Design and implementation of an operating system in Standard ML. Master's Thesis, University of Hawai'i at Mānoa, 1999. Available at∼esb/prof/proj/hello/guangrui/thesis/.Google Scholar
  15. 15.
    Hayden, M. The Ensemble system. Ph.D. Thesis, Cornell University, 1998. Available at Scholar
  16. 16.
    Kohler, E., Kaashoek, M.F., and Montgomery, D. A readable TCP in the Prolac protocol language. In SIGCOMM, 1999, pp. 3-13.Google Scholar
  17. 17.
    Milner, R., Tofte, M., and Harper, R. The Definition of Standard ML. MIT Press, Cambridge, MA, 1990.Google Scholar
  18. 18.
    Milner, R., Tofte, M., Harper, R., and MacQueen, D. The Definition of Standard ML(Revised). MIT Press, 1997.Google Scholar
  19. 19.
    O'Malley, S. and Peterson, L. A dynamic network architecture. ACM Transactions on Computer Systems, 10(2) (1992).Google Scholar
  20. 20.
    O'Malley, S., Proebsting, T., and Montz, A.B. USC: A universal stub compiler. In Proceedings, 1994 SIGCOMM Conference, London (UK), 1994, pp. 295-306.Google Scholar
  21. 21.
    Reppy, J.H. CML: A higher-order concurrent language. In Proceedings of the SIGPLAN '91 Conference on Programming Language Design and Implementation.Google Scholar
  22. 22.
    RFC 0791 Internet protocol. Information Sciences Institute, USC, 1981.Google Scholar
  23. 23.
    RFC 0793 Transmission Control Protocol. Information Sciences Institute, USC, 1981.Google Scholar
  24. 24.
    RFC 1014 XDR: External data representation standard. Sun Microsystems, Inc. 1987.Google Scholar
  25. 25.
    RFC 1057 RPC: Remote procedure call protocol specification, Version 2. Sun Microsystems, Inc, 1988.Google Scholar
  26. 26.
    Shivers, O. Virtualisable threads. In Proceedings of the Second ACM SIGPLAN Workshop on Continuations, Jan 1997, Paris, France, O. Danvy (Ed.) vol. 2, pp. 1-15. Technical Report BRICS-NS-96-13, University of Aarhus.Google Scholar
  27. 27.
    Shivers, O. The Express Project, 2000. Available at Scholar
  28. 28.
    Thibault, S., Consel, C., Lawall, J.L., Marlet, R., and Muller G. Static and dynamic program compilation by interpreter specialization. Higher-Order and Symbolic Computation, 13(3) (2000).Google Scholar
  29. 29.
    Wand, M. Continuation-based multiprocessing. Higher-Order and Symbolic Computation, 12(3) 1999, 285-299. Reprinted from the proceedings of the 1980 Lisp Conference.Google Scholar

Copyright information

© Kluwer Academic Publishers 2001

Authors and Affiliations

  • Edoardo Biagioni
    • 1
  • Robert Harper
    • 2
  • Peter Lee
    • 2
  1. 1.ICS DepartmentUniversity of Hawai'i at MānoaHonoluluUSA
  2. 2.School of Computer ScienceCarnegie Mellon UniversityPittsburghUSA

Personalised recommendations