Notes from MPLS Fundamentals - Cisco Express Forwarding

ccie-sp September 3rd, 2009

Here are some additional notes I found while cleaning out my drafts.  I forgot to publish it when I was reading the book.

MPLS Fundamentals - Chapter 6: Cisco Express Forwarding

Overview of IOS Switching Methods
-Process Switching - An IOS process handles the switching of a packet
-Interrupt Switching - When packets arrive the interface processor interrupts the central CPU asks it to switch the packet according to a route cache or switching table
-ASIC - CEF table is programmed in ASICS so packets can be switched in hardware

Process Switching
-IOS process copies the packet to CPU memory and looks up destination IP in routing table
-Packets are switched out particular interfaces after TTL has been lowered and CRC has been recalculated
-Central CPU always looks at packet

Fast Switching
-An on-demand forwarding table
-1st packet is process switched; central CPU builds a cache
-Interrupt code will switch subsequent packets for the same destination
-Cache is not permanent
-Route cache has an outgoing interface, next hop, and Layer 2 Rewrite field
-Enabled with ‘ip route-cache’ interface command

CEF Switching
-Table is built in advance
-Only switching method that can label an incoming IP packet and forward it

CEF Components
-FIB - Also known as CEF table
-Adjacency Table - Responsible for MAC or Layer 2 Rewrite; ARP used to map Layer 2 addresses to IP

CEF Table
-Responsible for the Layer 3 forwarding decision
-Recursive prefixes are immediately resolved

CEF Operation
-When packet enters router, Layer 2 info is stripped off
-A lookup is performed on the destination IP in the CEF table
-A forwarding decision is made
-Layer 2 Rewrite allows router to put a new Layer 2 header onto the frame before switching the packet out the outgoing interface toward the next hop

Distributed CEF (DCEF)
-Can be used in a distributed manner with higher-end models (i.e. 7500, GSR 12000)
-Distributed CPUs handle forwarding of traffic without burdening the central CPU
-For 7500, the CEF and adjacency table resides on VIP
-For GSR 12000, the CEF and adjacency table resides on the line cards

CEF Switching in Hardware
-ASICs can forward packets at very high rates

CEF Load Balancing
-Per-packet - Round-robin packet per packet on outgoing links
-Per-destination - Destination and source IP addresses are hashed; hash is pointed to load sharing table

Labeling IP Packets by CEF
-CEF labels only the packets that are initially on the ingress PE router

Load Balancing Labeled Packets
-If MPLS payload is IPv4 packet, load balancing is done by hashing the source and destination IP address of the IPv4 header
-If MPLS payload is IPv6 packet, load balancing is done by hashing the source and destination IP address of the IPv6 header
-If MPLS payload is not an IPv4 or IPv6 packet, load balancing is done by looking at the value of the bottom label

Notes from MPLS Fundamentals - Forwarding Labeled Packets

ccie-sp July 6th, 2009

For me, returning back to work after a long weekend is a slow process.  I find that I need to spark my motivation in some way, so before diving in to my workload, I decided to read up on MPLS.  The main reason for reading up on MPLS (and not something else more enjoyable) was to prepare for a proposal that I needed to write up for a client.  Since terminology is often thrown around in meetings and discussions, I figured during my morning lull that it was best to solidify my knowledge of the technology.  I pretty much read through Chapters 1 & 2 fairly quickly.  Based on past experiences, the bulk of the material for Cisco Press books seems to appear in the 3rd chapter.  On that point, here are the notes I gathered:

MPLS Fundamentals - Chapter 3: Forwarding Labeled Packets

IP Lookup vs Label Lookup
-Lookup in CEF table
–IP-to-IP
–IP-to-label
-Lookup in LFIB table
–Label-to-IP
–Label-to-label

Label Operations Recap
-Pop - top label is removed; packet forwarded with remaining label stack or as an unlabeled packet
-Swap - top label is removed and replaced with a new label
-Push - top label is replaced with new label (swapped) and one or more labels are added (pushed) on top of the swapped label
-Untagged/No label - stack is removed and packet is forwarded unlabeled
-Aggregate - label stack is removed and IP lookup is performed on IP packet

Unknown Label
-LSR will drop incoming packets with an unknown top label

Reserved Labels 0 - 15
-0 - Explicit NULL Label - Maintains QoS on PHP
-1 - Router Alert Label - Present anywhere in stack except bottom; packet not forwarded in hardware will be reviewed by software process
-2 - IPv6 Explicit NULL Label
-3 - Implicit NULL Label - PHP; removes LFIB lookup for directly connected and summary
-14 - OAM Alert Label - Not used by IOS; used for failure detection, localization, and performance monitoring

IP TTL
-An 8-bit field within an IP header signifies the time a packet has to live before it is dropped;  TTL is usually 255 and decremented by 1 at each hop; When TTL reaches 0, packet is dropped by router and sends ICMP message type 11, code 0 (time exceeded) to end of LSP for delivery to originator (i.e. P-router has no knowledge of orignator routes)

MPLS TTL
-IP TTL value is copied to pushed labels
–IP-to-MPLS Behavior of MPLS TTL - Safeguard mechanism in IOS does not copy if MPLS TTL > IP TTL
–Label-to-label Behavior of MPLS TTL - Swap operation, TTL of incoming label -1 is copied to swapped label; Push operation, received MPLS TTL of top label -1 is copied to swapped and pushed labeles; Pop operation, TTL of incoming label -1 is copied to new exposed label
–P-router Behavior of MPLS TTL - Notes what the MPLS payload, a Layer 2 frame, is when the TTL expires; drops packets if not IPv4 or IPv6

MPLS MTU
-n * 4 bytes, n = # of labels
-sh mpls int det
-mpls mtu ‘1500 + (2 * 4)’
-Giant Frame
–Layer 2 frame that reaches max size for data link
-Baby Giant Frame
–Slightly bigger than max allowed
–Recommended on switches
—system jumbomtu
—system mtu
—mtu (int setting)

MPLS MRU
-Cisco proprietary; LSR is informed how big a received label packet of a certain FEC that can still be forwarded out without fragmentation; label operation determines MRU per FEC or prefix

Fragmentation
-If labeled packet exceeds outgoing MTU, the LSR strips the label stack and fragments IP; if DF-bit set, ICMP error message type 3, code 4 (Fragmentation needed and do not fragment bit set) is sent to end of LSP
-Path MTU Discovery - Orignator that receives ICMP error message type 3, code 4 lowers the size of packet and retransmits to avoid fragmentation
–Firewalls, ACLs, and routing issues can prohibit originator receipt of ICMP error message type 3, code 4

blank