Lab 4
Lab 4
Objective:
The objective of this experiment was Configure Traffic Policing/Shaping Configuring Traffic Engineering by using Policy based Routing
Overview of Policing and shaping: Shaping is a computer network management technique which is used to optimize or guarantee performance, increase usable bandwidth, improve latency for some of packets by delaying other kinds of packets that meet certain criteria. Traffic shaping is sometimes applied by traffic sources to ensure the traffic they send complies with a contract may enforce in the network by a policer. Mostly traffic shaping is used for network traffic engineering. When we have to implement the Quality of Service (QoS), one of the main features to consider is the ability to regulate the traffic flow. These tow method (Policing & Shapimg) can be independently or together to achieve required service. Token Bucket algorithm A token bucket is a formal definition of a transfer rate. It has three components: burst size, mean rate, and time interval (Tc). Mean rate (committed information rate (CIR)): It specifies how much data, on average, can be sent per time unit. Burst size (Conformed Burst) Also called the Committed Burst (Bc) size: It specifies in bits per burst how much can be sent within a given unit of time to not create scheduling concerns. The size of the Token Bucket is equal to Bc. Time interval: Also called the measurement interval, it specifies the time quantum in seconds per burst. Although the mean rate is generally represented as bits per second, any two values may be derived from the third by the relation shown as follows: Mean rate = Burst size /Time interval In a token bucket, tokens are put into the bucket at a certain rate. The bucket itself has a specified capacity. If the bucket fills to capacity, newly arriving tokens are discarded. Each token is permission for the source to send a certain number of bits into the network. To send a packet, the Lab4 Page 1
ELEC6181
regulator must remove from the bucket a number of tokens equal in representation to the packet size. If not enough tokens are in the bucket to send a packet, the packet either waits until the bucket has enough tokens or the packet is discarded or marked down. If the bucket is already full of tokens, incoming tokens overflow and are not available to future packets. Thus, at any time, the largest burst a source can send into the network is roughly proportional to the size of the bucket. Note that the token bucket mechanism used for traffic shaping has both a token bucket and a data buffer, or queue; if it did not have a data buffer, it would be a policer.
Matching Criteria
Traffic matching identifies the traffic of interest for rate limiting, precedence setting, or both. It can be configured with one the following parameters: Incoming interface All IP traffic IP precedence (defined by a rate-limit access list) MAC address (defined by a rate-limit access list) IP access list (standard and extended) Traffic shaper/policer provides configurable actions, such as send, drop, or set precedence when traffic conforms to or exceeds the rate limit.
Lab4
Page 2
ELEC6181
Conform and Exceed Actions
A policer/shaper uses a token bucket. Once a packet has been classified as conforming to or exceeding a particular rate limit, the router performs one of the following actions on the packet: TransmitThe packet is sent. DropThe packet is discarded. Set precedence and transmitThe IP Precedence (ToS) bits in the packet header are rewritten. The packet is then sent. You can use this action to either color (set precedence) or recolor (modify existing packet precedence) the packet. ContinueThe packet is evaluated using the next rate policy in a chain of rate limits. If there is not another rate policy, the packet is sent. Set precedence and continueSet the IP Precedence bits to a specified value and then evaluate the next rate policy in the chain of rate limits.
How a Traffic Policer or Shaper Works A traffic policer or shaper examines traffic received on an interface or a subset of that traffic selected by access list criteria. It then compares the rate of the traffic to a configured token bucket and takes action based on the result. For example, it will drop the packet or rewrite the IP precedence by resetting the type of service (ToS) bits. A token bucket measurement is used to measure traffic. Tokens are inserted into the bucket at the committed rate (CIR). The depth of the bucket is the burst size (Bc). Traffic arriving at the bucket when sufficient tokens are available is said to conform, and the corresponding number of tokens are Lab4 Page 3
ELEC6181
removed from the bucket. If a sufficient number of tokens are not available, then the traffic is said to exceed. Matching Criteria Traffic matching identifies the traffic of interest for rate limiting, precedence setting, or both. It can be configured with one the following parameters: Incoming interface All IP traffic IP precedence (defined by a rate-limit access list) MAC address (defined by a rate-limit access list) IP access list (standard and extended) Traffic shaper/policer provides configurable actions, such as send, drop, or set precedence when traffic conforms to or exceeds the rate limit. Conform and Exceed Actions A policer/shaper uses a token bucket. Once a packet has been classified as conforming to or exceeding a particular rate limit, the router performs one of the following actions on the packet: TransmitThe packet is sent. DropThe packet is discarded. Set precedence and transmitThe IP Precedence (ToS) bits in the packet header are rewritten. The packet is then sent. You can use this action to either color (set precedence) or recolor (modify existing packet precedence) the packet. Continuethe packet is evaluated using the next rate policy in a chain of rate limits. If there is not another rate policy, the packet is sent. Set precedence and continueSet the IP Precedence bits to a specified value and then evaluate the next rate policy in the
Setup
Check the router configurations. OSPF routing should be enabled on all routers and you should be able to access all router interfaces and hosts in the network. All router interfaces should be up in both physical and data link layers.
Lab4
Page 4
ELEC6181
Task A: Configure network topology Step 1: Configure serial interfaces speed as 256Kbps and queuing as FIFO.
Command R25-1#configure terminal R25-1(config)#interface serial0/x R25-1 (config-if)#clock rate 256000 R25-1 (config-if)#bandwidth 256 R25-1 (config-if)#^z x= 0, 1 Result These commands are used to configure the serial 0/0 and serial0/1 terminals and we set clock rate as 256000 and bandwidth as 256.
Step 1 : Check the routing paths from your router to all the other routers and write down the results in
the following table. You should use the following command:
Result By this we can trace the routes from our router to some other router.
Source router
Path
R25-1
R45-3
Lab4
Page 5
ELEC6181
R25-2 192.168.20.83
R25-3
192.168.20.99
Parameters Collector Time out Sample Interval Destination Port Request Payload Packet Interval No. of Packet s 150 Jitter Threshold
5000
10
UDP16400
160
20
250
5000
10
UDP50505
1024
100
50
250
Step 2: Start Voice, Video and FTP collector in IPM and check the traffic delays for a period of 5
minutes. Then capture real-time diagrams and stop the collectors.
Lab4
Page 6
ELEC6181
Lab4
Page 7
ELEC6181
Fig.2 video: Source-Destination Jitter (21 Msec) Destination-Source Jitter (1 Msec) Round-Trip Latency (1696 Msec)
Lab4
Page 8
ELEC6181
Fig.3 Voice Source-Destination Jitter (6 Msec) Destination-Source Jitter (1 Msec) Round-Trip Latency (29 Msec)
Task D: Configure traffic policing Step 1: Configure traffic policing to mark packets with the following DSCP values:
Mark FTP traffic up to 16Kbps with DSCP=2 and for more than that with DSCP=1 Mark Video traffic up to 48Kbps with DSCP=4 and for more than that with DSCP=3 Mark Voice traffic up to 32Kbps with DSCP=6 and for more than that with DSCP=5 For separation of different traffic types we are using following acess lists: R25-1(config)#Access-list 130 permit tcp 192.168.20.96 0.0.0.15 any eq ftp Lab4 Page 9
ELEC6181
R25-1(config)#Access-list 130 permit tcp 192.168.20.96 0.0.0.15 eq ftp-data any R25-1(config)#access-list 140 permit udp any any eq 16400 R25-1(config)#access-list 150 permit udp any any eq 50505 For traffic policing, the following commands should be executed on the specified routers: R25-1(config)#interface serial0/0 R25-1(config-if)#rate-limit output access-group 130 16000 2000 2000 conform-action set-dscp-continue 2 exceed-action set-dscp-continue 1 R25-1(config-if)#rate-limit output access-group 150 48000 2000 2000 conform-action set-dscp-transmit 4 exceed-action set-dscp-transmit 3 R25-1(config-if)#rate-limit output access-group 140 32000 2000 2000 conform-action set-dscp-continue 6 exceed-action set-dscp-continue 5
R25-1(config)#interface serial0/1 R25-1(config-if)#rate-limit output access-group 130 16000 2000 2000 conform-action set-dscp-continue 2 exceed-action set-dscp-continue 1 R25-1(config-if)#rate-limit output access-group 150 48000 2000 2000 conform-action set-dscp-transmit 4 exceed-action set-dscp-transmit 3 R25-1(config-if)#rate-limit output access-group 140 32000 2000 2000 conform-action set-dscp-continue 6 exceed-action set-dscp-continue 5 Task E: Monitor Network Performance Step 1:Start Voice, Video and FTP collectors and enter the following command to check the packet marking: R25-1#show interface serial0/x rate-limit Check the command output and append it to your report. Try to discuss various fields in the output. Stop the traffic collectors after you finish this step.
Lab4
Page 10
ELEC6181
Interface serial0/0:
Lab4
Page 11
ELEC6181
Interface serial0/1:
Lab4
Page 12
ELEC6181
Fig.1 FTP
Round Trip Latency (msec)=2454
Lab4
Page 13
ELEC6181
Fig.2 video: Source-Destination Jitter (12 Msec) Destination-Source Jitter (1 Msec) Round-Trip Latency (1112 Msec)
Lab4
Page 14
ELEC6181
Fig.3 voice: Source-Destination Jitter (1 Msec) Destination-Source Jitter (1 Msec) Round-Trip Latency (24 Msec)
Lab4
Page 15
ELEC6181
Routers Traversed
R25-1->R45-2->R45-3 ->R25-2
R25-2
WS-25-3
R25-3
WS-25-1
R25-3->R45-3->R45-1->R25-1
R25-3->R45-3 R45-3->R45-1
FTP traffic will be selected by using the access lists in step 2. You configure the corresponding route maps to conduct traffic by using the match and set statements. In match statements, packets are checked against specific conditions which in this case are the access lists. In set commands, nexthop-address is specified which is the address of the corresponding interface on the next router in the path. Enter the following commands in global configuration mode on the corresponding routers specified in Routers with Policy statements section of above table: R25-1(config-route-map)#route-map R25-1-map permit 10 R25-1(config-route-map)#match ip address 130 Lab4 Page 16
ELEC6181
R25-1(config-route-map)#set ip next-hop 10.0.15.10 R25-1(config-route-map)#exit
S0/1
(interface name)
S0/0
(10.0.15.10) (next hop address)
R25-1 router
R45-2 router
Step 2: Issue the following commands on the corresponding interfaces to assign route-maps to an interface. The interface should be chosen as the incoming interface for the preferred traffic which in this case is FTP R25-1(config)#interface s0/1 R25-1(config-if)#ip policy route-map R25-1-map Step 3 Excecute the debugging command for policy based routing as follows: R25-1#debug ip policy. Step 5 we took curves for Voice, Video and FTP
Lab4
Page 17
ELEC6181
Lab4
Page 18
ELEC6181
Fig.2 video: Source-Destination Jitter (21 Msec) Destination-Source Jitter (1 Msec) Round-Trip Latency (1112 Msec)
Lab4
Page 19
ELEC6181
Fig.3 voice: Source-Destination Jitter (19 Msec) Destination-Source Jitter (1 Msec) Round-Trip Latency (547 Msec)
Lab4
Page 20
ELEC6181
Q: Is there any improvement in FTP delay? Why? Ans: Yes, there is an improvement in FTP delay in Task F compared to Task C. It is clear of graph of FTP
of task F has less round trip latency (2480) compared to task C FTP round trip latency (7325). This is because in task C traffic management is a default i.e. FIFO. Thus it larger delay, because every packet were served in sequence. So thats why FTP data had to wait longer, so it results to larger delay. But here in Task F we were using priority as according to the DSCP bits. So thats why everything was scheduled according to DSCP priority bits which decreased the delay.
Q: Is there any improvement in Video delay? Why? Ans: Yes, there is an improvement in Video delay also in Task F as compared to Task C.
From the graphs: Task C Task F Source-Destination Jitter (21 Msec) Destination-Source Jitter (1 Msec) Round-Trip Latency (1112 Msec)
Source-Destination Jitter (21 Msec) Destination-Source Jitter (1 Msec) Round-Trip Latency (1696 Msec)
The video delay RTP in Task F is less as comparatively to Task C. This is because in Task C FIFO was used and there is no priority for video packets and it treat as common data and served when it turn had come. So thats why Video data suffer delays. But here in Task F we were using priority according to the DSCP bits. So thats why everything was scheduled according to DSCP priority bits which improved the video delays. DSCP values taken are as shown above.
Lab4
Page 21