ProtocolStack

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
- IP
- ICMP
- TCP
- UDP
Examples
References
- Articles
- Blogs
- Books
- Docs
- Codecov
- Docker
- fedora
- GitHub Actions
- Mutagen
- Slack
- UI
- Vagrant
- Go
- Makefile
- Papers
- RFC
- Open Source Software
- Wikipedia
- Computer Network
- Memory
- Others
Notes
- GO
- Asynchronous Preemption
- Context
- Programming
- Question and answer site
Memos
- Use the context types properly acording to the rubric.
- Definition of errno in Go