Pure-Python, zero-dependency TCP/IP stack — Ethernet through RFC 9293 TCP — running in user space on a TAP/TUN interface, with a Berkeley-sockets API.
Project description
PyTCP
Pure-Python, zero-dependency TCP/IP stack — Ethernet through RFC 9293 TCP — running in user space on a TAP/TUN interface, with a Berkeley-sockets API.
from pytcp import socket, stack
What it is
A full, RFC-grounded TCP/IP stack implemented entirely in Python: Ethernet II / 802.3, ARP, IPv4 / IPv6 (with extension headers), ICMPv4 / ICMPv6 (incl. Neighbor Discovery, MLDv2), UDP, and a RFC 9293 TCP with a real FSM, congestion control, and a BSD-sockets facade. It runs on a TAP/TUN interface in user space — no kernel module, no privileged data path.
Architecture
The stack is split into three independently-published, strictly-layered distributions:
| Distribution | Import | Role |
|---|---|---|
PyTCP-net_addr |
net_addr |
Address value types (IPv4/IPv6/MAC, networks, masks). |
PyTCP-net_proto |
net_proto |
Protocol packet parse / assemble / validate. |
PyTCP |
pytcp |
The running stack: threads, sockets, ARP/ND caches, RX/TX rings. |
Installing PyTCP pulls the other two automatically (lockstep
version pin).
Install
pip install PyTCP
Brings in PyTCP-net_proto and PyTCP-net_addr (and aenum).
Fully typed (ships py.typed, PEP 561).
Requirements
Python 3.14+, Linux (TAP/TUN), POSIX. Running the stack needs a TAP/TUN interface (root for interface/bridge setup).
License
GPL-3.0-or-later. PyTCP by Sebastian Majewski.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytcp-3.0.5.tar.gz.
File metadata
- Download URL: pytcp-3.0.5.tar.gz
- Upload date:
- Size: 381.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e64eedd8e95b0f3e1a99e59a795212669ca8e8d55c2148caef464715efd33d8
|
|
| MD5 |
930d136295d4fdc9aa34c8796b6464e4
|
|
| BLAKE2b-256 |
d39302e7bd6e64a74729afb1de194e91bf1b452509db34f6e62d0280ae28c6b6
|
Provenance
The following attestation bundles were made for pytcp-3.0.5.tar.gz:
Publisher:
publish.yml on ccie18643/PyTCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytcp-3.0.5.tar.gz -
Subject digest:
0e64eedd8e95b0f3e1a99e59a795212669ca8e8d55c2148caef464715efd33d8 - Sigstore transparency entry: 1574187045
- Sigstore integration time:
-
Permalink:
ccie18643/PyTCP@d700646864d064691a70a93a10c3cbf598214902 -
Branch / Tag:
refs/tags/v3.0.5 - Owner: https://github.com/ccie18643
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d700646864d064691a70a93a10c3cbf598214902 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pytcp-3.0.5-py3-none-any.whl.
File metadata
- Download URL: pytcp-3.0.5-py3-none-any.whl
- Upload date:
- Size: 516.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71b2faf9fdc5301e18b66c3f39dc3468f3ea2d064f765dbe7f02ba5274f758b9
|
|
| MD5 |
133cceaaec3e5eccc7865c429f822075
|
|
| BLAKE2b-256 |
1b5a74f29d2c3041443f0455b261bb5789e95aa465cdb2cbcc82c6711a55715f
|
Provenance
The following attestation bundles were made for pytcp-3.0.5-py3-none-any.whl:
Publisher:
publish.yml on ccie18643/PyTCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytcp-3.0.5-py3-none-any.whl -
Subject digest:
71b2faf9fdc5301e18b66c3f39dc3468f3ea2d064f765dbe7f02ba5274f758b9 - Sigstore transparency entry: 1574187178
- Sigstore integration time:
-
Permalink:
ccie18643/PyTCP@d700646864d064691a70a93a10c3cbf598214902 -
Branch / Tag:
refs/tags/v3.0.5 - Owner: https://github.com/ccie18643
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d700646864d064691a70a93a10c3cbf598214902 -
Trigger Event:
release
-
Statement type: