16
The use of different port numbers allows us to use the same physical device on a network for different
services.
Port numbers are not chosen arbitrarily, they are standardized and controlled by an organization called
IANA.
Our multiplexers all use port number 10110, which is a registered port for NMEA data.
Protocols
Two transport protocols are available for sending data over the network: UDP and TCP. UDP can be used
in two different modes: Broadcast and Directed.
UDP Broadcast
NMEA sentences are broadcast on the network using UDP messages. Every device on the network will
receive these messages. At the same time, any device on the network can send data to the multiplexer,
either to its IP address (directed) or as a broadcast. UDP Broadcast has the following properties:
•
Every device on the network will receive NMEA data from the multiplexer.
•
Every device on the network can send NMEA data to the multiplexer.
•
Other MiniPlex-2E/2Wi’s on the same network will also receive each other’s data. It is therefore
possible to send NMEA data over the network from NMEA device to another. Care should be taken to
prevent buffer overflows by selectively routing the desired NMEA data to an NMEA output at the
receiving end and blocking unwanted NMEA data.
•
Routers do not pass UDP Broadcasts from one network to another so this mode can only be used on
one network.
•
Delivery of NMEA data is not guaranteed, messages can be lost.
•
Wi-Fi routers often assign a low priority to UDP broadcasts, resulting in dropped messages. Typically
up to 5% of the messages gets lost.
UDP Directed
With directed UDP data is sent to a specific IP address. The advantage is that it travels across routers and
networks and can therefore also be used to send NMEA data over the Internet. Any device on the
network can send data to the multiplexer either to its IP address (directed) or as a broadcast. Directed
UDP has the following properties:
•
Travels across routers/networks and the Internet.
•
Higher change of delivery than UDP broadcast.
•
Every computer on the network can send NMEA data to the multiplexer.
•
Only one computer can receive NMEA data from the multiplexer.
•
Delivery of NMEA data is not guaranteed, messages can be lost.
TCP
When using TCP, a device sets up an exclusive connection with the MiniPlex. The TCP protocol is reliable,
which means that when data gets lost on the way from one device to another, it is automatically
retransmitted. Both the MiniPlex-2E and the MiniPlex-2Wi are limited to one TCP connection at a time.
TCP has the following properties:
•
Travels across routers/networks and the Internet.
•
Only one computer or other device may communicate with the multiplexer.
•
Reliable connection. Lost messages are automatically retransmitted.
Although TCP might seem the best option from the above, it is favourable to use UDP. Compared with
TCP, UDP will minimize network bandwidth. To send periodically updated sensor data, it is usually more
appropriate to NOT use a guaranteed-delivery protocol like TCP. In navigation applications, the best thing
to do in the rare event that a message doesn't get through is to simply wait for the next message. The
TCP protocol forces retries that increase network traffic unnecessarily.
UDP resembles NMEA the most because NMEA is also a message based broadcast protocol without any
acknowledgements or retries.
Assigning IP addresses
When devices are connected to a network, they all must have a unique IP address and a matching
netmask. One way of achieving this is to set the IP address and netmask of each device manually. The
other way is to let a DHCP server take care of this.
DHCP is an acronym for Dynamic Host Configuration Protocol and it is a mechanism to automatically
assign IP addresses to devices (hosts) on a network. A DHCP server on a network will respond to
requests from DHCP clients to obtain an IP address.