2008年6月29日 星期日

IEEE802.1p QoS

端到端QoS技術    ASIC技術的高速發展使低端設備具備強大的QoS能力成為可能,網路的QoS開始從集中保證逐漸向端到端保證過渡。現在,網路邊緣設備已經可以根據埠、 MAC位址、VLAN資訊、IP位址甚至更高層的資訊來識別應用類型,為資料包打上優先順序標記(如修改IEEE802。1p或IPDiffServ 域),核心設備不用對應用進行識別,只需根據IPDiffServ和IEEE802。1P進行交換,並提供服務品質即可。這種智慧的QoS功能也是基於晶 片的64位元組以上的處理深度發展起來的。


基于端口的划分流量优先级服务

  交换机所有端口都支持两个优先级的队列:低优先级队列和高优先级队列,通过对端口

  进行优先级的划分,可以确保重要的应用能够优先得到服务。

  基于端口划分的流量优先级服务只对没有标记的数据帧起作用,基于IEEE802.1p标准来

  划分服务优先级只对标记的数据帧起作用。这两种划分方法互相补充,交换机都支持。

  但当使用两种标准时,只在当数据帧离开交换机时起作用。

  注:标记的数据帧指当采用IEEE802.1p/Q,ISL或其它技术时,当数据帧经过交换机时,

  会被交换机标记(增加标记的区域)。

關於IEEE802.1p QoS 設置

請問設置QOS的值是越大優先級越高還是小的級別高

越大優先級越高,優先級為0是最小的級別。



IEEE802.1p的運作原理

從上面這張圖我們可以很清楚看到
在正常封包格式中加入一個4 BYTES 的 TAG CONTROL INFO
叫做802.3ac標籤格式

在這個 4 BYTES的TAG中
前面 2 BYTES固定是 8100h
這個用意是告訴所有的網路設備
1.我是一個具備802.3ac標籤格式的封包
不是一個不標準的封包
請不要拋棄我

2.我是一個帶有802.1p/Q資訊的封包
請來讀相關的資訊並且根據設定的資訊辦事

看不懂8100h會把封包當不正常封包丟掉的設備就是不相容不支援802.1p/Q
看的懂8100h不會丟封包但卻不會照資訊辦事的網路設備就是相容802.1p/Q
看的懂8100h不會丟封包也會照資訊辦事的網路設備就是支援802.1p/Q
會特別寫出第2行的相容是因為在當初標準剛出來時
有些過渡性的產品就是這樣亂搞的

接下來我們來看後面 2 個 BYTES
前面 3 個 bits就是放IEEE802.1p設定資訊的地方
大家都知道 2 的 3 次方是 8
所以這裡總共可以表現出0-7共八個優先權等級
於是封包之間的優先權就被區分出來

當優先權被區分出來時
就要靠網路設備上的佇列來實現先後的順序
以上面這張圖為例
網路卡上有2個佇列
當封包內的802.1p資訊設定為0-3時就走一般佇列
當封包內的802.1p資訊設定為4-7時就走高優先權佇列
一般的網路設備都會有2個/4個/8個佇列就是為了實現這八個優先權等級
看到這兒各位看倌應該就了解整個IEEE802.1p的運作原理吧



IP Type of Service

This classification type is based on an exact match of the one-byte ToS/DSCP field contained in the IP header of a frame. The ToS (Type of Service) or DSCP (Diffserve Codepoint) value is defined by an 8-bit hexadecimal number between 0 and FF. Enter a value or click Select to open a window where you can generate a hex value. For information on how to generate a ToS or DSCP value, see ToS/DSCP Configuration window.

Type of Service can be used by applications to indicate priority and Quality of Service for each frame. The level of service is determined by a set of service parameters which provide a three way trade-off between low-delay, high-reliability, and high-throughput. The use of service parameters may increase the cost of service. In many networks, better performance for one of these parameters is coupled with worse performance on another. Except for very unusual cases, at most, two of the parameters should be set.

"IP precedence 使用前3bit; ToS 使用4-7 bit, 最后一位备用;"

"DSCP 使用0-5bit, 最后两位备用;"

For a ToS value, the 8-bit hexadecimal number breaks down as follows:

Bits 0-2: Precedence
Bit 3: 0=Normal Delay, 1=Low Delay
Bit 4: 0=Normal Throughput, 1=High Throughput
Bit 5: 0=Normal Reliability, 1=High Reliability
Bits 6-7: Explicit Congestion Notification

########################

0 1 2 3 4 5 6 7
+-----+-----+-----+-----+-----+-----+-----+-----+
| | | | | | |
| PRECEDENCE | D | T | R | 0 | 0 |
| | | | | | |
+-----+-----+-----+-----+-----+-----+-----+-----+

#########################

The precedence bits (bits 0-2) break down as follows:

111 - Network Control
110 - Internetwork Control
101 - CRITIC/ECP
100 - Flash Override
011 - Flash
010 - Immediate
001 - Priority
000 - Routine

The Network Control precedence designation is intended to be used within a network only. The actual use and control of that designation is up to each network. The Internetwork Control designation is intended for use by gateway originators only.

For a DSCP value, the value represents codepoints for two Differentiated Services (DS) Per-Hop-Behavior (PHB) groups called Expedited Forwarding (EF) and Assured Forwarding (AF). For more information on these PHB groups, refer to RFC 2597 and RFC 2598.

########################################################

在IP网络中,IPv4报文中有三种承载QoS优先级标签的方式,分别为基于二层的CoS字段(IEEE802.1p)的优先级、基于IP层的IP 优先级字段ToS优先级和基于IP层的DSCP(Differentiated Services Codepoint)字段优先级。每种优先级的定义如下:

  (1) IEEE802.1p优先级

  它是位于二层带标签的以太网帧的CoS字段,和VLAN ID在一起使用,在字节中的位置如下:

  其中:IEEE802.1p优先级:3bit(P2-P0)
  未用(CU):1bit
  VLAN ID:12bit(V11-V0)
   IEEE802.1p优先级值有8个(0-7),0优先级最低,7优先级最高。报文分为三种情况:带优先级和VLAN ID的标签报文,其优先级值是自身带的值;只带优先级的标签报文,此时VLAN ID为0,其优先级值是自身带的值;未带标签的报文,一般默认的优先级值为0,也可以进行更改指定新的优先级。

  (2) IP优先级

  它由IP分组报头中的服务类型(ToS)字节中的3位组成,其在字节中的位置如下:

  P2 P1 P0 T3 T2 T1 T0 CU

  其中:IP优先级:3bit(P2-P0)
  服务类型(ToS):4bit(T3-T0)
  未用(CU):1bit
  IP优先级值有8个(0-7),0优先级最低,7优先级最高。在默认情况下,IP优先级6和7用于网络控制通讯使用,不推荐用户使用。ToS字段的服务类型未能在现有的IP网络中普及使用。

  (3) DSCP优先级

  它由IP分组报头中的6位组成,使用的是ToS字节,因此在使用DSCP后,该字节也被称为DSCP字节。其在字节中的位置如下:

  DS5 DS4 DS3 DS2 DS1 DS0 CU CU

  其中:DSCP优先级:6bit(DS5-DS0)
  未用(CU):2bit
  DSCP优先级值有64个(0-63),0 优先级最低,63优先级最高。事实上DSCP字段是IP优先级字段的超集,DSCP字段的定义向后与IP优先级字段兼容。目前定义的DSCP有默认的 DSCP,值为0;类选择器DSCP,定义为向后与IP优先级兼容,值为(8,16,24,32,40,48,56);加速转发(EF),一般用于低延迟 的服务,推荐值为46(101110);确定转发(AF),定义了4个服务等级,每个服务等级有3个下降过程,因此使用了12个DSCP值 ((10,12,14),(18,20,22),(26,28,30),(34,36,38))。

#############################################

IP precedence和DSCP代码对照表


原文連結

http://drupal.morezman.com/?q=node/28

http://wordpress.morezman.com/?p=93
http://blog.chinaitlab.com/html/72/272272-160029.html
http://www.juniper.net/techpubs/software/junos/junos76/swconfig76-network-interfaces/html/interfaces-summary153.html

沒有留言:

張貼留言