title: Simulate network latency on specific port using tc
body: <p>I'm trying to simulate a fixed time latency on tcp packets coming from source port 7000 using the tc command on ubuntu. The commands I'm using are:</p>
  
  <pre><code>sudo tc qdisc add dev eth1 root handle 1: prio
  sudo tc qdisc add dev eth1 parent 1:1 handle 2: netem delay 3000ms
  sudo tc filter add dev eth1 parent 1:0 protocol ip u32 match ip sport 7000 0xffff flowid 2:1
  </code></pre>
  
  <p>There doesn't appear to be any delay caused by this filter, could someone please point out where I'm going wrong? Also, is there any way I can ping a port or do something equivalent to test the latency?</p>
  
  <p>Thanks!</p>