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

Bidirectional connections #42

Open
danalex97 opened this issue Nov 18, 2018 · 0 comments
Open

Bidirectional connections #42

danalex97 opened this issue Nov 18, 2018 · 0 comments

Comments

@danalex97
Copy link
Owner

When two nodes communicate via the capacity module they create unidirectional links. However, when a connection is established from node A to node B, node B cannot see the Link unless node A specifically sends the object through a ControlMessage. This effectively allows establishing a link only after an RTT.

This is, however, impractical since the user needs to implement a handshake mechanism for bidirectional connections. This issue is about creating and testing a BidirectionalPerfectLink in the capacity module. The new bi-directional link will eventually replace the PerfectLink.

Requirements:

  • when A calls Connect a new Link object should be created
  • when B calls Connect, instead of creating a new Link object, the Link object created by A should be used
  • when A calls Connect another Link object should be created
  • [...]

Implementation: the easiest way to implement this is probably as following:

  • when A calls Connect, a new Link L(A) is created
  • A sends a control message to B
  • when B calls Connect, a new Link L(B) is created
  • B sends a control message to A
  • when B receives the control message, B replaces L(B).download with L(A).download
  • when A receives the control message, A replaces L(A).download with L(B).download
  • this way, both A and B have different Link objects, but the objects are correctly linked

An example handshake mechanism can be found here.

@danalex97 danalex97 added this to the Version 1.1 milestone Nov 18, 2018
@danalex97 danalex97 modified the milestones: Version 1.1, Version 1.2 May 13, 2019
@danalex97 danalex97 modified the milestones: Version 1.2, Version 1.1 May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant