Support multiple interfaces - #5414
Open
coot wants to merge 5 commits into
Open
Conversation
coot
force-pushed
the
coot/multiple-interfaces
branch
from
August 3, 2026 16:29
a084d71 to
7d8efb7
Compare
coot
force-pushed
the
coot/multiple-interfaces
branch
3 times, most recently
from
August 6, 2026 14:50
5bbb118 to
58f2c71
Compare
coot
force-pushed
the
coot/multiple-interfaces
branch
from
August 17, 2026 15:08
58f2c71 to
23d33eb
Compare
Diffusion now supports multiple interfaces. Outbound connections will use a random interface. On all given addresses / systemd sockets we will run a server accepting connections. `Configuration` type now accepts `dcAddresses :: [Either ntnFd ntnAddr]` which is a list of supported addresses / systemd sockets. One can use `readIPAndPort` parser to parse addresses on a command line.
coot
force-pushed
the
coot/multiple-interfaces
branch
2 times, most recently
from
August 18, 2026 11:49
db586db to
69a05dc
Compare
`addrFamily` doesn't provide what it needs, and there's a confusing choice between `addrFamily` and `addressType`, which is can be a source of bugs and/or at test failures. As a side effect, `addrFamily` gets simpler.
We can use `addrFamily` from `Snocket` API now.
coot
force-pushed
the
coot/multiple-interfaces
branch
from
August 18, 2026 12:27
69a05dc to
8c33875
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for running diffusion on multiple network interfaces at once, rather than at most one
IPv4and oneIPv6address.Diffusion.Configuration.dcAddresses :: Either (NonEmpty ntnFd) (NonEmpty ntnAddr)replaces the separatedcIPv4Address/dcIPv6Addressfields. A server socket is opened on every configured address (or systemd socket); outbound connections pick a random configured interface matching the peer's address family. ThereadIPAndPortcommand-line parser moved fromcardano-pingintoouroboros-networkso it can be reused for parsing these addresses.Simplified
Snocket.AddressFamilyto a plainAFInet | AFInet6 | AFLocalenum, dropping theTestFamily/TestAddressGADT indexing.ConnectionManager.Arguments'saddressTypefield is removed in favour ofSnocket.addrFamily.addrFamilyandaddressTypewere two separate, redundant classifications of the same address that could silently disagree —addrFamilyreflects an address's real family, whileaddressTypewas supplied independently (and in test code, often hardcoded to a constant). That divergence is exactly the kind of bug this closes off; a single source of truth removes the failure class outright.Simulation.Network.Snocketis now monomorphic over a concreteNetworkAddresstype (ported from the diffusion testnet), simplifying the simulated-network test code.TestAddress addr+GlobalAddressScheme addrtypeclass indirection gave each test module its own ad-hoc family classification(e.g. even/odd on an
Int) unrelated to the address's real shape. A concrete type with genuineEphIPv4Addr/EphIPv6Addr/IPAddr/LocalAddrconstructors lets tests exercise real, distinguishable address-family behaviour — which is what multiple-interface support actually needs to be tested against.Updates
framework-sim-teststo generate consistentAFInet/AFInet6multi-node scripts, now thataddrFamilyreflects real address families instead of a constant.Breaking changes
Diffusion.Configuration:dcIPv4Address/dcIPv6Address→dcAddresses.ConnectionManager.Arguments:ipv4Address/ipv6Addressare now[peerAddr]lists;addressTyperemoved (useSnocket.addrFamily).Snocket.AddressFamilyis no longer indexed by address type;TestAddressremoved.Checklist
Quality
Maintenance
ouroboros-networkproject.