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

feat: handle SCMP errors on UDP socket and add raw socket #125

Merged
merged 6 commits into from
Jan 26, 2024

Conversation

mlegner
Copy link
Contributor

@mlegner mlegner commented Jan 24, 2024

Originally, I wanted to use the new raw socket as a basis for the UDP socket. However, there are several challenges and the amount of duplicated code turned out to be somewhat limited. So I now kept two separate sockets with some extracted utility functions.

The UDP socket now returns specific errors if SCMP error messages are received. The raw socket can be used to send and receive SCMP info messages (among other custom SCION packets) as shown in the corresponding integration test.

What is still missing (but should be done in a separate PR) is to make some use of the SCMP errors in the PathAwareDatagram; for example, to invalidate cached paths.

Closes #54

@mlegner mlegner added enhancement New feature or request rust refactor labels Jan 24, 2024
@mlegner mlegner self-assigned this Jan 24, 2024
Copy link
Contributor

github-actions bot commented Jan 24, 2024

Code Coverage

Package Line Rate Health
crates/scion-proto/src/scmp 77%
crates/scion/src/pan 78%
crates/scion-proto/src 79%
crates/scion-proto/src/packet 80%
crates/scion/src/pan/path_strategy 83%
crates/scion-proto/src/path 83%
crates/scion/src 80%
crates/scion-proto/src/packet/headers 85%
crates/scion-proto/src/path/standard 92%
crates/scion-proto/src/reliable 95%
crates/scion-proto/src/address 70%
crates/scion/src/daemon 91%
crates/scion-proto/src/path/metadata 100%
crates/scion/src/socket 77%
Summary 79% (1929 / 2427)

Copy link
Contributor

@jpcsmith jpcsmith left a comment

Choose a reason for hiding this comment

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

Hey Markus, thank's for preparing this, the raw socket. It looks good. My primary concern would be that we could probably add something (trait or enum) that is a ScionPacket and can be used in the send function signature.

crates/scion/src/pan/error.rs Show resolved Hide resolved
crates/scion/src/socket/utils.rs Outdated Show resolved Hide resolved
crates/scion/src/socket/raw.rs Outdated Show resolved Hide resolved
@mlegner mlegner enabled auto-merge (rebase) January 26, 2024 08:57
@mlegner mlegner merged commit fdb4c81 into main Jan 26, 2024
11 checks passed
@mlegner mlegner deleted the feat/scmp-socket branch January 26, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement SCMP
2 participants