How do I slow down my network?  
Author Message
Chris Berg





PostPosted: 2004-6-14 2:35:00 Top

java-programmer, How do I slow down my network? This may be a bit off-topic, but still:

I'm working with a Java client/server app.
In my test setup the client and server are connected via the 100 MBit
LAN, so bandwidth is virtually unlimited.

I want to test it in a more realistic setup, where the bandwidth is
only, say, 56 kbit/sec.

Is there a simple way to temporarily limit the bandwidth for test
purposes?

I have thought of putting a delay between every IP packet, on the
trasmitting or the receiving side, but in Java I don't have access to
individual packets, so I can't figure out where to insert the delay.

Maybe the solution should be made on a lower layer, like the ethernet.

Chris

 
Hal Rosser





PostPosted: 2004-6-14 3:16:00 Top

java-programmer >> How do I slow down my network? Why not install a dial-up modem on the client and unplug the ethernet cable
from it


"Chris Berg" <email***@***.com> wrote in message
news:email***@***.com...
> This may be a bit off-topic, but still:
>
> I'm working with a Java client/server app.
> In my test setup the client and server are connected via the 100 MBit
> LAN, so bandwidth is virtually unlimited.
>
> I want to test it in a more realistic setup, where the bandwidth is
> only, say, 56 kbit/sec.
>
> Is there a simple way to temporarily limit the bandwidth for test
> purposes?
>
> I have thought of putting a delay between every IP packet, on the
> trasmitting or the receiving side, but in Java I don't have access to
> individual packets, so I can't figure out where to insert the delay.
>
> Maybe the solution should be made on a lower layer, like the ethernet.
>
> Chris
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 5/22/2004


 
Roedy Green





PostPosted: 2004-6-14 4:03:00 Top

java-programmer >> How do I slow down my network? On Sun, 13 Jun 2004 20:34:30 +0200, Chris Berg
<email***@***.com> wrote or quoted :

>Is there a simple way to temporarily limit the bandwidth for test
>purposes?

In Forth this would be a piece of cake, but in Java it would take more
doing. To simulate a slower Internet connection, you would have to
write a replacement for the standard Socket class that could be choked
down, to let through only so many bytes per second. Then you need to
replace the standard Socket class with it in rt.jar. It would be just
like the standard Socket class with an extra static choke method for
globally controlling the choke on all external sockets. You don't want
to choke internal ones.

See http://mindprod.com/projects/klunker.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
 
Mark Thornton





PostPosted: 2004-6-14 4:23:00 Top

java-programmer >> How do I slow down my network? Chris Berg wrote:
> This may be a bit off-topic, but still:
>
> I'm working with a Java client/server app.
> In my test setup the client and server are connected via the 100 MBit
> LAN, so bandwidth is virtually unlimited.
>
> I want to test it in a more realistic setup, where the bandwidth is
> only, say, 56 kbit/sec.
>
> Is there a simple way to temporarily limit the bandwidth for test
> purposes?
>
> I have thought of putting a delay between every IP packet, on the
> trasmitting or the receiving side, but in Java I don't have access to
> individual packets, so I can't figure out where to insert the delay.
>
> Maybe the solution should be made on a lower layer, like the ethernet.
>
> Chris
>

You can write a simple application (in Java) that reads data from a
socket, pauses, and then send it on via another socket. You can do
something like this for both TCP (streams) and UDP (packets). If you can
change the ports used for the communication you can run everything on
one machine, otherwise you may need to use an extra machine to run the
'slow net' simulator. I wrote one such system to simulate using SQL
Server over a slow network. In this case neither the client nor server
were Java, just the simulator.

Mark Thornton
 
 
Chris Berg





PostPosted: 2004-6-14 5:17:00 Top

java-programmer >> How do I slow down my network? On Sun, 13 Jun 2004 15:15:45 -0400, "Hal Rosser"
<email***@***.com> wrote:

>Why not install a dial-up modem on the client and unplug the ethernet cable
>from it
>

Well, that solution has occurred to me, it would certainly be the most
realistic one. But where I am, dial-up costs $$ per minute plus
subscription, so it would be a bit far-fetched to do that. Not to
mention the two phonelines occupied while testing.

However, maybe I could connect the two modems directly, but I don't
know how to do that - I guess it takes more than just a solder gun.
Some PPP server software, i suppose.

Chris

 
 
Roedy Green





PostPosted: 2004-6-14 5:30:00 Top

java-programmer >> How do I slow down my network? On Sun, 13 Jun 2004 23:17:26 +0200, Chris Berg
<email***@***.com> wrote or quoted :

>However, maybe I could connect the two modems directly, but I don't
>know how to do that - I guess it takes more than just a solder gun.
>Some PPP server software, i suppose.

There is a device called "The Linker" from Jec tech that lets you
simulate a phone system with dial tones, letting you plug to modems
back to back.

Phones were:
(614) 927-3494 FAX
(614) 927-3495 voice

If you can't find own, I'd be willing to sell you mine I am not using.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
 
Chris Berg





PostPosted: 2004-6-14 5:53:00 Top

java-programmer >> How do I slow down my network? On Sun, 13 Jun 2004 21:29:37 GMT, Roedy Green
<email***@***.com> wrote:

>On Sun, 13 Jun 2004 23:17:26 +0200, Chris Berg
><email***@***.com> wrote or quoted :
>
>>However, maybe I could connect the two modems directly, but I don't
>>know how to do that - I guess it takes more than just a solder gun.
>>Some PPP server software, i suppose.
>
>There is a device called "The Linker" from Jec tech that lets you
>simulate a phone system with dial tones, letting you plug to modems
>back to back.
>
>Phones were:
>(614) 927-3494 FAX
>(614) 927-3495 voice
>
>If you can't find own, I'd be willing to sell you mine I am not using.

Thanks a lot. I'll get back to that if all other attempts fail.

Chris

 
 
mromarkhan@rogers.com





PostPosted: 2004-6-14 11:15:00 Top

java-programmer >> How do I slow down my network? Chris Berg wrote:
> This may be a bit off-topic, but still:
>
[snip]
> Is there a simple way to temporarily limit the bandwidth for test
> purposes?
[snip]
>
> Maybe the solution should be made on a lower layer, like the ethernet.
>
> Chris
>

Peace be unto you.

The following shows my ignorance with regard to
networking, but here goes.
I guess you should try reducing the TCP Window size,
to increase the number of acknowledgements.

"Reducing the TCP Window size effectively causes an acknowledgment to
be sent to the sender for data received sooner. This will lower the
possibility that the sender will time out while waiting for an
acknowledgment. However it will also increase the amount of network
traffic and cause slower throughput. "
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q140/5/52.asp&NoWebContent=1

Set the TCP Window Size for All Network Adapters
http://www.microsoft.com/technet/community/scriptcenter/network/scnet135.mspx

Well at least if I am completely wrong and totally
off topic, someone
with a slow network connection might find this useful
and do the opposite.

Have a good night.
 
 
David Segall





PostPosted: 2004-6-14 14:41:00 Top

java-programmer >> How do I slow down my network? Chris Berg <email***@***.com> wrote:

>This may be a bit off-topic, but still:
>
>I'm working with a Java client/server app.
>In my test setup the client and server are connected via the 100 MBit
>LAN, so bandwidth is virtually unlimited.
>
>I want to test it in a more realistic setup, where the bandwidth is
>only, say, 56 kbit/sec.
>
>Is there a simple way to temporarily limit the bandwidth for test
>purposes?
>
>I have thought of putting a delay between every IP packet, on the
>trasmitting or the receiving side, but in Java I don't have access to
>individual packets, so I can't figure out where to insert the delay.
>
>Maybe the solution should be made on a lower layer, like the ethernet.
>
>Chris
Netlimiter (http://www.netlimiter.com/) claims to do what want and is
inexpensive shareware. I have not tried it so, if you do, I would
appreciate a follow up on how it performed.

 
 
iksrazal





PostPosted: 2004-6-14 23:42:00 Top

java-programmer >> How do I slow down my network? Chris Berg <email***@***.com> wrote in message news:<email***@***.com>...
> This may be a bit off-topic, but still:
>
> I'm working with a Java client/server app.
> In my test setup the client and server are connected via the 100 MBit
> LAN, so bandwidth is virtually unlimited.
>
> I want to test it in a more realistic setup, where the bandwidth is
> only, say, 56 kbit/sec.
>
> Is there a simple way to temporarily limit the bandwidth for test
> purposes?
>
> I have thought of putting a delay between every IP packet, on the
> trasmitting or the receiving side, but in Java I don't have access to
> individual packets, so I can't figure out where to insert the delay.
>
> Maybe the solution should be made on a lower layer, like the ethernet.
>
> Chris

Try this script:

#!/bin/sh

while :;
do
wget -r -l10 http://yourip -O /dev/null ;
done
exit 0; # really unnecessary

I'm joking, of course.

Outsource to an American programmer living in brazil!
http://www.braziloutsource.com/
iksrazal
 
 
samhunt90





PostPosted: 2004-6-15 2:36:00 Top

java-programmer >> How do I slow down my network? Chris Berg <email***@***.com> wrote in message news:<email***@***.com>...
> This may be a bit off-topic, but still:
>
> I'm working with a Java client/server app.
> In my test setup the client and server are connected via the 100 MBit
> LAN, so bandwidth is virtually unlimited.
>
> I want to test it in a more realistic setup, where the bandwidth is
> only, say, 56 kbit/sec.
>
> Is there a simple way to temporarily limit the bandwidth for test
> purposes?
>
> I have thought of putting a delay between every IP packet, on the
> trasmitting or the receiving side, but in Java I don't have access to
> individual packets, so I can't figure out where to insert the delay.
>
> Maybe the solution should be made on a lower layer, like the ethernet.
>
> Chris

There is a freeware app on Linux called "nistnet". It lets you specify
the bandwidth of the link. Now for the tricky part - it has to be on
an intermediary router.

Another option that might work would be to set up a firewall which
blocks incoming packets. Then, use a package like the excellent JPCap
(see sourcefourge), which can take packets off the wire even if they
are firewalled (as long as the firewall operates at a higher level
than the link layer). Then just rewrite the packets to the local host
and socket that you're receiving on.

Of course other options mentioned would probably be simpler, like
setting the TCP window size (if using tcp), or most simply write your
outgoing packets to the local host, and have a Java app listen for it
and write the packets out on a more liesurely basis.

Sam90
 
 
Chris Berg





PostPosted: 2004-6-15 22:55:00 Top

java-programmer >> How do I slow down my network? On Mon, 14 Jun 2004 06:40:58 GMT, David Segall <email***@***.com>
wrote:

>Netlimiter (http://www.netlimiter.com/) claims to do what want and is
>inexpensive shareware. I have not tried it so, if you do, I would
>appreciate a follow up on how it performed.

Thanx. That seems to do the job just fine.

Chris
 
 
Juha Laiho





PostPosted: 2004-6-16 1:12:00 Top

java-programmer >> How do I slow down my network? Chris Berg <email***@***.com> said:
>In my test setup the client and server are connected via the 100 MBit
>LAN, so bandwidth is virtually unlimited.
>
>I want to test it in a more realistic setup, where the bandwidth is
>only, say, 56 kbit/sec.

Some firewalls also contain traffic shaping functionality; also, if
you happen to be running Linux, there are traffic shaping solutions
available at no cost.

Other ways would be to just replace the 100Mbit/s connection with
something slower, such as a serial line between two machines and run PPP
on top of that. No modem needed.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)