Skip to content

Conversation

@RuiyuZhu
Copy link
Contributor

@RuiyuZhu RuiyuZhu commented Jun 5, 2022

Summary:
Our existing arrangement of party info (ip address and port number) is buggy as there will be a conflict with more than 2 parties. This diff is to address this issue.

Our current code works fine with 2 party setting. But it will break with more than 2 parties.

Example scenario:
when party 0 connects with party 1, with current code, he will pull out the partyinfo of party 0, and add one to the port number. Party 1 will add 1 to a port number on his side.
When party 1 connects with party 2, with current code, he will pull out the same partyinfo of party 0, and add on to the port number. Party 2 will add 1 to a port number on his side.

Since multiple connections will be established between each pair of parties, this will definitely create a conflict. For example, party 0 will add 1 to the same port number twice while others only do that once.

Our solution:

  1. Each party keep a map of partyinfo, served as "info needed to connected to party i".
  2. during each connection attemption, each party will use the peer's id to look up the partyinfo map. If this party is going to play the role of server, the ip address is useless. The corresponding ip address and port number can be used to establish connection.

Differential Revision: D36908724

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Jun 5, 2022
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D36908724

adshastri pushed a commit to adshastri/fbpcf that referenced this pull request Jun 6, 2022
Summary:
Pull Request resolved: facebookresearch#218

Our existing arrangement of party info (ip address and port number) is buggy as there will be a conflict with more than 2 parties. This diff is to address this issue.

Our current code works fine with 2 party setting. But it will break with more than 2 parties.

Example scenario:
when party 0 connects with party 1, with current code, he will pull out the partyinfo of party 0, and add one to the port number. Party 1 will add 1 to a port number on his side.
When party 1 connects with party 2, with current code, he will pull out the same partyinfo of party 0, and add on to the port number. Party 2 will add 1 to a port number on his side.

Since multiple connections will be established between each pair of parties, this will definitely create a conflict. For example, party 0 will add 1 to the same port number twice while others only do that once.

Our solution:

1. Each party keep a map of partyinfo, served as "info needed to connected to party i".
2. during each connection attemption, each party will use the peer's id to look up the partyinfo map. If this party is going to play the role of server, the ip address is useless. The corresponding ip address and port number can be used to establish connection.

Differential Revision: D36908724

fbshipit-source-id: 60c96c97f2cc1c77710ad55ebda63c179abd14ca
Summary:
Pull Request resolved: facebookresearch#218

Our existing arrangement of party info (ip address and port number) is buggy as there will be a conflict with more than 2 parties. This diff is to address this issue.

Our current code works fine with 2 party setting. But it will break with more than 2 parties.

Example scenario:
when party 0 connects with party 1, with current code, he will pull out the partyinfo of party 0, and add one to the port number. Party 1 will add 1 to a port number on his side.
When party 1 connects with party 2, with current code, he will pull out the same partyinfo of party 0, and add on to the port number. Party 2 will add 1 to a port number on his side.

Since multiple connections will be established between each pair of parties, this will definitely create a conflict. For example, party 0 will add 1 to the same port number twice while others only do that once.

Our solution:

1. Each party keep a map of partyinfo, served as "info needed to connected to party i".
2. during each connection attemption, each party will use the peer's id to look up the partyinfo map. If this party is going to play the role of server, the ip address is useless. The corresponding ip address and port number can be used to establish connection.

Differential Revision: D36908724

fbshipit-source-id: 7821ade91cfb8c61be76cf79547ef8a4fdc8c476
@RuiyuZhu RuiyuZhu force-pushed the export-D36908724 branch from 12e28f1 to ade2a06 Compare June 6, 2022 20:52
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D36908724

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants