Categories ArticlesNetworking

Traffic shaping 101: How to avoid rush hours on your network

Have you ever been on a VoIP call and faced disturbances, incoherent conversations, or even dropped calls? Well, you know the frustration that comes from such calls. From an organization’s standpoint, it also leads to productivity loss, misinformation, and a possible loss to its reputation. Why do these problems occur? At the heart of any VoIP call or for that matter, any application is the network, and all data pass through it. Elementary, right? But what’s important to understand is that the rate of data transfer is determined by a host of factors such as the network bandwidth, physical distance between the source and destination computers, number of devices that have to be hopped, and more. Out of these, network bandwidth is an important consideration as it can set right the other factors to a large extent. This means, if you have complete control over your bandwidth, you can determine to a large extent, the rate of data transmission through your network. So obviously, the next question is how can you improve network bandwidth to increase the rate of data transfer. Though there are many techniques available to optimize your network and get more out of your bandwidth, traffic shaping is one of the easiest and most popular choices.

What is traffic shaping?

Traffic shaping is a technique for managing your network bandwidth to optimize your network’s performance, increase the usability of your bandwidth by giving priority to certain kinds of data packets, and to reduce latency. It can be customized to meet the specific requirements of your organization or an application. Broadly speaking, there are two ways to shape the traffic on your network: application-based traffic shaping and route-based traffic shaping.

Application-based shaping

You can change the settings on your router to set higher priority for certain applications, so its data packets are sent quickly. For example, let’s say there are two types of applications that use your network bandwidth — a VoIP and a browser. Both the applications transmit data in packets, but the data packets of your VoIP must stay together to have a coherent conversation and so they should be given a higher priority.

You can set up your network to give priority to these voice data packets, so the other data packets are stopped until the voice packets are fully transmitted. Another way is to dedicate a part of your network for voice calls, so these packets are transmitted smoothly and quickly. Imagine this scenario to a transit lane on a highway that’s dedicated to emergency vehicles. Just as no other vehicle can take this lane even when there are no emergency vehicles, no other data packets can take up this bandwidth even when there are no voice calls. But this can reduce the usability of your bandwidth and this is why most organizations prefer to go with the priority-setting option.

There are many limitations to application-based shaping, with the prominent one being the use of encryption to circumvent this shaping.

Route-based shaping

The other option is route-based shaping based on the source of the packets and their intended destination. This type of shaping is mostly used to prevent applications from circumventing the application-based shaping policies.

Why do you need traffic shaping?

Now that you know what is traffic shaping, why do you need it and where can you use it?

Traffic shaping helps you to prioritize the transfer of your data packets, so you can give more importance to the data packets of critical applications over other data. This prioritization becomes necessary when you’re grappling with limited bandwidth and want to make the most of what you have.

Traffic shaping also helps ensure a high quality of transmission for certain critical applications and is an absolute necessity for a network firewall. Other reasons to use traffic shaping are:

  • It is necessary to meet the service-level agreements (SLAs) of your contracts.
  • It may be used by Internet service providers (ISPs) to limit the use of resources by certain peer sharing applications.
  • Traffic shaping is considered to be one of Internet Traffic Management best practices.
  • It is necessary to ensure that the transmission rate does not go over the configured rate of transmission.
  • It delays the sending of packets to curb the use of certain applications.
  • Shaping helps to normalize traffic flow during peak times to avoid overflows.

How to implement traffic shaping?

Different device manufacturers implement traffic shaping differently, but in general, you can set it up through your router. The key here is to determine the rate of transmission. Let’s understand this with an example.

Let’s say a network is capable of sending 2Mbps per second, which is 2,000,000 bits per second. But your ISP has only given you a bandwidth of 1Mbps per second or 1,000,000 bits per second. So, your ISP will have to cut its bandwidth by half to ensure that you get what you pay for. But in reality, it is not possible to make an interface transmit at a slower pace than its line speed, which is 2Mbps here. So, to achieve this objective, the ISP will do a start-stop operation where it will send data for a while, stop it for some time, and restart it again. In this case, it could send 500,000 bits, stop, and send the remaining 500,000 bits after 0.5 seconds or 500 milliseconds to ensure that the eventual rate of transmission is only 1Mbps. It also ensures that all 1,000,000 reach the end-user at the same time, but at a slower rate.

When you have to set this traffic shaping rate for every application, it can be cumbersome to calculate the numbers. But don’t worry, as there is a simple formula for this.

Committed information rate (CIR in bits per second) = burst size (in bits per second) / time interval in seconds. A quick explainer:

  • CIR is the rate you want to achieve, which is 1Mbps in the above example.
  • Burst size is the number of bits you should send at one-go to maintain the CIR
  • Time interval is the frequency of transmission.

If you take the above example, the CIR is 500,000/0.5, which is equal to 1,000,000. Based on this formula and your bandwidth size, you can set the transmission rate for different applications in your router. It is important to keep in mind that the implementation will vary based on your router. It is best to check with your router’s manufacturer or use third-party help to set this up, especially if you’re trying it for the first time.

Traffic shaping and traffic policing

While on this topic, it’s important to know the difference between traffic shaping and policing. First off, they are not synonyms but different functions with different outputs. In policing, the data packets are sent out in bursts and when the traffic reaches the maximum rate, the remaining packets are dropped. This creates an uneven flow of data and may not be ideal for applications like VoIP. If you plot this transmission on a graph, you’ll see many crests and troughs in it. Traffic shaping, on the other hand, slows down the rate of transmission without dropping any packet and this is why the output is a smooth curve. In other words, shaping delays packets by holding them in a queue while policing drops packets when they exceed the limit. Also, shaping is not applicable for inbound packets while policing works for both incoming and outgoing packets. In policing, there is no delay in transmission as the output rate is managed by packet drops while shaping never drops packets, but only delays them in a queue. Since they are two different techniques altogether, they work well in different situations. As a user, you can determine which works better in each situation.

Traffic shaping is one of the most popular techniques for network optimization and it helps to get more out of your bandwidth. By delaying traffic, it ensures that critical applications get priority over others and this makes it a highly useful technique for organizations and ISPs.

Featured image: Shutterstock

Lavanya Rathnam

Lavanya Rathnam is a professional writer of tech and financial blogs. Creative thinker, out of the boxer, content builder and tenacious researcher who specializes in explaining complex ideas to different audiences.

Share
Published by
Lavanya Rathnam

Recent Posts

Microsoft Teams guest access: How to enable and manage it

Two of the main factors that affect the total cost of an organization’s Microsoft 365…

15 hours ago

Samsung Galaxy Unpacked 2020: Everything you need to know

Samsung rolled out the all-new Galaxy Z Fold 2, Note 20, Note 20 Ultra handsets…

18 hours ago

SAN vs. NAS: Detailed comparison of these two storage technologies

SAN and NAS provide dedicated storage for a group of users using completely different approaches…

21 hours ago

Generation 1 virtual machines: Modernize them and bring them up to date

In many companies, Generation 1 virtual machines have been superseded by Gen 2 VMs. But…

2 days ago

Free VPNs from Hong Kong with ‘no-log policy’ experience data leak

With these free VPNs based in Hong Kong, you may not be paying any money…

2 days ago

Azure DevOps tips and tricks: Using built-in features

These Azure DevOps tips and tricks come fresh from the field where they have been…

2 days ago