0

I have question what is the best way to implement in GPS Tracker software communication with server. The connection is established with GPRS but I have some question to it.

GPS Tracker has a tendency to switch between Network BTS'es during vehicle movement. How GPRS is designed.

  1. Does during the BTS switch the GPRS session have to be established again?
  2. If no what is better. Creating one long running TCP/IP connection to the server (IP:PORT) and send data over this connection all the time (ONE GPRS SESSION) or maybe Creating TCP/IP connection each time when tracker has something to send and then close the connection (ALL ON ONE GPRS SESSION)? Does switching between BTS destroy my GPRS SESSION and connection that i created during this session?

It would be great is somebody give me some info about this topic and how to approach the best possible design taking into acount behaviour of changing BTS'es, Network Operator, Countries (roaming turned ON). Thanks.

By saying CONNECTION to the server I mean connection that is established during ONE GPRS SESSION. During one GPRS session You can create many connections so my question is about connections over ONE GPRS session and if GPRS SESSION has to be recreated in some scenario, connections over many GPRS SESSIONS (which will be more expensive).

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
Marcin Kapusta
  • 5,076
  • 3
  • 38
  • 55

1 Answers1

0

Switching between BTS'es does not destroy connection (well, I don't know too much on this thing, except I've worked with it and I'm sure that sometimes connection is preserved).

My preferred solution would be as follows:

  1. Create a connection if there is something to send, but allow it to be idle for some minutes before closing.

  2. Provide an application-level keepalive protocol to detect hanging connections.

Disconnecting while you've got nothing to send can have interesting implications if (1) it involves shutdown of GPRS session and (2) the provider charges some minimum fee for GPRS sessions, so you can pay for 40kb on open+send 200 bytes+close sequence. The solution above should be a good compromise.

Anton Kovalenko
  • 20,999
  • 2
  • 37
  • 69
  • Thanks for Your answer. I explain in more detail in question what I mean Connection and GPRS session is for me. I think that You treat it like connection=GPRS session which is not true in my case. God point that Connection shoud be opened some minutes after data transmission because server will be able to send some command in this moment. Closing GPRS session is in general bad idea because of charges. The GPS tracker can work all day on ONE GPRS session if the GSM coverage is good. – Marcin Kapusta Jan 10 '13 at 19:52
  • Where do you live? It is rather unusual that opening GPRS sessions are charged for. Normaly it's volume-based or time-based. If you are indeed on a volume-based tariff, then opening/Sending/closing might be best for you. For volume-based tariffs you would need to check if the keep-alive as describes by Anton makes sense. – Bernd Jan 11 '13 at 08:03