https://github.com/jserv/nstack
Userspace TCP/IP stack for Linux
https://github.com/jserv/nstack
linux network-stack networking tcp-ip
Last synced: 27 days ago
JSON representation
Userspace TCP/IP stack for Linux
- Host: GitHub
- URL: https://github.com/jserv/nstack
- Owner: jserv
- License: other
- Created: 2018-05-09T05:45:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-05T00:31:27.000Z (over 1 year ago)
- Last Synced: 2025-03-29T20:06:29.936Z (about 1 month ago)
- Topics: linux, network-stack, networking, tcp-ip
- Language: C
- Homepage:
- Size: 103 KB
- Stars: 330
- Watchers: 20
- Forks: 66
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nstack
## Overview
nstack is a Linux userspace TCP/IP stack. It was constructed to meet the following goals:
* Learn TCP/IP
* Learn Linux systems/network programming
* Learn Linux Socket APICurrent features:
* One network interface and socket
* Ethernet frame handling
* ARP request/reply, simple caching
* ICMP pings and replies
* IPv4 packet handling, checksum
* TCPv4 Handshake
* TCP data transmission## Build and Test
```shell
make
```Set up test environment:
```shell
sudo tools/testenv.sh start
tools/run.sh veth1
```Execute `ping` inside test environment:
```shell
tools/ping_test.sh
```Expected nstack messages:
```
arp_gratuitous: Announce 10.0.0.2
nstack_ingress_thread: Waiting for rx
nstack_ingress_thread: Frame received!
ether_input: proto id: 0x800
ip_input: proto id: 0x1
icmp_input: ICMP type: 8
nstack_ingress_thread: tick
nstack_ingress_thread: Waiting for rx
nstack_ingress_thread: Frame received!
ether_input: proto id: 0x800
ip_input: proto id: 0x1
icmp_input: ICMP type: 8
```Ending the test environment:
```shell
sudo tools/testenv.sh stop
```# Licensing
nstack is freely redistributable under the two-clause BSD License.
Use of this source code is governed by a BSD-style license that can be found
in the `LICENSE` file.# Reference
* [Level-IP](https://github.com/saminiir/level-ip) and [informative blog](http://www.saminiir.com/)
* [Linux kernel TCP/IP stack](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/net/ipv4)
* [picoTCP](https://github.com/tass-belgium/picotcp)
* [tapip](https://github.com/chobits/tapip)