Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snet/daemon: daemon Connector should cache local topology information #4542

Open
matzf opened this issue Jun 10, 2024 · 0 comments
Open

snet/daemon: daemon Connector should cache local topology information #4542

matzf opened this issue Jun 10, 2024 · 0 comments
Labels
workitem Something needs doing

Comments

@matzf
Copy link
Contributor

matzf commented Jun 10, 2024

Follow up from #4344 (review).

The snet.Topology interface was added in #4344, as a sub-interface for pkg/daemon.Connector:

type Topology interface {
	LocalIA(ctx context.Context) (addr.IA, error)
	PortRange(ctx context.Context) (uint16, uint16, error)
	Interfaces(ctx context.Context) (map[uint16]netip.AddrPort, error)
}

This information is accessed by snet e.g. when opening new sockets.
Previously, only the LocalIA information was required and it was used by value in addr.IA the snet.SCIONNetwork struct.

To avoid requesting this same topology information over and over from the daemon, it should be cached somewhere.
The pkg/daemon.grpcConn can transparently cache the results of these API invocations.

Alternatively, the snet interface is not yet frozen. The snet.Topology could be changed into a struct that contains LocalIA, PortRange and Interface as values; the daemon Connector interface can be adapted to return this in one go for convenient initialization of the snet.SCIONNetwork.

@matzf matzf added the workitem Something needs doing label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
workitem Something needs doing
Projects
None yet
Development

No branches or pull requests

1 participant