DukeNukem3D Posted July 6, 2017 Всем привет! Пытаюсь решить следующий головняк - у нас есть коммутатор Cisco Nexus 3000, который работает как транзитный L2 коммутатор между маршрутизаторами, несколькими провайдерами и приватными L2 линками от других провайдеров. Я хочу добиться того, чтобы пользовательский трафик (которого бывает много) не влиял на BGP и OSPF соседства, а также протоколы управления (RDP, SSH и так далее). Я перекопал конфиг гайд от кошки, кучу статей и видяшек как это готовить на нексусах, в итоге мозг родил следующий конфиг: ! ip access-list AL-Routing-Protocols 10 remark # BFD Echo # 20 permit udp any any eq 3785 30 permit udp any eq 3785 any 40 permit tcp any any eq 3785 50 permit tcp any eq 3785 any 60 remark # BFD Control # 70 permit udp any any eq 3784 80 permit udp any eq 3784 any 90 permit tcp any any eq 3784 100 permit tcp any eq 3784 any 110 remark # BFD Multihop Control 120 permit udp any any eq 4784 130 permit udp any eq 4784 any 140 permit tcp any any eq 4784 150 permit tcp any eq 4784 any 160 permit ospf any any 170 permit tcp any any eq bgp 180 permit tcp any eq bgp any ! ip access-list AL-Management-Protocols 10 permit tcp any any eq 22 20 permit tcp any eq 22 any 30 permit tcp any any eq 3389 40 permit tcp any eq 3389 any 50 permit udp any any eq 3389 60 permit udp any eq 3389 any 70 permit tcp any any eq 23 80 permit tcp any eq 23 any ! ip access-list AL-Our-AS-Addrs-Only 10 permit ip 169.254.0.0/16 169.254.0.0/16 ! ip access-list AL-any-IP-Traffic 10 permit ip any any ! class-map type qos match-any CM-QoS-Routing-Protocols match access-group name AL-Routing-Protocols ! class-map type qos match-any CM-QoS-Management-Protocols match access-group name AL-Management-Protocols ! class-map type qos match-any CM-QoS-Our-AS-Traffic-Only match access-group name AL-Our-AS-Addrs-Only ! ! policy-map type qos PM-QoS-Edge-Class-and-Internal-pre-Mark class CM-QoS-Routing-Protocols set qos-group 5 class CM-QoS-Management-Protocols set qos-group 4 class CM-QoS-Our-AS-Traffic-Only set qos-group 3 ! ! class-map type queuing CM-Queuing-Routing-Protocols match qos-group 5 ! class-map type queuing CM-Queuing-Management-Protocols match qos-group 4 ! class-map type queuing CM-Queuing-Our-AS-Traffic-Only match qos-group 3 ! ! ! policy-map type queuing PM-Queuing-Internet-Edge class type queuing CM-Queuing-Routing-Protocols bandwidth percent 5 priority class type queuing CM-Queuing-Management-Protocols bandwidth percent 20 class type queuing CM-Queuing-Our-AS-Traffic-Only bandwidth percent 30 class type queuing class-default bandwidth percent 30 ! ! interface e1/51 service-policy type qos input PM-QoS-Edge-Class-and-Internal-pre-Mark service-policy type queuing output PM-Queuing-Internet-Edge Теперь проверяю что в итоге накручено на физической дырке: SD2-5-8-22-L2SW-155(config)# sh queuing interface e1/51 Ethernet1/51 queuing information: qos-group sched-type oper-bandwidth 0 WRR 30 qos-group 0 HW MTU: 1500 (1500 configured) drop-type: drop, xon: 0, xoff: 0 Statistics: Ucast pkts sent over the port : 66122156488 Ucast bytes sent over the port : 42691127066217 Mcast pkts sent over the port : 46358 Mcast bytes sent over the port : 3038776 Ucast pkts dropped : 6363974 Ucast bytes dropped : 9145820663 Mcast pkts dropped : 0 Mcast bytes dropped : 0 Pkts dropped by RX thresholds : 0 Bytes dropped by RX thresholds : 0 ! SD2-5-8-22-L2SW-155(config)# sh policy-map interface e1/51 Global statistics status : enabled NOTE: Type qos policy-map configured on VLAN will take precedence over system-qos policy-map for traffic on the VLAN Ethernet1/51 Service-policy (qos) input: PM-QoS-Edge-Class-and-Internal-pre-Mark policy statistics status: enabled Class-map (qos): CM-QoS-Routing-Protocols (match-any) Match: access-group AL-Routing-Protocols set qos-group 5 Class-map (qos): CM-QoS-Management-Protocols (match-any) Match: access-group AL-Management-Protocols set qos-group 4 Class-map (qos): CM-QoS-Our-AS-Traffic-Only (match-any) Match: access-group AL-Our-AS-Addrs-Only set qos-group 3 Class-map (qos): class-default (match-any) Match: any set qos-group 0 Service-policy (queuing) input: default-in-policy policy statistics status: enabled Class-map (queuing): class-default (match-any) Match: qos-group 0 bandwidth percent 100 Service-policy (queuing) output: PM-Queuing-Internet-Edge policy statistics status: enabled Class-map (queuing): CM-Queuing-Routing-Protocols (match-any) Match: qos-group 5 bandwidth percent 5 priority queue dropped pkts : 0 current depth pkts: 0 queue dropped bytes : 0 current depth bytes: 0 queue transmit pkts: 0 queue transmit bytes: 0 queue max depth pkts: 0 queue max depth bytes: 0 Class-map (queuing): CM-Queuing-Management-Protocols (match-any) Match: qos-group 4 bandwidth percent 20 queue dropped pkts : 0 current depth pkts: 0 queue dropped bytes : 0 current depth bytes: 0 queue transmit pkts: 0 queue transmit bytes: 0 queue max depth pkts: 0 queue max depth bytes: 0 Class-map (queuing): CM-Queuing-Our-AS-Traffic-Only (match-any) Match: qos-group 3 bandwidth percent 30 queue dropped pkts : 0 current depth pkts: 0 queue dropped bytes : 0 current depth bytes: 0 queue transmit pkts: 0 queue transmit bytes: 0 queue max depth pkts: 0 queue max depth bytes: 0 Class-map (queuing): class-default (match-any) Match: qos-group 0 bandwidth percent 30 queue dropped pkts : 6363974 current depth pkts: 0 queue dropped bytes : 9145820663 current depth bytes: 0 queue transmit pkts: 66122180569 queue transmit bytes: 42691145285775 queue max depth pkts: 0 queue max depth bytes: 0 В итоге всё странно и не понятно - qos-group 0 единственно активная очередь с полосой 30, то есть частично конфиг применился. Также видно что policy-map для маркировки (type qos PM-QoS-Edge-Class-and-Internal-pre-Mark) и для разруливания очередей (type queuing PM-Queuing-Internet-Edge) применились, но в них нет трафика. Более того, в дефолтной очереди есть дропы, хотя текущий трафик на физической дырке не более 150мбпс и если я правильно понимаю как работают очереди в режиме CBWFQ, то дропы должны появляться тогда, когда имеет место перегрузка и в других очередях или приоритетных очередях присутствует трафик, которому нужна эта пропускная полоса. Вопрос - что я делаю не так? Я знаю что на нексусах есть еще такие объекты как system qos и network-qos, но из конфиг гайда у меня четкого понимания не получилось почему и как я должен эти вещи настраивать в том случае, если я хочу изменить настройки классификации, маркировки и очередней на одной конкретной физической дырке, а не на всем коммутаторе. Всем спасибо. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
v_r Posted July 6, 2017 На Нексусах чтобы использовать очереди отличные от 0 надо их создать и навесить: policy-map type network-qos NET-QOS class type network-qos C1 mtu 9216 class type network-qos C2 mtu 9216 class type network-qos C3 mtu 9216 class type network-qos C4 mtu 9216 class type network-qos C5 mtu 9216 class type network-qos C6 mtu 9216 class type network-qos C7 mtu 9216 class type network-qos class-default mtu 9216 system qos service-policy type network-qos NET-QOS В ранних прошивках трафик направленный в не созданные очереди дропался. я хочу изменить настройки классификации, маркировки и очередней на одной конкретной физической дырке, а не на всем коммутаторе. N3K построен на чипсете Broadcom Trident+, и соответственно логика работы QoS не похожа на свитчи с Cisco IOS. Изучайте документацию по NX-OS и делайте как там написано, настраивать Нексусы по аналогии с Каталистами не получится - в конфиге команды выглядят похоже а по факту настройки буквально всех фич отличаются. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
DukeNukem3D Posted July 6, 2017 На Нексусах чтобы использовать очереди отличные от 0 надо их создать и навесить: policy-map type network-qos NET-QOS class type network-qos C1 mtu 9216 class type network-qos C2 mtu 9216 class type network-qos C3 mtu 9216 class type network-qos C4 mtu 9216 class type network-qos C5 mtu 9216 class type network-qos C6 mtu 9216 class type network-qos C7 mtu 9216 class type network-qos class-default mtu 9216 system qos service-policy type network-qos NET-QOS В ранних прошивках трафик направленный в не созданные очереди дропался. я хочу изменить настройки классификации, маркировки и очередней на одной конкретной физической дырке, а не на всем коммутаторе. N3K построен на чипсете Broadcom Trident+, и соответственно логика работы QoS не похожа на свитчи с Cisco IOS. Изучайте документацию по NX-OS и делайте как там написано, настраивать Нексусы по аналогии с Каталистами не получится - в конфиге команды выглядят похоже а по факту настройки буквально всех фич отличаются. То есть на нексусах нельзя настроить очереди на конкретной дырке, а можно только для всего асика сразу? PS: документация написана крайне мутно у них по этой теме Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
v_r Posted July 6, 2017 То есть на нексусах нельзя настроить очереди на конкретной дырке, а можно только для всего асика сразу? Да. Аналогично MTU, он связан с очередью, поменять MTU для одного порта нельзя. PS: документация написана крайне мутно у них по этой теме Что касается NX-OS то увы, не только по этой, и не только мутно но еще и не всегда точно. SD2-5-8-22-L2SW-155(config)# sh policy-map interface e1/51 Global statistics status : enabled Аккуратнее со статистикой для QoS, эта фича расходует TCAM (проверяется sh hardware capacity forwarding), на N3K его и так не много, банально может не получиться навесить QoS на десяток портов, хорошо что NX-OS при такой ошибке достаточно ясно ругается. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
DukeNukem3D Posted July 7, 2017 Попыхтел еще 8 часов, родил сие: ! ip access-list AL-Routing-Protocols 10 remark # BFD Echo # 20 permit udp any any eq 3785 30 permit udp any eq 3785 any 40 permit tcp any any eq 3785 50 permit tcp any eq 3785 any 60 remark # BFD Control # 70 permit udp any any eq 3784 80 permit udp any eq 3784 any 90 permit tcp any any eq 3784 100 permit tcp any eq 3784 any 110 remark # BFD Multihop Control 120 permit udp any any eq 4784 130 permit udp any eq 4784 any 140 permit tcp any any eq 4784 150 permit tcp any eq 4784 any 160 permit ospf any any 170 permit tcp any any eq bgp 180 permit tcp any eq bgp any ! ip access-list AL-Management-Protocols 10 permit tcp any any eq 22 20 permit tcp any eq 22 any 30 permit tcp any any eq 3389 40 permit tcp any eq 3389 any 50 permit udp any any eq 3389 60 permit udp any eq 3389 any 70 permit tcp any any eq 23 80 permit tcp any eq 23 any ! ip access-list AL-Our-AS-Addrs-Only 10 permit ip 169.254.0.0/16 169.254.0.0/16 ! ip access-list AL-any-IP-Traffic 10 permit ip any any ! ! ! class-map type qos match-any CM-QoS-Routing-Protocols match access-group name AL-Routing-Protocols ! class-map type qos match-any CM-QoS-Management-Protocols match access-group name AL-Management-Protocols ! class-map type qos match-any CM-QoS-Our-AS-Traffic-Only match access-group name AL-Our-AS-Addrs-Only ! ! ! policy-map type qos PM-QoS-Intern-Premarking class type qos CM-QoS-Routing-Protocols set qos-group 5 class type qos CM-QoS-Management-Protocols set qos-group 4 class type qos CM-QoS-Our-AS-Traffic-Only set qos-group 3 ! !!! show policy-map ! ! class-map type network-qos CM-NetQos-Routing-Protocols match qos-group 5 ! class-map type network-qos CM-NetQos-Management-Protocols match qos-group 4 ! class-map type network-qos CM-NetQos-Our-AS-Traffic-Only match qos-group 3 ! ! ! policy-map type network-qos PM-NetQoS class type network-qos CM-NetQos-Routing-Protocols class type network-qos CM-NetQos-Management-Protocols class type network-qos CM-NetQos-Our-AS-Traffic-Only class type network-qos class-default ! ! ! class-map type queuing CM-Queuing-Routing-Protocols match qos-group 5 ! class-map type queuing CM-Queuing-Management-Protocols match qos-group 4 ! class-map type queuing CM-Queuing-Our-AS-Traffic-Only match qos-group 3 ! ! ! policy-map type queuing PM-Queuing-Internet-Edge class type queuing CM-Queuing-Routing-Protocols bandwidth percent 5 priority class type queuing CM-Queuing-Management-Protocols bandwidth percent 20 class type queuing CM-Queuing-Our-AS-Traffic-Only bandwidth percent 30 class type queuing class-default bandwidth percent 30 ! ! ! system qos service-policy type network-qos PM-NetQoS service-policy type qos input PM-QoS-Intern-Premarking ! ! interface e1/51 service-policy type queuing output PM-Queuing-Internet-Edge ! ! ! Теперь смотрю что получилось с дыркой, куда никакой service-policy специално не вешал: SD2-5-8-22-L2SW-155(config)# sh run int e1/2 | i service SD2-5-8-22-L2SW-155(config)# ! SD2-5-8-22-L2SW-155(config)# sh policy-map interf e1/2 Global statistics status : enabled NOTE: Type qos policy-map configured on VLAN will take precedence over system-qos policy-map for traffic on the VLAN Ethernet1/2 Service-policy (qos) input: PM-QoS-Intern-Premarking policy statistics status: enabled Class-map (qos): CM-QoS-Routing-Protocols (match-any) Match: access-group AL-Routing-Protocols set qos-group 5 Class-map (qos): CM-QoS-Management-Protocols (match-any) Match: access-group AL-Management-Protocols set qos-group 4 Class-map (qos): CM-QoS-Our-AS-Traffic-Only (match-any) Match: access-group AL-Our-AS-Addrs-Only set qos-group 3 Class-map (qos): class-default (match-any) Match: any set qos-group 0 Service-policy (queuing) input: default-in-policy policy statistics status: enabled Class-map (queuing): class-default (match-any) Match: qos-group 0 bandwidth percent 100 Service-policy (queuing) output: default-out-policy policy statistics status: enabled Class-map (queuing): class-default (match-any) Match: qos-group 0 bandwidth percent 100 ! SD2-5-8-22-L2SW-155(config)# sh queuing interf e1/2 Ethernet1/2 queuing information: qos-group sched-type oper-bandwidth 0 WRR 100 3 WRR 0 4 WRR 0 5 WRR 0 qos-group 0 HW MTU: 1500 (1500 configured) drop-type: drop, xon: 0, xoff: 0 Statistics: Ucast pkts sent over the port : 10397450997 Ucast bytes sent over the port : 5314259680494 Mcast pkts sent over the port : 8839349 Mcast bytes sent over the port : 729449883 Ucast pkts dropped : 28 Ucast bytes dropped : 14630 Mcast pkts dropped : 0 Mcast bytes dropped : 0 qos-group 3 HW MTU: 1500 (1500 configured) drop-type: drop, xon: 0, xoff: 0 Statistics: Ucast pkts sent over the port : 0 Ucast bytes sent over the port : 0 Mcast pkts sent over the port : 0 Mcast bytes sent over the port : 0 Ucast pkts dropped : 0 Ucast bytes dropped : 0 Mcast pkts dropped : 0 Mcast bytes dropped : 0 qos-group 4 HW MTU: 1500 (1500 configured) drop-type: drop, xon: 0, xoff: 0 Statistics: Ucast pkts sent over the port : 55405 Ucast bytes sent over the port : 7926679 Mcast pkts sent over the port : 0 Mcast bytes sent over the port : 0 Ucast pkts dropped : 0 Ucast bytes dropped : 0 Mcast pkts dropped : 0 Mcast bytes dropped : 0 qos-group 5 HW MTU: 1500 (1500 configured) drop-type: drop, xon: 0, xoff: 0 Statistics: Ucast pkts sent over the port : 7322 Ucast bytes sent over the port : 2844918 Mcast pkts sent over the port : 0 Mcast bytes sent over the port : 0 Ucast pkts dropped : 0 Ucast bytes dropped : 0 Mcast pkts dropped : 0 Mcast bytes dropped : 0 Pkts dropped by RX thresholds : 1 Bytes dropped by RX thresholds : 427 ! Теперь очереди появились и в них есть трафик, но написано что Service-policy (queuing) input: default-in-policy policy statistics status: enabled Class-map (queuing): class-default (match-any) Match: qos-group 0 bandwidth percent 100 Service-policy (queuing) output: default-out-policy То есть по факту дырка будет работать как обычная FIFO. Теперь смотрю дырку на которую навесил service-policy: SD2-5-8-22-L2SW-155(config)# sh run int e1/51 | i service service-policy type queuing output PM-Queuing-Internet-Edge SD2-5-8-22-L2SW-155(config)# ! ! SD2-5-8-22-L2SW-155(config)# sh policy-map interface e1/51 Global statistics status : enabled NOTE: Type qos policy-map configured on VLAN will take precedence over system-qos policy-map for traffic on the VLAN Ethernet1/51 Service-policy (qos) input: PM-QoS-Intern-Premarking policy statistics status: enabled Class-map (qos): CM-QoS-Routing-Protocols (match-any) Match: access-group AL-Routing-Protocols set qos-group 5 Class-map (qos): CM-QoS-Management-Protocols (match-any) Match: access-group AL-Management-Protocols set qos-group 4 Class-map (qos): CM-QoS-Our-AS-Traffic-Only (match-any) Match: access-group AL-Our-AS-Addrs-Only set qos-group 3 Class-map (qos): class-default (match-any) Match: any set qos-group 0 Service-policy (queuing) input: default-in-policy policy statistics status: enabled Class-map (queuing): class-default (match-any) Match: qos-group 0 bandwidth percent 100 Service-policy (queuing) output: PM-Queuing-Internet-Edge policy statistics status: enabled Class-map (queuing): CM-Queuing-Routing-Protocols (match-any) Match: qos-group 5 bandwidth percent 5 priority queue dropped pkts : 0 current depth pkts: 0 queue dropped bytes : 0 current depth bytes: 0 queue transmit pkts: 7695 queue transmit bytes: 539529 queue max depth pkts: 0 queue max depth bytes: 0 Class-map (queuing): CM-Queuing-Management-Protocols (match-any) Match: qos-group 4 bandwidth percent 20 queue dropped pkts : 0 current depth pkts: 0 queue dropped bytes : 0 current depth bytes: 0 queue transmit pkts: 277061 queue transmit bytes: 40085512 queue max depth pkts: 0 queue max depth bytes: 0 Class-map (queuing): CM-Queuing-Our-AS-Traffic-Only (match-any) Match: qos-group 3 bandwidth percent 30 queue dropped pkts : 0 current depth pkts: 0 queue dropped bytes : 0 current depth bytes: 0 queue transmit pkts: 3141804 queue transmit bytes: 1958850691 queue max depth pkts: 0 queue max depth bytes: 0 Class-map (queuing): class-default (match-any) Match: qos-group 0 bandwidth percent 30 queue dropped pkts : 6363974 current depth pkts: 0 queue dropped bytes : 9145820663 current depth bytes: 0 queue transmit pkts: 66289563195 queue transmit bytes: 42806084828363 queue max depth pkts: 0 queue max depth bytes: 0 ! ! SD2-5-8-22-L2SW-155(config)# sh queuing interface e1/51 Ethernet1/51 queuing information: qos-group sched-type oper-bandwidth 0 WRR 30 3 WRR 30 4 WRR 20 5 priority 5 qos-group 0 HW MTU: 1500 (1500 configured) drop-type: drop, xon: 0, xoff: 0 Statistics: Ucast pkts sent over the port : 66289589209 Ucast bytes sent over the port : 42806121034986 Mcast pkts sent over the port : 46358 Mcast bytes sent over the port : 3038776 Ucast pkts dropped : 6363974 Ucast bytes dropped : 9145820663 Mcast pkts dropped : 0 Mcast bytes dropped : 0 qos-group 3 HW MTU: 1500 (1500 configured) drop-type: drop, xon: 0, xoff: 0 Statistics: Ucast pkts sent over the port : 3194392 Ucast bytes sent over the port : 1993938788 Mcast pkts sent over the port : 0 Mcast bytes sent over the port : 0 Ucast pkts dropped : 0 Ucast bytes dropped : 0 Mcast pkts dropped : 0 Mcast bytes dropped : 0 qos-group 4 HW MTU: 1500 (1500 configured) drop-type: drop, xon: 0, xoff: 0 Statistics: Ucast pkts sent over the port : 282846 Ucast bytes sent over the port : 40934445 Mcast pkts sent over the port : 0 Mcast bytes sent over the port : 0 Ucast pkts dropped : 0 Ucast bytes dropped : 0 Mcast pkts dropped : 0 Mcast bytes dropped : 0 qos-group 5 HW MTU: 1500 (1500 configured) drop-type: drop, xon: 0, xoff: 0 Statistics: Ucast pkts sent over the port : 7828 Ucast bytes sent over the port : 548515 Mcast pkts sent over the port : 0 Mcast bytes sent over the port : 0 Ucast pkts dropped : 0 Ucast bytes dropped : 0 Mcast pkts dropped : 0 Mcast bytes dropped : 0 Pkts dropped by RX thresholds : 1 Bytes dropped by RX thresholds : 68 Вроде как и очереди есть и к ним политика с приоритетами применяется. Вопрос к опытным коллегам - в целом такой подход адекватный и я делаю то, что нужно? Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
v_r Posted July 7, 2017 По поводу system qos service-policy type qos input PM-QoS-Intern-Premarking есть сомнения, если свитч стоит в ядре то ОК, а если туда включаются абоненты или сторонние устройства то я бы на их порту настраивал более простую политику, например без приоретизации OSPF и BFD. Теперь очереди появились и в них есть трафик, но написано что Service-policy (queuing) input: default-in-policy policy statistics status: enabled Class-map (queuing): class-default (match-any) Match: qos-group 0 bandwidth percent 100 Service-policy (queuing) output: default-out-policy То есть по факту дырка будет работать как обычная FIFO. Свитч радостно пишет про Input queueing но на N3K он ЕМНИП не поддерживается. В остальном вроде все ОК. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
DukeNukem3D Posted July 7, 2017 По поводу system qos service-policy type qos input PM-QoS-Intern-Premarking есть сомнения, если свитч стоит в ядре то ОК, а если туда включаются абоненты или сторонние устройства то я бы на их порту настраивал более простую политику, например без приоретизации OSPF и BFD. Этот свич не то чтобы в ядре, он как бы Internet Edge - то есть в него воткнуты все провайдеры с одной стороны и с другой все наши граничные маршрутизаторы. Насчет input queue это да, в курсе, спасибо! Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...