Skip to content

Conversation

matzf
Copy link
Contributor

@matzf matzf commented Jan 29, 2020

Adapt pathpol.Path so that snet.Path is compliant. Rename Key to Fingerprint and use snet.PathInterface instead of the equivalent/redundant pathpol.PathInterface type.

This allows to create pathpol.Pathset from snet.Path objects without intermediate wrappers, and thereby makes application access to pathpol.Filter a bit more convenient.


This change is Reviewable

This allows to create pathpol.Pathset from snet.Path objects without
intermediate wrappers, and thereby making application access to
pathpol.Filter a bit more convenient.
Copy link
Collaborator

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 8 of 8 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@lukedirtwalker lukedirtwalker merged commit 299a765 into scionproto:master Jan 29, 2020
@matzf matzf deleted the pathpol-interfaces branch January 29, 2020 08:57
matzf added a commit to radwasherif/scion-apps that referenced this pull request Jan 29, 2020
Update scion dependency to get scionproto/scion#3640 which allows to get
rid of the clunky wrapper type for calling pathpol.Filter.
juagargi added a commit to netsec-ethz/scion-apps that referenced this pull request Jan 31, 2020
* Added support for used-defined path policies:

- ConnWrapper: wrapper around SCIONConn to allow for writing packets to paths that satisfy user-defined policy
- AppConf: contains path policy, path selection mode, and optional storage of static path and static overlay in case of staic path selection mode
- Running on SCIONLab, client fetches localhost address from gen/ia
- Running on local topology, client address is specificed using --client-address flag

Addressed PR comments:
- moved appconf and conn_wrapper to lib/scionutil
- replaced if-statements in WriteTo with switch statements
- removed code duplciation in DialSCION and DialSCIONWithConf in sssh.go and scionutils.go

* - rename connWrapper* to policyConn* and AppConf to PathAppConf
- policyConn now implements default behavior: arbitrary path selection
- for static and round-robin path selection, we have staticPolicyConn and roundRobinPolicyConn
- creating all policyConn* objects from PathAppConf
- moved AppConf and ConnWrapper back to the ssh/scionutils
- cleaned up commented code
- added log statements and doc strings

* embedded snet.Conn instead of snet.SCIONConn into policyConn, now get local IA via snet.DefNetwork

* - fixed import and DialSCION build issues
- added function pointer to policyConn to simulate "dynamic" method binding
- gofmt

* - changed pathSelectorFunc to pathSelector
- removed .String() from debug statements

* Added unit tests for policy_conn and path_app_conf

* fix build

* go fmt ./...

* More formatting.

Imports in blocks: first the std library, then other packages, then scionproto and netsec packages.

* Minor formatting

* Remove unnecessary function pointer in policyConn

Adapt UT to return working paths.

* added UT for staticPolicyConn

* Simplified design:

- One policyConn class
- Path selectors are subclassed
- Fixed intialization bug for pathResolver and localIA
- WriteTo defined on *policyConn
- NewPolicConn* return net.PacketConn
- Modified UTs to match new design

* go fmt

* Simplify code.

Construct a policy from the configuration only.

* go lint

* Minor fix, godoc for PathSelection type

* Add path filtering back, fix initialization, update tests

Re-implement path filtering by using pathpol.Filter.

Removed defaultPathSelector as the behaviour is virtually identical with
staticPathSelector now.

Separate path quering from path-selector initialization. This allows
for simpler testing of the path selection logic.
Initialize one path-selector instance per destination ISD-AS. This is
overkill for the current usage; it's clear however that a proper
PacketConn would need to do this, and implementing it is not much more
work than documenting a weird restriction. This would also allow to
eventually use this on the quic _server_.

Update / redo tests for static and round-robin path selectors.

* Update to scion master, remove pathpol.Path wrapper

Update scion dependency to get scionproto/scion#3640 which allows to get
rid of the clunky wrapper type for calling pathpol.Filter.

* Improve readability in filterPathSlice

* Improve method name for creating and initialising a selector

Co-authored-by: Juan A. García Pardo Giménez de los Galanes <juagargi@gmail.com>
Co-authored-by: Matthias Frei <matthias.frei@inf.ethz.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants