Testing system evironment...not working?

Linux Advanced Routing and Traffic Control

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

 



hey, i wrote the queue schedulling script for controlling the bandwidth use by FTP and HTTP.
I didnt get any error message when i execute the scrip.
But when i setup the LAN to test the Qos gateway.
The Qos gateway not fuctionning...
If anyone read this script, please info me where is the error. Thank you.
 
 

#!/bin/bash -x

DOWNLINK=80000

UPLINK=80000

DEV0="eth0"

DEV1="eth1"

if [ "$1" = "status" ]

then

tc -s qdisc ls dev $DEV0

tc -s class ls dev $DEV0

tc -s qdisc ls dev $DEV1

tc -s class ls dev $DEV1

exit

fi

#Remove all previous queues

echo "deleting..."

tc qdisc del dev $DEV0 root 2> /dev/null > /dev/null

tc qdisc del dev $DEV1 root 2> /dev/null > /dev/null

tc class del dev $DEV0 ingress 2> /dev/null > /dev/null

tc class del dev $DEV1 ingress 2> /dev/null > /dev/null

if [ "$1" = "stop" ]

then

exit

fi

#add the root

echo "adding..."

tc qdisc add dev $DEV0 root handle 1: htb default 30

tc qdisc add dev $DEV1 root handle 2: htb default 30

tc class add dev $DEV0 parent 1: classid 1:1 htb rate 100Mbit burst 256k

tc class add dev $DEV1 parent 2: classid 2:2 htb rate 100Mbit burst 256k

 

#set up two classes attached to the root (download from server)

tc class add dev $DEV0 parent 1:1 classid 1:10 htb rate 10Mbit burst 256k

tc class add dev $DEV0 parent 1:1 classid 1:20 htb rate 90Mbit burst 256k

#set up two classes attached to the root (upload from client)

tc class add dev $DEV1 parent 2:2 classid 2:10 htb rate 10Mbit burst 256k

tc class add dev $DEV1 parent 2:2 classid 2:20 htb rate 90Mbit burst 256k

#make each of them use stochasitic fairness queueing (download from server)

tc qdisc add dev $DEV0 parent 1:10 handle 10: sfq perturb 10

tc qdisc add dev $DEV0 parent 1:20 handle 20: sfq perturb 10

#make each of them use stochasitic fairness queueing (upload from client)

tc qdisc add dev $DEV1 parent 2:10 handle 10: sfq perturb 10

tc qdisc add dev $DEV1 parent 2:20 handle 20: sfq perturb 10

#add the layer7 filter to two of them (download from server)

tc filter add dev $DEV0 protocol ip parent 1:0 prio 1 layer7 protocol ftp classid 1:10

tc filter add dev $DEV0 protocol ip parent 1:0 prio 1 layer7 protocol http classid 1:20

#add the layer7 filter to two of them (download from server)

tc filter add dev $DEV1 protocol ip parent 2:0 prio 2 layer7 protocol ftp classid 2:10

tc filter add dev $DEV1 protocol ip parent 2:0 prio 1 layer7 protocol http classid 2:20

if [ "$1" = "stop" ]

then

exit

fi

#show the result

echo "the ftp use 30% bandwidth http use 70% "

 

 And the figure below is my testing eviroment.   

         PC1                                             PC2                                             PC3
         eth0                      &
 nbsp;       eth0                         eth1                             eth0
   192.168.1.0               192.168.1.245         192.168.2.245               192.168.2.0            
 
    FTP Server             Sub-network A    Sub-network B 
 ;      Client 
   Web-Server                                  Qos Tool                               
 ;Download tool         
 
 
FTP-Server = Bullet Proof FTP Server v2.21  
Web-Server = TOMCAT Apache
Download tool = Net Transfer
Qos tool = Qos Layer 7 Packet filter
                                The testing system environment

 Isnt possible i succes to control the transfer rate of the application??

  


MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*. _______________________________________________ LARTC mailing list / LARTC@xxxxxxxxxxxxxxx http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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