{"id":954,"date":"2011-09-07T22:39:00","date_gmt":"2011-09-07T14:39:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=954"},"modified":"2023-11-07T22:46:38","modified_gmt":"2023-11-07T14:46:38","slug":"cisco-qos-for-voip","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/954","title":{"rendered":"Cisco QoS for VoIP"},"content":{"rendered":"\n<p><strong>Cisco IP Phone models<\/strong><br>Most contain a 3port switch<br><strong>The voice and user PC ports:<\/strong><br>\u3000connecting to the user&#8217;s PC, the internal VoIP data stream<br>\u3000always function as access-mode switch ports<br><strong>The uplink ports<\/strong><br>\u3000connects to the upstream switch<br>\u3000to operate as an 802.1Q trunk or as an access-mode (single VLAN) port.<br>\u3000If an 802.1Q trunk is needed, a special-case trunk automatically is negotiated by the DTP and CDP<br><strong>structure<\/strong><br>\u3000[cisco switch] &#8212; [cisco ip phone] &#8212; [pc]<br>\u3000When a PC is connected to the PC switch port on an IP Phone,The Catalyst switch instructs the IP Phone how to trust the PC QoS information.<br>\u3000cisco switch\u5fc5\u9808\u555f\u52d5cdp\u53caportfast\u4ee5\u652f\u63f4cisco ip phone<br>\u3000pc\u9023\u5230switch\u4e0d\u6703\u611f\u89ba\u5230ip phone\u5b58\u5728<br><strong>code:<\/strong><br>\u3000G.711 , G.729<\/p>\n\n\n\n<p>\u8a2d\u5b9aVVID(voice vlan id)<br><strong>(config-if)# switchport voice vlan &lt; vlan-id | dot1p | untagged | none&gt;<\/strong><br>\u9810\u8a2d\u662f\u95dc\u9589<br>\u6b64vlan\u5c6c\u65bcAuxiliary VLANs<br>\u53ea\u80fd\u4ee5access mode\u8a2d\u5728layer2 interface<br>\u6703\u5efa\u7acb\u7279\u6b8a\u7684802.1q trunk<br>qos\u6839\u64damls qos turst\u7684\u8a2d\u5b9a,\u9810\u8a2d\u662f0<br><strong>vlan-id<\/strong>:\u4f7f\u7528trunk,<br>\u3000\u6307\u5b9a\u8a72vlan\u70bavoice vlan,<br>\u3000pc data\u5728native vlan\u4e0d\u88abtag,\u7528802.1p\u505aqos<br><strong>dot1q<\/strong>:\u4f7f\u7528trunk,<br>\u3000\u6307\u5b9avlan0\u70bavoice vlan,<br>\u3000pc data\u5728native vlan\u4e0d\u88abtag,\u7528802.1p\u505aqos<br><strong>untagged<\/strong>:\u4f7f\u7528trunk,<br>\u3000\u6307\u5b9anative vlan\u70bavoice vlan,<br>\u3000pc data\u548cvoice data\u5728native vlan\u4e0d\u88abtag<br><strong>none(default)<\/strong>:\u4e0d\u4f7f\u7528trunk,<br>\u3000\u985e\u4f3cuntagged<br>ps:<br>The Port Fast feature is automatically enabled when voice VLAN is configured. When you disable voice VLAN, the Port Fast feature is not automatically disabled.<br>ps:<br>You cannot configure static secure or sticky secure MAC addresses on a voice VLAN.<\/p>\n\n\n\n<p>ex:<br>\u6307\u5b9avlan50\u70bavoice vlan,vlan10\u7d66pc data<br>(config)# interface gigabitethernet1\/0\/1<br>(config-if)# switchport access vlan 10<br>(config-if)# switchport trunk native vlan 20<br>(config-if)# switchport voice vlan 50<br>(config-if)# switchport mode access<\/p>\n\n\n\n<p>\u986f\u793aVVID\u72c0\u614b<br><strong>#show interface switchport<\/strong><br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Switch# show interfaces fastEthernet 1\/0\/1 switchport<br>Name: Fa1\/0\/1<br>Switchport: Enabled<br>Administrative Mode: dynamic auto<br><strong>Operational Mode: static access<\/strong><br>Administrative Trunking Encapsulation: negotiate<br>Operational Trunking Encapsulation: native<br>Negotiation of Trunking: On<br><strong>Access Mode VLAN: 10 (VLAN0010)<\/strong><br>Trunking Native Mode VLAN: 1 (default)<br>Administrative Native VLAN tagging: enabled<br><strong>Voice VLAN: 110 (VoIP)<\/strong><br>Administrative private-vlan host-association: none<br>Administrative private-vlan mapping: none<br>Administrative private-vlan trunk native VLAN: none<br>Administrative private-vlan trunk Native VLAN tagging: enabled<br>Administrative private-vlan trunk encapsulation: dot1q<br>Administrative private-vlan trunk normal VLANs: none<br>Administrative private-vlan trunk private VLANs: none<br>Operational private-vlan: none<br>Trunking VLANs Enabled: ALL<br>Pruning VLANs Enabled: 2-1001<br>Capture Mode Disabled<br>Capture VLANs Allowed: ALL<br>Protected: false<br>Unknown unicast blocked: disabled<br>Unknown multicast blocked: disabled<br>Appliance trust: none<\/p>\n\n\n\n<p><br>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<\/p>\n\n\n\n<p><br><strong>QOS Trust Boundary<\/strong><br>\u5b9a\u7fa9:<br>The perimeter formed by switches that do not trust incoming QoS;<br>trust boundary\u7531\u6700\u5916\u5c64\u7684turst device\u7d44\u6210<br>\u529f\u80fd:<br>a point in the network where decisions about CoS markings on incoming packets are made.<br>\u7d44\u6210\u8a2d\u5099:<br>trust device,\u53efturst\u7684classifies packet<br>\u4f48\u7f72:<br>1\u908a\u754c\u4e0d\u5efa\u8b70\u5728L3 device\uff0c\u56e0\u70ba\u6703\u9020\u6210device CPU Loading\u904e\u9ad8\u7684\u554f\u984c<br>2\u5efa\u8b70\u96e2PC\u7aef\u8d8a\u8fd1\u7684\u8a2d\u5099\u505aQoS(\u908a\u754c)<br>ex:\u908a\u754c\u5728IP Phone\u662f\u6700\u597d\u7684\uff0c\u56e0\u70ba\u5728IP Phone\u5c31\u958b\u59cb\u5c0d\u8a9e\u97f3\u7684\u5c01\u5305\u5206\u985e\uff0cQoS\u7684\u6548\u679c\u6700\u4f73<\/p>\n\n\n\n<p><br><strong>cisco packet qos priority<\/strong><br>1. voice<br>2. call signaling<br>3. video interactive<br>4. video streaming<br>5. network management<br>6. ip routing<\/p>\n\n\n\n<p>\u5e38\u898b\u7684Qos\u914d\u7f6e\u65b9\u6cd5<br>1.\u4f7f\u7528\u4eba\u5de5\u914d\u7f6e<br>2.\u4f7f\u7528Cisco SDM(Security Device Manager)\u8a2d\u5b9a<br>3.\u4f7f\u7528AutoQoS\u81ea\u52d5\u914d\u7f6e\u3000 &nbsp;<\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p>\u555f\u52d5QOS\u529f\u80fd<br><strong>(config)# mls qos<\/strong><\/p>\n\n\n\n<p>\u8a2d\u5b9a\u4fe1\u4efb\u4ecb\u9762<br>Switch(config)# interface &lt; interface &gt;<br><strong>Switch(config-if)# mls qos trust &lt; cos | ip-precedence | dscp&gt;<\/strong><br>\u9810\u8a2d\u70ba\u975e\u4fe1\u4efb\u4ecb\u9762,\u6b64\u985e\u4ecb\u9762\u4e0d\u76f8\u4fe1\u9032\u4f86\u7684qos\u8a2d\u5b9a<br>ip-precedence:\u4f7f\u7528ip\u7684tos\u6b04\u4f4d<br>cos:\u9810\u8a2d\u70ba0,\u53ea\u6703\u4f5c\u7528frame\u4e0a,\u4e5f\u5c31\u662f\u53ea\u5728trunk\u767c\u63ee\u4f5c\u7528<br>dscp:\u53ea\u4f5c\u7528\u5728packet\u4e0a<br>ps:<br>\u9023\u63a5\u5728client\u4e4b\u4ecb\u9762\u901a\u5e38\u4e0d\u6703\u8a2d\u6210trust,\u56e0\u8981\u9632\u6b62client\u81ea\u8a02qos\u800c\u7372\u5f97\u8f03\u9ad8\u4e4b\u7db2\u8def\u512a\u5148\u6b0a<br>ps:<br>cisco\u9810\u8a2d\u6703\u555f\u7528cos-to-dscp mapping,\u5c07cos\u8cc7\u8a0a\u5beb\u9032dscp\u4e2d<\/p>\n\n\n\n<p>ps:<br>\u9650\u5236cisco-phone\u4fe1\u4efb\u689d\u4ef6<br><strong>(config-if)# mls qos trust device cisco-phone<\/strong><br>\u6703\u900f\u904ecdp\u6aa2\u6e2c\u662f\u5426\u70bacisco-phone,\u82e5\u662f\u5247\u4fe1\u4efbcisco-phone\u904e\u4f86\u4e4bqos\u8a2d\u5b9a<br>ps:<br>\u6307\u5b9acisco-phone\u5c0dpc\u6578\u64da\u4e4b\u4fe1\u4efb\u689d\u4ef6<br><strong>(config-if)# switchport priority extend | trust&gt;<\/strong><br>cos &lt; value&gt; :\u5c07pc\u6578\u64da\u4e4bqos\u91cd\u8a2d\u70ba\u6b64value(0-7)<br>cos 0 :(default)\u6307\u5b9apc\u6578\u64da\u4e0d\u53ef\u4fe1\u4efb<br>trust :\u6307\u5b9apc\u6578\u64da\u53ef\u4fe1\u4efb<\/p>\n\n\n\n<p>&#8230;&#8230;.<\/p>\n\n\n\n<p>\u4f7f\u7528auto-qos<br><strong>(config-if)#[no] auto qos voip &lt; cisco-phone | cisco-softphone | trust&gt;<\/strong><br>\u8a72\u547d\u4ee4\u57f7\u884c\u4ee5\u4e0b\u4efb\u52d9<br>\u3000\u555f\u7528qos<br>\u3000\u555f\u7528cos-to-dscp mapping<br>\u3000\u6578\u64da\u9032\u5165\u4ecb\u9762\u548c\u51fa\u53bb\u4ecb\u9762\u4e4bqueue tuning<br>\u3000\u6307\u5b9avoip\u6578\u64da\u512a\u5148\u9032\u5165\u4ecb\u9762<br>\u3000\u5efa\u7acbqos trust\u908a\u754c<br>cisco-phone:\u8981\u7531cdp\u767c\u73fe\u4e4bcisco-phone\u624d\u6703\u88abtrust<br>cisco-softphone:\u9032\u4f86\u7684\u6578\u64da\u82e5dscp\u8a2d\u70ba24,26,46\u624d\u6703\u88abtrust,\u5176\u4ed6\u5247\u91cd\u8a2d\u70ba0<br>trust:\u6240\u6709\u9032\u4f86\u7684\u6578\u64da\u90fdtrust,\u7528\u65bc\u9023\u63a5switch<br>ps:<br>\u82e5\u8981\u4fee\u6539parameter,\u9700\u5148\u7528no auto qos voip,\u5728\u7528auto qos voip &lt; parameter &gt;<br>ps:CEF\u548cCDP\u5fc5\u9700\u5148\u555f\u52d5<\/p>\n\n\n\n<p>ps:<br>auto qos voip cisco-phone\u70ba\u4f8b,\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Switch(config-if)# auto qos voip cisco-phone<br>Switch(config-if)#<br>*Sep 7 04:14:41.618 EDT: mls qos map cos-dscp 0 8 16 26 32 46 48 56<br>*Sep 7 04:14:41.622 EDT: mls qos min-reserve 5 170<br>*Sep 7 04:14:41.622 EDT: mls qos min-reserve 6 85<br>*Sep 7 04:14:41.622 EDT: mls qos min-reserve 7 51<br>*Sep 7 04:14:41.626 EDT: mls qos min-reserve 8 34<br>*Sep 7 04:14:41.626 EDT: mls qos<br>*Sep 7 04:14:42.598 EDT: interface FastEthernet0\/37<br>*Sep 7 04:14:42.598 EDT: mls qos trust device cisco-phone<br>*Sep 7 04:14:42.602 EDT: mls qos trust cos<br>*Sep 7 04:14:42.606 EDT: wrr-queue bandwidth 10 20 70 1<br>*Sep 7 04:14:42.610 EDT: wrr-queue min-reserve 1 5<br>*Sep 7 04:14:42.618 EDT: wrr-queue min-reserve 2 6<br>*Sep 7 04:14:42.626 EDT: wrr-queue min-reserve 3 7<br>*Sep 7 04:14:42.634 EDT: wrr-queue min-reserve 4 8<br>*Sep 7 04:14:42.642 EDT: no wrr-queue cos-map<br>*Sep 7 04:14:42.646 EDT: wrr-queue cos-map 1 0 1<br>*Sep 7 04:14:42.650 EDT: wrr-queue cos-map 2 2 4<br>*Sep 7 04:14:42.654 EDT: wrr-queue cos-map 3 3 6 7<br>*Sep 7 04:14:42.658 EDT: wrr-queue cos-map 4 5<br>*Sep 7 04:14:42.662 EDT: priority-queue out<br>\u8aaa\u660e: mls qos and wrr-queue QoS-related commands are two shaded commands that enable trust for CoS values coming from a Cisco phone.<br>cos-dscp 0 8 16 26 32 46 48 56\u8868\u793a\u5c0d\u61c9\u5230cos 8\u500bpriority level<\/p>\n\n\n\n<p>\u555f\u7528qos debug<br><strong># debug auto qos<\/strong><br>\u53ef\u770b\u898bqos\u8a73\u7d30\u72c0\u614b\u53caauto qos voip\u6240\u57f7\u884c\u4e4b\u53c3\u6578<\/p>\n\n\n\n<p>\u986f\u793aauto qos\u72c0\u614b<br><strong># show auto qos [ interface &lt; interface &gt;]<\/strong><br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Switch# show auto qos interface fastethernet 0\/37<br>FastEthernet0\/37<br>auto qos voip cisco-phone<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;.<\/p>\n\n\n\n<p>\u986f\u793aqos\u4ecb\u9762\u72c0\u614b<br><strong># show mls qos interface &lt; interface&gt;<\/strong><br>ps:<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Switch# show mls qos interface fastethernet 0\/1<br>FastEthernet0\/1<br><strong>trust state: trust cos\u3000\u3000\/\/\u4fe1\u4efbcos\u72c0\u614b<\/strong><br>trust mode: trust cos\u3000\u3000<br><strong>trust enabled flag: ena<\/strong><br><strong>COS override: dis \/\/\u95dc\u9589cos\u8907\u5beb<\/strong><br>default COS: 0<br>DSCP Mutation Map: Default DSCP Mutation Map<br><strong>Trust device: none<\/strong><br>\u8aaa\u660e:\u6b64\u70ba\u4fe1\u4efb\u72c0\u614b<br>ps:<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Switch# show mls qos interface fastethernet 0\/1<br>FastEthernet0\/1<br><strong>trust state: not trusted<\/strong><br>trust mode: trust cos<br><strong>trust enabled flag: dis<\/strong><br>COS override: dis<br>default COS: 0<br>DSCP Mutation Map: Default DSCP Mutation Map<br><strong>Trust device: cisco-phone<\/strong><br>\u8aaa\u660e:\u4e0d\u662f\u9023\u63a5cisco-phone,\u6240\u4ee5\u6b64\u70ba\u4e0d\u4fe1\u4efb\u72c0\u614b<\/p>\n\n\n\n<p><br>\u986f\u793aswitchport\u4ecb\u9762\u72c0\u614b<br><strong>#show interface &lt; interface &gt; switchport<\/strong><br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Switch# show interface fastethernet 0\/1 switchport<br>Name: Fa0\/1<br>Switchport: Enabled<br>[output deleted&#8230;]<br>Voice VLAN: 2 (VLAN0002)<br><strong>Appliance trust: none<\/strong><br>\u8aaa\u660e\u5982\u4e0b<br>Appliance trust: none,\u8868\u793a\u76ee\u524d\u9023\u63a5\u4e4b\u8a2d\u5099\u4e0d\u7b26\u5408trust\u689d\u4ef6<\/p>\n\n\n\n<p><br>\u986f\u793arunning-config\u4e4b\u4ecb\u9762\u72c0\u614b<br><strong>#show running-config interface &lt; interface&gt;<\/strong><br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Switch# show running-config interface fastethernet 0\/47<br>Building configuration&#8230;<br>Current configuration : 219 bytes<br>!<br>interface FastEthernet0\/47<br>switchport access vlan 10<br>switchport trunk encapsulation dot1q<br>switchport mode access<br>switchport voice vlan 100<br><strong>mls qos trust device cisco-phone<br>mls qos trust cos<\/strong><br>no mdix auto<br>end<\/p>\n\n\n\n<p>ps:<br>cisco-phone\u555f\u7528\u4e4b\u8a0a\u606f\u5927\u81f4\u5982\u4e0b<br>6d18h: %ILPOWER-7-DETECT: Interface Fa1\/0\/1: Power Device detected: Cisco PD<br>6d18h: %ILPOWER-5-POWER_GRANTED: Interface Fa1\/0\/1: Power granted<br>6d18h: %LINK-3-UPDOWN: Interface FastEthernet1\/0\/1, changed state to up<br>6d18h: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1\/0\/1, changed state to up<br>6d18h: %SWITCH_QOS_TB-5-TRUST_DEVICE_DETECTED: cisco-phone detected on port Fa1\/0\/1, port trust enabled.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cisco IP Phone modelsMost cont &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[34],"tags":[],"class_list":["post-954","post","type-post","status-publish","format-standard","hentry","category-cisco-layer2"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=954"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/954\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}