This repository is for learning network programming in Go and mainly aims to implement TCP/IP stack.
- Ethernet
- ARP
- Request
- Reply
- IP
- v4
- v6
- ICMP
- Echo Request
- Echo Reply
- TCP
- Receiving data less than MTU
- Receiving data which exceeds MTU
- Sending data
- Flow Control
- Retransmission
- UDP
- OS: Linux
- Go: 1.14.x or higher
ProtocolStack/
├── .github
│ └── workflows .. Configurations for GitHub Actions
├── src
│ ├── binary ..... provides utilities for binary operation
│ ├── cli ........ cli command difinitions
│ ├── error ...... error definitions
│ ├── log ........ provides utilities for logging
│ ├── monitor .... provides monitoring features to watch services
│ ├── mw ......... provides a layer to connect network layer with ethernet layer
│ ├── net ........ protocol implementations
│ │ ├── arp .... arp
│ │ ├── eth .... ethernet protocol
│ │ ├── icmp ... icmp
│ │ ├── ip ..... ip
│ │ └── tcp .... tcp
│ ├── repo ....... provides repositories of various entities
│ ├── syscall .... provides system call wrappers
│ ├── test ....... test cases
│ ├── time ....... provides utilities for time operation
│ └── worker ..... provides various types used by worker
└── vagrant
└── provisioners provides provisioning scripts
ProtocolStack needs a TAP device for its capability. For the reason, this project uses a virtual machine (Linux) to run the application.
Software required is as follows:
Note: Mutagen synchronizes files between local system and virtual machine.
vm.sh
controls the virtual machine. The available commands are as follows:
start
stop
restart
You can perform the commands below:
> ./vm.sh start # Start the 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.
- See the instruction for more detail.
- Related information:
It is able to compile the application with make
:
> make compile
./bin/pstack server
./bin/pstack ping -c 192.0.2.1
Note: make
supports the commands below:
build
build projectclean
clean up cachescompile
resolve dependencies, and build the programfmt
run formattergen
generate source codelint
run linters (golangci-lint)resolve
resolve dependenciestest
run all tests
- 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
- Architectural pattern
- Communicating sequential processes
- Continuation
- Cooperative multitasking
- Critical section
- Ellipsis (computer programming)
- Fair-share scheduling
- Fork-join model
- Generic programming
- Monitor (synchronization)
- Pipeline stall
- Preemption (computing)
- Process substitution
- Reflective programming
- Software design pattern
- Task (computing)
- Template metaprogramming
- Thread pool
- Threading models
- Work stealing
- Computer Network
- GO
- Asynchronous Preemption
- Context
- Programming
- Question and answer site
- Use the context types properly acording to the rubric.
- Definition of errno in Go