![]() |
|
|
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. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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. |
|
|||
|
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. |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|