Configuring Cisco IOS-XE Routers: Class-Based Service Policies for Torrent Traffic Control
In this article, we will discuss how to configure a Cisco IOS-XE router to control torrent traffic and prevent it from disrupting other internet clients such as calls and web browsing. The router used in this example is a C1111-4p running IOS-XE 17.12.02.
Class-Based Service Policies
Class-Based Service Policies (CBSP) are used to classify and manage network traffic based on various parameters such as IP addresses, protocols, and ports. By creating a CBSP, we can control the bandwidth allocated to different types of traffic and ensure that critical applications receive the required bandwidth.
Configuring CBSP for Torrent Traffic Control
To configure CBSP for torrent traffic control, we need to follow the steps below:
- Create a class map to match torrent traffic
- Create a policy map to set the bandwidth limit for torrent traffic
- Apply the policy map to the interface
Step 1: Create a Class Map
The first step is to create a class map to match torrent traffic. In this example, we will use the BitTorrent protocol, which uses TCP port 6881-6889. We will create a class map named "class-torrent" to match this traffic.
Router(config)# class-map match-any class-torrent
Router(config-cmap)# match protocol bittorrent
Router(config-cmap)# exit
Step 2: Create a Policy Map
The next step is to create a policy map to set the bandwidth limit for torrent traffic. We will create a policy map named "policy-torrent" and set the bandwidth limit to 10% of the total bandwidth.
Router(config)# policy-map policy-torrent
Router(config-pmap)# class class-torrent
Router(config-pmap-c)# bandwidth percent 10
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Step 3: Apply the Policy Map to the Interface
The final step is to apply the policy map to the interface. In this example, we will apply the policy map to the FastEthernet0/0 interface.
Router(config)# interface FastEthernet0/0
Router(config-if)# service-policy input policy-torrent
Router(config-if)# exit
Verification
To verify the configuration, we can use the "show policy-map interface" command. This command will display the policy map applied to the interface and the class map match statistics.
Router# show policy-map interface FastEthernet0/0
FastEthernet0/0
Service-policy input: policy-torrent
Class-map: class-torrent (match-any)
Match: protocol bittorrent
10 packets, 460 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
20 packets, 1040 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Policy Map policy-torrent
Class class-torrent
Bandwidth Remaining: [10000000 bits/sec] [1250000 bytes/sec]
Bandwidth (%) 10
(pkts, bytes) 0, 0
(bps, pps) 0, 0
Class-map: class-default (match-any)
Match: any
10 packets, 460 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
20 packets, 1040 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Policy Map policy-torrent
Class class-torrent
Bandwidth Remaining: [9000000 bits/sec] [1125000 bytes/sec]
Bandwidth (%) 10
(pkts, bytes) 0, 0
(bps, pps) 0, 0
In this article, we have discussed how to configure a Cisco IOS-XE router to control torrent traffic and prevent it from disrupting other internet clients. We have created a class map to match torrent traffic, a policy map to set the bandwidth limit for torrent traffic, and applied the policy map to the interface. By following these steps, we can ensure that critical applications receive the required bandwidth and prevent torrent traffic from disrupting other internet clients.