流量整形和治安
Traffic policing and traffic shaping are two similar approaches initiated to regulate the flow of traffic from one network to another. This is done in compliance to the traffic contract made between the networks. Traffic contract is an agreement made between two networks. It defines the kind of traffic to be transported and the performance requirements of that traffic, such as bandwidth and Quality of service. In traffic engineering, both traffic shaping and policing is widely used as a method of providing Quality of service, and are commonly applied at the edges of the network, but can also be applied at the traffic source.
什么是交通警务?
Traffic policing is the process of monitoring traffic in a network and taking steps to conform it to the agreed traffic parameters. It basically measures the flow of data and monitors each packet, and when a violation is found, it simply drops the packet. It marks each of the packets with a particular level of conformance (also called coloring). This continuous process helps to control the maximum rate of traffic sent or received on each interface in multiple priority levels. This is also known as classes of service.
Policing is done at many different levels in a network; it can be done at either port level or for Ethernet Service or a particular class of service. Traffic policing uses a special algorithm called “token bucket” algorithm for regulating the flow of traffic. It is a comprehensive mathematical model developed for controlling the maximum traffic rate allowed for an interface at a particular time. This has two basic components.
1)标记:Represents the permission to send a fixed number of bits from one network to another.
2)存储桶:一次容纳指定量的令牌。
操作系统在网络中运行,将令牌以一定的速度放入了存储桶中。当准备将其转发到另一个网络时,每个数据包进入网络将其从存储库相应地将其从数据包大小带到其数据包大小。当存储桶满足时,所有新到达的代币将被拒绝。这些被拒绝的令牌也无法用于将来的数据包。所有令牌都是根据交通协议中定义的峰值传输速率生成的。可用令牌的数量确定了通过数据包数据网络选择用于传输的数据包的数量。
There is several traffic policing mechanisms available for optimizing the policing such as traffic Single Rate Color Marker for Traffic Policing, Two-Rate Three-Color Marker for Traffic Policing, Percent-Based Policing, etc.
What is Traffic Shaping?
Traffic shaping is a technique used in traffic management for delaying some or all packets in order to confirm with a desired traffic data profile. Actually it is a form of rate limiting which works by monitoring and queuing IP packets in transition mode, in accordance with a number of parameters that are can be configured in advance. Thus, it allows implementing a specific policy that alters legacy way in which data is queued for transmission.
基本上,流量塑造根据两个原则起作用。第一个是根据配置的流量限制应用带宽限制,然后通过排队在带宽需求较低时将数据包排队以稍后发送。第二个原则是当数据包缓冲区满足时丢弃数据包。在这里,从这些数据包中选择了掉落的数据包,这些数据包负责创建“果酱”。同样,在交通警务中,塑造还优先考虑流量。相比之下,根据管理员的选择,将优先级排列。当较高优先级的流量大量增加,而通信线路已满,较低的优先流量在一段时间内暂时限制,以便为高优先级流量提供机会。
This task is typically implemented by treating a certain amount of traffic (the guaranteed amount of traffic in traffic contract) as higher priority traffic, and the traffic that exceeds this limit which have the same priority as any other traffic, then competes with the rest of the traffic which is non-prioritized.
Generally, good traffic shapers do not let to queue up large amounts of data when determining the exact traffic to be sent based on prioritization of traffic. They rather first make an attempt to measure the amount of prioritized traffic and based on that they limit the non prioritized traffic dynamically. Thus, it won’t disturb the throughput of the prioritized traffic at all.
Traffic Policing vs Shaping
•交通警务和塑造都使用令牌桶机构进行操作。
• Traffic policing is used for controlling traffic on inbound or outbound on an interface, whereas traffic shaping can be used only for controlling outbound traffic.
•交通警务和塑造都使用令牌桶机构进行操作。
• Traffic policing can be used inbound or outbound on an interface, whereas traffic shaping can be used for outbound traffic only.
•在这两种机制中,都需要衡量数据传输速率和接收速率,并根据交通合同的交通率采取行动。
•在警务中,它可以传播流量爆发,而交通构成则提供了平滑的数据包输出速率。
•塑形支持排队并提供足够的内存以缓冲延迟数据包,而警务则没有。
• A special scheduling function is needed for traffic shaping for later transmission of any number of delayed packets, while policing does not.
• In shaping, token values are configured in bits per second whereas in policing configured in bytes.
• Queuing in traffic shaping causes delaying; particularly creates very long queues, whereas policing Controls the output packet rate by dropping packets. This avoids the delay caused by packet queuing.
• In traffic shaping, token values are configured as bits per second whereas in policing it is configured as bytes per second.
发表评论