Computer Network Tutorial: Policing and Shaping

beginner
11 min

Computer Network Tutorial: Policing and Shaping

Welcome to our comprehensive guide on Policing and Shaping, two essential concepts in the realm of computer networking! šŸŽÆ

Understanding Policing and Shaping

In this lesson, we'll delve into the world of traffic control in computer networks. We'll discuss Policing and Shaping, which are used to manage network traffic and ensure quality of service (QoS).

šŸ“ Note: Policing and Shaping are crucial for maintaining a stable and efficient network, especially in situations with limited bandwidth or multiple users.

What is Policing?

Policing is the process of enforcing traffic conformance to a specific contract or service level agreement (SLA). It ensures that incoming traffic complies with the predefined parameters, such as maximum bit rate, maximum burst size, and minimum inter-arrival time.

šŸ’” Pro Tip: Policing helps prevent network congestion by discarding excess packets that violate the defined parameters.

What is Shaping?

Shaping, on the other hand, is the process of slowing down the traffic to match the agreed-upon rate before it's sent out onto the network. Shaping helps prioritize and manage network traffic to maintain quality of service (QoS).

šŸ’” Pro Tip: Shaping helps ensure that the network can handle the traffic and prevents excessive bandwidth utilization by slowing down the traffic flow.

Practical Examples

Let's dive into some practical examples to help you understand Policing and Shaping better.

Policing Example

c
// Simple example of policing in Cisco IOS interface FastEthernet0/0 service-policy output POLICING_RATE ! policy-map POLICING_RATE class class-default police cir 10000000 conform-action transmit exceed-action drop

In this example, the service-policy output POLICING_RATE command applies the policing policy to the FastEthernet0/0 interface. The policy-map POLICING_RATE creates a policy map called POLICING_RATE with a single class class-default. The police command sets the committed information rate (CIR) to 10 Mbps, which is the maximum bit rate. The conform-action transmit states that traffic that conforms to the defined rate will be transmitted, and exceed-action drop indicates that excess traffic will be dropped.

Shaping Example

c
// Simple example of shaping in Cisco IOS interface FastEthernet0/0 service-policy output SHAPING_RATE ! policy-map SHAPING_RATE class class-default shape average 5000000

In this example, the service-policy output SHAPING_RATE command applies the shaping policy to the FastEthernet0/0 interface. The policy-map SHAPING_RATE creates a policy map called SHAPING_RATE with a single class class-default. The shape average 5000000 command sets the average bit rate to 5 Mbps, which is the shaping rate. This means that the traffic will be shaped to match the defined rate before it's sent out onto the network.

Quiz

Quick Quiz
Question 1 of 1

What is the main difference between Policing and Shaping?