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

Mistaken same-host rendezvous mode may result in misleading error reports #369

Open
ethouris opened this issue May 3, 2018 · 2 comments
Assignees
Labels
[apps] Area: Test applications related improvements Priority: Medium
Milestone

Comments

@ethouris
Copy link
Collaborator

ethouris commented May 3, 2018

When you try to make a rendezvous-type connection to another host, while the destination host actually resolves to localhost (or, more simply, when the bound IP address is the same as the target IP address), it causes unexpected things to happen and it causes misleading errors.

That is, the result is that the packet sent to the socket is then received back by the sender as if it had received a packet from the "peer", and it tries to resolve it as a peer's handshake. In case of HSv5 this results in having equal cookies, which causes an immediate error due to unresolved cookie contest, however this happens immediately after running this command, without even starting the command on the "peer side". This "problem resolution" is however rather accidental, and it is desired that the problem be resolved more predictable way.

Normally the rendezvous sockets have to be first bound locally, so I think it should be enough to check in the function called directly from srt_connect that if this a rendezvous socket, then the target IP address must differ to the bound IP address, otherwise this function results in error.

@ethouris
Copy link
Collaborator Author

ethouris commented May 9, 2018

Further study: this check requires getting all IP addresses of the current machine and check the target address against each of them, if the bound address (s->m_pSelfAddr, with CUDTSocket* s) contains sin_addr.s_addr == INADDR_ANY.

@ethouris
Copy link
Collaborator Author

#377 Submitted to add the check to the srt-test* applications, the check is done before the call to srt_connect.

@ethouris ethouris added the [core] Area: Changes in SRT library core label Aug 12, 2019
@mbakholdina mbakholdina added this to the v1.5.0 milestone Feb 20, 2020
@mbakholdina mbakholdina added [apps] Area: Test applications related improvements and removed [core] Area: Changes in SRT library core labels Feb 20, 2020
@maxsharabayko maxsharabayko modified the milestones: v1.5.0, v1.5.1 Jun 19, 2020
@mbakholdina mbakholdina modified the milestones: v1.5.1, Backlog May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[apps] Area: Test applications related improvements Priority: Medium
Projects
None yet
Development

No branches or pull requests

3 participants