Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Control upload speeds to improve downloads Internet
I found this very cool free app called CarraFix. This app is designed to allow you to control the bandwidth that uploads use when you run a Carracho or Hotline server. It uses the built-in "ipfw" command on OSX to do this.

The problem that it solves is that when you are uploading something utilizing all your upload bandwidth, surfing or downloading comes to a grinding halt because the acknowledgment packets can't be sent in a timely manner since your upload pipe is saturated. Carrafix allows you to set a delay between packets that are being sent on a specific port. This basically allows you to control how fast data is sent on that port which leaves time/bandwidth for other things.

I thought that was cool, but I do most of my file transfers using FTP. When I'm uploading stuff to my servers, all other network traffic bogs down to the point where it's pretty useless. I came up with a way to use this same program to throttle back ftp transfers.

Read the rest of the article for the how-to...

Carrafix allows you to specify a TCP/UDP port to throttle. You might think it would be simple then to throttle port 21, which is the ftp port by default. That would be true except that port 21 is not the actually port used during uploads. It is just the port used for the FTP protocol. Every transfer creates a new and random port. Nothing in the FTP transcript tells you what the port is either. I found another app called IPNetMonitorX [$40 shareware] that has a feature called connection list. This will tell you the port that your ftp connection is using once it is established:
TCP    ESTABLISHED    My_IP:54355    server_IP:56260  FTP_Application
In this example, I entered 54355 into CarraFix, and I had full control of the upload bandwidth. My DSL connection gives me a max upload speed of about 30-35k. I throttled the transfer back to about 20k, and now my surfing and downloads where back to their full 150k. Without throttling I could only get 15k down since the acknowledge packets never made it back to the host in a timely manner.

I hope this helps others as much as it's helped me.
    •    
  • Currently 1.40 / 5
  You rated: 2 / 5 (5 votes cast)
 
[26,738 views]  

Control upload speeds to improve downloads | 7 comments | Create New Account
Click here to return to the 'Control upload speeds to improve downloads' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Another use for this
Authored by: Anonymous on Jun 28, '02 12:41:04PM

Those of us doing web design know that download time is an extremely important consideration. However, with the greatly increased utility of broadband, we lose touch with modem users as we design. I personally have a T1, and most everything loads instantly. I no longer have a "feel" for how my pages load on a modem.

It looks like you could set up CarraFix on localhost:80, and throttle your web server back to 4k/sec or so, to emulate a 56k modem on a slightly sluggish day, then use Apache to preview pages at modem speed. I am going to try this and report back my results.



[ Reply to This | # ]
Terminal commands for other port identification
Authored by: Palijn on Jun 29, '02 06:05:10AM

For those of you who don't want to use a shareware for this, it is fairly easy to find out what port a TCP connection uses with the Terminal.
Just open the Terminal and type "netstat | grep tcp" to get all the open TCP connections.
For a particular connection to a server server.com , just type "netstat | grep server.com" and you should get all open connections to/from server.com .
The FTP control connection is indicated by a server.com.ftp text on the 5th column (for the curious, .ftp is really port 21 translated to the "ftp" text by a lookup to the /etc/services table. Unixism...)
The various (if existing) FTP DATA connections - i.e. the one you want to control the bandwidth - are displayed with server.com.XX where XX is really the port used by the data transfer.

Interesting note:
Usually the data port occurs to be 20 if you don't use passive FTP and you have only one FTP transfer running at a time....time-saving default ;-)



[ Reply to This | # ]
Terminal commands for other port identification
Authored by: Embro on Jun 30, '02 11:13:48PM

Thanks for that info. I really like IPNetMonitor but I knew there had to be a terminal commmand that the info was coming from. Gotta love Unix :-) The author(s) of Carrafix mention on their web site that they are/were going to make the source available. I emailed them today about his because I'd love to make this more automated. It seems that this should be a normal network function since oversaturating the channel just kills the rest of your network flow.

I'll post back here if/when any progress is made.



[ Reply to This | # ]
More terminal commands for other port identification
Authored by: iv on Jul 02, '02 02:04:28AM

If you want more information than what netstat gives you, try lsof.

E.g. sudo lsof -i shows all open network sockets, their status, commands that opened them and their PID etc. This way you can easily see, what all those open ports do.

iv

[ Reply to This | # ]

ipfw & dummynet
Authored by: sphen on Jul 02, '02 11:37:26PM

has anyone been able to do bandwidth limiting via regular ipfw commands? i found several places where you should beale to do this on bsd systems using something called dummynet, and its only a matter of activating it in the kernel. But something like this should limit any traffic coming from 10.0.1.128 to 128 kbits:

ipfw add 100 pipe 1 ip from 10.0.1.128 to any
ipfw pipe 1 config bw 128Kbit/s

good ol osx gives me errors though making me think that this so called dummynet feature is not installed.



[ Reply to This | # ]
Carrafix has moved
Authored by: pascalpp on Oct 03, '02 02:54:16AM
the following text now appears at http://homepage.mac.com/altimac/carrafix/: --- BYE BYE ITOOLS ACCOUNT ! PLEASE GO TO http://perso.wanadoo.fr/altimac --- posting here for those who read this hint after that iTools account expires.

[ Reply to This | # ]
Control upload speeds to improve downloads
Authored by: lrivers on Mar 02, '03 04:32:30PM
It's now Carrafix.com.

There's another one called Throttled



[ Reply to This | # ]