ccnp

NBAR and HTTP Data Conversations

I’m still working on the ONT test and doing labs, so I marked up a lab for me to work.  I’m using the same setup as I did last time.  The two routers are 3640s running 12.4(25b).

nbar-classmap1

Part of the lab was to identify HTTP traffic coming into F0/0 and mark it as CS3.  That’s pretty easy, right?  Of course, the lab I made up was a little more complicated, but the point comes clear with a simpler example.

class-map match-all HTTP
 match protocol http
!
policy-map PM-F0/0-IN
 class HTTP
  set dscp cs3
!
interface FastEthernet0/0
 service-policy input PM-F0/0-IN

I fired off a small script on TestHost1 to repeatedly do NMap scans on TCP/80 of TestHost2 to generate some traffic. 

root@bt:~#while ( true ) do nmap -sT -p 80 -v -n 172.16.2.101; done

I let that run for a while and checked out the service policy on F0/0; there were absolutely no matches on that class.

R1#sh policy-map int f0/0 input class HTTP
 FastEthernet0/0

  Service-policy input: PM-F0/0-IN

    Class-map: HTTP (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: protocol http
      QoS Set
        dscp cs3
          Packets marked 0

I thought that was strange, so I kept the script running and captured the traffic coming out of S1/0.  Looking at the packets in Wireshark showed that none of the HTTP packets were showing up as being marked as CS3; they’re all set to the default DSCP value.

HTTP-nomarkNo matter how many NMap scans cycled through, the class never incremented a bit.  I let it run for two full minutes and generated a few hundred HTTP packets, but there was still nothing.

On a whim, I enabled NBAR protocol discovery on F0/0 to see if that would shed any light on my mess.  Guess what I found.  That’s right; there were no HTTP matches to NBAR, either.  That makes sense since the class-map I defined uses the NBAR protocol.  Alright, so it seems that it’s NBAR that doesn’t see the packets as HTTP, but why?

Looking through the packet captures again, I noticed that there was no real data in the streams.  I saw the 3-way TCP handshake (a.k.a., my signature wrestling move) and then a RST,ACK.  I only told NMap to check if the port was open, so I changed the while loop a bit and enabled version detection with the “-sV” flag.  This time when I can the script, NMap was actually getting the HTTP banner.  It was much traffic, but it was an actual HTTP conversation, so I checked NBAR again.  Success!  The same for the class, too. 

For craps and smiles, I created a class-map that matched SIP, added it to the same policy-map, and set NMap after TCP/5060 without version detection.  Without having a real SIP conversation, the class counters incremented as long as I was sending packets.  That would seem unexpected until you realize that NBAR has some advanced knowledge of HTTP; you can actually match on URLs, hostnames, and MIME-types.  I guess that means it also know when a real HTTP conversation is taking place.

To finish out the testing, I added an ACL to the router that matched any-any-eq-80.  I made the class-map into a match-any and added the ACL.  Since the ACL just matches the destination port and doesn’t care what the content is, every packet sent matched the class as expected.  I remember reading several places and seeing a couple videos that said that you can use NBAR matching and ACLs interchangeably.  That may not really be true when it comes to HTTP.

Send any Cisco learning credits questions my way.

Stubby post: ROUTE Cert Kit Giveaway

Rofi at ITDualism is giving away a ROUTE cert kit to a random commenter.  Swing by there and put your name in the hat.

ONT – Epic Fail

I failed the ONT test today.  It was an utter lack of subject matter knowledge that did me in from the beginning.  When the first three questions mention things that I’ve never even heard, it’s going to be a long test.  I’ll take blame on it for sure, but the test was a lot darker than I imagined it would be.

I heard from a couple people that the ONT test was the easiest of the 4 CCNP test.  I must say today’s test was a LOT harder than the ISCW test I took back in December.  Most of the questions were fair, but there were a few that were down-right evil or unanswerable.  Without giving too much away, there were some matching questions that had multiple items with multiple answers, rendering the answer to a guess.  I even ran into a CLI question about the WLC, which surely wasn’t mentioned anywhere I studied, and I don’t have a spare sitting around on which to test.  The icing, though, was the number of questions about FRTS; I know I need to understand it, but the magical question dice landed on that topic way too many times in my opinion.

At the heart of it, I think my demise stemmed from using only the Cisco Press book.  I really needed to get a wider exposure to the topics.  Though the CP books might have mentioned some topics that I missed, a lot of it is mentioned in passing but appeared in detail on the test.  I would think getting different training would fix that problem and I’ll be using some of our CLCs this week to do just that

The facility was great, though.  I was comfortable and couldn’t hear traffic or the lecture across the hall this time.  At least I know a good place to take tests now.  I hope somebody gets some value from my absolute failure.

Send any test vouchers questions my way.

ONT Notes – WLAN Management

Elements of Cisco Unified Wireless Network

  • Client devices – Cisco compatible extensions on WLAN clients
  • Mobility platform – allows configuration of LWAPs through WLCs
  • Network unification – integration into the rest of the network with WLCs doing RF management, IPS, etc.
  • World-class network management – centralized management through WCS
  • Unified advanced services – supports advanced technologies and threat detection

WLAN Implementation

Autonomous and LWAP

Category Autonomous LWAP
Access Point Autonomous APs LWAPs
Control Individual configurations Configuration through WLCs
Dependency Independent operations Dependent on WLC
Management CiscoWorks WLSE and WDS WCS
Redundancy Through APs Through WLCs

Wireless LAN Services Engine (WLSE)

  • Part of CiscoWorks
  • Manages autonomous APs
  • Centralized configuration, firmware, and radio management
  • Autoconfig of new APs
  • Misconfiguration and rogue AP alerts
  • Proactive monitoring of APs, bridges, and 802.1x servers
  • Supports SSH, HTTP, CDP, SNMP for up to 2500 APs
  • WLSE Express supports 100 devices in either automatic or manual setups

Wireless Control System (WCS)

  • Supports 50 WLCs and 1500 APs
  • Three versions
    • Base – can determine with which APs a devices in associated
    • Location – Base plus RF fingerprinting
    • Location + 2700 Series Wireless Location Appliance – Tracks devices in real time and stores historical location data

ONT Notes – 802.1x and Encryption on LWAPs

  • Traditional WLAN weaknesses
    • SSID for security
    • Vulnerable to rogue APs
    • MAC filtering for security
    • WEP
  • WEP weaknesses
    • Disribution of static keys is not scalable
    • WEP keys can be cracked easily
    • Vulnerable to dictionary attacks
    • No protection against rogue APs
  • Benefits of 802.1x
    • Centralized authentication through Radius via AAA
    • Mutual authentication between client and auth server
    • Can use multiple encryption algorithms (AES, WPA, TKIP, WEP)
    • Automatic dynamic WEP keys
    • Roaming
  • Requirements of 802.1x
    • EAP-capable client (supplicant)
    • 802.1x-capable AP (authenticator)
    • EAP-capable auth server
Table 1. Characteristics of the EAP variants
Feature Cisco LEAP EAP-FAST EAP-TLS PEAP-GTC PEAP-MSCHAPv2
User authentication DB AD AD, LDAP OTP, LDAP, NDS, AD OTP, LDAP, NDS, AD AD
Requires server certs No No Yes Yes Yes
Requires client certs No No Yes No No
Single sign-on Yes Yes Yes No Yes
Roaming Yes Yes No No No
Works with WPA/WPA2 Yes Yes Yes Yes Yes
  • WPA
    • Features
      • Authenticated key management – auths prior to key management
      • Unicast and broadcast key management – keys are distributed and stored on the client and the AP
      • TKIP and MIC
        • Temporal Key Integrity Protocol (TKIP) – per-packet keying
        • Message Integrity Checking (MIC) – integrity checking
      • Initialization vector (IV) expansion – from 24 bits to 48 bits
    • Shortcomings
      • Relies on RC4
      • Firmware support required in NICs, APs
      • Susceptible to DoS attacks
      • Dictionary attacks can discover PSKs
  • WPA2
    • Features
      • 802.1x authentication or PSK
      • Key distribution and renewal
      • Proactive Key Caching (PKC) – allows roaming
      • IDS for rogue APs and attacks
    • Shortcomings
      • Supplicant must have WPA2-compliance firmware
      • AAA server must support EAP
      • WPA2 uses more CPU, so a hardware upgrade may be required
      • Older devices may not be upgradeable and must be replaced
Table 2. WPA/WPA2 Enterprise and Personal Modes
Mode WPA WPA2
Enterprise Auth: 802.1x/EAP
Encryption: TKIP/MIC
Auth: 802.1x/EAP
Encryption: AES-CCMP
Personal Auth: PSK
Encryption: TKIP/MIC
Auth: PSK
Encryption: AES-CCMP

ONT Notes – AutoQoS

  • AutoQoS benefits
    • Automates QoS for most deployments
    • Protects business-critical apps to maximize availability
    • Simplifies QoS deployments
    • Reduces configuration errors
    • Cheaper, faster, and simpler deployments
    • Follows DiffServ
    • Allows complete control over QoS configs
    • Allows modification of auto-generated configs
  • AutoQoS phases of evolution
    • AutoQoS VOIP – Early version that configures the basics without discovery
    • AutoQoS for Enterprise – Second version that only runs on routers and uses two-step process
      • Autodiscovery using NBAR
      • Generation of class maps
  • AutoQoS key elements
    • Application classification
    • Policy generation
    • Configuration
    • Monitoring and reporting
    • Consistency
  • Interfaces that you can configure AutoQoS on
    • Serial ifs with PPP and HDLC
    • FR point-to-point subifs (NOT multipoint)
    • ATM point-to-point subifs
    • FR-to-ATM links
  • Prerequsites
    • No Qos policy already configured on if
    • CEF enabled on if
    • Correct bandwidth configured on if
    • IP address on low-speed if
  • Configuring AutoQoS Enterprise on a router (NOT a switch)
    • auto qos discovery – begins discovery process
    • auto qos – generates and applies MQC-based policies
  • Configuring AutoQoS VOIP
    • auto qos voip [ trust | cisco-phone ]
  • Verifying AutoQoS on router
    • show auto discovery qos – get autodiscovery results
    • show auto qos – examine configuration generated
      • Number of classes
      • Classification options
      • Marking options
      • Queuing mechanisms
      • Other QoS mechanisms
      • If, subif, PVC where policy is applied
    • show policy-map interface – look at if stats
  • Verify AutoQoS VOIP
    • show auto qos
    • show policy-map interface
    • show mls qos maps – shows CoS to DSCP mappings
  • Possible issues with AutoQoS
    • Too many traffic classes – manually consolidate some
    • Configuration doesn’t change – rerun AutoQoS
    • Configuration may not fit your situation – fine-tune it by hand
  • Fine-tuning AutoQoS
    • Use QPM
    • CLI
    • copy policy into editor, change, reapply
  • AutoQoS can match on characteristics besides ACLs and NBAR
    • match input interface
    • match cos
    • match ip precedence
    • match ip dscp
    • match ip rtp

ONT Notes – Pre-classify and End-to-end QoS

  • VPNs (Didn’t ISCW cover this?)
    • Provide
      • Confidentiality
      • Integrity
      • Authentication
    • Types
      • Remote-access
        • Client-initiated
        • NAS-initiated
      • Site-to-site
        • LAN-to-LAN
        • Extranet
  • L3 Tunneling protocols
    • GRE
    • IPSec
  • Pre-classify allows traffic to be classified before being sent across a tunnel or crypto-ed.
    • qos pre-classify
    • Provides a view into the original IP headers
    • To classify on pre-tunnel header, apply the policy to the tunnel interface WITHOUT pre-classify.
    • To classify on post-tunnel header, apply the policy to the physical interface WITHOUT pre-classify.
    • To classify on pre-tunnel header, apply the policy to the physical interface WITH pre-classify.
  • SLA – agreement with provider to guarantee QoS mechanisms across their network based on your markings.
    • Assures availability, loss, throughput, delay, and jitter.
  • End-to-end QoS
    • To be effective, each hop in the path must have QoS configured similarly.
    • Necessary in three locations
      • Campus – within the customer network
      • The edges – customer facing the provider, provider facing customer
      • On the provider network
  • QoS tasks
    • Campus access switches
      • Speed/duplex settings
      • Classification
      • Trust
      • Phone/access switch configs
      • Multiple queues on switch ports, including priority for VOIP
    • Campus distribution
      • L3 policing and marking
      • Multiple queues on switch ports, including priority for VOIP
      • WRED
    • WAN edge
      • SLA definitions
      • LLQ
      • LFI
      • WRED
      • Shaping
    • Provider cloud
      • Capacity planning
      • PHB
      • LLQ
      • WRED
  • Enterprise campus QoS implementation
    • Implement multiple queues to avoid congestion
    • Assign VOIP and video to highest priority queue
    • Esablish trust boundaries
    • Use policing to rate-limit excess traffic
    • Use hardware QoS when possible
  • Control Plane Policing (CoPP)
    • Applies QoS policy to traffic destined for the router
      • Routing protocols
      • Management protocols
    • Can be used to avoid DOS attacks
    • Applied to control-plane in global config

ONT Notes – Congestion Avoidance, Policing, Shaping, and Link Efficiency

  • Tail drop drawbacks
    • TCP synchronization – Dropping TCP packets from different flows can cause them all to window down and back up again at the same time in cycles.
    • TCP starvation – Non-TCP or aggressive flows can starve everyone else out when TCP throttles back.
    • No differentiated drop – Tail drop doesn’t care who you are, so you get dropped if the queue is full.
  • RED – Random Early Detection
    • Avoids tail drop by randomly dropping packets from the queue before it gets full
    • Only dropped TCP flows slow down instead of everyone who has sent a packet since the queue filled
    • Queues are smaller.
    • Link utilization is more efficient
    • Configured with
      • Minimum threshold – start dropping when the queue is this size
      • Maximum threshold – if the queue is this big, start tail dropping
      • Mark probability denominator (MPD) – 1/MPD is the ratio of packets to drop when between the thresholds
  • WRED – Weighted RED
    • Based on IP precedence or DSCP values
    • Less-important packets are dropped more aggressively than important packets
    • Applied to an interface, VC or a class within a policy map
  • CBWRED – Class based WRED
    • Configured with CBWFQ
  • Policing
    • Limits subrate bandwidth (give you 100kbps on a T1)
    • Limits traffic of certain applications
    • Any traffic that exceeds police is dropped or re-classified; it’s a hard limit
    • Inbound or outbound
  • Shaping
    • Sets a limit but buffers any in excess
    • Requires memory to store the buffer
    • Buffers = delay and/or jitter
    • Outbound only
    • Can respond to network signals like BECNs and FECNs
  • Token and bucket
    • The queue is a bucket; if a byte of data needs to be sent, it needs a token.
    • If there are enough tokens, the traffic is considered conforming.
    • If there aren’t enough tokens, the traffic is considered exceeding, which triggers the drop (policing), re-classify (policing), or buffer (shaping).
  • Frame relay traffic shaping (FRTS)
    • Only controls frame relay traffic
    • Applied on subif or DLCI
    • Support fragmentation and interleaving
    • Reacts to FECNs and BECNs
  • Compression
    • Removed redundancy and patterns in data
    • Less data = less latency
    • Hardware compression or hardware-assisted compression does not involve the main CPU
    • Software compression does
    • Payload compression
    • Header compression
  • Link fragmentation and interleaving
    • Small data might be waiting for larger data pieces to finish sending
    • Chunks data into smaller fragments so they don’t have to wait
    • Interleaving shuffles flows in the Tx queue