Re: [LARTC] urgent help needed in iproute2+tc

Linux Advanced Routing and Traffic Control

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

 



Hi Ravi,

First you must know what port is used on voip.
To check the correct port of voip, you can use Etherreal, tcpdump or
Sniffer.
I guess it is the same as H.323 on MS NetMeeting used with UDP port 1720.
Port 1720 = 0x06B8.

In here we use priority and simple FIFO queuing. Both queuing are used in
ordinary Cisco Routers.
Below is the commands:

------------------------------
###### To control eth0 ######
#Create Priority queuing (minimum 3 bands)
tc qdisc add dev eth0 root handle 1: prio bands 3 priomap 0 1 2

#Create FIFO queuing and attach to priority queuing
tc qdisc add dev eth0 parent 1:1 handle 2: pfifo limit 1024
tc qdisc add dev eth0 parent 1:2 handle 3: pfifo limit 1024
tc qdisc add dev eth0 parent 1:3 handle 4: pfifo limit 1024

#Installing a u32 classifier for the traffic
#In Cisco router 'tc filter' command has same function as access-list
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 divisor 1

# Filter UDP traffic which has destination port 1720 (0x06B8) and direct
#   this traffic to class 1:1 (FIFO priority 1)
tc filter add dev eth0 parent 1:0 prio 1 u32 match udp src 0x06B8 0xffff \
flowid 1:1
# Filter UDP traffic which has source port 1720 (0x06B8) and direct this
#   traffic to class 1:1 (FIFO priority 1)
tc filter add dev eth0 parent 1:0 prio 1 u32 match udp dst 0x06B8 0xffff \
flowid 1:1

###### To control eth1 ######
#Create Priority queuing (minimum 3 bands)
tc qdisc add dev eth1 root handle 1: prio bands 3 priomap 0 1 2

#Create FIFO queuing and attach to priority queuing
tc qdisc add dev eth1 parent 1:1 handle 2: pfifo limit 1024
tc qdisc add dev eth1 parent 1:2 handle 3: pfifo limit 1024
tc qdisc add dev eth1 parent 1:3 handle 4: pfifo limit 1024

#Installing a u32 classifier for the traffic
#In Cisco router 'tc filter' command has same function as access-list
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 divisor 1

# Filter UDP traffic which has destination port 1720 (0x06B8) and direct
#   this traffic to class 1:1 (FIFO priority 1)
tc filter add dev eth1 parent 1:0 prio 1 u32 match udp src 0x06B8 0xffff \
flowid 1:1
# Filter UDP traffic which has source port 1720 (0x06B8) and direct this
#   traffic to class 1:1 (FIFO priority 1)
tc filter add dev eth1 parent 1:0 prio 1 u32 match udp dst 0x06B8 0xffff \
flowid 1:1

###### To control eth2 ######
#Create Priority queuing (minimum 3 bands)
tc qdisc add dev eth2 root handle 1: prio bands 3 priomap 0 1 2

#Create FIFO queuing and attach to priority queuing
tc qdisc add dev eth2 parent 1:1 handle 2: pfifo limit 1024
tc qdisc add dev eth2 parent 1:2 handle 3: pfifo limit 1024
tc qdisc add dev eth2 parent 1:3 handle 4: pfifo limit 1024

#Installing a u32 classifier for the traffic
#In Cisco router 'tc filter' command has same function as access-list
tc filter add dev eth2 parent 1:0 protocol ip prio 1 u32 divisor 1

# Filter UDP traffic which has destination port 1720 (0x06B8) and direct
#   this traffic to class 1:1 (FIFO priority 1)
tc filter add dev eth2 parent 1:0 prio 1 u32 match udp src 0x06B8 0xffff \
flowid 1:1
# Filter UDP traffic which has source port 1720 (0x06B8) and direct this
#   traffic to class 1:1 (FIFO priority 1)
tc filter add dev eth2 parent 1:0 prio 1 u32 match udp dst 0x06B8 0xffff \
flowid 1:1
------------------------------


I haven't tried it before. Let me know it can work or not.

Regards,

> Date: Tue, 10 Apr 2001 16:23:43 -0700
> To: lartc@xxxxxxxxxxxxxxx
> From: Ravikanth Samprathi <rsamprat@xxxxxxxxx>
> Subject: [LARTC] urgent help needed in iproute2+tc
>
> Hi all,
> I am running linux-2.4.0 with
> 3 interfaces - eth0, eth1, and eth2.
>
> eth0 is the outgoing WAN interface.
> eth1 and eth2 are the internal LAN interfaces.
> eth1 and eth2 belong to a bridge group br0.
> eth1 is connected to a voice-over-ip phone.
> eth2 is connected to a pc.
>
> so, the setup is
                        ------------------------------
                        |                            |
         voip-phone --->| eth1  --->                 |
                        |   br0                eth0 -|---WAN
      lan-pc ---------->| eth2 ---->                 |
                        ------------------------------
>
> voip-phone can talk with lan-pc
> through-the-bridge-group.
> voip phone can also talk with any other
> phone in the outside-world-through-the-WAN.
>
> I need to setup QoS so that all packets
> from voip-phone (that is destined to either
> eth1, eth2 or to eth0) are provided with
> high-priority-low-delay service.  voip-phone
> can be on any lan-interface (eth1 or eth2).
> The only thing that can be surely said
> about the voip-phone is that it will
> have only a particular set of ip addresses
> ranging from 171.72.233.100 to 171.72.233.200.
>
> To implement this, i downloaded the
> iproute2+tc tool version
> iproute2-2.2.4-now-ss991023.tar.gz
> and went through the README files.
>
> Can somebody please help me in
> writing the commands?  That will
> be of great help.
>
> Thanking you in advance,
> ravi
>
>
> --------------------------------------------------->
> Ravi Samprathi   work:(408)853-8038
> Cisco Systems   res  :(408)988-2268
> Empowering the  Internet Generation
> <---------------------------------------------------
>
>
>
>








[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux