Skip to content

backwards compatibility with ddm protocol version 1 #156

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

Merged
merged 7 commits into from
Jan 26, 2024

Conversation

rcgoodfellow
Copy link
Collaborator

@rcgoodfellow rcgoodfellow commented Jan 25, 2024

This PR now covers backward compatibility with version one of the ddm exchange protocol.

Ddm has two protocols, a router discovery protocol and a prefix exchange protocol. The tunnel routing updates did not change the discovery protocol - and that protocol carries an 8-bit version in it. I updated the exchange client/server code to speak either v1 or v2 of the protocol based on what the peer advertised in the discovery phase. I also added backward compatibility tests to CI.

@rcgoodfellow rcgoodfellow changed the title don't unwrap on excahnge message errors backwards compatibility with ddm protocol version 1 Jan 26, 2024
@@ -128,15 +134,15 @@ pub struct DiscoveryPacket {
impl DiscoveryPacket {
pub fn new_solicitation(hostname: String, kind: RouterKind) -> Self {
Self {
version: VERSION_1,
version: Version::V2 as u8,

Choose a reason for hiding this comment

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

Apologies as I've not spent much time in this, but how does hardcoding version 2 for the different discovery packets actually fit in terms of backwards compatibility? If someone only understood version 1, they'd presumably ignore the solicitation or advertisement, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Version 1 does not do anything with the version value in the discovery header, except for fill it in with the value 1 and send it out. The backwards compatibility part comes in with how the routers behave when they get to the exchange phase, which comes after discovery. If a version 2 router detects a version 1 peer through discovery, it will speak the version 1 protocol for exchange.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've added a comment on this in 1f95198

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

rcgoodfellow and others added 2 commits January 25, 2024 21:26
@rcgoodfellow rcgoodfellow merged commit d12bdf8 into main Jan 26, 2024
@rcgoodfellow rcgoodfellow deleted the protocol-unwrap-fix branch January 26, 2024 06:05
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.

3 participants