pub struct HandleIncomingPacketRequest {
    pub session_id: u16,
    pub payload: Vec<u8, 309>,
}
👎Deprecated
Expand description

uavcan.internet.udp.HandleIncomingPacket.0.1

Size ranges from 4 to 313 bytes

This message carries UDP packets sent from a remote host on the Internet or a LAN to a node on the local Cyphal bus. Please refer to the definition of the message type OutgoingPacket for a general overview of the packet forwarding logic.

This data type has been made a service type rather than a message type in order to make its transfers addressable, allowing nodes to employ hardware acceptance filters for filtering out forwarded datagrams that are not addressed to them. Additionally, requiring the destination nodes to always respond upon reception of the forwarded datagram opens interesting opportunities for future extensions of the forwarding protocol. If the service invocation times out, the modem node is permitted to remove the corresponding entry from the NAT table immediately, not waiting for its TTL to expire.

It should be noted that this data type definition intentionally leaves out the source address. This is done in order to simplify the implementation, reduce the bus traffic overhead, and because the nature of the communication patterns proposed by this set of messages does not provide a valid way to implement server hosts on the local Cyphal bus. It is assumed that local nodes can be only clients, and therefore, they will be able to determine the address of the sender simply by mapping the field session_id to their internally maintained states. Furthermore, it is uncertain what is the optimal way of representing the source address for client nodes: it is assumed that the local nodes will mostly use DNS names rather than IP addresses, so if there was a source address field, modem nodes would have to perform reverse mapping from the IP address they received the datagram from to the corresponding DNS name that was used by the local node with the outgoing message. This approach creates a number of troubling corner cases and adds a fair amount of hidden complexities to the implementation of modem nodes.

It is recommended to perform service invocations at the same transfer priority level as was used for broadcasting the latest matching message of type OutgoingPacket. However, meeting this recommendation would require the modem node to implement additional logic, which may be undesirable. Therefore, implementers are free to deviate from this recommendation and resort to a fixed priority level instead. In the case of a fixed priority level, it is advised to use the lowest transfer priority level.

Fields§

§session_id: u16
👎Deprecated

This field shall contain the same value that was used by the local node when sending the corresponding outgoing packet using the message type OutgoingPacket. This value will be used by the local node to match the response with its local context.

saturated uint16

Always aligned, size 16 bits

§payload: Vec<u8, 309>
👎Deprecated

Effective payload. This data will be forwarded from the remote host verbatim. UDP packets that contain more than 508 bytes of payload may be dropped by some types of communication equipment. Refer to RFC 791 and 2460 for an in-depth review. Cyphal further limits the maximum packet size to reduce the memory and traffic burden on the nodes. Datagrams that exceed the capacity of this field should be discarded by the modem node.

saturated uint8[<=309]

Always aligned, size ranges from 0 to 2472 bits

Trait Implementations§

source§

impl DataType for HandleIncomingPacketRequest

source§

const EXTENT_BYTES: Option<u32> = _

This type is delimited with an extent of 600 bytes.

source§

impl Deserialize for HandleIncomingPacketRequest

source§

fn deserialize(cursor: &mut ReadCursor<'_>) -> Result<Self, DeserializeError>where Self: Sized,

Deserializes a value and returns it
source§

fn deserialize_from_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>where Self: Sized,

A convenience function that creates a cursor around the provided bytes and calls deserialize
source§

impl Serialize for HandleIncomingPacketRequest

source§

fn size_bits(&self) -> usize

Returns the size of the encoded form of this value, in bits Read more
source§

fn serialize(&self, cursor: &mut WriteCursor<'_>)

Serializes this value into a buffer Read more
source§

fn serialize_to_bytes(&self, bytes: &mut [u8])

A convenience function that creates a cursor around the provided bytes and calls serialize
source§

impl Request for HandleIncomingPacketRequest

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.