Different network protocols used in TK102 to transfer data over GPRS

All Xexun GPS tracker versions (TK102, TK102-1, TK103, TK106 and probably others), as well as all known clones of them, are using either TCP or UDP protocol . Here you'll find which uses which and what are advantages and disadvantages of each.

Original Xexun trackers allows users to choose, whether they want to send data through GPRS using either TCP or UDP. If you own a bit better, more expensive clone, you'll have device using only TCP protocol (better in some situations, see below), but without abillity to change it to UDP. If you have cheaper, crappy clone, UDP protocol will be the only option for you.

TCP vs. UDP

In general networking TCP protocol is considered as slower, but much better. It uses data correction algorithms and re-transmission of a lost packages. All data, when divided into TCP packets, is always re-ordered upon reception, at destination address, which means, that when some packet is lost and then re-transmitted or delayed from any other reason, destination device will wait for it and only present entire dataset to upper network layer, when it is received completely, reordered and verified. Providing these features requires adding extra data to each packet and doing some other extra work. This means, that data transmission is more secure (in terms of data lost, not in general security meaning), but is slower.

On the other hand, UDP protocol hasn't got most of what TCP has got. Packets are sent through different routes, so can be delayed or even lost. Upon reception they're not re-ordered, there is no verification, that entire dataset was received or if packets are in correct order, which assures that data is not corrupted. Because of this, UDP packets are sent and received much faster, but provide much less data quality.

Developer vs. regular user

Because GPS location data is quite small, it is nearly always sent as singe packet and it is not divided into parts. This gives firmware developers possibility to choose cheaper and easier in implementation (less code) UDP protocol. For you, as a single user, all disadvantages of UDP protocol are also lesser or no problem at all. Since whole location data is sent as one UDP datagram, you don't have to actually care about that un-order or packet lost problem. You're most likely using some on-line service to track your localizer and don't actually care, what is being transmited between it and that service, right?

However, if you're a developer, having device that uses UDP only could turn into a real nightmare. These packets are harder to trace, harder to code upon reception and harder to debug, in case of any problems. There is even a larger group of developers, which skill will simply forbit them to write a code for you. As writing some TCP listener is quite easier to do, then to code some UDP listener.

Conclusion

If you are a developer and have any option to choose, always buy original Xexun devices or only those, where you're 100% sure that you have TCP protocol at your service. Always avoid UDP-only cheap clones. The same goes, when buying or programming any other vendor-specific GPS localizer.

BTW: For Xexun family, TK102-2, TK103 and TK106 are reported (not confirmed by me, though) to support command GPRSMODEpassword n to switch between TCP and UDP protocol. If you're using default (123456) password, send SMS with GPRSMODE123456 1 to switch your localizer to UDP protocol mode and GPRSMODE123456 0 to bring it back to default TCP protocol.

Leave a Reply