https://github.com/li-plus/cs144
An elegant implementation for Stanford CS144 TCP Lab
https://github.com/li-plus/cs144
network-stack tcp tcp-ip
Last synced: 21 days ago
JSON representation
An elegant implementation for Stanford CS144 TCP Lab
- Host: GitHub
- URL: https://github.com/li-plus/cs144
- Owner: li-plus
- Created: 2021-07-01T09:09:43.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-02T15:37:28.000Z (over 2 years ago)
- Last Synced: 2025-02-15T23:41:58.443Z (3 months ago)
- Topics: network-stack, tcp, tcp-ip
- Language: C++
- Homepage: https://github.com/li-plus/cs144/blob/master/writeups/notes.md
- Size: 769 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
For solution, see [CS144 Notes](https://github.com/li-plus/cs144/blob/master/writeups/notes.md).
For build prereqs, see [the CS144 VM setup instructions](https://web.stanford.edu/class/cs144/vm_howto).
## Sponge quickstart
To set up your build directory:
$ mkdir -p /build
$ cd /build
$ cmake ..**Note:** all further commands listed below should be run from the `build` dir.
To build:
$ make
You can use the `-j` switch to build in parallel, e.g.,
$ make -j$(nproc)
To test (after building; make sure you've got the [build prereqs](https://web.stanford.edu/class/cs144/vm_howto) installed!)
$ make check_labN *(replacing N with a checkpoint number)*
The first time you run `make check_lab...`, it will run `sudo` to configure two
[TUN](https://www.kernel.org/doc/Documentation/networking/tuntap.txt) devices for use during
testing.### build options
You can specify a different compiler when you run cmake:
$ CC=clang CXX=clang++ cmake ..
You can also specify `CLANG_TIDY=` or `CLANG_FORMAT=` (see "other useful targets", below).
Sponge's build system supports several different build targets. By default, cmake chooses the `Release`
target, which enables the usual optimizations. The `Debug` target enables debugging and reduces the
level of optimization. To choose the `Debug` target:$ cmake .. -DCMAKE_BUILD_TYPE=Debug
The following targets are supported:
- `Release` - optimizations
- `Debug` - debug symbols and `-Og`
- `RelASan` - release build with [ASan](https://en.wikipedia.org/wiki/AddressSanitizer) and
[UBSan](https://developers.redhat.com/blog/2014/10/16/gcc-undefined-behavior-sanitizer-ubsan/)
- `RelTSan` - release build with
[ThreadSan](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Thread_Sanitizer)
- `DebugASan` - debug build with ASan and UBSan
- `DebugTSan` - debug build with ThreadSanOf course, you can combine all of the above, e.g.,
$ CLANG_TIDY=clang-tidy-6.0 CXX=clang++-6.0 .. -DCMAKE_BUILD_TYPE=Debug
**Note:** if you want to change `CC`, `CXX`, `CLANG_TIDY`, or `CLANG_FORMAT`, you need to remove
`build/CMakeCache.txt` and re-run cmake. (This isn't necessary for `CMAKE_BUILD_TYPE`.)### other useful targets
To generate documentation (you'll need `doxygen`; output will be in `build/doc/`):
$ make doc
To format (you'll need `clang-format`):
$ make format
To see all available targets,
$ make help