This is a new node type that allows netgraph nodes that are in different vnet(9)s to be connected. It absolutely does add an extra pair of function calls as data goes from one node to its wormhole, on to the next wormhole, and finally back out to another node.
But you will never pay more than that price as connecting two wormholes will cause collapse of one pair leaving behind only one pair.
For this to work you must mkpeer wormhole w evthorizon and separately open the wormhole into another jail. This creates the connected pair. The pair hold each other open, but until then they will shutdown when nothing is connected so you need to create with something like:
ngctl -f- << EOF mkpeer wormhole w evthorizon name .:w wh0 msg wh0: open “testjail" EOF
This is intentionally minimalist and wormholes also have strict invariants:
- Both ends can NOT be in the same vnet(9), ever.
- if they were you wouldn't need the wormhole!
- If you connect the evthorizon of two wormholes they collapse
- As a consequence you can never have more than 2 extra function calls
- Wormholes can only be opened once.
- If either side of a wormhole is shutdown they both shutdown
- As a consequence you don’t have to clean up on jail shutdown.