Computer networks lab programs
Install with python -m pip install cnlab. Requires Python 3.9 or later.
import cnlab
cnlab.crc() # writes crc/crc.py
cnlab.dns() # writes dns/server.py and dns/client.py
cnlab.write("udpchat", "chat") # writes chat/chat_a.py and chat/chat_b.py
Each function returns a list of pathlib.Path objects. The optional argument is the exact output directory. Existing identical files can be reused. A file with different contents raises FileExistsError. The scripts are bundled and can be exported offline.
| Function or ID | Files in the output directory |
|---|---|
| distancevector | distancevector.py |
| crc | crc.py |
| dns, tcpsensor, tcporder, tcpfile | server.py and client.py for each lab |
| tcphttp | tcphttp.py |
| udpchat | chat_a.py and chat_b.py |
| arprarp | server.py and client.py |
For client/server labs, open two terminals and run the server first, then the client. For udpchat, start chat_b.py first. The tcphttp exercise connects to example.com. The arprarp exercise simulates lookups in a static table over localhost TCP.
Publish directly to PyPI
The project archive includes a prebuilt wheel and source distribution in dist/. Open a terminal in the folder containing pyproject.toml and run:
python -m pip install --upgrade twine
python -m twine check dist/*
python -m twine upload --repository pypi --username __token__ dist/*
Enter your PyPI token at the hidden prompt. For a first release of a new project, use a token with account-wide scope. For later releases, increment the version in pyproject.toml and move previous distributions out of dist/ before building:
python -m pip install --upgrade build
python -m build
Metadata
Release files for cnlab 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cnlab-0.1.0.tar.gz | 7.8 kB | Without provenance | Details for cnlab-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cnlab-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for cnlab-0.1.0-py3-none-any.whl |
Total release size: 18.6 kB
Release files / cnlab-0.1.0.tar.gz
| Download URL | cnlab-0.1.0.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1802ea0ec72d1453737db266e349f55179afd21814ff5362866ef8496336daf2
|
|
BLAKE2b-256 checksum How to use checksums |
1a927dee330b61543d66704fc8fc9fef4631365ed8dd0935be39b445cbfd834e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / cnlab-0.1.0-py3-none-any.whl
| Download URL | cnlab-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e07c9aa406fc6fd6d5942fdfced6628fe3e60965da31df4e1a0f21a8943e3d3
|
|
BLAKE2b-256 checksum How to use checksums |
57633f15fdd70b7634817ad35e5be59e259d3a99200ceebd90a441fb6271271a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for cnlab 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.