Skip to main content

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

pytcp-3.0.5.tar.gz (381.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytcp-3.0.5-py3-none-any.whl (516.4 kB view details)

Uploaded Python 3

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

Hashes for pytcp-3.0.5.tar.gz
Algorithm Hash digest
SHA256 0e64eedd8e95b0f3e1a99e59a795212669ca8e8d55c2148caef464715efd33d8
MD5 930d136295d4fdc9aa34c8796b6464e4
BLAKE2b-256 d39302e7bd6e64a74729afb1de194e91bf1b452509db34f6e62d0280ae28c6b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytcp-3.0.5.tar.gz:

Publisher: publish.yml on ccie18643/PyTCP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pytcp-3.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 71b2faf9fdc5301e18b66c3f39dc3468f3ea2d064f765dbe7f02ba5274f758b9
MD5 133cceaaec3e5eccc7865c429f822075
BLAKE2b-256 1b5a74f29d2c3041443f0455b261bb5789e95aa465cdb2cbcc82c6711a55715f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytcp-3.0.5-py3-none-any.whl:

Publisher: publish.yml on ccie18643/PyTCP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page