Skip to content

BroLeaf/nstack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 API

Current features:

  • One network interface and socket
  • thernet II frame handling
  • ARP request/reply, simple caching
  • ICMP pings and replies
  • IPv4 packet handling, checksum
  • TCPv4 Handshake
  • TCP data transmission

Build and Test

make

Set up test environment:

tools/testenv.sh start
tools/run.sh veth1

Execute ping inside test environment:

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

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

About

Userspace TCP/IP stack for Linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 94.4%
  • C++ 4.0%
  • Other 1.6%