views:

565

answers:

2

Hello,

I'm assigned to a project where my code is supposed to perform uploads and downloads of some files on the same FTP or HTTP server simultaneously. The speed is measured and some conclusions are being made out of this.

Now, the problem is that on high-speed connections we're getting pretty much expected results in terms of throughput, but on slow connections (think ideal CDMA 1xRTT link) either download or upload wins at the expense of the opposite direction. I have a "higher body" who's convinced that CDMA 1xRTT connection is symmetric and thus we should be able to perform data transfer with equivalent speeds (~100 kbps in each direction) on this link.

My measurements show that without heavy tweaking the code in terms of buffer sizes and data link throttling it's not possible to have same speeds in forementioned conditions. I tried both my multithreaded code and also created a simple batch file that automates Windows' ftp.exe to perform data transfer -- same result.

So, the question is: is it really possible to perform data transfer on a slow symmetrical link with equivalent speeds? Is a "higher body" right in their expectations? If yes, do you have any suggestions on what should I do with my code in order to achieve such throughput?

Thanks.

PS. I completely re-wrote the question, so it would be obvious it belongs to this site.

PPS. HUGE thanks for people who took their time to answer the question!

+4  A: 

CDMA 1x consists of up to 15 channels of 9.6kbps traffic. This results in a total throughput of 144kbps.

Two channels are used for command and control signals (talking to base stations, associating/disassociating, SMS traffic, ring signals, etc).

That leaves you with up to 124.8kbps.

--> Each channel is one way. <--

They are dynamically switched and allocated depending on the need.

Generally you'll get more download than upload because that's the typical cell phone modem usage. But you'll never get more than 120kbps total aggregate bandwidth.

In practise, due to overhead of 1xRTT encoding, error correction, resends, etc, you'll typically experience between 60kbps and 90kbps even if you have all the channels possible.

This means that you can probably only get 30kbps-60kbps of upload and download simultaneously.

Further, due to switching the channels dynamically (and the fact that the base station controls this more than your modem - they need to manage base station channels carefully to keep channels free for voice calls) you'll lose time when it switches channels - it's not an instantaneous process.

So - 1xRTT can, in theory, give you 124kbps one way, but due to overhead, switching times, base station capacity, or the phone company simply limiting such connections for other reasons, you can't depend on a symmetrical link.

NOTE:

This will vary to some degree based on the provider and the modem. For instance, some modems have 16 channels, and some providers support 16 channels. In some cases those modems and providers work well together and can provide a full 144kbps aggregate raw bandwidth to the application, with only one dedicated channel (which has to work pretty hard) to deal with control, switching, and other issues. Even then, though, with the overhead of the modem communications, then the overhead of PPP, then the overhead of IP, then the overhead of TCP, you're still looking at maybe 100-120kbps total bandwidth, both up and down.

Lastly, no provider yet supports transparent transfer of IP traffic. In other words if you're modem is moving, the modem will switch to a new base station, but you'll completely drop the PPP session and have to restart it, as well as all the TCP sessions and such. You typically won't get the same IP address, and so your TCP sessions will not recover gracefully.

The "fun" aspect to this twist is that this can happen even if you aren't moving. If one base station gets loaded down, you may be transferred to another base station if you are close enough - there are other things that may make your modem transfer even without you moving. So make sure you take this into account, since you seem to be keen on maintaining a full duplex, symmetric channel open. It's tough to write stuff that will recover gracefully, nevermind anticipate it and do it quickly. You would do well to work very closely with a modem manufacturer (such as Kyocera) on this - otherwise you won't get the documentation on how to control the modem chipset at the low level that you need.

Adam Davis
What would you say if I have a requirement from a higher body to have ~100kbps on each direction when I'm transferring both files simultaneously? ;)
I'd say the "higher body" will be disappointed. It’s not even theoretically possible (see Adam's answer). I agree (after years of testing on real 1x networks) that you're not going to get more than 60-90 kbps in practice.
Andrew
You tell the "higher body" that you can't perform miracles.
Adam Jaskiewicz
I would tell them to invest in two modems, or EVDO. An EVDO modem isn't that much more expensive than a 1xRTT, but the coverage isn't as good, so if you want great coverage and 200kbps of aggregate bandwidth, two 1xRTT modems are your best bet.
Adam Davis
Well, it's not about what we can use, it's about what we have to use. We're using wide range of devices ranging from 1x to EV rev0 to EV revA.
Adam, thanks a lot!If you curious, the app utilizes emulated environment, so there're ideal conditions. We're actualy able to see 135kbps of either down- or upload. Problems started when someone believed that they can have 135 kbps + 135 kbps when transmitting files in both directions at once.
+1  A: 

I think the whole drama with high equal speeds on both directions is because my higher body thinks that they have 144 kbps on uplink AND 144 kbps on DOWNLINK (== TWO pipes). Whereas in reality we have 144 kbps of ONE pipe which is switching directions when I transfer files.

Comment me if I right or wrong, please.