• Stars
    star
    368
  • Rank 115,958 (Top 3 %)
  • Language
    C
  • License
    Other
  • Created over 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

User-mode TCP/IP stack from 4.4BSD-Lite2, a companion of TCP/IP Illustrated vol. 2

User-mode 4.4BSD-Lite2 TCP/IP Stack

User-land TCP/IP stack from 4.4BSD-Lite2, a companion of W. Richard Stevens's immortal work TCP/IP Illustrated, Volume 2: The Implementation, with a focus on TCP chapters. TCP/IP Illustrated vol.2 uses 4.4BSD-Lite as its example, a slightly early version. TCP/IP code of 4.4BSD-Lite2 is roughly the same as FreeBSD 2.0.

This is not a fork of https://github.com/sergev/4.4BSD-Lite2, which contains the whole 4.4BSD-Lite2.tar.gz. This repository only contains usr/src/sys of the tarball, ie. the kernel source.

How to build and play

$ make

This build a few executables:

  • objs/test_init TCP three-way handshake, you can step through code with GDB
  • objs/test_self TCP self-connection
  • objs/test_pigeon ICMP echo request/response
  • objs/test_tun Connect to host with TAP/TUN device.
    • BSD stack is attached to tun0, its IP address is 192.168.0.2, listens on port 1234.
    • Try ping 192.168.0.2 or nc 192.168.0.2 1234, also watch the packets with tcpdump -n -i tun0.

This TCP/IP stack is alive, using tap/tun device on Linux. (WIP)

Unofficial companion site of TCP/IP Illustrated vol. 2

See also

For running recent FreeBSD TCP/IP stack in user mode, take a look at https://github.com/pkelsey/libuinet and https://github.com/cloudius-systems/osv.

More Repositories

1

muduo

Event-driven network library for multi-threaded Linux server in C++11
C++
14,793
star
2

recipes

Some code snippets for sharing
C++
1,874
star
3

typeset

TeX
922
star
4

muduo-tutorial

Tutorial of Muduo network library
C++
508
star
5

documents

488
star
6

coolshell

Static mirror of coolshell.cn, (c) haoel 2023.
HTML
221
star
7

muduo-protorpc

Google Protobuf RPC based on Muduo
Java
196
star
8

linux-debug

C
148
star
9

tcpip-study

Shuo's learning notes on Linux TCP/IP stack
112
star
10

primer

Source code of C++ Primer 4th ed
C++
62
star
11

old-minix

Minix 1.1 to 2.0.4
C
49
star
12

nuedc

nuedc.org
34
star
13

notes

Shuo's notes
Jupyter Notebook
31
star
14

evcpp

A header-only C++ wrapper of libevent2
C++
29
star
15

leanstl

Lean STL
C++
29
star
16

tcpipv2

Unofficial companion site of TCP/IP Illustrated volume 2
25
star
17

muduo-examples-in-go

Go
24
star
18

practical-network-programming

Companion to my Practical Network Programming course at boolan.com
CSS
21
star
19

veriloglabs

Undergraduate digital circuit laboratory
SystemVerilog
20
star
20

cppindex

C++
19
star
21

muduo-udns

Muduo Non-blocking Address Resolver with UDNS
C
19
star
22

muduo-book

17
star
23

software-tools-in-c

C/C++ source code for Software Tools in Pascal by Kernighan and Plauger
OpenEdge ABL
15
star
24

evproto

Automatically exported from code.google.com/p/evproto
C++
14
star
25

tempest

Interactive TCP stack learning tool
C++
13
star
26

quickfix-core

A quicker FIX engine based on Muduo
C++
10
star
27

unixtop

Unix Top is written by William LeFebvre, see http://www.unixtop.org
C
10
star
28

muduo-lua

C++
9
star
29

lnpe

Linux Network Programming by Examples
7
star
30

lua-release

C
3
star
31

evproto2

Automatically exported from code.google.com/p/evproto2
C++
1
star
32

kythe-static

Generate static HTML pages for kythe
Protocol Buffer
1
star
33

muduo-polarssl

PolarSSL is GPL
C++
1
star