Categorygithub.com/42milez/ProtocolStack
module
0.5.0
Repository: https://github.com/42milez/protocolstack.git
Documentation: pkg.go.dev

# README

ProtocolStack

CI codecov GitHub release (latest SemVer) License: MIT
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.

1. Preparing for using the virtual machine

Software required is as follows:

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

2. Controlling the 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.

Note: Remote debugging with GoLand

3. Compile

It is able to compile the application with make:

> make compile

4. Running application

Start as echo server

./bin/pstack server

Start as client

Send ICMP request:
./bin/pstack ping -c 192.0.2.1

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

# Packages

No description provided by the author