
RTL8305SB 
2002/04/09 
46
Rev.1.0
7.3.8 QoS Function 
The RTL8305SB can recognize the QoS priority information of the incoming packets to give a different egress service priority. 
The RTL8305SB identifies the packets as high priority based on several types of QoS priority information that based on: 1) Port 
based priority; 2) 802.1p/Q VLAN priority tag; 3) TCP/IP's TOS/DiffServ (DS) priority field. These types of QoS are selected by 
hardware pins DisPortPri[4:0], DisTagPri and DisDSPri respectively upon reset or internal registers via SMI after reset. 
There are 2 priority queues, a high-priority queue and a low-priority queue, supported by the RTL8305SB to buffer high and 
low priority frames. The queue service rate is based on the Weighted Round Robin algorithm, the packet based service weight 
ratio of high-priority queue and low-priority queue can be set as 4:1, 8:1, 16:1 or "Always high priority first" by hardware pins 
QWeight[1:0] upon reset or internal register via SMI after reset. 
When Port based priority is applied, any packets received from the high priority port, which is set by DisPortPri[4:0], will be 
sent to the high priority queue of the destination port. 
When 802.1p VLAN tag priority applied, the RTL8305SB can recognize the 802.1Q VLAN tag frames and extract the 3-bit 
User_Priority information from the VLAN tag. The RTL8305SB sets the threshold of User_Priority as 3. Therefore, VLAN 
tagged frames with User_Priority value = 4~7 will be treat as high priority frames, other User_Priority values (0~3) as low 
priority frames (follows 802.1p standard). 
When TCP/IP's TOS/DiffServ(DS) based priority is applied, the RTL8305SB can recognize TCP/IP Differentiated Services 
Codepoint (DSCP) priority information from the DS-field defined on RFC2474. The DS field byte for the IPv4 is 
Type-of-Service (TOS) octet and for IPv6 is Traffic-Class octet. The recommended DiffServ Codepoint is defined in RFC2597 
to classify the traffic into different service classes. The RTL8305SB can extract the codepoint value of DS-field from IPv4 and 
IPv6 packets, and identify the priority of the incoming IP packet follows the definition as bellow:  
   High priority: whose DS-field = (EF ,expected forwarding:) 101110;   
                              (AF, Assured Forwarding:) 001010; 010010; 011010; 100010  
                              (Network Control:) 110000 and 111000. 
   Low priority: whose DS-field = others values. 
The VLAN tagged frame and 6-bit DS-field in IPv4 and IPv6 frame format are shown bellow: 
6 bytes 
DA 
6 byte 
SA 
2 byte 
81-00 
3 bits 
User-Priority 
( 0~3:Low-pri ; 4~7: High-pri ) 
---- 
Table 3: 802.1Q VLAN tag frame format 
6 bytes 
DA 
6 byte 
SA 
4 byte 
802.1Q Tag 
(optional) 
2 byte 
08-00 
4 bits 
Version  
IPv4= 0100  
4 bit 
IHL 
6 bits 
TOS[0:5] 
= DS-field  
---- 
6 bytes 
DA 
6 byte 
SA 
4 byte 
802.1Q Tag 
(optional)
Table 4: IPv4/6 frame format
Note: IPv6 refer to rcf2460 
2 byte 
08-00 
4 bits 
Version  
IPv6= 0110  
6 bits 
Traffic Class [0:5] 
=DS-field 
---- 
The RTL8305SB can automatically turn off 802.3x flow control and Back pressure flow control for 1~2 sec whenever the port 
receives VLAN-tag or TOS/DS high priority frames, the flow control is re-enabled when no priority frame is received during a 
1~2 sec duration. The hardware pin DisFCAutoOff upon reset or internal register via SMI after reset can enable this auto-turn 
off function. 
7.3.9 Insert/Remove VLAN Priority Tag 
When QoS function is enabled
, a tag can be inserted or removed on a per output port basis. The RTL8305SB will insert 
VLAN priority-tag (VID=0x000) for untagged frames only, or remove a tag for all types tagged frames. Port 4 can use two 
strapping pins upon reset or internal registers via SMI after reset to set Insert/Remove function. Other ports can use a serial 
EEPROM upon reset or internal registers via SMI after reset to set this function. For example: When P0IRTag[1:0]=10, the 
RTL8305SB will insert priority tag for untagged frame from Output High Queue (user priority field=0b111, CFI=0, 
VID=0x000) of Port0 and Low Queue of Port0 (user priority field=0b000, CFI=0, VID=0x000). When P0IRTag[1:0]=01, the