Repository navigation
Releases
P4Net 1.10.1
Added
- Added Python 3.14 and 3.15 to the package classifiers and CI matrix for Ubuntu 22.04 and 24.04.
Changed
- Updated the P4Net project overview and revised the English and Chinese quick start, CLI reference, and example walkthroughs.
- Clarified when Linux assigns IPv6 link-local addresses and how the multi-hop INT example estimates delay between switches.
Fixed
- Restored IPv4 connectivity among all three hosts in the async multi-switch example.
- Removed machine-specific absolute paths from benchmark exports and the published benchmark snapshot.
p4net 1.10.0
Added
pingandping6with multiple probes display replies as they arrive and summarize sent and received probes and packet loss.pingallandpingall6report progress in batches and show partial results when cancelled.<host> cmdstreams stdout and stderr as the process flushes them.<switch> packet listenshows each packet as it arrives and reports the number received when it finishes.NetworkNamespace.popen()acceptsstart_new_session.NSProcess.stdoutandNSProcess.stderrexpose captured pipes.
Changed
- Updated the CPU punt, asymmetric link, and multi-hop INT walkthroughs. The INT walkthrough shows how to run separate copies with independent namespaces and timestamp files.
- Clarified that BMv2 resets the fields selected by the P4Info counter unit when
counter resetruns.
Fixed
- Pressing
Ctrl-Cduring an interactive command cancels that command and returns to the prompt with the topology running. Cancelling or timing out a host command cleans up its process group. A terminal hangup with the default signal handler cleans up the topology. - Multi-hop INT integration tests use per-test timestamp files, so parallel runs avoid overwriting each other's results or the example's file.
Upgrading from 1.9
- Scripts that parse interactive output should allow progress lines before results, the multi-probe ping totals, and the final
packet listencount. A single ping probe printsOKorFAIL. Stdout and stderr from host commands can now appear in the order the shell reads them. - To shut down from the interactive prompt, use
exit,quit, orCtrl-Don an empty line.
p4net 1.9.0
Added
- The interactive shell reports when topology startup begins, when the network and
setup()are ready, and when shutdown begins. packet listenshows the switch, requested packet count, and timeout before waiting.counter <name> --nonzeroomits cells whose packet and byte counts are both zero.counter <name>andcounter <name> --alllist all returned cells.
Changed
- Group interactive help by command type, wrap long usage lines at argument boundaries, and leave one blank line between command output and the next prompt.
table dumplists the table name and entry count once, then shows match fields and action parameters asname=valueon separate lines.- Publish PyPI release files through GitHub Actions Trusted Publishing with signed attestations.
p4net 1.8.2
Fixed
- The synchronous P4Runtime client uses gRPC's default keepalive policy. This fixes
too_many_pingsdisconnects that BMv2 could trigger after idle periods with the previous 10-second interval. Callers can set a keepalive interval explicitly throughchannel_options.
p4net 1.8.1
Changed
- The installation guide uses global pipx installation for the CLI so users can run the tutorials and examples with
sudo p4net. The guide covers Ubuntu 24.04's pipx version and project virtual environments.
Fixed
- Align the columns in
hosts, thepingallandpingall6matrices, and switch counter output. Widen the spacing between ping matrix columns and right-align numeric counter values. - Resolve interactive help for actual host and switch names, complete help topics for those names, and display interactive command errors consistently.
- When BMv2 startup times out, save the last listener observations and process and thread state before cleanup. The startup error includes the path to the diagnostic file when it is saved.
- Serve the custom page for missing documentation URLs, keep error pages out of site search and indexing, and use absolute language-alternate URLs.
p4net 1.8.0
中文
p4net 1.8.0 新增 Network.astart()、Network.astop(),支持在事件循环中等待网络启停和清理完成;CLI 新增 值&&&掩码 三态匹配与 下界..上界 范围匹配。本版本还修复编译缓存、连接回收、Unicode 接口名、跨命名空间接口复用、拓扑地址判重和 P4Runtime 编码问题,并更新中英文文档。
从 1.7 升级时,请检查这些变化:
- 异步场景使用
await net.astart()、await net.astop(),保持客户端所属循环运行到关闭完成。 - 导入拓扑快照需提供完整端口和接口名。地址、整数、布尔及匹配字段按其类型和格式校验;LPM 主机位和 TERNARY 掩码外值位必须清零。
- OPTIONAL、TERNARY、RANGE 表项的插入和删除需要合法的正整数优先级。异常处理按修正后的 RPC 错误类别调整。
- ping 支持小数超时,发送次数受
count限制,至少一次应答即成功。tc 字符串使用10mbit、1.5ms等数值紧邻单位的 ASCII 格式。
Python 3.10.20、3.12.3 各通过 3685 项测试,均以 root 启用 p4c 和 BMv2。四个独立安装环境的同步与异步网络验证共覆盖 12 个原生场景、16 次有向 ping。具体环境、警告及未执行项见附件 VALIDATION.md。
English
p4net 1.8.0 adds awaitable network startup and shutdown with Network.astart() and Network.astop(), plus CLI ternary (value&&&mask) and range (low..high) matches. It fixes compiler caches, connection cleanup, Unicode interfaces, interface reuse across namespaces, effective-IP collision checks and P4Runtime encodings, and updates the English and Chinese documentation.
When upgrading from 1.7:
- Await network lifecycle operations in an event loop and keep each async client's owning loop running through shutdown.
- Supply complete ports and interface names in imported snapshots. Use correctly typed topology and match values, canonical LPM prefixes and ternary values with zero bits outside the mask.
- Supply valid positive priorities for inserting and deleting optional, ternary and range entries. Review handlers that relied on previous RPC error classifications.
- Ping supports fractional timeouts, bounds requests by
countand succeeds after any reply. Use adjacent ASCII numbers and units for traffic-control strings, such as10mbitand1.5ms.
Python 3.10.20 and 3.12.3 each passed 3,685 tests as root with p4c and BMv2 enabled. Four clean installations also passed 12 native scenarios and 16 directional pings. See VALIDATION.md for environments, warnings and checks not run.
Full changelog · Changes since 1.7.0
Source revision: 0268483570acbf70d394fe535841173be622fc12.
The wheel, source distribution, REVISION, CHANGELOG.md, VALIDATION.md and SHA256SUMS are attached. Run sha256sum --check SHA256SUMS with all six files in the same directory.
p4net 1.7.0
Changed
AsyncP4RuntimeClient,AsyncOperationCancelledError, and
RunningSwitch.async_clientpromoted from Provisional to
Stable following real-world user soak since their introduction
in 1.6.0. No source-level API change — only the stability tier is
updated; method signatures are byte-for-byte unchanged. The
promotion honors the two-minor-release upper bound committed in
docs/api-stability.md(promoted at one minor release in, within
the commitment window). See updated stability documentation for
the new contract.
p4net 1.6.0
Added
AsyncP4RuntimeClient: parallel async P4Runtime client using
grpc.aio. Mirrors the syncP4RuntimeClientAPI surface
(connect/disconnect,push_pipeline,
insert_table_entry/modify_table_entry/
delete_table_entry/list_table_entries,read_counter,
read_register/write_register,send_packet_out/
on_packet_in/expect_packet_in). Marked Provisional in
1.x; commit is to upgrade to Stable within two minor releases
conditional on no incompatible adjustments being needed in the
interim.RunningSwitch.async_client: lazy property returning an
unconnectedAsyncP4RuntimeClientfor the switch, pre-seeded with
the sync client's P4Info index. Provisional.AsyncOperationCancelledError: paired exception for async
cancellation cases (subclass ofP4RuntimeError). Provisional.- New example
examples/async_concurrent/demonstrating concurrent
multi-switch operations via the async client andasyncio.gather. docs/async-client.md(EN + ZH) explaining the async API,
mastership coexistence patterns, and cancellation semantics.
Changed
BMv2Switch.grpc_portis now a public property (was private,
needed byRunningSwitch.async_clientto plumb the gRPC address
through to the async client constructor).docs/api-stability.mdgained a "Provisional tier and async
client" section explaining the rationale for shipping the async
client as Provisional rather than Stable on day one.docs/known-limitations.md: the "single Network lifecycle per
Python process" entry now references the async client as the
primary workaround for per-RPC operations.pytest-asyncio>=0.23added to dev dependencies;
asyncio_mode = "auto"in[tool.pytest.ini_options]so async
tests don't need per-test decorators.
p4net 1.5.1
Changed
- Multi-hop INT integration test no longer asserts strict aligned-causal
ordering between switches. The assertion tested packet causality —
guaranteed by construction in a linear topology, not by p4net code —
and had to be widened twice (5 ms → 20 ms across v1.4 and v1.5) to
absorb measurement drift under suite load. It produced two flakes
without catching a real regression. Replaced with a bounded-difference
sanity check (aligned timestamps within 10 s of each other) that
validates alignment produces plausible numbers without asserting
physics. No production code is affected.
p4net 1.5.0
Added
Network.boot_timestamps: read-only dict mapping switch name to
wall-clock microseconds since Unix epoch when that switch's BMv2
process started. Convenience helper over per-switch
RunningSwitch.boot_timestamp_us; returns a fresh dict on each
call, raisesNetworkNotRunningErrorif the network isn't
running. Stable per the API stability commitment.
Changed
- Multi-hop INT example reads
P4NET_INT_BOOT_TIMES_PATHfrom the
environment to locate its coordination file, defaulting to
/tmp/p4net-int-multi-hop-boot-times.jsonwhen unset. Allows
concurrent multi-hop INT topologies on the same host. Both
topology.pyandlistener.pyhonor the variable;sudo -E
is required to preserve it across privilege escalation. - Multi-hop INT example's
topology.pyuses the new
Network.boot_timestampshelper instead of a manual dict
comprehension over each switch — adapts automatically as switches
are added.
Fixed
test_two_switches_each_insert_their_own_shimaligned-causal slack
widened from 5 ms to 20 ms to absorb the Popen + BMv2 early-init
drift observed reproducibly under full-suite load. The slack is
alignment-drift bookkeeping, not data-plane latency; real per-hop
forwarding latency through BMv2's userspace pipeline remains in the
tens-to-hundreds of microseconds.