PPP over usb dongle (3G modem)

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wanted to know if there is a way I the client could know if the server (mobile cell) on the other end still has connection with me.

I do so far LCP, CHAP and then IPCP and then sit there hoping users from other end of the world will send me web (HTTP) querries :)

However after long periods of inactivities I have noticed my dongle becomes unresponsive. Well I do a http request after long periods of inactivity, the lil webserver on micro will no longer respond. Well infact the dongle does not receive any data to start with. So my conclusion is that the mobile network operator on the other end has assumed I have gone offline?

So is there a way I could perform "I am alive" or "Are you alive" games with the remote end (mobile network) once in a while to let it know I am still hooked on during periods of inactivity?

I think also the network operators disconnect 3G internet during times of high demand or 4hr session etc, right?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

after long periods of inactivities I have noticed my dongle becomes unresponsive

tempting...huh?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am working on a project that MAY have the same sort of issue. Telecom broadband mobile seems to periodically drop the connection. I need it to stay alive so that if an alarm condition occurs my SMTP email message will get through.

I have queried the provider, but they don't seem to understand my problem. I think their SMTP service is way down the list of priorities.

I was going to investigate sending a "connect signal" using chat before trying to send the alarm message.

I would be interested in what you discover.

Cheers,
Dave

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

So is there a way I could perform "I am alive" or "Are you alive" games with the remote end (mobile network) once in a while to let it know I am still hooked on during periods of inactivity?

How about sending a ping from your end? or a DNS query? You could use it to trigger a connection reset.

- S

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am currently trying to write a routine that may send regular (1 min) interval LCP Echo reqeust...I think you are allowed to do that even after your IPCP session is established...I will get back to you.

This LCP echo request from remote cell is the closest thing to ping. Unfortunately the remote server doesnt give me any IP address during the IPCP handshake....so no way to actually ping it.

Alternative way may be to send out a dummy DNS querry type querry? or I have seen something like "who has ip www.xxx.yyy.zzz?" type querry that machines/routers normally send. I could perhaps send a querry with my own IP address in it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was going to try modifying this example from Sierra-Wireless or do you think I am barking up the wrong tree?

# Connection script for Sierra Wireless GSM/UMTS modems
# Note: This demo script is setup to work on the Cingular EDGE network
#
SAY 'Starting Sierra Wireless GSM connect script...\n'
SAY '\n'

#######################################
SAY 'Setting the abort string\n'
SAY '\n'
# Abort String ------------------------------
ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT DELAYED

#######################################
SAY 'Initializing modem\n'
# Modem Initialization 
'' AT
OK ATZ

#######################################
SAY '\n'
SAY     'Setting APN\n'
# Access Point Name (APN) 
# Incorrect APN or CGDCONT can often cause errors in connection.
# Below are a bunch of different popular APNs

#REG:\s1 AT+cgdcont=1,"IP","proxy"
#OK     'AT+CGDCONT=0,"IP","proxy"'
#OK     'AT+CGDCONT=1,"IP","proxy"'
#OK     'AT+CGDCONT=2,"IP","proxy"'
#OK     'AT+CGDCONT=0,"IP","ISP.CINGULAR"'
OK     'AT+CGDCONT=1,"IP","ISP.CINGULAR"'
#OK     'AT+CGDCONT=2,"IP","ISP.CINGULAR"'

#######################################
SAY '\n'
SAY     'Dialing...\n'
# Dial the ISP, this is the common Cingular dial string

OK ATD*99#
CONNECT ''
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Isn't this what "keepalive" exists for?

http://tldp.org/HOWTO/TCP-Keepal...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

davef I think u r barking up the wrong tree... lol..

Ok guys I have done some experiment sending LCP echo request after my session is established....unfortunately the cell tower starts renegotiating the whole LCP process the moment I send an LCP echo request instead of sending me an echo reply. This is probably expected as the RFC says one is only allowed to send an LCP echo request during the LCP Opened state. I presume this Opened state is immediately after LCP negotiation and not after athentication and IPCP stage has been established.

So I am thinking now some kind of dummy dns search is the way to keep things alive? how does the "keep alive" work in 3g modem routers?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

oh looks like I have succeeded in sending an LCP echo request...it didnt work the first time because i mistakenly placed LCP TYPE id = 1 which is an LCP config request instead of LCP type id = 9 which is an LCP echo reqeust in the LCP packet.

So after the fix the remote end replies with an echo reply!

So I now have keep alive :) yeeha!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I am currently trying to write a routine that may send regular (1 min) interval LCP Echo reqeust...I think you are allowed to do that even after your IPCP session is established...

Yes, LCP echo is legal even after IPCP is up. However, the mechanism that your mobile carrier is using for detecting and shutting down idle connections might not count LCP packets as non-idle traffic.

Quote:

This LCP echo request from remote cell is the closest thing to ping. Unfortunately the remote server doesnt give me any IP address during the IPCP handshake....so no way to actually ping it.

You don't have to ping the remote end of the PPP connection - any IP server that reliably reponds to ICMP pings will work. e.g. www.avrfreaks.net, or 8.8.8.8 (google's anycast address for its network of DNS resolvers).

Quote:

Alternative way may be to send out a dummy DNS querry type querry? or I have seen something like "who has ip www.xxx.yyy.zzz?" type querry that machines/routers normally send. I could perhaps send a querry with my own IP address in it?

The "who has" request you saw was probably ARP, which isn't valid over PPP links. Just send a DNS "A" query for a well known hostname (e.g. www.avrfreaks.net). You can ignore the contents of the reply.

Quote:

Isn't this what "keepalive" exists for?

Kinda - it's more to bring down a TCP connection if either end has somehow disconnected without the other end realising. To use it to ensure idle connections aren't dropped, Mr Ocean will need to find a server to connect to that will leave the connection open for a long time. Doing ICMP echos or DNS requests is usually a tad easier to accomplish.

- S

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hii thanks for the above post!
Yes to my suprised last night I have found out that having LCP every 2minutes does not help in telstra disconnecting me every 30minish... I left my system up from about 1am last night till 6:30am...and I got disconnected about 12 times... :P

And sure enough the device dials back straight away once disconnected and gets online. I dont have access to google.com or sites of the like as the SIM cards are on telstra IPWAN (private) pool, so no access to outside world. I could I guess ping a server machine that too uses another sim card to be in the pool.

All is going to be better I am hoping when I start sending data intermittenly, as this is meant to be a datalogger device. :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are lots of reasons why or how a 3G usb dongle can get disconnected.

- Network does a LCP terminate request and disconnects me. In this case the micro controller will detect this and redial after termination acknowledge.

- I have left the device over night also and found the device unresponsive in the morning. Micro was not frozen, there just was no data coming through USB at all. So somehow dongle was disconnected from network but hadnt realised it? For this case I have placed a task function in my code that does the LCP echo request every 2min, so that if the link is down after 5 tries (a 2nd, 3rd etc try is performed after 1seconds of failure of trial before) and if all failed then reboots the micro (by watchdog) which essentially powers down the usb and then does a redial etc...

So I think I have handled all cases of network link down using the above two case...

Any comments?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just for my information, is LCP echo request NOT appropriate for my situation. That is, trying to keep a mobile broadband link connected.

If it is not, can you suggest any keywords for me.

Thanks,
Dave

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Just for my information, is LCP echo request NOT appropriate for my situation. That is, trying to keep a mobile broadband link connected.

If it is not, can you suggest any keywords for me.

It's a bit hard to be sure without doing some poking around your mobile setup - AFAIK, LCP is often handled entirely within the mobile "modem" so sending LCP echos will not keep your link up.

If I were faced with the same problem, the first thing I would try is to do something like a ping (i.e. ICMP echo) to 8.8.8.8 (or some other IP address that you can rely on to reply to a ping request).

- S

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

So I think I have handled all cases of network link down using the above two case...

Ummmm.... I've seen a couple of weird corner cases on my mobile phone where an IP level keepalive would detect a down link and an LCP echo wouldn't. But that's on a different carrier network, with a different radio stack, so they may not apply to your situation.

- S

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mnehpets,

Thanks I'll try that when serious use starts in a few months.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hhm...interesting I used to be able to get on the vodafone australia assigned IP addresses from public computers before now I cant ... has vodafone started to make their IP addresses private? I cant seem to be able to ping them any more from any other computer...