PiCN is a:
- prototyping-friendly, modular library for Information-Centric Networking (ICN / CCN)
- set of tools and network nodes (forwarder, repository, fetch, management)
- platform for Named Function Networking (NFN)
- simple simulation system for ICN and NFN
PiCN supports Python 3.14 and includes an asyncio runtime alongside the
original multiprocessing-per-layer path (--runtime sync|async, default
sync, so existing workflows keep working unchanged). See
docs/modernization.md for how the migration got
here and docs/design-adrs/ for the design
rationale behind the dual runtime.
| Topic | Doc |
|---|---|
| Architecture (layers + dual runtime) | docs/architecture.md |
| Package layout | docs/project_structure.md |
| Design decisions (ADRs) | docs/design-adrs/ |
| Contributor conventions | AGENTS.md |
- Link Layer (UDP faces, simulation bus)
- Packet Encoding Layer (NDN TLV + simple string format)
- ICN Layer (forwarding, CS / FIB / PIT)
- Chunking, repository, NFN / thunk / routing / autoconfig layers
- Management interface (sync process or async TCP task)
picn-relay— ICN forwarder (--runtime sync|async)picn-nfn— NFN forwarder (--runtime sync|async)picn-repo/picn-pushrepo— content repositoriespicn-fetch/picn-peek— fetch tools (picn-fetchsupports--runtime)picn-mgmt— management clientpicn-setup— multi-node setup helper
- Python ≥ 3.14 (see
pyproject.toml) - No hard runtime dependencies for the default CLI path
- Optional:
pip install "PiCN[dev]"for pytest;pip install "PiCN[config]"forpicn-relay -cTOML configs (pytoml)
git clone https://github.com/cn-uofbasel/PiCN.git
cd PiCN
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
export PATH="$PATH:$(pwd)/starter"
# starter scripts also set PYTHONPATH to the repo rootAlternatively without editable install: export PYTHONPATH=$(pwd) and put starter/ on your PATH.
Set up a repository and a forwarding node:
Prepare content:
mkdir -p /tmp/repo
echo "HELLO WORLD" > /tmp/repo/exampleStart a repository and a forwarder (default sync runtime):
picn-repo --format ndntlv /tmp/repo /the/prefix 10000 &
picn-relay --format ndntlv --port 9000 &Configure a face and forwarding rule:
picn-mgmt --ip 127.0.0.1 --port 9000 newface 127.0.0.1:10000:0
picn-mgmt --ip 127.0.0.1 --port 9000 newforwardingrule /the:0You can also install a rule that fans out to multiple faces (e.g. face-ids 0 and 1):
picn-mgmt --ip 127.0.0.1 --port 9000 newforwardingrule /prefix:0,1Fetch content via the forwarder:
picn-fetch --format ndntlv 127.0.0.1 9000 /the/prefix/example
HELLO WORLDRelay and fetch accept --runtime async (one event loop per node instead of
one process per layer). Example:
picn-relay --format ndntlv --port 9000 --runtime async &
picn-fetch --format ndntlv --runtime async 127.0.0.1 9000 /the/prefix/exampleDetails: docs/architecture.md.
NFN is a computation engine for ICN: express how data should be transformed;
the network finds where to compute. Tutorial: docs/nfn.md.
Minimal sketch (commands unchanged; add --runtime async on picn-nfn /
picn-fetch if desired):
picn-nfn --port 9000 --format ndntlv -l debug &
picn-nfn --port 9001 --format ndntlv -l debug &
picn-mgmt --port 9000 newface 127.0.0.1:9001:0
picn-mgmt --port 9000 newforwardingrule /data:0
# … install function + data via picn-mgmt newcontent, then:
picn-fetch 127.0.0.1 9000 '/func/combine("Hello",/data/obj1)/NFN'python -m pytest PiCN/ --ignore=PiCN/Simulations -q --timeout=90GitHub Actions (this branch): fast suite on every push; full suite
(Ubuntu + macOS) on pull requests and workflow_dispatch. Simulations are
excluded from CI (slow / environment-sensitive).
- PiCN Toolbox
- Setting up a Network
- PiCN runnables as systemd service
- Packet Formats
- Simulation System
The asyncio/Python 3.14 migration is complete. Its rationale and verification record are kept for reference: plan and current-state audit · per-phase test evidence.
- Licensing
- Upstream mailing list: picn@unibas
