4

Consider the following, each of two peers has both TCP and UDP propery forwarded and bound:

Peer A
-> tcp 15600
-> udp 14600

Peer B
-> tcp 15600
-> udp 14600

Which of the following conditions will result in a successful connection:

# Valid TCP Connection
Peer A adds [ Peer B : tcp 15600 ]
Peer B adds [ Peer A : tcp 15600 ]

# Valid UDP Connection
Peer A adds [ Peer B : udp 14600 ]
Peer B adds [ Peer A : udp 14600 ]

But what will happen if the peers add each-other on different protocols?

Peer A adds [ Peer B : tcp : 15600 ]
Peer B adds [ Peer A : udp : 14600 ]

Will this scenario result in a mutual connection between nodes?

1 Answer 1

2

No, different protocols will not work.

When receiving a packet from your neighbor, iri will validate if the source of the packet is in your neighbors list. As the port numbers differ, the packets will get rejected.

Source: https://github.com/iotaledger/iri/blob/acfbc76f39c785aa0914f8bcb6745f34d8f6511b/src/main/java/com/iota/iri/network/Node.java#L244-L246

3
  • It would be great if you could integrate the relevant part of your link into your answer. SE answers should stand on their own even if links rot.
    – Helmar
    Commented Dec 3, 2017 at 20:32
  • @Helmar: What exactly should I include here? The link points to the source code of iri where eactly the neighbors are compared, and that the port number is compared, too. Also, the link refers to the commit hash so will be valid and have same content as long as iota's node (iri) is available on GitHub (even if iri changes later), and afterwards you can probably find it on some mirrors too.
    – mihi
    Commented Dec 3, 2017 at 21:08
  • Maybe the relevant 5-10 lines of code. The goal should be to not force the reader to read all the code.
    – Helmar
    Commented Dec 4, 2017 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.