Changes between Version 6 and Version 8 of Ticket #950


Ignore:
Timestamp:
Aug 19, 2009 9:09:31 AM (15 years ago)
Author:
bennylp
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #950

    • Property Type changed from defect to enhancement
  • Ticket #950 – Description

    v6 v8  
    6666 }}} 
    6767 
    68  The traffic classes above will determine how the Layer 2 and 3 QoS settings will be used. The mapping between the classes above to the corresponding Layer 2 and 3 settings are as follows: 
     68 The traffic classes above will determine how the Layer 2 and 3 QoS settings will be used. The standard mapping between the classes above to the corresponding Layer 2 and 3 settings are as follows: 
    6969 
    70  || PJLIB Traffic Type    || IP DSCP || WMM* || 802.1p  || 
    71  || BEST_EFFORT || 0x00    || BE   ||   0    || 
    72  || BACKGROUND  || 0x08    || BK   ||   2    || 
    73  || VIDEO       || 0x28    || VI   ||   5    || 
    74  || VOICE       || 0x30    || VO   ||   6    || 
    75  || CONTROL     || 0x38    || VO   ||   7    || 
     70 || PJLIB Traffic Type    || IP DSCP || WMM || 802.1p  || 
     71 || BEST_EFFORT || 0x00    || BE (Bulk Effort) ||   0    || 
     72 || BACKGROUND  || 0x08    || BK (Bulk)  ||   2    || 
     73 || VIDEO       || 0x28    || VI (Video)   ||   5    || 
     74 || VOICE       || 0x30    || VO (Voice)   ||   6    || 
     75 || CONTROL     || 0x38    || VO (Voice)   ||   7    || 
    7676 
    77  *: WMM acronyms: 
    78  - BE: Bulk effort priority 
    79  - BK: Bulk priority 
    80  - VI: Video priority 
    81  - VO: Voice priority 
    82  
    83  Application applies the traffic class to a socket via this new APIs: 
     77 There are two sets of API provided to manipulate the QoS parameters. The first set is: 
    8478 
    8579 {{{ 
     80 // Set QoS parameters 
    8681 PJ_DECL(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, 
    8782                                           pj_qos_type val); 
    8883 
     84 // Get QoS parameters 
    8985 PJ_DECL(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, 
    9086                                           pj_qos_type *p_val); 
     
    9288 
    9389 The API will set the traffic type according to the DSCP class, for '''both''' Layer 2 and Layer 3 QoS settings, where it's available. If any of the layer QoS setting is not settable, the API will silently ignore it. If '''both''' layers are not setable, the API will return error. 
     90 
     91 The API above is the recommended use of QoS, since it is the most portable across all platforms. 
     92 
     93 The second set of API is intended for application that wants to fine tune the QoS parameters. 
     94 
     95 The Layer 2 and 3 QoS parameters are stored in {{{pj_qos_params}}} structure: 
     96 
     97 {{{ 
     98 typedef enum pj_qos_flag 
     99 { 
     100    PJ_QOS_PARAM_HAS_DSCP = 1, 
     101    PJ_QOS_PARAM_HAS_802_1_P = 2, 
     102    PJ_QOS_PARAM_HAS_WMM = 4 
     103 } pj_qos_flag; 
     104 
     105 typedef enum pj_qos_wmm_prio 
     106 { 
     107    PJ_QOS_WMM_TYPE_BULK_EFFORT_PRIO, 
     108    PJ_QOS_WMM_TYPE_BULK_PRIO, 
     109    PJ_QOS_WMM_TYPE_VIDEO_PRIO, 
     110    PJ_QOS_WMM_TYPE_VOICE_PRIO 
     111 } pj_qos_wmm_prio; 
     112 
     113 typedef struct pj_qos_params 
     114 { 
     115    pj_uint8_t      flags;    // Determines which values to  
     116                              // set, bitmask of pj_qos_flag 
     117    pj_uint8_t      dscp_val; // DSCP value to set 
     118    pj_uint8_t      so_prio;  // SO_PRIORITY value 
     119    pj_qos_wmm_prio wmm_prio; // WMM priority value 
     120 } pj_qos_params; 
     121 }}} 
     122 
     123 The second set of API with more fine-grained control over the parameters are: 
     124 
     125 {{{ 
     126 // Retrieve QoS params for the specified traffic type 
     127 PJ_DECL(pj_status_t) pj_qos_get_params(pj_qos_type type,  
     128                                        pj_qos_params *p); 
     129 
     130 // Set QoS parameters to the socket 
     131 PJ_DECL(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, 
     132                                             const pj_qos_params *p); 
     133 
     134 // Get QoS parameters from the socket 
     135 PJ_DECL(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, 
     136                                             pj_qos_params *p); 
     137 
     138 }}} 
     139 
     140 '''Important:''' 
     141  
     142 The {{{pj_sock_set_qos_params()}}} API is not portable, and it's probably only going to be implemented on Linux. Application should always try to use {{{pj_sock_set_qos_type()}}} instead. 
     143 
     144 
    94145 
    95146'''Limitations'''