MOTOTRBO and IP

Introduction

This post was first published on 25 October 2012 - it has been altered since then and includes additional information and clarifications. (The last change was made on 06.09.13).

For non-IT folk, the way to think about a MOTOTRBO system (any system, except maybe Connect Plus), is think about it as a computer network: the radios are end points and the repeaters are routers and, in some cases, end-points. MOTOTRBO radios send and receive voice (and data) using IP. A MOTOTRBO radio has an IP address (made up of the CAI number and Radio ID). We can access some of that IP data by connecting the radio to a PC and making use of things like data transfer and text messaging.
In general, MOTOTRBO repeaters have three interfaces:
  1. The Ethernet interface – This is via the RJ45 Ethernet connector on the back of the DR3000 or on the controller of the MTR3000.
  2. The RF Air Interface – As you guessed, this is done via the transmitter and receiver using the ETSI DMR standard and some Motorola specialities.
  3. The USB interface
Similarly, MOTOTRBO radios have two interfaces:
  1. The RF Air Interface – As you guessed, this is done via the transmitter and receiver using the ETSI DMR standard and some Motorola specialities.
  2. The USB interface.
In this post, I will only discuss the Ethernet interface of the repeater and specifically the configuration thereof in relation to voice and data. When I say data, I mean data that originates from the user (text; telemetry; MMDS and GPS) and from the repeaters themselves (control messages; handshakes, arbitration etc.). The majority of traffic (number of packets per hour) on a regular MOTOTRBO network will be voice in any case.
In summary, we can say the following about MOTOTRBO repeaters and systems:
  • Supports IPv4 addressing.
  • Uses UDP/IP to transfer voice and data.
  • Requires sufficient bandwidth to pass voice and data between sites.
  • Generally requires a stable latency of less than around 600ms**.
  • Jitter as close as possible to zero.
  • Requires one static IP address per network for the master repeater.
  • Supports VPN, NAT, VLANs, Firewalls etc.
** Based on customer feedback. The Motorola Engineering recommendation for latency is less than 90ms.

IPv4 and IPv6

MOTOTRBO repeaters support IP version 4 addressing. Some IP networks and the Worldwide Web have begun to use IP version 6 addressing.  Most IPv6 networks support Dual IP Stack which means that IPv4 and IPv6 devices can share the same network components. The most noticeable difference between the two, is the way in which an IP version 6 address is written.
Read further about IP version 6 here and about IP version 4 here.
Like any other IP device, the MOTOTRBO repeater needs to know five pieces of information about the network in terms of IP: - It’s own IP address; the IP address of the Gateway; the subnet mask; the UDP port and the IP address of the Master.
There are two ways of allocating these values: either through Static IP addressing (you define it) or via Dynamic IP addressing (the DHCP handles this) and DHCP. Static IP addressing is best suited for applications where there is no DHCP server or where the network administrator has implemented static IP throughout (though the latter is rare).
An example of a network where no DHCP is used could be a Wireless Broadband network you have installed yourself using Cambium (formerly Motorola) Point to Point links and no other infrastructure exists (i.e. this is your own IP backbone).
If no DHCP server exists then static IP addressing should be used on all devices. This means that no matter if the repeater is a Master or Peer, the IP address used must be predefined. A good place to plan this sort of information is on your fleetmap.
If the network is being piggybacked on an existing network, where there already is a DHCP server, then the peer repeaters can use DHCP for IP address allocation. This of course only applies to IP Site Connect and (Single Site) Capacity Plus where everything is on the same LAN.
Linked Capacity Plus systems, and IP Site Connect systems which use the internet (or any other medium), need routers on the sites and the configuration thereof is a little different. I will discuss Linked Capacity Plus separately as this seems to be a difficultly for some folk.

UDP

MOTOTRBO uses UDP to transfer voice and data between sites. UDP is very well suited for this, in that it is simple to implement (in terms of hardware); allows packets to arrive in a different order than they were sent and avoids the need for retries (as is the case with TCP). UDP is nothing new to us: well known services such as Skype; Remote Desktop; IP Telephony and IPTV (Digital cable TV) all use UDP in one way or another.
UDP also requires us to define a port number (also referred to as a socket). This port number is specified in the repeater codeplug and sometimes configured in the router and / or firewall.
Read about UDP here.

The Router

The Cisco Catalyst 6513 Router
Rather than me explaining how a Router works, rather have a look at Wikipedia. There are also some nice introductory videos on Youtube here; here and here (they all talk about Rowters though).
There is also a series of good videos, on Youtube about generel principles of computer networking here.
In a MOTOTRBO IP Site Connect network, a Router is used to connect multiple sites via another medium. Some examples of this include: connecting sites via the Inernet (ADSL) or connecting sites using Fiber-Optic.
I have shown three examples of Routers here: The Cisco Catalyst 6513 (which you would never use in a MOTOTRBO Network becuase of price capacity and size); the HP MSR20-20, which is the Motorola Engineering reccomended Router and the Netgear WNR1000, which is the Router I use when I do training. All three of these devices do the same thing - the only difference - in my opinion - is the processing power and (as a result) reliability.
The HP MSR20-20 Router
In a MOTOTRBO Capacity Plus system, a Router would be used to provide external access to the repeaters via an existing WAN or via the Internet (or whatever). The repeaters would need to be accessed externally, if the customer was using a Dispatch Application or RDAC.
In a MOTOTRBO Linked Capacity Plus system, the Router has a dual purpose: 1) it forwards traffic from the WAN to the Master repeater and 2) prevents Limited IP Broadcast traffic from escaping the LAN and interfering with the operation of other repeaters.
Almost all Routers nowadays are configured via a web browser: you connect your PC to the Router on one of the LAN ports (plugs), start Internet Explorer (or whatever you use to look on the internet), go to the IP address of the Router and make some changes.

There are four settings that you would need to look at in the Router:
  1. The WAN connection method and IP addressing. here you would need to know how the Router will connect to the internet and/or to the other sites. If you are connecting to the internet, your connection will be provided by an Internet Service Provider.
  2. The LAN IP address (my suggestion is to leave this as is). This is the IP address of the Router on the LAN. It is also the gateway IP address (as in the codeplug) according to the Repeaters on this site.
    The Netgear WNR1000
    
  3. Port forwarding. This is requred on the site which contains the Master repeater and ensures anything coming in from the WAN (or LAN) is forwarded to the Master.
  4. DHCP and LAN addresses. Remember that the Master repeater needs a Static IP Address. Devices which do not require a Static IP Address can use a Dynamic IP Address. This Dynamic IP Address is assigned by the Router using DHCP.
It makes good engineering sense to keep MOTOTRBO repeaters behind a seperate Router - in other words on their own LAN.

The Seven Layers

Its also probably a good time for your to read about the OSI model now. Ethernet switches and PTP links operate at layer 2. Routers and Wireless Modems (3G/4G cards) operate at Layer 3.

The Eighth Layer

The 8th Layer in the OSI Model is the most problematic! 95% of the problems I see with MOTOTRBO (and other IP based) Systems is directly attributable to this.

The Port

The IP address of a networked device provides a means of delivering data to it. This IP address is also used when that device needs to send data to another device. This works well on a device to device level.
The port provides a second level of addressing within an IP based system where a specific application at a specific IP can be addressed. For example, a PC connected to the internet uses IP address 140.101.16.142 however web pages are received using TCP port 1080 and emails sent on port 25. The IP address talks to the box whereas the port addresses the application in that box.
With the exception of IP Remote programming, MOTOTRBO exclusively uses UDP for all communications between sites and repeaters.

Port Forwarding

Port Forwarding (sometimes called Port Mapping) is a method by which the address and/or port number of a packet, arriving on one connection of a Router, is translated to new destination. This may include accepting such packets via a packet filter.
A Router which supports Port Forwarding may also do this by means of a routing table. The destination may be a predetermined network port on a device within a LAN, based on the port number on which the packet was received at the Router, from the originating device.
Port Forwarding is used to permit communications by external devices with services (e.g. MOTOTRBO UDP) provided within a LAN behind a Router.
Learn more about Port Forwarding here.
Consider the following network. Here we have a MOTOTRBO IP Site Connect network with two sites and two repeaters on each site.

Here, we can do something interesting: there are two repeaters offering four virtual channels (i.e. two channels with two slots each). Not only that, we can put one Master on one site and the other on the other site.
Here Peer 2 is linked to Master 1 and Peer 1 is linked to Master 2. The connection is via two Routers and a WAN cloud. The Routers use Static IP Addressing on their WAN Ports. They also use DHCP to give IP Addresses to the Peer repeaters. The Masters use Static IP addressing and in fact the same LAN IP Address.
How can the two Masters use the same IP Address? Because they are in different LANs and because the two Routers use Port Forwarding. UDP traffic from Peer 2 is on port 50000 and is forwarded to 192.168.0.2 on Router 1. UDP traffic from Peer 1 is on port 51000 and is forwarded to 192.168.0.2 on Router 2. The two IPSC links are differentiated by means of the port number.

NAT Loopback 

NB! As of release 2.2, NAT Loopback is no longer a requirements for the Routers used in Linked Capacity Plus. The information posted here is for your information only.

A router which supports NAT Loopback is critical in a Linked Capacity Plus system, if the firmware in the repeaters is older than R02.20.02 or if a RDAC PC is using the same LAN. Packets, from the Repeaters within the same site, which are destined for the Master, need to be directed to the router and forwarded to the Master repeater. Even the Master repeater needs to use the router - that is why the Master IP address field is not greyed out when Link Type is set to Master.

Consider the above Linked Capacity Plus system. Here we have two sites, with three repeaters on each site. The Router on Site 1 is configured with port forwarding and NAT loopback such that any TCP or UDP traffic on port 50000 is sent to the Master repeater at 192.168.0.2. The IP Address (192.168.0.2) of the Master is static.
The Router on Site 2 does not need to have port forwarding enabled. All the peers on all of the sites, all use Dynamic IP Addressing . The DHCP server within Routers 1 and 2 are configured to allocate IP addresses in the range of 192.168.0.3 to 192.168.0.200.
192.168.0.201 is reserved for the Rest Channel IP Address – which is also static and common to all repeaters. I will discuss the Rest Channel IP Address separately.
These two LANs can use the same IP Address range becuase they are seperated by two routers.
The WAN can be anything. In this case, it's just a direct CAT5 cable connection and since there is no Internet Service provider or DHCP server here, I have made up my own Static IP Addresses: 10.0.0.1 for Site 1 and 10.0.0.2 for Site 2. You would probably do the same if you were installing PTP links or Fiber-Optic.
Let's assume for one moment, that we have just switched on Peer 3 on Site 2 and Peer 2 on site 1. They are configured to register themselves with the Master repeater (this is defined in the CPS). They will do this using UDP/IP.
According to Peer 3 (Site 2), the Master repeater has IP Address 10.0.0.1. Therefore, to send its packet to this address, it needs to go through the Gateway - since 10.0.0.1 is not within the range defined by the Subnet Mask (this is set in the CPS and Router). The Gateway in this case is the Router (Site 2 Router).
The registration packet goes off to 10.0.0.1 via the Gateway (follow the green line) and arrives at the WAN port of the other Router: Site 1 Router. Since this Router has Port Forwarding enabled, and since the registration packet arrives on UDP port 50000, the Router automaticaly forwards this to 192.168.0.2 - the Master Router.
Now, when Peer 2, on Site 1 powers up, it also connects to the Master, at the same IP Address: 10.0.0.1, but since the Router (Site 1 Router) has NAT Loopback, the packet is redirected to the Master. If NAT Loopback was not there, the repeater would simply not connect to the network. Follow the red line above.
Remember that the Master is only needed for registering (adding) repeaters to the network. If the Master fails, the system will continue to operate abeit the reduced number of channels on one site. If this is an issue, another repeater can be used to act as a standby Master (a subject of a forthcoming post).

During normal operation, UDP traffic from the other sites on port 50000 will automatically be forwarded to the Master becuase of the port forearding setting in the Router on Site 1. Traffic on other ports will be forwarded as per the information contained in the respective packet headers - that is any traffic not on port 50000 will be directed to the peer on that site.

No port forwarding is needed for the peers since the information required to send UDP traffic between them is exchanged when they power up and when their lease is renewed. The lease is renewed whenever the DHCP gives out a new IP address - this IP address is only allocated for a limited period defined in the Router.

Rest Channel IP Address

In a Linked Capacity Plus system, whenever a repeater becomes a Rest Channel, it generates two IP Addresses for itself. One IP Address acts as a destination for Arbitration (TR-A-RT) packets from the other repeaters.
The (normal) IP Address given to the repeater by the DHCP server - or Statically assigned - is retained while this is happening. In other words, there are two IP addresses to set: the IP address for all traffic and a second, Rest Channel IP address, which is only used while the repeater is a rest channel. 
The UDP Port for the Rest Channel should be different: I use 55000.

QoS

In a Router, UDP packets on the ports used by the repeaters, need to have high priority in the Router.
Read more about QoS here.

Firewalls

There is no issue with operating a MOTOTRBO repeater within a network with a Firewall. The only requirement is that a specific port (default is UDP port 50000) be opened on the firewall. Alternatively, an allready open port on the Firewall can be used for MOTOTRBO traffic.
Remember that if Remote IP Programming is ticked, the Master UDP Port (both in the CPS) is used for both programming the repeaters and for UDP traffic. Remote IP Programming uses TCP so therefore the Firewall must be opened to both TCP and UDP traffic if you intend using this feature.
Remote IP Programming allows the programming of (32Mb memory) repeaters via an IP connection, rather than connecting to the repeater directly.


TCP

TCP/IP is only used for IP Remote Programming of a repeater - specifically since it inherently supports packet retry which is important when writing codeplugs. 
Powered by Blogger.