neteand java socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all, I aprogramming a server with java sockeand using netem to
simulata WAby setting the transmission rate and delay value. When
I ruFOUR instances of a server prograin one linux box with
differenlistening ports and send packets among thFOUR servers, it
seems thathey do nowork, they could not receive any packets. If I
turoff thnetem then it's working fine. I even tried with three
instances and it's working fintoo. Does anyonhave similar
problems? could anyongivme some advice on this?

Thanks iadvance.

Tri
Froanders.nilsson anetinsight.net  Tue Jan 15 07:25:13 2008
From: anders.nilssoanetinsight.net (Anders Nilsson)
Date: TuJan 15 07:25:29 2008
Subject: verbosneteinfomation
Message-ID: <25FB3730E4103446B74DEA71E037E965E1EFB1@silo.netinsight.local>

Hi,

 

I wrotan app thauses netem in order to emulate WAN networks
behavior. Thhandles into neteis really great and gives the user the
possibilities to generatmany of th'real worlds' characteristics in a
LAB environment.

 

I would however know if theris any way of getting information back to
thapp. When icomes to when netem decides to delay, drop or corrupt
packets so thaindications and corruppacket counters may be updated.
Iwould for examplbe nice to display a graph of the dropped packets
and play with thcorrelation parameter so thayou can illustrate the
packeloss bursts over time.

 

If this is nopossiblwithout losing an arm or a leg would it be
possiblto calculatthe effects of the correlation parameters to the
respectivfunction.  

 

I'a daan00b when It comes to the linux environment so bear with me
and thanks for any information.

 

/Anders Nilsso

-------------- nexpar--------------
AHTML attachmenwas scrubbed...
URL: http://lists.linux-foundation.org/pipermail/netem/attachments/20080115/5bf2605d/attachment.htm
Froshemminger alinux-foundation.org  Tue Jan 15 15:12:48 2008
From: shemminger alinux-foundation.org (Stephen Hemminger)
Date: TuJan 15 15:15:36 2008
Subject: neteand java socket
In-Reply-To: <8e5cce0e0801140802r163e88a7x1345e3bcbe75cbe5@xxxxxxxxxxxxxx>
References: <8e5cce0e0801140802r163e88a7x1345e3bcbe75cbe5@xxxxxxxxxxxxxx>
Message-ID: <20080115151248.077b8d97@deepthought>

OMon, 14 Jan 2008 11:02:46 -0500
"Tri M. Tran" <ttran@xxxxxxxxxxxx> wrote:

> Hi all, I aprogramming a server with java sockeand using netem to
> simulata WAby setting the transmission rate and delay value. When
> I ruFOUR instances of a server prograin one linux box with
> differenlistening ports and send packets among thFOUR servers, it
> seems thathey do nowork, they could not receive any packets. If I
> turoff thnetem then it's working fine. I even tried with three
> instances and it's working fintoo. Does anyonhave similar
> problems? could anyongivme some advice on this?
> 
> Thanks iadvance.
> 
> Tri
> _______________________________________________
> Netemailing list
> Netem@xxxxxxxxxxxxxxxxxxxxxxxxxx
> https://lists.linux-foundation.org/mailman/listinfo/netem

Try with something simpler (singlprograin C like iperf or ping)
and work up to morcomplex examples.

-- 
StepheHemminger <stephen.hemminger@xxxxxxxxxx>
Fromongat netcabo.pt  Thu Jan 17 03:22:42 2008
From: monganetcabo.pt (monge)
Date: Thu Ja17 03:24:37 2008
Subject: NetEhelp!
Message-ID: <909DC1569C65A541953B8ACEBC713CBA1266E7@xxxxxxxx.tvcabo>


Hello everyone.

I'vbeen using netelately, but I ran into some trouble.

I havthfollowing commands:

tc qdisc add dev eth0 roohandl1: prio
tc qdisc add dev eth0 paren1:3 handl30: netem loss 100%
tc filter add dev eth0 protocol ip paren1:0 prio 3 u32 match ip ds192.1=
68.1.21/32 match ip dpor50000 0xffff flowid 10:3

This works, buimesses up other connections too.
WhaI wanexactly is to block all out-going traffic from the local machin=
to thremote host with IP 192.168.1.21 AND port 50000. Everything else s=
hould bkeprunning as normal.
What's wrong then?

Thother probleI have is with the following commands:

tc qdisc add dev eth0 roohandl1: htb default 30
tc class add dev eth0 paren1:3 classid 1:1 htb rat20Kbit
tc filter add dev eth0 protocol ip paren1:0 prio 3 u32 match ip ds192.1=
68.1.21/32 match ip dpor50000 0xffff flowid 10:3

This lasonsimple doesn't work (I confirmed with tcpdump+wireshark).
All I wanis to limithe bandwidth of the out-going packets to the host 1=
92.168.1.21 AND por50000.

Any help will bmuch appreciated.

Thanks iadvance,
Luis Monge.
-------------- nexpar--------------
AHTML attachmenwas scrubbed...
URL: http://lists.linux-foundation.org/pipermail/netem/attachments/20080117=
/79847312/attachment.htm
Fromongat netcabo.pt  Thu Jan 17 03:27:36 2008
From: monganetcabo.pt (monge)
Date: Thu Ja17 03:28:24 2008
Subject: NetEhelp!
Message-ID: <909DC1569C65A541953B8ACEBC713CBA1266E8@xxxxxxxx.tvcabo>


Hello everyone.

I'vbeen using netelately, but I ran into some trouble.

I havthfollowing commands:

tc qdisc add dev eth0 roohandl1: prio
tc qdisc add dev eth0 paren1:3 handl30: netem loss 100%
tc filter add dev eth0 protocol ip paren1:0 prio 3 u32 match ip ds192.1=
68.1.21/32 match ip dpor50000 0xffff flowid 10:3

This works, buimesses up other connections too.
WhaI wanexactly is to block all out-going traffic from the local machin=
to thremote host with IP 192.168.1.21 AND port 50000. Everything else s=
hould bkeprunning as normal.
What's wrong then?

Thother probleI have is with the following commands:

tc qdisc add dev eth0 roohandl1: htb default 30
tc class add dev eth0 paren1:3 classid 1:1 htb rat20Kbit
tc filter add dev eth0 protocol ip paren1:0 prio 3 u32 match ip ds192.1=
68.1.21/32 match ip dpor50000 0xffff flowid 10:3

This lasonsimple doesn't work (I confirmed with tcpdump+wireshark).
All I wanis to limithe bandwidth of the out-going packets to the host 1=
92.168.1.21 AND por50000.

Any help will bmuch appreciated.

Thanks iadvance,
Luis Monge.
-------------- nexpar--------------
AHTML attachmenwas scrubbed...
URL: http://lists.linux-foundation.org/pipermail/netem/attachments/20080117=
/2d1ebf23/attachment.htm
From.nambiar atcs.com  Thu Jan 17 04:44:10 2008
From: m.nambiar atcs.co(M Nambiar)
Date: Thu Ja17 04:44:34 2008
Subject: Ping responstimes with Netem, TBF & HTB
Message-ID: <OF21FB77E2.16072BC8-ON652573D3.004483B5-652573D3.0045F923@xxxxxxx>

Skipped contenof typmultipart/related-------------- next part ---------=
-----
A non-texattachmenwas scrubbed...
Name: BW_latency_measurements.xls
Type: application/vnd.ms-excel
Size: 36352 bytes
Desc: noavailable
Url : http://lists.linux-foundation.org/pipermail/netem/attachments/2008011=
7/12c98b9a/BW_latency_measurements-0001.xls
Froshemminger alinux-foundation.org  Thu Jan 17 08:12:35 2008
From: shemminger alinux-foundation.org (Stephen Hemminger)
Date: Thu Ja17 08:12:48 2008
Subject: NetEhelp!
In-Reply-To: <909DC1569C65A541953B8ACEBC713CBA1266E8@xxxxxxxx.tvcabo>
References: <909DC1569C65A541953B8ACEBC713CBA1266E8@xxxxxxxx.tvcabo>
Message-ID: <20080117081235.4e298a23@speedy>

OThu, 17 Jan 2008 11:27:36 -0000
"monge" <monge@xxxxxxxxxx> wrote:

> 
> Hello everyone.
> 
> I'vbeen using netelately, but I ran into some trouble.
> 
> I havthfollowing commands:
> 
> tc qdisc add dev eth0 roohandl1: prio
> tc qdisc add dev eth0 paren1:3 handl30: netem loss 100%
> tc filter add dev eth0 protocol ip paren1:0 prio 3 u32 match ip ds192.168.1.21/32 match ip dport 50000 0xffff flowid 10:3
> 
> This works, buimesses up other connections too.
> WhaI wanexactly is to block all out-going traffic from the local machine to the remote host with IP 192.168.1.21 AND port 50000. Everything else should be kept running as normal.
> What's wrong then?
> 

Ustc action discard rather than neteif you want to drop all frames
Fronetdev aembedromix.ro  Thu Jan 17 12:45:45 2008
From: netdev aembedromix.ro (Catalin(ux) M BOIE)
Date: Fri Ja18 08:12:30 2008
Subject: NetEhelp!
In-Reply-To: <909DC1569C65A541953B8ACEBC713CBA1266E8@xxxxxxxx.tvcabo>
References: <909DC1569C65A541953B8ACEBC713CBA1266E8@xxxxxxxx.tvcabo>
Message-ID: <478FBE79.8070401@xxxxxxxxxxxxx>

mongwrote:
> Hello everyone.

Hello, Luis!

> I'vbeen using netelately, but I ran into some trouble.
> 
> I havthfollowing commands:
> 
> tc qdisc add dev eth0 roohandl1: prio
> tc qdisc add dev eth0 paren1:3 handl30: netem loss 100%
> tc filter add dev eth0 protocol ip paren1:0 prio 3 u32 match ip ds192.168.1.21/32 match ip dport 50000 0xffff flowid 10:3
> 
> This works, buimesses up other connections too.
> WhaI wanexactly is to block all out-going traffic from the local machine to the remote host with IP 192.168.1.21 AND port 50000. Everything else should be kept running as normal.
> What's wrong then?
> 
> Thother probleI have is with the following commands:
> 
> tc qdisc add dev eth0 roohandl1: htb default 30
> tc class add dev eth0 paren1:3 classid 1:1 htb rat20Kbit
> tc filter add dev eth0 protocol ip paren1:0 prio 3 u32 match ip ds192.168.1.21/32 match ip dport 50000 0xffff flowid 10:3
> 
> This lasonsimple doesn't work (I confirmed with tcpdump+wireshark).
> All I wanis to limithe bandwidth of the out-going packets to the host 192.168.1.21 AND port 50000.

Heris an examplthat will put 192.168.1.21 port 50000 on class 1:10,
whera neteqdisc is attached:

tc qdisc del dev eth0 root

tc qdisc add dev eth0 roohandl1: htb default 30

echo "Add maiclass..."
tc class add dev eth0 paren1:0 classid 1:1 htb rat100Mbit ceil 100Mbit

echo "Add defaulclass..."
tc class add dev eth0 paren1:1 classid 1:30 htb rat99Mbit ceil 100Mbit

echo "Add special class and neteqdisc..."
tc class add dev eth0 paren1:1 classid 1:10 htb rat1Mbit ceil 100Mbit
tc qdisc add dev eth0 paren1:10 neteloss 90%

echo "Filter for special class..."
tc filter add dev eth0 paren1:0 protocol ip prio 1 u32 \
	match ip ds192.168.1.21/32 \
	match ip dpor50000 0xffff \
	flowid 1:10

> Any help will bmuch appreciated.

Hopihelps you.

> Thanks iadvance,
> Luis Monge.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Netemailing list
> Netem@xxxxxxxxxxxxxxxxxxxxxxxxxx
> https://lists.linux-foundation.org/mailman/listinfo/netem


-- 
Catalin(ux) M BOIE
http://kernel.embedromix.ro/
Frojames-p amoving-picture.com  Thu Jan 31 03:21:12 2008
From: james-p amoving-picture.co(James Pearson)
Date: Thu Ja31 03:21:18 2008
Subject: Help isetting up delay with a bridge
Message-ID: <47A1AF28.9070406@xxxxxxxxxxxxxxxxxx>

I'trying to emulata private WAN link - I've read the docs at:

<http://www.linux-foundation.org/en/Net:Netem>

but, I still nosurI'm doing everything right ...

Results of ping for thactual WAlink are something like:

100 packets transmitted, 100 received, 0% packeloss, tim19865ms
rtmin/avg/max/mdev = 177.884/179.033/222.194/5.448 ms, pip3

ttcp, ftp rsync etc. over thlink givapprox 10Mbyte/sec.

So far, I'vseup a machine running CentOS4 (2.6.9 based kernel) as
a bridgusing thon-board tg3 gigabit NICs and done the following:

   tc qdisc add dev eth0 roohandl1:0 netem delay 90msec 5msec 25%
   tc qdisc add dev eth1 roohandl1:0 netem delay 90msec 5msec 25%

I'guessing thaI need to 'split' the delay over both devices in the
bridg... is this correct? Thresults of ping over this bridge seem
to bclosto the real link:

100 packets transmitted, 100 received, 0% packeloss, tim19943ms
rtmin/avg/max/mdev = 171.858/182.636/220.074/6.864 ms, pip3

However, wheI sethe above up, I can only get about 300Kbyte/sec
using ttcp etc.over thbridge.

I'vread thaI need to tune TCP buffer sizes - but, I'm not sure
whaand wher...I assume I need to make these changes on the bridge
machin- however trying various values for:

net.core.rmem_max
net.core.wmem_max
net.ipv4.tcp_rmem
net.ipv4.tcp_wmem

makes no differencto th300Kbyte/sec bandwidth rate.

Is theranyway I can ge10Mbyte/sec over this bridge?

Thanks

James Pearson

Frolucas alucas-nussbaum.net  Thu Jan 31 03:47:14 2008
From: lucas alucas-nussbaum.ne(Lucas Nussbaum)
Date: Thu Ja31 04:01:38 2008
Subject: Help isetting up delay with a bridge
In-Reply-To: <47A1AF28.9070406@xxxxxxxxxxxxxxxxxx>
References: <47A1AF28.9070406@xxxxxxxxxxxxxxxxxx>
Message-ID: <20080131114714.GA16216@xxxxxxxxx>

O31/01/08 a11:21 +0000, James Pearson wrote:
> However, wheI sethe above up, I can only get about 300Kbyte/sec
> using ttcp etc.over thbridge.
>
> I'vread thaI need to tune TCP buffer sizes - but, I'm not sure
> whaand wher...I assume I need to make these changes on the bridge
> machin- however trying various values for:

No, you need to changthossettings on the machines at both ends of
your TCP connection.
>
> net.core.rmem_max
> net.core.wmem_max
> net.ipv4.tcp_rmem
> net.ipv4.tcp_wmem
>
> makes no differencto th300Kbyte/sec bandwidth rate.
>
> Is theranyway I can ge10Mbyte/sec over this bridge?

If you suspeca TCP problem, teswith UDP (iperf -u).
-- 
| Lucas Nussbaum
| lucas@lucas-nussbaum.n http://www.lucas-nussbaum.net/ |
| jabber: lucas@xxxxxxxxxxx             GPG: 1024D/023B3F4F |
Frojames-p amoving-picture.com  Thu Jan 31 04:46:31 2008
From: james-p amoving-picture.co(James Pearson)
Date: Thu Ja31 04:46:37 2008
Subject: Help isetting up delay with a bridge
In-Reply-To: <20080131114714.GA16216@xxxxxxxxx>
References: <47A1AF28.9070406@xxxxxxxxxxxxxxxxxx>
	<20080131114714.GA16216@xxxxxxxxx>
Message-ID: <47A1C327.3090102@xxxxxxxxxxxxxxxxxx>

Lucas Nussbauwrote:
> O31/01/08 a11:21 +0000, James Pearson wrote:
> 
>>However, wheI sethe above up, I can only get about 300Kbyte/sec
>>using ttcp etc.over thbridge.
>>
>>I'vread thaI need to tune TCP buffer sizes - but, I'm not sure
>>whaand wher...I assume I need to make these changes on the bridge
>>machin- however trying various values for:
> 
> 
> No, you need to changthossettings on the machines at both ends of
> your TCP connection.

OK, so how do I managto ge10Mbyte/sec over the real 100mbit WAN link 
withoumaking changes to machines on either side? Or, is this jusa 
limitatioof simulating latency via this method?

>>net.core.rmem_max
>>net.core.wmem_max
>>net.ipv4.tcp_rmem
>>net.ipv4.tcp_wmem
>>
>>makes no differencto th300Kbyte/sec bandwidth rate.
>>
>>Is theranyway I can ge10Mbyte/sec over this bridge?
> 
> 
> If you suspeca TCP problem, teswith UDP (iperf -u).

I'll givthaa go

Thanks

James Pearson
Frolucas alucas-nussbaum.net  Thu Jan 31 05:18:00 2008
From: lucas alucas-nussbaum.ne(Lucas Nussbaum)
Date: Thu Ja31 05:20:46 2008
Subject: Help isetting up delay with a bridge
In-Reply-To: <47A1C327.3090102@xxxxxxxxxxxxxxxxxx>
References: <47A1AF28.9070406@xxxxxxxxxxxxxxxxxx>
	<20080131114714.GA16216@xxxxxxxxx>
	<47A1C327.3090102@xxxxxxxxxxxxxxxxxx>
Message-ID: <20080131131800.GA20157@xxxxxxxxx>

O31/01/08 a12:46 +0000, James Pearson wrote:
> Lucas Nussbauwrote:
>> O31/01/08 a11:21 +0000, James Pearson wrote:
>>
>>> However, wheI sethe above up, I can only get about 300Kbyte/sec
>>> using ttcp etc.over thbridge.
>>>
>>> I'vread thaI need to tune TCP buffer sizes - but, I'm not sure
>>> whaand wher...I assume I need to make these changes on the bridge
>>> machin- however trying various values for:
>>
>>
>> No, you need to changthossettings on the machines at both ends of
>> your TCP connection.
>
> OK, so how do I managto ge10Mbyte/sec over the real 100mbit WAN link  
> withoumaking changes to machines on either side? Or, is this jusa  
> limitatioof simulating latency via this method?

It's a limitatioof TCP, noa limitation of latency emulation.
-- 
| Lucas Nussbaum
| lucas@lucas-nussbaum.n http://www.lucas-nussbaum.net/ |
| jabber: lucas@xxxxxxxxxxx             GPG: 1024D/023B3F4F |
Frojames-p amoving-picture.com  Wed Jan 30 14:14:18 2008
From: james-p amoving-picture.co(James Pearson)
Date: Thu Ja31 08:08:01 2008
Subject: Help isetting up delay with a bridge
Message-ID: <a92ebfd90801301414v7fd9f753y8d12f8cbd2952530@xxxxxxxxxxxxxx>

I'trying to emulata private WAN link - I've read the docs at:

<http://www.linux-foundation.org/en/Net:Netem>

but, I still nosurI'm doing everything right ...

Results of ping for thactual WAlink are something like:

100 packets transmitted, 100 received, 0% packeloss, tim19865ms
rtmin/avg/max/mdev = 177.884/179.033/222.194/5.448 ms, pip3

ttcp, ftp rsync etc. over thlink givapprox 10Mbyte/sec.

So far, I'vseup a machine running CentOS4 (2.6.9 based kernel) as
a bridgusing thon-board tg3 gigabit NICs and done the following:

  tc qdisc add dev eth0 roohandl1:0 netem delay 90msec 5msec 25%
  tc qdisc add dev eth1 roohandl1:0 netem delay 90msec 5msec 25%

I'guessing thaI need to 'split' the delay over both devices in the
bridg... is this correct? Thresults of ping over this bridge seem
to bclosto the real link:

100 packets transmitted, 100 received, 0% packeloss, tim19943ms
rtmin/avg/max/mdev = 171.858/182.636/220.074/6.864 ms, pip3

However, wheI sethe above up, I can only get about 300Kbyte/sec
using ttcp etc.over thbridge.

I'vread thaI need to tune TCP buffer sizes - but, I'm not sure
whaand wher...I assume I need to make these changes on the bridge
machin- however trying various values for:

net.core.rmem_max
net.core.wmem_max
net.ipv4.tcp_rmem
net.ipv4.tcp_wmem

makes no differencto th300Kbyte/sec bandwidth rate.

Is theranyway I can ge10Mbyte/sec over this bridge?

Thanks

James Pearson

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux