




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Support for QoS (TOS/DSCP, WMM, 802.1p)Table of Contents1. Introduction on QoS1. Layer 2: IEEE 802.1p for Ethernet2. Layer 2: WMM3. Layer 3: DSCP4. Layer 3: Other2. Availability1. Summary2. Linux3. MacOS X4. Windows and Windows Mobile5. Symbian S60 3rd Ed3. Objective4. Design1. Portable High Level API2. Fine Grained Control API5. Limitations6. Using QoS in PJSIP Applications1. PJSUA-LIB2. Low Level Transports7. ReferencesThis article describes the QoS support in PJSIP and how to use it.Introduction on QoSQoS settings are available for both Layer 2 and Layer 3 of TCP/IP protocols:Layer 2: IEEE 802.1p for EthernetIEEE 802.1p tagging will mark frames sent by a host for prioritized delivery using a 3-bit Priority field in the virtual local area network (VLAN) header of the Ethernet frame. The VLAN header is placed inside the Ethernet header, between the Source Address field and either the Length field (for an IEEE 802.3 frame) or the EtherType field (for an Ethernet II frame).Layer 2: WMMAt the Network Interface layer for IEEE 802.11 wireless, the Wi-Fi Alliance certification for Wi-Fi Multimedia (WMM) defines four access categories for prioritizing network traffic. These access categories are (in order of highest to lowest priority) voice, video, best-effort, and background. Host support for WMM prioritization requires that both wireless network adapters and their drivers support WMM. Wireless access points (APs) must have WMM enabled.Layer 3: DSCPAt the Internet layer, you can use DifferentiatedServices/Diffserv?and set the value of the Differentiated Services Code Point (DSCP) in the IP header. As defined in RFC 2472, the DSCP value is the high-order 6 bits of the IP version 4 (IPv4) TOS field and the IP version 6 (IPv6) Traffic Class field.Layer 3: OtherOther mechanisms exist (such as RSVP, IntServ) but this will not be implemented.AvailabilitySummaryThe following table summarizes the availability/accessability of various QoS settings on platforms that PJSIP supports. XXX is supported row shows whether the OS is able to set that QoS setting. Whether that setting can be controlled programmatically depends on XXX is user settable row. For example, on Windows Mobile 6 (WM6), both DSCP and WMM priority can be changed by the OS, but these settings are applied based onIP_DSCP_TRAFFIC_TYPEand user (i.e. PJLIB) cannot directly change the DSCP and WMM prio settings.Win2k/olderXP, Vista, WM2003, WM5WM6Symbian S60LinuxMacOS XiPhone1)High level APIYesNoYesYesYesYesYesAPI backendqos_bsd.c2)qos_dummy.cqos_wm.cqos_symbian.cppqos_bsd.cqos_bsd.cqos_bsd.cDSCP is supportedYesNoYesYesYesYesYesDSCP is user settableYesNoNoYesYesYesYesWMM prio is supportedNoNoYesYesNoNoNoWMM prio is user settableNoNoNoNoNoNoNoSO_PRIORITY is supportedNoNoNoNoYesYesYesSO_PRIORITY is settableNoNoNoNoYesYesYesNotes:1) iPhone availability is assumed based on MacOS X2) On win32, sock_qos_dummy.c is used by default. SetPJ_QOS_IMPLEMENTATIONtoPJ_QOS_BSDto enable the use of sock_qos_bsd.c.LinuxDSCP is available via IP TOS option.Ethernet 802.1p tagging is done by settingsetsockopt(SO_PRIORITY)option of the socket, then with theset_egress_map optionof thevconfig utilityto convert this to set vlan-qos field of the packet.WMM is not known to be available.MacOS XDSCP is available via IP TOS option.Windows and Windows Mobile(Its a mess!)DSCP is settable withsetsockopt()on Windows 2000 or older, but Windows would silently ignore this call on WinXP or later, unless administrator modifies the registry. On Windows 2000, Windows XP, and Windows Server 2003, GQoS (Generic QoS) API is the standard API, but this API may not be supported in the future. On Vista and Windows 7, the is a new QoS2 API, also known as Quality Windows Audio-Video Experience (qWAVE).IEEE 802.1p tagging is available via Traffic Control (TC) API, available on Windows XP SP2, but this needs administrator access. For Vista and later, its in qWAVE.WMM is available for mobile platforms on Windows Mobile 6 platform and Windows Embedded CE 6, viasetsockopt(IP_DSCP_TRAFFIC_TYPE). qWAVE supports this as well.Symbian S60 3rd EdBoth DSCP and WMM is supported viaRSocket:SetOpt()with will set both Layer 2 and Layer 3 QoS settings accordingly.ObjectiveThe objective of this ticket is to add new API to PJLIB socket API to enable manipulation of the QoS parameters above in a uniform and portable manner.DesignBased on the above, the following API is proposed.Declare the following standard traffic types.typedef enum pj_qos_type PJ_QOS_TYPE_BEST_EFFORT, PJ_QOS_TYPE_BACKGROUND, PJ_QOS_TYPE_VIDEO, PJ_QOS_TYPE_VOICE, PJ_QOS_TYPE_CONTROL pj_qos_type;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:PJLIB Traffic TypeIP DSCPWMM802.1pBEST_EFFORT0x00BE (Bulk Effort)0BACKGROUND0x08BK (Bulk)2VIDEO0x28VI (Video)5VOICE0x30VO (Voice)6CONTROL0x38VO (Voice)7There are two sets of API provided to manipulate the QoS parameters.Portable High Level APIThe first set of API is:/ Set QoS parametersPJ_DECL(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, pj_qos_type val);/ Get QoS parametersPJ_DECL(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, pj_qos_type *p_val);The API will set the traffic type according to the DSCP class, forbothLayer 2 and Layer 3 QoS settings, where its available. If any of the layer QoS setting is not settable, the API will silently ignore it. Ifbothlayers are not setable, the API will return error.The API above is the recommended use of QoS, since it is the most portable across all platforms.Fine Grained Control APIThe second set of API is intended for application that wants to fine tune the QoS parameters.The Layer 2 and 3 QoS parameters are stored inpj_qos_paramsstructure:typedef enum pj_qos_flag PJ_QOS_PARAM_HAS_DSCP = 1, PJ_QOS_PARAM_HAS_802_1_P = 2, PJ_QOS_PARAM_HAS_WMM = 4 pj_qos_flag;typedef enum pj_qos_wmm_prio PJ_QOS_WMM_TYPE_BULK_EFFORT_PRIO, PJ_QOS_WMM_TYPE_BULK_PRIO, PJ_QOS_WMM_TYPE_VIDEO_PRIO, PJ_QOS_WMM_TYPE_VOICE_PRIO pj_qos_wmm_prio;typedef struct pj_qos_params pj_uint8_t flags; / Determines which values to / set, bitmask of pj_qos_flag pj_uint8_t dscp_val; / DSCP value to set pj_uint8_t so_prio; / SO_PRIORITY value pj_qos_wmm_prio wmm_prio; / WMM priority value pj_qos_params;The second set of API with more fine-grained control over the parameters are:/ Retrieve QoS params for the specified traffic typePJ_DECL(pj_status_t) pj_qos_get_params(pj_qos_type type, pj_qos_params *p);/ Set QoS parameters to the socketPJ_DECL(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, const pj_qos_params *p);/ Get QoS parameters from the socketPJ_DECL(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, pj_qos_params *p);Important:Thepj_sock_set/get_qos_params()APIs are not portable, and its probably only going to be implemented on Linux. Application should always try to usepj_sock_set_qos_type()instead.LimitationsWin32 currently is not be implemented.Using QoS in PJSIP ApplicationsPJSUA-LIBOn PJSUA-LIB, QoS parameters have been added topjsua_transport_config. Please seepjsua_transport_config referencefor more info.ExamplesTo set QoS of RTP/RTCP traffic toVoicetype (this will activate the appropriate DSCP, WMM, and SO_PRIORITY settings, if the OS supports it): / Media transport setting is configurable on per account basis pjsua_acc_config acc_cfg; pjsua_acc_config_default(&acc_cfg); / Set account settings . / Set media transport settings (listening start port etc) according to app settings . / Set media transport traffic type to Voice acc_cfg.rtp_cfg.qos_type = PJ_QOS_TYPE_VOICE; / Create account with this config pjsua_acc_add(&acc_cfg, .);To tag SIP transport traffic with a specific DSCP value (in this case, DSCP CS3 or value 24). Note that not all pla
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 惯性测量基本原理课件
- 情感配音基础知识培训课件
- 四川省南充市阆中中学2026届高二化学第一学期期末复习检测模拟试题含答案
- 患者安全知识培训课件
- 父亲节策划方案
- 秋期小班个人工作方案
- “好书伴我成长”主题班会活动的解决方案
- 学校常规管理活动方案
- 水利分类考试题及答案
- 护卫支队考试题及答案
- 医院综合门诊部综合管理体系建设
- 2025年中医师承出师考试题库
- 2025年宜昌市猇亭区招聘化工园区专职工作人员(6人)笔试备考试题及答案详解(夺冠)
- uom无人机考试题库及答案2025
- 预防接种基础知识课件
- 护栏生产及安装方案(3篇)
- 厂区参观流程规范
- 污水厂培训课件
- 科协单位涉密管理制度
- 夏季安全生产试题及答案
- 体育教师专业考试试题及答案
评论
0/150
提交评论