2007 May1 Chapter 5 Traffic Shaping
2007 May2 Traffic shaping Algorithm Two predominant methods for shaping traffic existing: 1. Token bucket Reference : 2. Leaky bucket Reference :
2007 May3 Traffic shaping Terminology Two major components and two sub-items controlling traffic shaping in DFL unit: Pipe object PipeRule –Traffic filter factor Service (protocol) Direction (the traffic from…to…) –Pipe Chain First Pipe – (a kinds of statement for declaring the traffic’s precedence) Following Pipe –( Assign the token for specific traffic)
2007 May4 Traffic shaping Terminology Pipe –Is an object for loading up all kinds of traffics. –We can limit the total bandwidth or dynamic balancing bandwidth for First Pipe and Following Pipe respectively. –We can assign the role for each Pipe based on the setting of PipeRule, to tell from which Pipe is the First Pipe, which Pipe is the Following Pipe.
2007 May5 Traffic shaping Terminology PipeRule –Control the traffic type (protocol). –Assign the role to Pipe for bi-direction (Forward chain, Return chain) traffic. –Define the way for searching the traffic’s level to the First Pipe. Use the default from first pipe Fixed precedence (0~7) Use IP DSCP (TOS)
2007 May6 Traffic shaping Terminology First Pipe –The role is assigned by PipeRule set. –Bandwidth control –Declare the traffic level Following Pipe –The role is assigned by PipeRule set. –Total bandwidth control –Assign the token for the traffic from First Pipe
2007 May7 Prec 5 : 200 Prec 5 : 150Prec 5 : 100 Traffic shaping Flow chart Two tiers concept First Pipe Following Pipe Raw Packet A 100 kbps BW Limitation: 50 kbps Declared precedence : 5 Total BW Limitation: 200 kbps Prec 7 : 200 Prec 6 : 200 Prec 4 : 200 Prec 3 : 200 Prec 2 : 200 Prec 1 : 200 Total BW : 200 Buffer Raw Packet A 50 kbps Out Prec 0 : 200 Raw Packet A 50 kbps (5) Prec 5 : 200 Raw Packet A 50 kbps
2007 May8 Prec 5 : 100 Prec 0 : 200 Prec 0 : 100 Prec 4 : 100 Prec 3 : 100 Prec 1 : 100 Prec 2 : 100 Raw Packet A 100 kbps (5) Raw Packet A 100 kbps (0) Prec 5 : 0 Traffic shaping Flow chart Two tiers concept First Pipe Following Pipe Raw Packet A 200 kbps BW Limitation: No limitation Declared precedence : 5 Total BW Limitation: 200 kbps Prec 7 : 100 Prec 6 : 100 Total BW : 200 Out Raw Packet A 200 kbps
2007 May9 Traffic shaping Scenario hands-on 1 ISP HTTP/FTP server GW: Network: /24 Upstream commit rate is 500 kilobits/per sec Downstream commit rate is 500 kilobits/per sec 1. Insure the HTTP CR to 200 kbps for bi-direction traffic. (Marking the HTTP traffic to precedence 7 (highest priority). HTTP doesn’t utilize the rest of bandwidth. 2. Set 400 kbps to precedence 1 for FTP bi-direction traffic. When the FTP token is running out, the part of overflow can flow to precedence 0 to compete with other services, it’s so-called “utilize remaining bandwidth ”.
2007 May10 Traffic shaping Tips1 Step 1 Create the “IP rule” set for specific service you want to control, and then make sure this rule set will be first triggered in all of the IP rules Step 2 Create the Pipe objects for containing each kinds of traffic. Step 3 Create the same rule set we created before in Step 1 under the pipe rule. Step 4 In the tab of traffic shaping, select the desired pipe object respectively for both forward sessions and return sessions along with the chain concept, and then announce the precedence by “Use defaults from first pipe”, “Use Fixed Precedence” or “Map IP DSCP (ToS)” for first pipe object of return chain or forward chain. Step 5 Make sure whether the specific pipe rule will be first triggered in all of the pipe rules.
2007 May11 Traffic shaping Tips2
2007 May12 Traffic shaping Scenario hands-on 1 Settings-01/12 1 Changing the WAN1 IP address and subnet mask 2 Set the default gateway on interface on wan1
2007 May13 Traffic shaping Scenario hands-on 1 Settings-02/12 3 Add the necessary IP rule sets in IP rules
2007 May14 Traffic shaping Scenario hands-on 1 Settings-03/12 4 Add a pipe object for inbound FTP traffic, and we don’t have to set anything in the tag of “Pipe limits”
2007 May15 Traffic shaping Scenario hands-on 1 Settings-04/12 5 Add a pipe object for outbound FTP traffic, and we don’t have to set anything in the tag of “Pipe limits”
2007 May16 Traffic shaping Scenario hands-on 1 Settings-05/12 6 Add a pipe object for inbound HTTP traffic, and we shall set the total Kbps to limit the HTTP traffic
2007 May17 Traffic shaping Scenario hands-on 1 Settings-06/12 7 Add a pipe object for outbound HTTP traffic, and we shall set the total Kbps to limit the HTTP traffic
2007 May18 Traffic shaping Scenario hands-on 1 Settings-07/12 8 Add a pipe object for: 1.marking the total downstream commit rate. 2.pointing out the bandwidth for each precedence, in another words, it’s marking out how much token we will give for each precedence level.
2007 May19 Traffic shaping Scenario hands-on 1 Settings-08/12 9 Add a pipe object for marking the total upstream commit rate and also pointing out the bandwidth for each precedence level.
2007 May20 Traffic shaping Scenario hands-on 1 Settings-09/12 10 Under the Pipe Rule, we have to point out which one target, service and traffic flow shall be applying the Shaper. How to read the tab of Traffic Shaping in right page ? Outgoing FTP service (Forward Chain) which the traffic will flow to the First Pipe-- ftp-out and declare the precedence 1 first, then this traffic will take the token from Following Pipe--total-out. Vice versa for the traffic of Return FTP service. Outgoing traffic Step1 P 1 Step2 give p1 token
2007 May21 Traffic shaping Scenario hands-on 1 Settings-10/12 11 Under the Pipe Rule, we have to point out which one target, service and traffic flow shall be applying the Shaper.
2007 May22 Traffic shaping Scenario hands-on 1 Settings-11/12 12 Under the Pipe Rule, we shall mark the other services to precedence level “0”, let those services compete with each other under the precedence level zero.
2007 May23 Traffic shaping Scenario hands-on 1 Settings-12/12 13 Below is an overview of pipe rule sets. The theory of operation is the same with the “IP rules”, it also following the rule of “first trigger first go ”. So based on the below rule’s order, you can’t put the pipe index 3 to the index 1 because of the original index 1 won’t be triggered anymore.
2007 May24 Traffic shaping Scenario hands-on 1 ISP HTTP/FTP server GW: Network: /24 Upstream commit rate is 500 kilobits/per sec Downstream commit rate is 500 kilobits/per sec 1. Insure the HTTP CR to 200 kbps for bi-direction traffic. (Marking the HTTP traffic to precedence 7 (highest priority) ). HTTP have no Utilizing the rest of bandwidth. 2. Setting the 400 kbps in precedence 1 for FTP bi-direction traffic. When the FTP token is running out, the part of overflow can flow to precedence 0 to compete with other services, it’s so-called “utilizing remaining bandwidth ”.
2007 May25 Traffic shaping Traffic flow 1/5-Http-download 1. Check IP rules 2. Pipe rules Triggered
2007 May26 Traffic shaping Traffic flow 2/5-Http-download
2007 May27 Traffic shaping Traffic flow 3/5-Http-download Following Pipe CLI
2007 May28 Traffic shaping Traffic flow 4/5-Http-download The bandwidth limitation to First pipe First Pipe Following Pipe
2007 May29 Traffic shaping Traffic flow 5/5-Http-download We don’t give the limitation to First Pipe First PipeFollowing Pipe
2007 May30 Traffic shaping-Sum up the traffic flow IP rule pipe rule set precedence for each service based on 1.use from default first pipe 2. fixed precedence setting 3. Map IP DSCP (TOS) pipe pipe chain (if required) prioritize packets in memory queue packet outgoing Note. the traffic shaper will buffer and delay packets when the speed specified in the pipe is reached. If the buffers get full we remove the longest and the lowest precedence packet when a new packet arrive.
2007 May31 Traffic Shaping How to observe the traffic shaping status The relative command: Pipe [pipename] Showing the specific pipe status, in common way we always showing the overall pipe object for checking the status easily. Pipe –users Showing the status of the pipe’s overall usage.