18  Link

org.arl.unet.Services.LINK

18.1 Overview

The LINK service provides single-hop datagram delivery between neighboring nodes. “Single-hop” is meant logically: a link over a UDP/IP network may traverse many routers and switches, but it counts as one hop in the Unet, because the datagram passes through no intermediate Unet node along the way. An acoustic link agent builds on the PHYSICAL service (Chapter 17) to offer capabilities that the raw physical layer does not; other link agents carry datagrams over entirely different media (IP networks, optical or satellite modems). In particular, a link agent can:

  • deliver datagrams larger than a single physical frame, by transparently fragmenting them on transmission and reassembling them on reception (perhaps using the fragmentation framework in Section 33.6);
  • provide reliable delivery, by acknowledging received data and retransmitting what is lost; and
  • recover from errors efficiently, by combining error detection, forward error correction and selective retransmission.

Link agents provide the DATAGRAM service (Chapter 16), so datagrams are sent to them using a DatagramReq and received as a DatagramNtf, with delivery outcomes reported through the standard datagram notifications. A node may run more than one link agent (for example, an acoustic link and a UDP link), each providing connectivity to a different set of neighbors; the router (Chapter 21) can then choose between them per destination. The default underwater acoustic link agent is accessed as uwlink.

18.2 Capabilities

Link agents advertise one service-specific capability (org.arl.unet.link.LinkCapability):

  • LINK_STATUS – the agent tracks link state and publishes LinkStatusNtf notifications

The quality-of-service features of a link — reliability, fragmentation, cancellation, compression, priority — are advertised through the datagram capabilities (Chapter 16), and vary between implementations (see the tables below).

18.3 Messages

Datagram transfer over a link uses the datagram messages (Chapter 16). In addition, a link agent that tracks the state of its links to neighbors reports changes — link up/down transitions and link quality — by publishing the following notification on its topic:

  • LinkStatusNtf – link status update

    Field Type Default Remarks
    quality float link quality metric
    to int 0 peer node address
    up boolean true if link is up, false if down

18.4 Parameters

In addition to the datagram parameters MTU and RTU (Chapter 16), agents providing this service expose:

  • MTU – maximum data transfer size
  • RTU – recommended data transfer size
  • dataRate :: float – data rate (bps)

18.5 Examples

If you start the 2-node-network and connect to node A’s shell, you can send a reliable datagram to node B (address 31) over uwlink and watch for its delivery acknowledgement. First subscribe to the link agent so its notifications are printed, then send the datagram with reliability requested:

> subscribe uwlink
> uwlink << new DatagramReq(to: 31, data: [1,2,3,4,5,6,7,8], reliability: true)
AGREE
uwlink >> LinkStatusNtf:INFORM[link:uwlink to:31 up:true]
uwlink >> DatagramDeliveryNtf:INFORM[id:019f4248-e802-745e-9714-29b551c038e8]

You can also check the status of the link to a neighbor through the indexed parameters, which report any transfer in progress to that peer:

> uwlink[31]
« UWLINK »

[org.arl.unet.link.ECLinkProgressParam]
  from ⤇ 0
  progress ⤇ 0
  size ⤇ 0
  status = UP
  to ⤇ 0

18.6 Implementations

UnetStack ships with several agents that provide the LINK service. The default underwater acoustic link is ECLink (uwlink), described in full below. UdpLink carries the link service over IP networks, and GenericLink simulates non-acoustic links in the simulator. The older ReliableLink is retained for backward compatibility, and two licensed drivers — HydromeaLink and IridiumLink — provide optical and satellite links respectively.


  1. Advertised depending on configuration: RELIABILITY when the link is configured as reliable, FRAGMENTATION when RTU < MTU.↩︎