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 API
Current 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
Set up test environment:
sudo tools/testenv.sh starttools/run.sh veth1
Executeping
inside test environment:
Expected nstack messages:
arp_gratuitous: Announce 10.0.0.2nstack_ingress_thread: Waiting for rxnstack_ingress_thread: Frame received!ether_input: proto id: 0x800ip_input: proto id: 0x1icmp_input: ICMP type: 8nstack_ingress_thread: ticknstack_ingress_thread: Waiting for rxnstack_ingress_thread: Frame received!ether_input: proto id: 0x800ip_input: proto id: 0x1icmp_input: ICMP type: 8
Ending the test environment:
sudo tools/testenv.sh stop
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 foundin theLICENSE
file.