Skip to content

LuCC-que/TCP-implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS144 TCP/IP Implementation

Welcome to my repo, this is a implementation of TCP/IP comming from Standford computer network class, the project is divided into 7 labs, lab 0 is a simple web-getter application using build in TCP socket, then from lab1 - lab4 we will build a simple TCP protocal to replace the TCP socket in web-getter application, at this point the TCP protocal is already usable, the last two labs, 5 and 6, is building the link layer protocal and IP router table.

Q: Why your contribution is so little

A: well, back the may-june, 2022, I didn't use git well, if you click into commit message, you can see there are lager amount of commit with wrong value but my name is on it

Demonstration

Getting CS144 website! screen shot 1

Getting Queen's website! screen shot 2

Getting Standford website! screen shot 2

Postscript

There are still many limitations to this toy protocal, and performance is low, CPU-limited throughput is 0.08 Gbit/s, CPU-limited throughput with reordering is 0.08 Gbit/s, there are some advanced C++ technique needs to be appiled


For build prereqs, see the CS144 VM setup instructions.


Sponge quickstart

To set up your build directory:

$ mkdir -p <path/to/sponge>/build
$ cd <path/to/sponge>/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 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 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 and UBSan
  • RelTSan - release build with ThreadSan
  • DebugASan - debug build with ASan and UBSan
  • DebugTSan - debug build with ThreadSan

Of 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published