Skip to content

Getting Started: CLI (macOS)

Wonsup Yoon edited this page Mar 21, 2024 · 9 revisions

Prerequisites

Install Command Line Tools or Xcode

  • Command Line Tools: xcode-select --install
  • Xcode

Install CMake

Build

  1. Download and extract latest version.
  2. Open terminal and go to the extracted directory
  3. Prepare build files
$ cmake -B build .
  1. Move to build directory
$ cd build
  1. Build
$ make -j$(nproc)

Test

Socket Programming (PA#1)

Run following binary.

$ ./app/echo/echo

Using random seed.

$ RANDOM_SEED=1234 ./app/echo/echo

You can use non-kens binary to run the echo application via following.

$ ./app/echo/echo-non-kens

TCP

Run following binaries to test your TCP implementation (part1 and part2 for PA#2).

Open, bind, handshake, and close (PA#2)

$ ./app/kens/test-kens-open
$ ./app/kens/test-kens-bind
$ ./app/kens/test-kens-handshake
$ ./app/kens/test-kens-close

Using random seed.

$ RANDOM_SEED=1234 ./app/kens/test-kens-open
$ RANDOM_SEED=1234 ./app/kens/test-kens-bind
$ RANDOM_SEED=1234 ./app/kens/test-kens-handshake
$ RANDOM_SEED=1234 ./app/kens/test-kens-close

Transfer and unreliable tests (PA#3)

$ ./app/kens/test-kens-transfer
$ ./app/kens/test-kens-open-unreliable
$ ./app/kens/test-kens-bind-unreliable
$ ./app/kens/test-kens-handshake-unreliable
$ ./app/kens/test-kens-close-unreliable
$ ./app/kens/test-kens-transfer-unreliable

Using random seed.

$ RANDOM_SEED=1234 ./app/kens/test-kens-transfer
$ RANDOM_SEED=1234 ./app/kens/test-kens-open-unreliable
$ RANDOM_SEED=1234 ./app/kens/test-kens-bind-unreliable
$ RANDOM_SEED=1234 ./app/kens/test-kens-handshake-unreliable
$ RANDOM_SEED=1234 ./app/kens/test-kens-close-unreliable
$ RANDOM_SEED=1234 ./app/kens/test-kens-transfer-unreliable

Running prebuilt solutions

You can run KENS with prebuilt solutions.

  • Running prebuilt solutions
$ ./app/kens/test-kens-open-run-solution
$ ./app/kens/test-kens-bind-run-solution
$ ./app/kens/test-kens-handshake-run-solution
$ ./app/kens/test-kens-close-run-solution
$ ./app/kens/test-kens-transfer-run-solution
$ ./app/kens/test-kens-open-unreliable-run-solution
$ ./app/kens/test-kens-bind-unreliable-run-solution
$ ./app/kens/test-kens-handshake-unreliable-run-solution
$ ./app/kens/test-kens-close-unreliable-run-solution
$ ./app/kens/test-kens-transfer-unreliable-run-solution

Routing (PA#4)

Use routing-all to test routing assignment.

$ ./app/routing/routing-all