本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本檔案將說明如何在效能路由版本2(PfRv2)中定義和使用學習清單和映像,以便影響字首的流量。
思科建議您瞭解PfR的基本知識。
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
PfRv2中的learn-list功能允許路由器學習和分組特定流量類。企業網路由各種型別的流量組成,包括應用、語音、影片等。Learn-list可以靈活地根據網路要求對此流量進行分組。learn-lists中的流量分類和分組通常使用與某些特定差分服務代碼點(DSCP)值匹配的訪問清單來實現,但字首清單也可以用於匹配字首。以下是基於DSCP值「ef」學習和分組流量的learn-list示例。
list seq 10 refname Video-Traffic
traffic-class access-list Video
throughput
!
ip access-list extended Video
permit ip any any dscp ef
學習清單可以服從任何使用者定義的策略。這通常通過pfr-map來實現。
Pfr-map可幫助您定義包含一組引數的策略。然後,將通過learn-list分類或分組的流量對映到pfr-map的單個序列。以下是一些可以使用pfr對映定義的引數。
附註:延遲將作為本文檔其餘部分的關鍵引數
PfR-Map可以有多個序列號(如路由對映),並且每個序列號可以引用不同的學習清單。
Link-Groups用於對外部介面進行分組,以便將流量從所選邊界路由器(BR)的退出鏈路中推出。還可以定義故障切換鏈路組以便在主鏈路組出策略時進行切換。例如,此組態會透過以下方式定義連結群組:
set link-group INET fallback MPLS
序列20下在pfr-map PFR中使用的此配置語句定義只要INET處於INPOLICY狀態,所有要通過INET的資料流量。在出現策略違規時,流量將故障轉移到MPLS鏈路。
pfr-map PFR 20
set link-group INET fallback MPLS
此圖提供組態範例的拓撲範例:
圖中所示的裝置:
R1伺服器 — 發起流量。
R3 - PfR主路由器。
R4和R5 - PfR邊界路由器。
連線到R9和R10的客戶端是從R1伺服器接收流量的裝置。
對於上一個場景,將配置兩個學習清單,一個用於應用程式(APPLICATION-LEARN-LIST),另一個用於資料(DATA-LEARN-LIST)流量。此案例使用首碼清單來定義流量。存取清單也可用於匹配TCP、UDP、網際網路控制訊息通訊協定(ICMP)等流量型別。也可使用DSCP、服務型別(ToS)等其他選項來匹配流量。
key chain pfr
key 0
key-string cisco
!
policy-rules PFR
!
border 10.4.4.4 key-chain pfr
interface Ethernet0/0 internal
interface Ethernet0/1 external
link-group MPLS
!
border 10.5.5.5 key-chain pfr
interface Ethernet0/0 internal
interface Ethernet0/1 external
link-group INET
!
learn
traffic-class filter access-list DENY-ALL
list seq 10 refname APPLICATION-LEARN-LIST
traffic-class prefix-list APPLICATION
throughput
list seq 20 refname DATA-LEARN-LIST
traffic-class prefix-list DATA
throughput
!
ip prefix-list DATA
seq 5 permit 10.30.0.0/24
!
ip prefix-list APPLICATION
seq 5 permit 10.20.0.0/24
!
pfr-map PFR 10
match pfr learn list APPLICATION-LEARN-LIST
set periodic 90
set delay threshold 25
set mode monitor active
set resolve delay priority 1 variance 10
set active-probe echo 10.20.0.12
set probe frequency 5
set link-group MPLS fallback INET
!
pfr-map PFR 20
match pfr learn list DATA-LEARN-LIST
set periodic 90
set delay threshold 25
set mode monitor both
set resolve delay priority 1 variance 10
set probe frequency 5
set link-group INET fallback MPLS
流量流經網路時,會與對應的字首清單和學習清單相符。因此,PfR-Map根據為每個learn-list定義的引數對流量執行操作。
字首10.20.0.0/24(應用程式)的流量處於INPOLICY狀態,並通過鏈路組MPLS進行流量。同樣,字首10.30.0.0/24(資料)也處於INPOLICY狀態,並通過鏈路組INET進行流量。
R3#show pfr master traffic-class
OER Prefix Statistics:
Pas - Passive, Act - Active, S - Short term, L - Long term, Dly - Delay (ms),
P - Percentage below threshold, Jit - Jitter (ms),
MOS - Mean Opinion Score
Los - Packet Loss (percent/10000), Un - Unreachable (flows-per-million),
E - Egress, I - Ingress, Bw - Bandwidth (kbps), N - Not applicable
U - unknown, * - uncontrolled, + - control more specific, @ - active probe all
# - Prefix monitor mode is Special, & - Blackholed Prefix
% - Force Next-Hop, ^ - Prefix is denied
DstPrefix Appl_ID Dscp Prot SrcPort DstPort SrcPrefix
Flags State Time CurrBR CurrI/F Protocol
PasSDly PasLDly PasSUn PasLUn PasSLos PasLLos EBw IBw
ActSDly ActLDly ActSUn ActLUn ActSJit ActPMOS ActSLos ActLLos
--------------------------------------------------------------------------------
10.20.0.0/24 N N N N N N
INPOLICY 50 10.4.4.4 Et0/1 BGP
N N N N N N N N
4 3 0 0 N N N N
10.30.0.0/24 N N N N N N
INPOLICY 0 10.5.5.5 Et0/1 BGP
1 2 0 0 0 0 14 1
1 1 0 0 N N N N
MPLS雲中的延遲增加大約150毫秒。延遲的增加違反了根據PfR-Map語句set delay threshold 25配置的25 ms閾值延遲值。
這會導致應用流量(10.20.0.0/24)根據配置的語句set link-group MPLS fallback INET故障切換到鏈路組INET。一段時間後,流量再次進入INPOLICY狀態並通過鏈路組INET流動。
附註:未發現對DATA流量有任何影響,因為其主路徑是INET,並且未對其引入延遲。
R3#show pfr master traffic-class
OER Prefix Statistics:
Pas - Passive, Act - Active, S - Short term, L - Long term, Dly - Delay (ms),
P - Percentage below threshold, Jit - Jitter (ms),
MOS - Mean Opinion Score
Los - Packet Loss (percent/10000), Un - Unreachable (flows-per-million),
E - Egress, I - Ingress, Bw - Bandwidth (kbps), N - Not applicable
U - unknown, * - uncontrolled, + - control more specific, @ - active probe all
# - Prefix monitor mode is Special, & - Blackholed Prefix
% - Force Next-Hop, ^ - Prefix is denied
DstPrefix Appl_ID Dscp Prot SrcPort DstPort SrcPrefix
Flags State Time CurrBR CurrI/F Protocol
PasSDly PasLDly PasSUn PasLUn PasSLos PasLLos EBw IBw
ActSDly ActLDly ActSUn ActLUn ActSJit ActPMOS ActSLos ActLLos
--------------------------------------------------------------------------------
10.20.0.0/24 N N N N N N
INPOLICY 72 10.5.5.5 Et0/1 BGP
N N N N N N N N
2 4 0 0 N N N N
10.30.0.0/24 N N N N N N
INPOLICY 0 10.5.5.5 Et0/1 BGP
1 1 0 0 0 0 14 1
1 1 0 0 N N N N
R3#show pfr master traffic-class performance
Traffic-class:
Destination Prefix : 10.20.0.0/24 Source Prefix : N/A
Destination Port : N/A Source Port : N/A
DSCP : N Protocol : N/A
Application Name: : N/A
General:
Control State : Controlled using BGP
Traffic-class status : INPOLICY
Current Exit : BR 10.5.5.5 interface Et0/1, Tie breaker was delay criteria
Time on current exit : 0d 0:2:40
Time remaining in current state : 31 seconds
Traffic-class type : Learned
Improper config : None
Last Out of Policy event:
Exit : BR 10.5.5.5 interface Et0/1
Reason : delay criteria
Time since Out of Policy event : 0d 0:2:52
Active Delay Performance : 1 msecs
Active Delay Threshold : 25 msecs
Average Active Performance Current Exit: (Average for last 5 minutes)
Unreachable : 0% -- Threshold: 50%
Delay : 1 msec -- Threshold: 25 msec
Last Resolver Decision:
BR Interface Status Reason Performance Threshold
--------------- ------------ ------------ ------------ ----------- ---------
10.4.4.4 Et0/1 Eliminated Delay 162 msecs 25 msecs
10.5.5.5 Et0/1 Best Exit Delay 13 msecs 25 msecs
從輸出中,您可以看到在MPLS雲中的延遲中出現了高達162毫秒的浪湧。這會導致違反策略,因為閾值延遲配置為25毫秒。
這會導致資料流量(10.30.0.0/24)根據配置的語句set link-group INET fallback MPLS故障切換到鏈路組MPLS。經過一段時間後,流量再次進入INPOLICY狀態,並通過鏈路組MPLS流動。
附註:對應用流量沒有影響,因為其主路徑是MPLS,並且在此情況下沒有在其上引入延遲。
R3#show pfr master traffic-class
OER Prefix Statistics:
Pas - Passive, Act - Active, S - Short term, L - Long term, Dly - Delay (ms),
P - Percentage below threshold, Jit - Jitter (ms),
MOS - Mean Opinion Score
Los - Packet Loss (percent/10000), Un - Unreachable (flows-per-million),
E - Egress, I - Ingress, Bw - Bandwidth (kbps), N - Not applicable
U - unknown, * - uncontrolled, + - control more specific, @ - active probe all
# - Prefix monitor mode is Special, & - Blackholed Prefix
% - Force Next-Hop, ^ - Prefix is denied
DstPrefix Appl_ID Dscp Prot SrcPort DstPort SrcPrefix
Flags State Time CurrBR CurrI/F Protocol
PasSDly PasLDly PasSUn PasLUn PasSLos PasLLos EBw IBw
ActSDly ActLDly ActSUn ActLUn ActSJit ActPMOS ActSLos ActLLos
--------------------------------------------------------------------------------
10.20.0.0/24 N N N N N N
INPOLICY 58 10.4.4.4 Et0/1 BGP
N N N N N N N N
1 2 0 0 N N N N
10.30.0.0/24 N N N N N N
INPOLICY 0 10.4.4.4 Et0/1 BGP
1 1 0 0 0 0 14 1
2 1 0 0 N N N N
R3#show pfr master traffic-class performance
Traffic-class:
Destination Prefix : 10.30.0.0/24 Source Prefix : N/A
Destination Port : N/A Source Port : N/A
DSCP : N Protocol : N/A
Application Name: : N/A
General:
Control State : Controlled using BGP
Traffic-class status : INPOLICY
Current Exit : BR 10.4.4.4 interface Et0/1, Tie breaker was delay criteria
Time on current exit : 0d 0:2:31
Time remaining in current state : 35 seconds
Traffic-class type : Learned
Improper config : None
Last Out of Policy event:
Exit : BR 10.4.4.4 interface Et0/1
Reason : delay criteria
Time since Out of Policy event : 0d 0:2:44
Active Delay Performance : 0 msecs
Active Delay Threshold : 25 msecs
Passive Delay Performance : 9 msecs
Passive Delay Threshold : 25 msecs
Average Passive Performance Current Exit: (Average for last 5 minutes)
Unreachable : 0% -- Threshold: 50%
Delay : 9 msecs -- Threshold: 25 msecs
Loss : 0% -- Threshold: 10%
Egress BW : 4 kbps
Ingress BW : 1 kbps
Time since last update : 0d 0:0:11
Average Active Performance Current Exit: (Average for last 5 minutes)
Unreachable : 0% -- Threshold: 50%
Delay : 0 msec -- Threshold: 25 msec
Last Resolver Decision:
BR Interface Status Reason Performance Threshold
--------------- ------------ ------------ ------------ ----------- ---------
10.5.5.5 Et0/1 Eliminated Delay 96 msecs 25 msecs
10.4.4.4 Et0/1 Best Exit Delay 5 msecs 25 msecs
目前尚無適用於此組態的具體疑難排解資訊。