Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-20-2008, 04:32 PM
dustmop
 
Posts: n/a
tc to slow traffic to one port

Hello All,
I'm trying to use tc to introduce a 5 second delay to connections to a
certain port on my machine - mainly to test the effect of latency on
an application. Here is the script I'm using:

#!/bin/bash
I=eth0
PORT=8887
tc qdisc del dev $I root
tc qdisc add dev $I handle 1: root htb
tc class add dev $I parent 1: classid 1:1 htb rate 100Mbps
tc qdisc add dev $I parent 1:1 handle 10: netem delay 5000ms
tc filter add dev $I protocol ip parent 1: prio 1 u32 match \
ip dport $PORT 0xffff flowid 10:
tc filter add dev $I protocol ip parent 1: prio 1 u32 match \
ip sport $PORT 0xffff flowid 10:

It runs without error, but I don't notify any delays, whether I hit
the port from my current machine or from another.

I already tried just slowing localhost like this:

#!/bin/bash
tc qdisc del dev lo root
tc qdisc add dev lo root netem delay 5000ms

and that worked great. However, I need to add this port restriction.
Is there anything wrong with my tc commands? Is the filter even being
run, and is there some place I can monitor what they are doing?

Thank you for your assistance.
Reply With Quote
  #2 (permalink)  
Old 08-22-2008, 12:04 AM
Andy Furniss
 
Posts: n/a
Re: tc to slow traffic to one port

dustmop wrote:
> Hello All,
> I'm trying to use tc to introduce a 5 second delay to connections to a
> certain port on my machine - mainly to test the effect of latency on
> an application. Here is the script I'm using:
>
> #!/bin/bash
> I=eth0
> PORT=8887
> tc qdisc del dev $I root
> tc qdisc add dev $I handle 1: root htb
> tc class add dev $I parent 1: classid 1:1 htb rate 100Mbps
> tc qdisc add dev $I parent 1:1 handle 10: netem delay 5000ms
> tc filter add dev $I protocol ip parent 1: prio 1 u32 match \
> ip dport $PORT 0xffff flowid 10:
> tc filter add dev $I protocol ip parent 1: prio 1 u32 match \
> ip sport $PORT 0xffff flowid 10:
>
> It runs without error, but I don't notify any delays, whether I hit
> the port from my current machine or from another.
>
> I already tried just slowing localhost like this:
>
> #!/bin/bash
> tc qdisc del dev lo root
> tc qdisc add dev lo root netem delay 5000ms
>
> and that worked great. However, I need to add this port restriction.
> Is there anything wrong with my tc commands? Is the filter even being
> run, and is there some place I can monitor what they are doing?
>
> Thank you for your assistance.


The flowid should be 1:1

Andy.
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:15 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Currency Converter | Advertising | Loan | Mortgage Calculator | Remortgages



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114