• Stars
    star
    361
  • Rank 115,424 (Top 3 %)
  • Language
    C
  • License
    Other
  • Created about 10 years ago
  • Updated about 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,265
star
2

recipes

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

typeset

TeX
842
star
4

documents

483
star
5

muduo-tutorial

Tutorial of Muduo network library
C++
483
star
6

coolshell

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

muduo-protorpc

Google Protobuf RPC based on Muduo
Java
192
star
8

linux-debug

C
145
star
9

tcpip-study

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

primer

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

old-minix

Minix 1.1 to 2.0.4
C
48
star
12

leanstl

Lean STL
C++
29
star
13

evcpp

A header-only C++ wrapper of libevent2
C++
28
star
14

tcpipv2

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

muduo-examples-in-go

Go
25
star
16

notes

Shuo's notes
Jupyter Notebook
24
star
17

nuedc

nuedc.org
24
star
18

practical-network-programming

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

cppindex

C++
19
star
20

muduo-udns

Muduo Non-blocking Address Resolver with UDNS
C
18
star
21

veriloglabs

Undergraduate digital circuit laboratory
SystemVerilog
17
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++
12
star
26

quickfix-core

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

muduo-lua

C++
9
star
28

unixtop

Unix Top is written by William LeFebvre, see http://www.unixtop.org
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