MTU– maximum data transfer sizeRTU– recommended data transfer size
23 Transport
org.arl.unet.Services.TRANSPORT
23.1 Overview
The TRANSPORT service provides end-to-end delivery of datagrams across the network. Where the LINK service (Chapter 18) guarantees delivery only to an immediate neighbor, the transport service guarantees delivery all the way to a destination that may be several hops away, building on the ROUTING service (Chapter 21) to get there.
To do this reliably over a multi-hop path, the transport service handles two problems that the link layer cannot solve on its own:
- Large datagrams are fragmented for transmission and reassembled at the destination (potentially using the fragmentation framework in Section 33.6), so applications can send payloads much larger than a single link frame.
- Reliability is provided end-to-end: the destination acknowledges received data, and the source retransmits anything that is lost along the way. This is necessary because a datagram that is reliably delivered across each individual hop can still be lost if an intermediate node fails.
Because the transport agent provides the DATAGRAM service (Chapter 16), data is sent to it using a DatagramReq and received as a DatagramNtf. The ping command uses the transport service to check end-to-end reachability of a node. The default transport agent is accessed as transport.
23.2 Messages
The TRANSPORT service defines no messages of its own: all data transfer uses the datagram messages (Chapter 16). What distinguishes a transport provider is the scope of its guarantees — a DatagramReq with reliability requested is acknowledged by the final destination, not just the next hop, and the resulting DatagramDeliveryNtf or DatagramFailureNtf reflects end-to-end delivery. A transport provider is expected to support at least the RELIABILITY and FRAGMENTATION datagram capabilities.
23.3 Parameters
In addition to any implementation-specific parameters, a transport agent exposes the standard datagram parameters:
23.4 Commands
ping– ping nodeExample:
ping 27 // ping node 27 ping 27, 5 // ping node 27, 5 times ping 27, 5, 10000 // ping node 27, 5 times, with 10s timeoutabort– abort all transport datagram transfersExample:
abort // abort ongoing transfers
23.5 Examples
The simplest use of the transport service is to check end-to-end reachability of a remote node with the ping command. From node 21’s shell in a multi-hop network, ping node 31 (which is reachable only via an intermediate relay). The round-trip times — and any packet loss — depend on the channel conditions during the run:
> ping 31
PING 31
Response from 31: seq=1 time=8246 ms
1 packets transmitted, 1 packets received, 0% packet lossTo send application data reliably across multiple hops, send a DatagramReq to the transport agent with reliability enabled. The agent fragments the payload as needed, routes it to the destination, and confirms end-to-end delivery:
def req = new DatagramReq(to: 31, data: 'hello'.bytes, protocol: Protocol.USER, reliability: true)
def rsp = transport.request(req, 60000)
println rsp.performative // AGREE if accepted for deliveryAGREEA DatagramDeliveryNtf is published once the destination acknowledges receipt, while a DatagramFailureNtf indicates that delivery could not be confirmed within the configured retry limit (the retry parameter of the default transport agent, Chapter 24).
23.6 Implementations
23.6.1 Caddy / CaddyLite (transport)
The default TRANSPORT provider is the transport agent (Caddy / CaddyLite), loaded as part of the default stack. Because this same agent also provides the REMOTE service, it is documented in full — including its parameters and protocol — in Chapter 24.
23.6.2 SWTransport (stop-and-wait)
| Class | Services | Capabilities | Availability |
|---|---|---|---|
SWTransport |
TRANSPORT, DATAGRAM |
RELIABILITY, FRAGMENTATION, PROGRESS, CANCELLATION |
deprecated |
SWTransport is deprecated and retained only for backward compatibility. For new deployments, use the default transport agent (Chapter 24).
A simple multi-hop transport that delivers datagrams reliably using a stop-and-wait protocol.
23.6.2.1 How it works
Datagrams that fit the underlying provider’s transmission unit are sent directly. Larger datagrams are fragmented (with an 8-byte header carrying position, total length, protocol and an ID), and each fragment is acknowledged by the receiver before the next is sent. A missing acknowledgement triggers retransmission, with the timeout scaled by the number of hops (timeoutPerHop × maxHops) and bounded by maxRetries. It runs over any DATAGRAM provider (routing, link or physical).
23.6.2.2 Parameters
dsp– datagram service provider agent namemaxRetries– maximum number of retries for reliable deliverymaxHops– maximum number of hops for multi-hop transmissiontimeoutPerHop– timeout per hop (seconds)reportProgress– enable reporting of data transfer progressstatus– show status of ongoing transport agent connections