TCP/IP Timing over satellite
Posted: Wed Sep 21, 2011 1:33 pm
New member here, but happy NB SB72 EX user for a few years.
My app gathers data from a local serial device, and then on a schedule uploads it to my server via HTTP GET. The server can respond with one of several commands back to the unit, but usually just sends OK.
It works great on cable modems, DSL fiber, and cellular routers.
Then we tested it on a geostationary satellite Internet connection on WildBlue. It took me a while of troubleshooting and thinking to determine what I think was happening.
We were getting 3x or so as many data uploads as we should have been and there was a lot of duplication. I believe that somewhere there is an ACK timer in the program or TCP/IP stack that says, in essence, if I don't get something back from the server in X amount of time, resend the data.
So it works OK on terrestrial low latency links, but resends 3x or so on a satellite link with long latency, before the first ACK manages to traverse space and get back to the NB and it stops resending.
Is this a fair assessment of what's happening?
Because of satellite bandwidth requirements, I'd rather not just throw out the dupes on the server, but modify the code to not send dupes in the first place.
I did a little research. Is TCP TIME_WAIT the correct place to address this? If not, what is?
This brings up a related question.
No Internet link is 100% reliable. (Duh!) Upon lack-of-ack, I would like to buffer the to-send data to RAM and continue retrying on the regular upload schedule until the packet goes through. At that time, then send all of the stored data as well.
What flag should I look at to see if the ack has been received, or should I just look for the OK or whatever from the server? We already do that to parse out for commands.
I'm not the programmer, but I'm the system architect that designed this thing, helping him with research.
Thanks!
Chris
My app gathers data from a local serial device, and then on a schedule uploads it to my server via HTTP GET. The server can respond with one of several commands back to the unit, but usually just sends OK.
It works great on cable modems, DSL fiber, and cellular routers.
Then we tested it on a geostationary satellite Internet connection on WildBlue. It took me a while of troubleshooting and thinking to determine what I think was happening.
We were getting 3x or so as many data uploads as we should have been and there was a lot of duplication. I believe that somewhere there is an ACK timer in the program or TCP/IP stack that says, in essence, if I don't get something back from the server in X amount of time, resend the data.
So it works OK on terrestrial low latency links, but resends 3x or so on a satellite link with long latency, before the first ACK manages to traverse space and get back to the NB and it stops resending.
Is this a fair assessment of what's happening?
Because of satellite bandwidth requirements, I'd rather not just throw out the dupes on the server, but modify the code to not send dupes in the first place.
I did a little research. Is TCP TIME_WAIT the correct place to address this? If not, what is?
This brings up a related question.
No Internet link is 100% reliable. (Duh!) Upon lack-of-ack, I would like to buffer the to-send data to RAM and continue retrying on the regular upload schedule until the packet goes through. At that time, then send all of the stored data as well.
What flag should I look at to see if the ack has been received, or should I just look for the OK or whatever from the server? We already do that to parse out for commands.
I'm not the programmer, but I'm the system architect that designed this thing, helping him with research.
Thanks!
Chris