Troubleshooting connections

There are a few steps involved when setting up a new connection / bind to a remote system. IP addresses, firewalls, authentication and various configuration options for sending and receiving messages and delivery reports. We will try to describe how to troubleshoot a connection.

To our help we have the EMG connector and pdu logs. They are reachable both in the file system and via the “EMG log files” menu option in EMG Portal.

In our examples below we will use SMPP connections since they are the most common type of connection but most of the techniques described apply to any type of connection.

Outbound connections

We will start out by describing the various steps of an outbound connection, or a connector of type “outgoing” with EMG terminology.

Connecting

First step is to try to connect to the specified ip address and port of the remote system.

A successful connect will show up in the connector log like this

2015-04-28 21:25:42.104666 (0) CONNECT OK

while a failed connect might look like this

2015-04-27 13:27:36.360464 (0) CONNECT ERR (info="110")

Please note that the “(0)” indicates the instance number. If you have multiple instances of the connector each instance will log its own instance number. So, in order to follow a session you need to ensure that you filter out the log entries with the same instance number.

The numeric “info” code is in this case the error code from the “connect” system call in the operating system.

The most common error codes would be 110 (ETIMEDOUT) and 111 (ECONNREFUSED) indicating that either the ip address or port is incorrect or that there is a firewall or similar preventing the connection.

On CentOS 5 and 6 the errno codes and values are defined in the include file

/usr/include/asm-generic/errno.h

Logging in

When a connection has been established, next step is to log in  / authenticate  / bind with the remote system.

This time a successful log in will show up in the connector log like this

2015-04-28 21:25:42.104666 (0) LOGIN OK (info="0 system")

The error code is “0” indicating success and “system” is the “systemid” in the bind reponse from the remote system.

Failure would look like

2015-04-28 21:25:42.104666 (0) LOGIN ERR (info="15")

This time the error code would be the SMPP error code. The most common error codes would be 13, 14 and 15 all meaning that the bind failed due to invalid user credentials. It is possible that user credentials are correct but that the remote system still rejects the login for some other reason such that our IP address has not been whitelisted.

The pdu log will display the more detailed SMPP packets sent and received on the connection.

Sample excerpt from pdu log for a successful login

2015-04-29 03:03:59.473594 INFO  (smpp-out,0) Write op:0x00000009 (BIND_TRANSCEIVER) status:0 trn:11638 datalen:22 INTERFACEVERSION:52 PASSWORD:secret SYSTEMID:user
2015-04-29 03:03:59.474386 INFO  (smpp-out,0) Read op:0x80000009 (BIND_TRANSCEIVER_RESP) status:0 trn:11638 datalen:0 SCINTERFACEVERSION:52

We can see that the reponse was received less than a millisecond after the bind was sent, the interface version is specified as 52 (decimal, which is hex 0x34) indicating SMPP 3.4 and status “0” indicates all ok.

Connector is named “smpp-out” and the connector instance number is 0.

Inbound connections

When a remote system attempts to connect to an EMG connector of type incoming.

Connection

A successful connect will show up in the connector log like this

2015-04-28 10:32:23.432023 (3) CONNECT OK (info="0 192.168.0.1")

In this case “192.168.0.1” shows the ip address of the remote system.

If no connection attempts can be found for a client the connection attempts probably do not reach EMG. Possible reasons include the client is using wrong ip address or port, because the connection is prevented by an intermediate firewall, or if the connector uses the ACCESS option which doesn’t include this client.

Authentication

When EMG authenticates a client it checks username, password and also that the client ip address is allowed for the connector based on “connector access”.

If any of information is incorrect it will return SMPP error code 14 in decimal, 0x0e in hex, representing “ESME_RINVPASWD”.

Sample excerpt from pdu log for a successful login

2015-04-29 04:09:41.642615 INFO  (smpp-in,0) Read op:0x00000009 (BIND_TRANSCEIVER) status:0 trn:14914 datalen:22 INTERFACEVERSION:52 PASSWORD:secret SYSTEMID:user
2015-04-29 04:09:41.643365 INFO  (smpp-in,0) Write op:0x80000009 (BIND_TRANSCEIVER_RESP) status:0 trn:14914 datalen:0 SCINTERFACEVERSION:52