Weird SMPP SMSC problem

Weird SMPP SMSC problem SearchSearch
Author Message
Suvinay
New member
Username: Suvinay

Post Number: 8
Registered: 07-2004
Posted on Saturday, August 28, 2004 - 03:31 pm:   

Hi Bryce,
I am facing a weird problem when using the SMPP SMSC connection to connect to operator SMSC.
Basically what happens is that whenever the connection breaks ONLY DUE TO IP link breaking, then, after I reestablish the IP link to the internet and then reestablish the SMPP link to SMSC, somehow the SMSC is sending messages to the wrong ports.
Let me explain in detail what I have noticed:

Suppose I have an SMPP link to SMSC (giving only receiver eg. as transmitter not a problem)

1. Receiver local port 1234 to operator ip xxx.xx

2. Now for some reason the link breaks (NOT due to IPlink failure), eg I restart the service, then new local ports are used, when the SMPP SMSC link is established:
Receiver local port 2345 to operator ip xxx.xx

3. Now ONLY IF IP LINK BREAKS (ie. I disconnect from internet), then obviously the SMPP link to SMSC will break. When this happens and I reconnect to the Internet and restablish the SMPP link to SMSC, then new local ports are used:

Receiver local port 3456 to operator ip xxx.xx

Everything seems fine so far right? NOW the problem is that whenever a msg is sent by the SMSC to my SMPP link, the message is being delivered on WRONG PORTS specifically the ports used in 1. ie 1234 (previous to previous connection).

I guess what happens is that when the link abruptly breaks without unbinding, the current ports are lost and somehow the system is reverting to the last port, and even when new connection is being established, it is somehow not updating the ports and using the last to last ports!!!
Seems weird doesnt it! I have tried contacting and explaining this problem with the operator SMSC, but they are saying that more than 40 clients are connected to their SMSC and none of them are facing this problem, so I have to check my SMS software/gateway and correct on my end.

Thing is, if the link drops due to any other reason EXCEPT ip failure then everything works normally and incoming msgs are delivered on right new local ports (eg if I manually restart service or if link drops but IP link is still active).

This happens ONLY when IP connection to internet drops. Restarting the service before reconnecting to the internet does not help. The only way is to establish connection to the SMSC and then restart the service. BUT here the problem occurs that the SMSC stores all incoming msgs if the link is inactive and as soon as the link gets activated, it sends the messages to my gateway...but since they are delivered to wrong ports... the messages get lost.

What could be the reason for this problem? Is this operator SMSC problem only or something else? Please help.

Thanks and Regards,
Suvinay
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 3389
Registered: 10-2002
Posted on Monday, August 30, 2004 - 07:46 pm:   

Hi Suvinay,

I'm sorry, but I don't understand.

I basically don't understand what you are saying about the ports.

Can you explain exactly how you have things configured?

Are you saying that each time NowSMS connects, it uses a new local port number? (That is normal, unless you have fixed the local sender or receive port number under "Advanced Options".)

If you want NowSMS to use the same local port each time, you have to configure that port number under "Advanced Options" when defining an SMPP connection.

Note that when using fixed port settings, after you make a connection, you will not be able to reconnect again for approximately 2 minutes. This is a limitation of TCP/IP between fixed ports. So basically, when using fixed port settings, you should expect at least a 2 minute delay before being able to reconnect.

-bn
Suvinay
New member
Username: Suvinay

Post Number: 9
Registered: 07-2004
Posted on Tuesday, August 31, 2004 - 08:06 am:   

I am using SMPP connection to operator SMSC. I have NowSMS ver 5.50.

Yes, normally new local ports are used each time a connection is made to the SMSC.

What the problem is that...somehow when a new connection is made (and obviously new local ports are automatically assigned), the SMSC is delivering the messages to the wrong ports... not the new updated ports... AND this happens only when the link breaks due to IP failure

Let me try explaining this way:

At10am a connection was made to SMSC
local(IP:port) -> SMSC (IP:Port)
ip:1234 -> IP:555

At 11 am this SMPP connection breaks due to some reason and new SMPP connection is made:
local(IP:port) -> SMSC (IP:Port)
ip:2345 -> IP:555

At 1 pm this disconnects due to IP FAILURE ONLY and new connection is made after I reconnect to the internet:
local(IP:port) -> SMSC (IP:Port)
ip:3456 -> IP:555

NOW what happens is that subsequent incoming messages from SMSC to NowSMS is delivered to Wrong ports. ie..they should be delivered to port 3456 right? but they are instead delivered to port 1234 (the ports which were used when the initial connection at 10am was made)

Weird part is that if the IP is up and the connection breaks due to some other reason like timeouts or if I restart the service, then even though new local ports are used, still the SMSC will deliver to the right ports.

Only when the SMPP link breaks due to IP failure..ie internet disconnection...both sides either SMSC or mine, then this wrong port delivery problem occurs...

I hope I have been able to explain the position to you now? Why does this happen and is this a bug in the gateway or the SMSC???

Thanks
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 3394
Registered: 10-2002
Posted on Tuesday, August 31, 2004 - 04:15 pm:   

Suvinay,

The part that confuses me, is that if the ports are no longer connected, how do you know that the message is being delivered to the wrong port?

You can force NowSMS to use the same port each time by setting a local port number for the sender and/or receiver connections (only the sender is used if the connection type is transceiver). So you might want to try that if you believe the port number assignment is a problem. Just note that when you force the port number, there is a TCP/IP issue that after a broken connection it takes about 2 minutes before the connection can be re-established.

-bn
Suvinay
New member
Username: Suvinay

Post Number: 10
Registered: 07-2004
Posted on Wednesday, September 01, 2004 - 02:30 pm:   

Bryce, I am using a network activity monitoring software called BWMeter which shows bandwidth usage plus all incoming network traffic. Thats how I came to know the cause of the problem, as when I was sending messages from my mobile, sometimes they were being delivered and sometiems not.
:-)
Can I use NowSMS ver 5.50 for fixing the local ports for the receiver/sender connections?
Thanks again
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 3402
Registered: 10-2002
Posted on Wednesday, September 01, 2004 - 09:04 pm:   

Suvinay,

I don't know the BWMeter software ... but I cannot understand how a message could be delivered over a port that was closed. That is why this does not make any sense to me.

If you want to look at network traffic, I'd recommend www.ethereal.com with WinPCap ... it is excellent.

The option to set the local ports is under the "Advanced Options" in properties for an SMPP connection. I don't recall if this setting was present in v5.50 or if it was only added in v5.51.

-bn
Suvinay
New member
Username: Suvinay

Post Number: 11
Registered: 07-2004
Posted on Thursday, September 02, 2004 - 04:20 am:   

Bryce, I am also totally confused as to why this is happening. Apart from the traffic confirmation, another confirmation that the message is being delivered to the wrong port is the fact that the message does not reach NowSMS.. there are no entries in the SMSIN log file... even though the message is shown as delivered on the originating mobile and the SMSC operator also shows delivered in their log files....
Weird isn't it!
Could it be that some kind of 'ghost' port image of last connection is maintained somewhere in the SMSC? When the SMPP clients logs off without a proper unbind, maybe some error or something happens?
I really don't know what is happening, but the scenario I outlined above is confirmed as I am practically experiencing it

5.50 doesn't have local port settings.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 3409
Registered: 10-2002
Posted on Thursday, September 02, 2004 - 10:19 pm:   

Suvinay,

Some SMSCs do have problems detecting that a connection has dropped. Particularly, I have heard about one major SMSC vendor who runs their SMSC on an old operating system that is no longer even supported by the original vendor ... and that vendor has a special license to distribute that operating system on custom hardware for running their SMSC.

But in that type of situation, the SMSC doesn't let you rebind until a rather lengthy timeout occurs.

I'd suggest the local port settings in v5.51. v5.51 is a free update for v5.50, so it just needs to be downloaded and installed.
Suvinay
New member
Username: Suvinay

Post Number: 15
Registered: 07-2004
Posted on Friday, September 03, 2004 - 07:58 am:   

I will try out 5.51 with static ports.
I'd like to know.....incase the link between SMSC and SMPP breaks, how do I specify the time to wait before trying to reconnect to SMSC and how many attempts to make before aborting any more attempts? I presume these will be needed for the static ports option.
Thanks again.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 3422
Registered: 10-2002
Posted on Friday, September 03, 2004 - 07:29 pm:   

The retries will be handled automatically. Just note that it will take about 2 minutes.