MystenLabs / scion-rs

This library provides an end-host networking stack for SCION and can be used in Rust applications to communicate over a SCION network.
Apache License 2.0
19 stars 5 forks source link

Implement SCMP #54

Closed mlegner closed 7 months ago

mlegner commented 9 months ago
jpcsmith commented 9 months ago

The UDP man pages states that received errors are returned on subsequent calls to the socket. Additionally, errors can be set to be collected and requested using a separate API.

Error handling All fatal errors will be passed to the user as an error return even when the socket is not connected. This includes asynchronous errors received from the network. You may get an error for an earlier packet that was sent on the same socket. This behavior differs from many other BSD socket implementations which don't pass any errors unless the socket is connected. Linux's behavior is mandated by RFC 1122. [...] When the IP_RECVERR option is enabled, all errors are stored in the socket error queue, and can be received by recvmsg(2) with the MSG_ERRQUEUE flag set.

jpcsmith commented 9 months ago

The SCMP message handling can be seen in netsec-ethz/scion-apps/blob/master/pkg/pan/raw.go, which used by their UDP socket.

Their current approach is to notify the PathStats monitor that the path in the message is down when the socket receives either ExternalInterfaceDown or InternalConnectivityDown. All other SCMP messages are propagated as an error.