Borrow in CBQ doesn't work

Marcelo Celleri marceloc at espoltel.net
Thu Feb 8 14:48:12 UTC 2007


Thanks for your answers, but like I said I cannot switch to hfsc where I
have the main configuration for my customers, because I have a lot of
queues and the server gives me:

pfctl: DIOCADDALTQ: Cannot allocate memory

I don't know if something could be wrong in my config or is just the
amount of processes to support, which could be the maximum number of
hfsc queues to support related with the amount of memory?

Also I attached my config file, hoping that you can tell me if something
is wrong.


On jue, 2007-02-08 at 10:25 +0100, Marko Lerota wrote:
> Marcelo Celleri <marceloc at espoltel.net> writes:
> 
> > Hi everyone,
> >
> > I'm working with ALTQ, but I realize that the borrow option in cbq
> > queues doesn't work at least like the manual says "A child class can
> > borrow bandwidth from its parent class as long as excess bandwidth is
> > available"
> 
> You are not the only one who find that problem. It must be a bug. 
> I switched to hfsc and borrowing works fine.  
> 
> altq on $int_if hfsc bandwidth 4800Kb queue { def adm usr ser}
>     queue def bandwidth 30Kb hfsc (default realtime 30Kb)
>     queue usr bandwidth 600Kb hfsc (red realtime 600Kb) 
>     queue adm bandwidth 2000Kb hfsc (red realtime 2000Kb) 
>     queue ser bandwidth 1000Kb hfsc (red realtime 1000Kb)
> 
> pass inet proto { tcp, udp } from $admins to any keep state queue adm
> pass inet proto { tcp, udp } from $users to any keep state queue usr
> pass inet proto { tcp, udp } from $servers to any keep state queue ser
> 
> I have this in kernel 
> 
> options         ALTQ
> options         ALTQ_CBQ        # Class Bases Queuing (CBQ)
> options         ALTQ_RED        # Random Early Detection (RED)              
> options         ALTQ_RIO        # RED In/Out
> options         ALTQ_HFSC       # Hierarchical Packet Scheduler (HFSC)
> options         ALTQ_PRIQ       # Priority Queuing (PRIQ)
> options         ALTQ_NOPCC      # Required for SMP build
> options         ALTQ_DEBUG
> options         ALTQ_PRIQ       # Priority Queueing
> 
-- 
----------------------------------
       Marcelo Célleri M.
            Jefe IP
         ESPOLTEL S.A.
   PBX 593 04 2514477 Ext. 114
----------------------------------
-------------- next part --------------

ext_if="em0"	
int_if="em1"


#PORT DEFINITIONS
tcp_voip="1024:1502,1718:1720,2950,4555,4569,5036,5060,5061"
udp_voip="4000:4220,6801,17000:17046,30000:30046"
tcp_prio1="20,21,80,81,443,1863"
tcp_prio2="25,110,143"
p2p="1214,3531,4329,4661:4665,4672,4900:4999,6257,6346,6699,6881"


table <core_servers> {A.A.A.3, A.A.A.4, A.A.A.2, B.B.B.3, B.B.B.254}
table <uees_network> { Y.Y.Y.0/24 }
table <src_pymes128> persist file "/etc/custom/pymes"
table <src_pymes256_n3> persist file "/etc/custom/pymes256_n3"
table <src_pymes256_n6> persist file "/etc/custom/pymes256_n6"
table <src_pymes128_n2> persist file "/etc/custom/pymes128_n2"
table <src_residencial> persist file "/etc/custom/residencial_128"
table <CORTE> persist file "/etc/custom/corte_de_servicio"

# Queueing: rule-based bandwidth control [Download].

altq on $int_if hfsc bandwidth 100Mb queue { std, core, salinas,  uees, lnaval, tes, ecomundo, coe, \
	montepiedra, andec, copol, asuncion_pri, asuncion_sec, offset, afgye, calcivar, zona3, corpecuador, ststeban, \
	extradio, capig, capig_mail, esmena, marianitas, diteca, canizares, delfos, metain,  \
	pym256_n3, pym256_n4, pym128, pym128_n2, residencial }


# PREMIUM SERVICES
######################

#
#  MAIN QUEUE  _ _ _ _ queue A: Best prio, more BW (voip,www,ftp)
#                   |_ queue B: BW for correo-e (If exist Client MailServer)
#                   |_ queue C: Low BW, worst prio (P2P, non common aplication)
#

queue std bandwidth 50.0Mb hfsc(default)
queue core bandwidth 1.5Mb hfsc (upperlimit 1.5Mb)
queue salinas bandwidth 2Mb hfsc (upperlimit 2Mb)

queue uees bandwidth 2Mb hfsc (upperlimit 2Mb) { uees1, uees2, ueesdf }
	queue uees1 bandwidth 78% priority 3 hfsc(ecn)
	queue uees2 bandwidth 14% priority 2 hfsc(ecn)
	queue ueesdf bandwidth 8% hfsc(ecn)

queue lnaval bandwidth 192Kb hfsc (upperlimit 192Kb) { ln_voip, ln_sec, ln_pri }
	queue ln_sec bandwidth 87% priority 4 hfsc(ecn)
	queue ln_pri bandwidth 13% priority 2 hfsc(ecn)

queue tes bandwidth 720Kb hfsc (upperlimit 720Kb) { tes1, tes2, tesdf }
	queue tes1 bandwidth 78% priority 3 hfsc(ecn)
	queue tes2 bandwidth 14% priority 2 hfsc(ecn)
	queue tesdf bandwidth 8% hfsc(ecn)

queue ecomundo bandwidth 512Kb hfsc (upperlimit 512Kb) { ecomundo1, ecomundo2, ecomundodf }
	queue ecomundo1 bandwidth 70% priority 3 hfsc(ecn)
	queue ecomundo2 bandwidth 20% priority 2 hfsc(ecn)
	queue ecomundodf bandwidth 10% hfsc(ecn)

queue coe bandwidth 768Kb hfsc (upperlimit 768Kb) { coe1, coedf }
	queue coe1 bandwidth 75% priority 2 hfsc(ecn)
	queue coedf bandwidth 25% hfsc(ecn)

queue andec bandwidth 608Kb hfsc (upperlimit 608Kb) { andec1, andec2, andecdf }
	queue andec1 bandwidth 70% priority 4 hfsc
	queue andec2 bandwidth 20% priority 3 hfsc(ecn)
	queue andecdf bandwidth 10% priority 2 hfsc(ecn)

queue copol bandwidth 336Kb hfsc (upperlimit 336Kb) { copol1, copol2, copoldf }
	queue copol1 bandwidth 70% priority 3 hfsc(ecn)
	queue copol2 bandwidth 20% priority 2 hfsc(ecn)
	queue copoldf bandwidth 10% hfsc(ecn)

queue asuncion_pri bandwidth 224Kb hfsc (upperlimit 224Kb) { asuncion_pri1, asuncion_pri2, asuncion_pridf }
	queue asuncion_pri1 bandwidth 70% priority 3 hfsc(ecn)
	queue asuncion_pri2 bandwidth 20% priority 2 hfsc(ecn)
	queue asuncion_pridf bandwidth 10% hfsc(ecn)

queue asuncion_sec bandwidth 288Kb hfsc (upperlimit 288Kb) { asuncion_sec1, asuncion_sec2, asuncion_secdf }
	queue asuncion_sec1 bandwidth 70% priority 3 hfsc(ecn)
	queue asuncion_sec2 bandwidth 20% priority 2 hfsc(ecn)
	queue asuncion_secdf bandwidth 10% hfsc(ecn)

queue offset bandwidth 384Kb hfsc (upperlimit 384Kb) { offset1, offset2, offsetdf }
	queue offset1 bandwidth 70% priority 3 hfsc(ecn)
	queue offset2 bandwidth 20% priority 2 hfsc(ecn)
	queue offsetdf bandwidth 10% hfsc(ecn)

queue afgye bandwidth 320Kb hfsc (upperlimit 320Kb) { afgye1, afgye2, afgyedf }
	queue afgye1 bandwidth 70% priority 3 hfsc(ecn)
	queue afgye2 bandwidth 20% priority 2 hfsc(ecn)
	queue afgyedf bandwidth 10% hfsc(ecn)

queue calcivar bandwidth 384Kb hfsc (upperlimit 384Kb) { calcivar1, calcivar2, calcivardf }
	queue calcivar1 bandwidth 70% priority 3 hfsc(ecn)
	queue calcivar2 bandwidth 20% priority 2 hfsc(ecn)
	queue calcivardf bandwidth 10% hfsc(ecn)

queue esmena bandwidth 256Kb hfsc (upperlimit 256Kb) { esmena1, esmenadf }
        queue esmena1 bandwidth 80% priority 3 hfsc(ecn)
        queue esmenadf bandwidth 20% hfsc(ecn)

queue zona3 bandwidth 256Kb hfsc (upperlimit 256Kb) { zona3voip, zona3df }
	queue zona3voip bandwidth 82Kb priority 3 hfsc(ecn)
	queue zona3df bandwidth 174Kb hfsc(ecn)

queue capig bandwidth 144Kb hfsc (upperlimit 144Kb) { capig1, capigdf }
	queue capig1 bandwidth 80% priority 3 hfsc(ecn)
	queue capigdf bandwidth 20% hfsc(ecn)

queue capig_mail bandwidth 128Kb hfsc (upperlimit 128Kb)

queue corpecuador bandwidth 128Kb hfsc (upperlimit 140Kb, realtime 128Kb) { corpecuador1, corpecuadordf }
	queue corpecuador1 bandwidth 80% priority 3 hfsc(ecn)
	queue corpecuadordf bandwidth 20% hfsc(ecn)

queue montepiedra bandwidth 128Kb hfsc (upperlimit 140Kb, realtime 128Kb) { montepiedra1, montepiedradf }
	queue montepiedra1 bandwidth 80% priority 3 hfsc(ecn)
	queue montepiedradf bandwidth 20% hfsc(ecn)

queue extradio bandwidth 128Kb hfsc (upperlimit 140Kb, realtime 128Kb) { extradio1, extradiodf }
	queue extradio1 bandwidth 80% priority 3 hfsc(ecn)
	queue extradiodf bandwidth 20% hfsc(ecn)

queue ststeban bandwidth 128Kb hfsc (upperlimit 140Kb, realtime 128Kb) { ststeban1, ststebandf }
	queue ststeban1 bandwidth 80% priority 3 hfsc(ecn)
	queue ststebandf bandwidth 20% hfsc(ecn)

queue  marianitas bandwidth 96Kb hfsc (upperlimit 106Kb, realtime 96Kb) { marianitas1, marianitasdf }
	queue marianitas1 bandwidth 80% priority 3 hfsc(ecn)
	queue marianitasdf bandwidth 20% hfsc(ecn)

queue canizares bandwidth 64Kb hfsc (upperlimit 72Kb, realtime 64Kb) { canizares_voip, canizaresdf }
        queue canizares_voip bandwidth 35% priority 3 hfsc(ecn)
        queue canizaresdf bandwidth 65% hfsc(ecn)

queue diteca bandwidth 64Kb hfsc (upperlimit 72Kb, realtime 64Kb) { diteca1, ditecadf }
        queue diteca1 bandwidth 90% priority 3 hfsc(ecn)
        queue ditecadf bandwidth 10% hfsc(ecn)

queue delfos bandwidth 64Kb hfsc (upperlimit 72Kb, realtime 64Kb) { delfos1, delfosdf }
        queue delfos1 bandwidth 90% priority 3 hfsc(ecn)
        queue delfosdf bandwidth 10% hfsc(ecn)

queue metain bandwidth 64Kb hfsc (upperlimit 72Kb, realtime 64Kb) { metain1, metaindf }
        queue metain1 bandwidth 90% priority 3 hfsc(ecn)
        queue metaindf bandwidth 10% hfsc(ecn)


## SHARED SERVICES
#############################

queue pym128 bandwidth 512Kb hfsc (upperlimit 560Kb, realtime 512Kb) { pym128_a, pym128_b, pym128_df }
        queue pym128_a bandwidth 80% priority 3 hfsc(ecn)
        queue pym128_df bandwidth 20% hfsc(ecn)

#
#    MAIN QUEUE  _ _ _ queue A: Best prio, BW for VoIP or low delay traffic
#                   |_ queue B: More BW, ( Almost everything less P2P)
#                   |_ queue C: Low BW, Worst prio (P2P)
#

queue pym256_n3 bandwidth 408Kb hfsc (upperlimit 408Kb, realtime 440Kb){ pym256_n3a, pym256_n3b, pym256_n3df }
        queue pym256_n3a bandwidth 12% priority 3 hfsc(ecn)
        queue pym256_n3b bandwidth 78% priority 2 hfsc(ecn)
        queue pym256_n3df bandwidth 10% hfsc(ecn)

queue pym256_n6 bandwidth 300Kb hfsc (upperlimit 330Kb, realtime 300Kb) { pym256_n6a, pym256_n6b, pym256_n6df }
        queue pym256_n6a bandwidth 12% priority 3 hfsc(ecn)
        queue pym256_n6b bandwidth 78% priority 2 hfsc(ecn)
        queue pym256_n6df bandwidth 10% hfsc(ecn)

queue pym128_n2 bandwidth 256Kb hfsc (upperlimit 280Kb, realtime 256Kb) { pym128_n2a, pym128_n2b, pym128_n2df }
        queue pym128_n2a bandwidth 12% priority 3 hfsc(ecn)
        queue pym128_n2b bandwidth 78% priority 2 hfsc(ecn)
        queue pym128_n2df bandwidth 10% hfsc(ecn)

queue residencial bandwidth 840Kb hfsc (upperlimit 900Kb, realtime 840Kb) { residencial1, residencialdf }
        queue residencial1 bandwidth 80% priority 3 hfsc(ecn)
        queue residencialdf bandwidth 20% hfsc(ecn)


# FILTERS
###############

pass out quick on $int_if from any to <core_servers> queue core
pass out quick on $int_if from any to W.W.W.0/24 queue salinas

pass out quick on $int_if proto { tcp,udp } from any port 53 to Y.Y.Y.0/24 queue uees1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to Y.Y.Y.0/24 queue uees1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to Y.Y.Y.0/24 queue uees2
pass out quick on $int_if from any to Y.Y.Y.0/24 queue ueesdf

pass out on $int_if from any to X.X.X.77 queue ln_pri
pass out on $int_if from any to X.X.X.78 queue ln_voip
pass out on $int_if from any to X.X.X.76 queue ln_sec

pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to X.X.X.48/28  queue tes1
pass out quick on $int_if proto { tcp,udp } from any port 53 to X.X.X.48/28 queue tes1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to X.X.X.48/28 queue tes2
pass out quick on $int_if from any to X.X.X.48/28 queue tesdf

pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to { X.X.X.66 X.X.X.67 X.X.X.68 } queue ecomundo1
pass out quick on $int_if proto { tcp,udp } from any port 53 to { X.X.X.66 X.X.X.67 X.X.X.68 } queue ecomundo1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to { X.X.X.66 X.X.X.67 X.X.X.68 } queue ecomundo2
pass out quick on $int_if from any to { X.X.X.66 X.X.X.67 X.X.X.68 X.X.X.69  } queue ecomundodf

pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to X.X.X.120/30 queue coe1
pass out quick on $int_if proto { tcp,udp } from any port 53 to X.X.X.120/30 queue coe1
pass out quick on $int_if from any to X.X.X.120/30 queue coedf

#pass out quick on $int_if proto udp from any port 8000 to 200.49.242.17 queue andec1
pass out quick on  $int_if proto { tcp } from any port { $tcp_prio1 } to { X.X.X.34, X.X.X.35 } queue andec1
pass out quick on  $int_if proto { tcp } from any port { $tcp_prio2 } to { X.X.X.34, X.X.X.35 } queue andec2
pass out quick on $int_if from any to { X.X.X.34, X.X.X.35 }  queue andecdf

pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to Z.Z.Z.16/29 keep state queue copol1
pass out quick on $int_if proto { tcp,udp } from any port 53 to Z.Z.Z.16/29 keep state queue copol1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to Z.Z.Z.16/29 keep state queue copol2 
pass out quick on $int_if from any to Z.Z.Z.16/29 keep state queue copoldf

#pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to X.X.X.83 queue asuncion_pri1
#pass out quick on $int_if proto { tcp,udp } from any port 53 to X.X.X.83 queue asuncion_pri1
#pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to X.X.X.83 queue asuncion_pri2 
#pass out quick on $int_if from any to X.X.X.83 queue asuncion_pridf

#pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to X.X.X.84 queue asuncion_sec1
#pass out quick on $int_if proto { tcp,udp } from any port 53 to X.X.X.84 queue asuncion_sec1
#pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to X.X.X.84 queue asuncion_sec2 
#pass out quick on $int_if from any to X.X.X.84 queue asuncion_secdf

pass out quick on  $int_if proto { tcp } from any port { $tcp_prio1 } to { X.X.X.80 } queue offset1
pass out quick on  $int_if proto { tcp } from any port { $tcp_prio2 } to { X.X.X.80 } queue offset2
pass out quick on $int_if from any to { X.X.X.80 }  queue offsetdf

pass out quick on  $int_if proto { tcp } from any port { $tcp_prio1 } to { X.X.X.42 } queue calcivar1
pass out quick on  $int_if proto { tcp } from any port { $tcp_prio2 } to { X.X.X.42 } queue calcivar2
pass out quick on $int_if from any to { X.X.X.42 }  queue calcivardf

pass out quick on  $int_if proto { tcp } from any port { $tcp_voip } to { X.X.X.80 } queue afgye1
pass out quick on  $int_if proto { tcp } from any port { $tcp_prio1 } to { X.X.X.80 } queue afgye1
pass out quick on  $int_if proto { tcp } from any port { $tcp_prio2 } to { X.X.X.80 } queue afgye2
pass out quick on $int_if from any to { X.X.X.80 }  queue afgyedf

pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to X.X.X.46 queue esmena1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to X.X.X.46 queue esmena1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to X.X.X.46 queue esmena1
pass out quick on $int_if from any to X.X.X.46 queue esmenadf

pass out quick on $int_if from any to X.X.X.124 queue zona3df
pass out quick on $int_if from any to X.X.X.125 queue zona3voip

pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to X.X.X.98 queue capig1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to X.X.X.98 queue capig1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to X.X.X.98 queue capig1
pass out quick on $int_if from any to X.X.X.98 queue capigdf
pass out on $int_if from any to 200.49.246.250 queue capig_mail

pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to X.X.X.44 queue corpecuador1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to X.X.X.44 queue corpecuador1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to X.X.X.44 queue corpecuador1
pass out quick on $int_if from any to X.X.X.44 queue corpecuadordf

pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to Z.Z.Z.33 queue montepiedra1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to Z.Z.Z.33 queue montepiedra1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to Z.Z.Z.33 queue montepiedra1
pass out quick on $int_if from any to Z.Z.Z.33 queue montepiedradf

pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to X.X.X.108 queue extradio1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to X.X.X.108 queue extradio1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to X.X.X.108 queue extradio1
pass out quick on $int_if from any to X.X.X.108 queue extradiodf

pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to X.X.X.71 queue ststeban1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to X.X.X.71 queue ststeban1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to X.X.X.71 queue ststeban1
pass out quick on $int_if from any to X.X.X.71 queue ststebandf

pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to X.X.X.87 queue marianitas1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to X.X.X.87 queue marianitas1
pass out quick on $int_if proto { tcp } from any port { $tcp_prio2 } to X.X.X.87 queue marianitas1
pass out quick on $int_if from any to X.X.X.87 queue marianitasdf

pass out quick on $int_if from any to X.X.X.142 queue canizaresdf
pass out quick on $int_if from any to X.X.X.143  queue canizares_voip

pass out quick on $int_if proto { tcp } from any port { $p2p } to X.X.X.115 queue ditecadf
pass out quick on $int_if from any to X.X.X.115 queue diteca1

pass out quick on $int_if proto { tcp } from any port { $p2p } to X.X.X.73 queue delfosdf
pass out quick on $int_if from any to X.X.X.73 queue delfos1

pass out quick on $int_if proto { tcp } from any port { $p2p } to X.X.X.113 queue metaindf
pass out quick on $int_if from any to X.X.X.113 queue metain1


pass out quick on $int_if proto { tcp } from any port { $p2p } to <src_pymes128> queue pym128_df
pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to <src_pymes128> queue pym128_a
pass out quick on $int_if proto { udp } from any port { $udp_voip } to <src_pymes128> queue pym128_a
pass out quick on $int_if from any to <src_pymes128> queue pym128_b

pass out quick on $int_if proto { tcp } from any port { $p2p } to <src_pymes256_n3> queue pym256_n3df
pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to <src_pymes256_n3> queue pym256_n3a
pass out quick on $int_if proto { udp } from any port { $udp_voip } to <src_pymes256_n3> queue pym256_n3a
pass out quick on $int_if from any to <src_pymes256_n3> queue pym256_n3b

pass out quick on $int_if proto { tcp } from any port { $p2p } to <src_pymes256_n6> queue pym256_n6df
pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to <src_pymes256_n6> queue pym256_n6a
pass out quick on $int_if proto { udp } from any port { $udp_voip } to <src_pymes256_n6> queue pym256_n6a
pass out quick on $int_if from any to <src_pymes256_n6> queue pym256_n6b

pass out quick on $int_if proto { tcp } from any port { $p2p } to <src_pymes128_n2> queue pym128_n2df
pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to <src_pymes128_n2> queue pym128_n2a
pass out quick on $int_if proto { udp } from any port { $udp_voip } to <src_pymes128_n2> queue pym128_n2a
pass out quick on $int_if from any to <src_pymes128_n2> queue pym128_n2b

pass out quick on $int_if proto { tcp } from any port { $tcp_prio1 } to <src_residencial> queue residencial1
pass out quick on $int_if proto { tcp } from any port { $tcp_voip } to <src_residencial> queue residencial1
pass out quick on $int_if proto { udp } from any port { $udp_voip } to <src_residencial> queue residencial1
pass out quick on $int_if proto { tcp,udp } from any to <src_residencial> queue residencialdf


More information about the freebsd-pf mailing list