Showing posts with label QoS. Show all posts
Showing posts with label QoS. Show all posts

Monday, 16 November 2009

Testing Vyatta with QoS and Asterisk(Elastix) - Howto

The Setup:

First setting up the Interfaces:
R1:

interfaces {
ethernet eth0 {
address 10.0.12.1/24
description R1TOR2
}
ethernet eth1 {
address 192.168.10.254/24
description LAN1
}
ethernet eth2 {
address 10.0.10.1/24
description R1TOR10
}
ethernet eth3 {
address 10.0.13.1/24
description R1TOR3
}
loopback lo {
address 1.1.1.1/32
}

R2:

interfaces {
ethernet eth0 {
address 10.0.12.2/24
description R1TOR2
}
ethernet eth1 {
address 192.168.2.254/24
description LAN2
}
loopback lo {
address 2.2.2.2/32
}

R3

interfaces {
ethernet eth0 {
address 10.0.13.3/24
description R1TOR3
speed auto
}
ethernet eth1 {
address 192.168.3.254/24
description LAN3

}
loopback lo {
address 3.3.3.3/32
}
}


Setting up the IGP:
R1:

protocols {
ospf {
area 0 {
network 10.0.12.0/24
network 10.0.13.0/24
}
area 1 {
network 1.1.1.1/32
network 192.168.10.0/24
}
area 10 {
network 10.0.10.0/24
}
parameters {
router-id 1.1.1.1
}
}

R2:

protocols {
ospf {
area 0 {
network 10.0.12.0/24
}
area 2 {
network 2.2.2.2/32
network 192.168.2.0/24
}
parameters {
router-id 2.2.2.2
}
}
}

R3:

protocols {
ospf {
area 0 {
network 10.0.13.0/24
}
area 3 {
network 192.168.3.0/24
network 3.3.3.3/32
}
}
}


Setting up the QoS Policy:
R1:

qos-policy {
traffic-shaper SITE1 {
bandwidth 125kbit
class 10 {
bandwidth 85Kbit
match VOIP-RTP {
ip {
dscp 46
}
}
}
class 20 {
bandwidth 15kbit
match VOIP-CONTROL {
ip {
protocol udp
source {
port 5060
}
}
}
}
class 30 {
bandwidth 10kbit
match OSPF {
ip {
protocol ospf
}
}
queue-type fair-queue
}
default {
bandwidth 10kbit
}
description QOS_for_SITE1
}



The applying it:

R1:

interfaces {
ethernet eth0 {
address 10.0.12.1/24
description R1TOR2
qos-policy {
out SITE1
}





Here is the video where I configure and test it:

Testing Quality Of Service (QOS) with Vyatta and Asterisk from Richard Vimeo on Vimeo.

Friday, 13 November 2009

Testing Vyatta with QoS and Asterisk(Elastix)

Well, we have done something every simular here


However this time we are going all opensource :)

Monday, 9 November 2009

Testing QoS with Cisco Call Manager and SIP,RTP - How To

This is the practical to this lab: here


Setting up basic IP connectivity:
R1

!
interface FastEthernet0/0
description ToLan
ip address 192.168.10.254 255.255.255.0
duplex auto
speed auto
!
!
interface Serial0/0.123 multipoint
bandwidth 110
ip address 192.168.0.1 255.255.255.0
ip ospf network point-to-multipoint
snmp trap link-status
frame-relay map ip 192.168.0.2 122 broadcast
frame-relay map ip 192.168.0.3 123 broadcast
no frame-relay inverse-arp
!
!
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 1
network 192.168.0.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 1
!



R2

!
interface FastEthernet0/0
description ToLan
ip address 192.168.10.254 255.255.255.0
duplex auto
speed auto
!
!
interface Serial0/0.123 multipoint
bandwidth 110
ip address 192.168.0.1 255.255.255.0
ip ospf network point-to-multipoint
snmp trap link-status
frame-relay map ip 192.168.0.2 122 broadcast
frame-relay map ip 192.168.0.3 123 broadcast
no frame-relay inverse-arp
!
!
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 1
network 192.168.0.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 1
!


R3

!
interface FastEthernet0/0
ip address 192.168.3.254 255.255.255.0
duplex auto
speed auto
!
!
interface Serial0/0.321 multipoint
bandwidth 110
ip address 192.168.0.3 255.255.255.0
ip ospf network point-to-multipoint
frame-relay map ip 192.168.0.1 321 broadcast
frame-relay map ip 192.168.0.2 321 broadcast
!
!
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 3
network 192.168.0.0 0.0.0.255 area 0
network 192.168.3.0 0.0.0.255 area 3
!


Set up DHCP for Call Manager/TFTP
R1

ip dhcp excluded-address 192.168.10.1
ip dhcp excluded-address 192.168.10.100
ip dhcp excluded-address 192.168.10.254
!
ip dhcp pool POOL1
network 192.168.10.0 255.255.255.0
option 66 ip 192.168.10.100
default-router 192.168.10.254
!


(Pretty much the same on each router)


Now the important Stuff - QoS for SIP and RTP...

First the ACLs:

!
!Control is for SIP messages
ip access-list extended VOIP-CONTROL-ACL
permit tcp any any eq 5060
permit tcp any eq 5060 any
permit tcp any any eq 6970
permit tcp any eq 6970 any
! RTP is for the actual voices going down the line
ip access-list extended VOIP-RTP-ACL
permit udp any any eq 5060
permit udp any eq 5060 any
permit udp any any range 16384 32767
permit ip any any dscp ef
!


Now the Class Maps:

!
class-map match-any VOIP-CONTROL-CLASS
match access-group name VOIP-CONTROL-ACL
class-map match-any VOIP-RTP-CLASS
match access-group name VOIP-RTP-ACL
!



Now the Policy Maps:

!
policy-map VOIP
class VOIP-RTP-CLASS
priority 70
class VOIP-CONTROL-CLASS
bandwidth 8
class class-default
fair-queue
!


Map Class - Frame Relay:

!
map-class frame-relay FRAME-CLASS
!Provided by ISP
frame-relay cir 110000
!Set Tc to 10ms or 0.01 sec
frame-relay bc 1100
frame-relay be 0
!If you get a BECN set to this rate
frame-relay mincir 110000
!Remember to place this on both ends
frame-relay fragment 120
!Policy map
service-policy output VOIP
!





A few little extras(needed):

!
interface Serial0/0
bandwidth 400
no ip address
encapsulation frame-relay
frame-relay traffic-shaping
no frame-relay inverse-arp
frame-relay ip rtp header-compression
!
!
interface Serial0/0.123 multipoint
bandwidth 110
ip address 192.168.0.1 255.255.255.0
ip ospf network point-to-multipoint
snmp trap link-status
frame-relay class FRAME-CLASS
frame-relay map ip 192.168.0.2 122 broadcast
frame-relay map ip 192.168.0.3 123 broadcast
no frame-relay inverse-arp
!




Here is a video of the lab set up and me trying to break it!

Testing Quality of Service with Cisco Call Manager,VoIP from Richard Vimeo on Vimeo.







Here are the iPerf options I am using:
Server UDP:

iperf.exe -us -n 128m -i5

Client UDP:

iperf.exe -uc 192.168.2.3 -b256k -n 1G -i5 -d


*Remember if you wish to test DSCP tags try the "-s" options to tag the packets for example: "-s ef"

Sunday, 8 November 2009

Testing QoS with Cisco Call Manager and SIP,RTP

Hello again all,

Created a nice little lab here:



I plan to not only get up QoS but really stress test it using iperf to see if it works!

Tuesday, 2 June 2009

Using Rate-Limit for traffic shapping on cisco routers.

Hi again,

This post starts like a song "..I was working in the lab late one night" and I was playing around with cisco queueing and traffic shaping and whilst working on something for a client I worked out something that maybe be obvious for most but I have never really seen it in any forums/cisco documentation.

Anyway here is the visio of the scenario:
Here is how I did it.

1) Define the ACLs (These are used later for the Class-maps)
-Pings
access-list 110 permit icmp 10.10.0.0 0.0.0.255 any
-Voip
access-list 120 permit ip 10.10.0.0 0.0.0.255 host 192.168.0.5
-DNS
access-list 130 permit tcp 10.10.0.0 0.0.0.255 any eq domain
-Http
access-list 140 permit tcp 10.10.0.0 0.0.0.255 any eq www
-Bulk traffic
access-list 160 permit ip host 192.168.0.3 any

2) Define the class-maps:

class-map match-all VOIP
match access-group 110
match access-group 120
class-map match-all PING
match access-group 110
class-map match-all HTTP
match access-group 140
class-map match-all DNS
match access-group 130

3) Create 2 policy maps. This is because you can only really control outgoing bandwidth therefore you control WAN upstream on the WAN interface
But you control WAN downstream on the LAN interface.

*****************************************
policy-map WAN_OUT
class PING
bandwidth 1024
class VOIP
priority 1024
class DNS
bandwidth 1024
class HTTP
bandwidth 4096
class class-default
fair-queue

*****************************************
policy-map LAN_OUT
class PING
bandwidth 1024
class VOIP
priority 1024
class DNS
bandwidth 1024
class HTTP
bandwidth 4096
class class-default
fair-queue
*****************************************

Then I decided to cap all downstream traffic from 192.168.0.3 to about 256KB/s
This command make sure that when a user downloads a file it can never exceed this amount
(even when not congested)
interface FastEthernet0/1
..
rate-limit output access-group 160 2000000 1000000 1000000 conform-action continue exceed-action drop
..

Notice once again at this command is applied to the LAN interface on the output.


Once finished I used http://www.testyourvoip.com to test the quality whilst user 10.10.0.3 was downloading from the internet, grabing files over FTP & SMB from 192.168.0.3.

...and it worked! scored about 4.5 where as before shaping I had a score of about 3-ish


This isnt perfect, but it was just designed to show that you dont use the input queue on the wan interface to control your downloading you use the output queue on your lan interface.


Hope this helps some people out there.