ProtocolStack

module
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2021 License: MIT

README

ProtocolStack

CI codecov GitHub release (latest SemVer)
This repository is for learning network programming in Go and mainly aims to implement TCP/IP stack.

Requirements

  • OS: Linux
  • Go: 1.14.x or higher

Instructions

ProtocolStack needs a TAP device for its capability. For the reason, this project uses a virtual machine (Linux) to run the application. Also, you can perform debugging remotely with the VM if you use GoLand.

1. Prepare virtual machine

Software required is as follows:

Note: Mutagen synchronizes files between local system and virtual machine.

2. Control virtual machine

vm.sh controls the virtual machine. The available commands are as follows:

  • start start the virtual machine
  • stop stop the virtual machine
  • restart restart the virtual machine

You can perform the commands below:

> ./vm.sh start   # Start a VM and create a Mutagen session.
> ./vm.sh stop    # Stop the VM and terminate the Mutagen session.
> ./vm.sh restart # Restart the VM and recreate the Mutagen session.

3. Remote debugging with GoLand

See the instruction for more detail.

Related information:

4. Compile

It is able to compile the application with make as below:

> make compile

If no argument is provided, make compiles the server implicitly. When you would like to compile the other applications, specify BUILD_TYPE argument like below:

> make compile BUILD_TYPE=ping

Note: make supports the commands below:

  • build build project
  • clean clean up caches
  • compile resolve dependencies, and build the program
  • fmt run formatter
  • gen generate source code
  • lint run linters (golangci-lint)
  • resolve resolve dependencies
  • test run all tests

Supported Protocols

  • Ethernet
  • ARP
    • Request
    • Reply
  • IP
    • v4
    • v6
  • ICMP
    • Echo Request
    • Echo Reply
  • TCP
  • UDP

Examples

References

Notes

Memos

Directories

Path Synopsis
src
cli
log
mw
Package mw is a generated GoMock package.
Package mw is a generated GoMock package.
net
repo
Package repo is a generated GoMock package.
Package repo is a generated GoMock package.
syscall
Package syscall is a generated GoMock package.
Package syscall is a generated GoMock package.
time
Package time is a generated GoMock package.
Package time is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL