Git Product home page Git Product logo

mstack-cpp's Introduction

mstack-cpp ๐Ÿง

Build Status GitHub license

mstack-cpp is a Linux user-space TCP / IP stack based on TUN / TAP devices implemented in C++20.

This project aims to implement a SIMPLE and READABLE TCP / IP user-space protocol stack. Although it is not sound and cannot be used on a large scale, it is an excellent opportunity to explore the composition of the TCP / IP protocol stack. At the same time, it can help us to understand the various trade-offs on the architecture of the protocol stack.

Unlike C-style procedural programming, C++ has features such as object-oriented programming and meta-programming. This project uses c++ skills as much as possible to show a more explicit and more modern protocol stack.

Prerequisites

  • You MUST have /dev/net/tun device based on linux
  • CMake
  • fmt
  • glog

Running

mkdir build && cd build && cmake .. && make && sudo ./mstack

Current Feature

  • Ethernet II frame
  • ARP reply, simple caching
  • ICMP reply
  • IPv4 packet handling, checksum
  • TCPv4 Handshake
  • TCP RFC793 "Segment Arrives"

Doing Feature

  • ARP request
  • TCP RFC6298 Retransmission calculation
  • TCP RFC793 User Timeout
  • TCP data transmission
  • TCP Window Management
  • TCP Congestion Control
  • Server socket API calls (bind, accept...)

Upcoming Feature

  • IP Fragmentation
  • IP/ICMP Diagnostics
  • TCP Selective Acknowledgments (SACK)
  • TCP Silly Window Syndrome Avoidance
  • TCP Zero-Window Probes
  • ...

References

mstack-cpp's People

Contributors

qanora avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.