MPLSのTTL処理とMTU
MPLSのラベルは4バイトのラベルスタックエントリとしてパケットに付き、そのうちTTLフィールドが8ビットです。入口のLSRがIPヘッダーのTTLをこのフィールドへ写すかどうかで、コアのルータがtracerouteに見えるかが変わります。もう1つ、ラベルスタックエントリは1段につき4バイトを消費するので、リンクのMTUに対して運べるIPパケットがその分だけ小さくなります。本記事ではこの2点を解説し、IOS XR(XRv9000とXRd)のラボで確かめます。ラベルの形式はMPLSラベルとラベルスタックで解説しています。
ラベルのTTLとIPのTTL
MPLSのTTLはIPのTTLとは別のフィールドです。ラベル付きで転送している間、LSRが減らすのは先頭のラベルのTTLだけで、中のIPヘッダーには触れません。
入口のLSRがラベルを積むとき、TTLに何を入れるかで2通りに分かれます。RFC 3443はこれをuniformモデルとpipe / short pipeモデルとして整理しています。
| モデル | 入口でラベルに入れるTTL | 出口 |
|---|---|---|
| uniform(3.1節、IOS XRの既定) | IPのTTLから1を引いた値をコピーする | ラベルのTTLをIPへ書き戻す |
| short pipe(3.2節) | 運用者が決めた値(IOS XRは255) | ラベルのTTLは使わない |
| pipe(3.3節) | short pipeと同じ | 同上。TTLの扱いはPHPを使わないshort pipeと同じで、違いは出口がどちらのヘッダー(中のIPか、外側のラベルか)で転送を決めるか |
uniformでは、コアを通った分だけIPのTTLが減ります。tracerouteのプローブはTTLを1ずつ増やして送るので、コアのLSRがTTL超過のICMPを返し、コアのP(このラボではP1)が経路として見えます。伝搬を止めるとラベルのTTLは255から始まり、コアで尽きることがありません。コアはICMPを返さず、CE1から見るとPEの間が1ホップに見えます。
IOS XRではmpls ip-ttl-propagate disableで切り替えます。設定するのは入口になるPEだけで、方向ごとに独立しています。PE1にだけ入れた場合、CE1からCE2へのtracerouteではコアが消え、CE2からCE1へのtracerouteでは見えたままになります。
コアの構成を利用者に見せたくない事業者はこれを止めます。一方で止めると経路の追跡が難しくなるため、運用のしやすさとのトレードオフになります。
ラベルはMTUを消費する
ラベルは1段につき4バイトです。リンクのMTUは変わらないので、ラベルを積んだ分だけ運べるIPパケットが小さくなります。
IOS XRのインタフェースのmtuはL2のMTUで、イーサネットヘッダー14バイトを含みます。既定の1514はIPのMTUが1500という意味です。MPLSのMTUは、既定ではL2のMTUから14を引いた値になります。
コアのL2のMTUをMとすると、通せるIPパケットの上限は次のようになります。
| ラベルの段数 | 用途 | 上限 | 既定(M = 1514) |
|---|---|---|---|
| 1段 | トランスポートラベルのみ | M − 14 − 4 | 1496バイト |
| 2段 | MPLS VPN(トランスポート + VPN) | M − 14 − 8 | 1492バイト |
上限を超えたパケットが入口のPEに届くと、IPヘッダーのDFビットで扱いが分かれます。DFが立っていなければPEが断片化してから転送します。立っていれば転送できないので破棄し、送信元へICMPのType 3 Code 4(Fragmentation Needed)を返します。このとき通知するMTUはラベルの分を引いた値なので(RFC 3032の3.4節)、Path MTU Discoveryが正しく働きます。
実運用では、MPLS区間のMTUを大きくして、利用者の1500バイトのIPパケットをラベルを付けたまま通せるようにします。必要なL2のMTUは1500にラベルの段数×4と14を足した値で、MPLS VPNの2段なら1522です。ラベルを3段以上積む構成やL2VPN(利用者のイーサネットフレームを丸ごと運ぶ)にも備えて、コアのリンクは9216のように9000台に大きくとるのが一般的です。途中にスイッチがあれば、そこも同じ大きさのフレームを通す設定が必要です。
実機での検証
検証環境
CE1 — PE1 — P1 — PE2 — CE2 を直列につなぎ、PE1とPE2にVRF CUST-Aの顧客CE3 / CE4をつないでいます。AS 65001のPE1 / P1 / PE2がMPLSネットワークで、OSPF(area 0、全リンクnetwork point-to-point)で経路を、LDPでラベルを配っています。CE1 / CE2の経路はPE間のiBGP(next-hop-self)で、CE3 / CE4の経路はVPNv4で運ばれます。CE1からCE2へのパケットはラベル1段、CE3からCE4へのパケットはラベル2段(トランスポート + VPN)になります。
PE1 / P1 / PE2はXRv9000、CEはXRdです。XRd(IOS XRをコンテナで動かすソフトウェア版)どうしではmtuを上げても1500バイトを超えるフレームが届かないため、MTUを大きくするMPLS区間だけをXRv9000にしています。CEとPEの間は既定のMTU(1514)のままで、CEは1500バイトまでのIPパケットを送ります。
| ルータ | 種類 | 役割 | Lo0 | リンク |
|---|---|---|---|---|
| CE1 | XRd | 顧客側(AS 65101)、192.168.1.0/24 | 1.1.1.1/32 | Gi0/0/0/0 10.1.2.1 |
| PE1 | XRv9000 | 入口 / 出口LSR | 2.2.2.2/32 | Gi0/0/0/0 10.1.2.2(CE1) / Gi0/0/0/1 10.2.3.2(P1) / Gi0/0/0/2 10.2.6.2(CE3、VRF) |
| P1 | XRv9000 | 中継LSR | 3.3.3.3/32 | Gi0/0/0/0 10.2.3.3 / Gi0/0/0/1 10.3.4.3 |
| PE2 | XRv9000 | 入口 / 出口LSR | 4.4.4.4/32 | Gi0/0/0/0 10.3.4.4(P1) / Gi0/0/0/1 10.4.5.4(CE2) / Gi0/0/0/2 10.4.7.4(CE4、VRF) |
| CE2 | XRd | 顧客側(AS 65102)、192.168.2.0/24 | 5.5.5.5/32 | Gi0/0/0/0 10.4.5.5 |
| CE3 | XRd | VRF CUST-Aの顧客側(AS 65103)、192.168.3.0/24 | 6.6.6.6/32 | Gi0/0/0/0 10.2.6.6 |
| CE4 | XRd | VRF CUST-Aの顧客側(AS 65104)、192.168.4.0/24 | 7.7.7.7/32 | Gi0/0/0/0 10.4.7.7 |
CE1 - PE1、CE3 - PE1、PE1 - P1、P1 - PE2の4リンクでSTEPごとにキャプチャーしています。MTUを変えるのはMPLS区間の4インタフェース(PE1 Gi0/0/0/1、P1の2つ、PE2 Gi0/0/0/0)です。
検証のSTEP
| STEP | 操作 | 確かめること |
|---|---|---|
| 0 | 初期状態(MPLS区間のMTU 1514、TTL伝搬あり) | DF付きで通る上限がラベル1段で1496、2段で1492であること。PE1がICMP Type 3 Code 4を返し、DFなしの1500は断片化されること。tracerouteにP1が出ること |
| 1 | MPLS区間の4インタフェースをmtu 1522 | L3VPNの1500バイト(ラベル2段)がDF付きのまま通ること。MPLS区間を1522バイトのフレームが流れること |
| 2 | MPLS区間の4インタフェースをmtu 9216 | 1522を超えるフレームも通ること(PE1 - PE2間で9000バイト) |
| 3 | PE1にmpls ip-ttl-propagate disable | CE1からCE2へのtracerouteからP1が消え、逆方向は見えたままであること |
| 4 | STEP 1〜3を削除(最終状態) | STEP 0と同じに戻ること |
既定のMTUではL3VPNの1500バイトが通らない
MPLS区間のMTUが既定の1514のとき、CE3からCE4へDF付きで通るのは1492バイトまでです。1493と1500は届きません。DFを立てなければ1500も届きます。
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1492 df-bit count 5 timeout 1
Mon Sep 28 12:42:14.351 UTC
Type escape sequence to abort.
Sending 5, 1492-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 19/19/21 ms
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1493 df-bit count 5 timeout 1
Mon Sep 28 12:42:15.544 UTC
Type escape sequence to abort.
Sending 5, 1493-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
.....
Success rate is 0 percent (0/5)
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1500 df-bit count 5 timeout 1
Mon Sep 28 12:42:21.880 UTC
Type escape sequence to abort.
Sending 5, 1500-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
.....
Success rate is 0 percent (0/5)
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1500 count 5 timeout 1
Mon Sep 28 12:42:28.080 UTC
Type escape sequence to abort.
Sending 5, 1500-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 25/30/42 msラベル1段のCE1からCE2では、上限が4バイト大きい1496になります。
RP/0/RP0/CPU0:CE1#ping 192.168.2.1 source 192.168.1.1 size 1496 df-bit count 5 timeout 1
Mon Sep 28 12:40:34.301 UTC
Type escape sequence to abort.
Sending 5, 1496-byte ICMP Echos to 192.168.2.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 19/20/22 ms
RP/0/RP0/CPU0:CE1#ping 192.168.2.1 source 192.168.1.1 size 1497 df-bit count 5 timeout 1
Mon Sep 28 12:40:35.437 UTC
Type escape sequence to abort.
Sending 5, 1497-byte ICMP Echos to 192.168.2.1 timeout is 1 seconds:
.....
Success rate is 0 percent (0/5)
RP/0/RP0/CPU0:CE1#ping 192.168.2.1 source 192.168.1.1 size 1500 df-bit count 5 timeout 1
Mon Sep 28 12:40:41.302 UTC
Type escape sequence to abort.
Sending 5, 1500-byte ICMP Echos to 192.168.2.1 timeout is 1 seconds:
.....
Success rate is 0 percent (0/5)1493バイトのDF付きパケットを受け取ったPE1は、転送せずにICMP Type 3 Code 4を返します(CE3 - PE1間のNo.64)。通知するMTU(MTU of next hop)は1492で、ラベル2段の8バイトを引いた値です。CE1へ返した同じICMPでは1496でした。
Internet Control Message Protocol
Type: Destination unreachable (3)
[Expert Info (Note/Response): Type indicates an error]
[Type indicates an error]
[Severity level: Note]
[Group: Response]
Code: 4 (Fragmentation needed)
Checksum: 0xa902 [correct]
[Checksum Status: Good]
Unused: 00
Length: 17
[Length of original datagram: 68]
MTU of next hop: 1492
Internet Protocol Version 4, Src: 192.168.3.1, Dst: 192.168.4.1
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint: Default (0)
.... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 1493
Identification: 0x0000 (0)
010. .... = Flags: 0x2, Don't fragment
0... .... = Reserved bit: Not set
.1.. .... = Don't fragment: Set
..0. .... = More fragments: Not set
...0 0000 0000 0000 = Fragment Offset: 0DFなしの1500バイトは、PE1が断片化してからラベルを付けています。PE1 - P1間では1492バイトと28バイトの2つに分かれ、どちらにも2段のラベルが付いています。1つ目のフレームは1514バイトで、MTUいっぱいです。
$ tshark -r - -Y 'frame.number==445 || frame.number==449' -T fields -e frame.number -e frame.len -e mpls.label -e ip.len -e ip.flags.mf -e ip.frag_offset \
< mpls-ttl-mtu-step0-pe1p1.pcap
445 50 24001,24003 28 False 184
449 50 24001,24003 28 False 184MPLS区間のMTUを1522にするとL3VPNの1500バイトが通る
利用者の1500バイトにラベル2段(8バイト)とイーサネットヘッダー(14バイト)を足すと1522です。MPLS区間の両端のmtuを1522にします。P1では2つのインタフェースに入れています。
RP/0/RP0/CPU0:P1#show configuration commit changes last 1
Sun Oct 4 03:51:32.767 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
interface GigabitEthernet0/0/0/0
mtu 1522
!
interface GigabitEthernet0/0/0/1
mtu 1522
!
endIPに使えるのは14を引いた1508バイトで、ラベル2段の1500バイトがちょうど収まります。
RP/0/RP0/CPU0:P1#show ipv4 interface GigabitEthernet0/0/0/0
Sun Oct 4 04:04:54.019 UTC
GigabitEthernet0/0/0/0 is Up, ipv4 protocol is Up
Vrf is default (vrfid 0x60000000)
Internet address is 10.2.3.3/24
MTU is 1522 (1508 is available to IP)
Helper address is not set
Multicast reserved groups joined: 224.0.0.2 224.0.0.5 224.0.0.6
Directed broadcast forwarding is disabled
Outgoing access list is not set
Inbound common access list is not set, access list is not set
Proxy ARP is disabled
ICMP redirects are never sent
ICMP unreachables are always sent
ICMP mask replies are never sent
Table Id is 0xe0000000CE3からCE4へ、1500バイトまでDF付きのまま通るようになりました。
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1492 df-bit count 5 timeout 1
Sun Oct 4 04:00:07.118 UTC
Type escape sequence to abort.
Sending 5, 1492-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 15/16/19 ms
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1493 df-bit count 5 timeout 1
Sun Oct 4 04:00:08.121 UTC
Type escape sequence to abort.
Sending 5, 1493-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 15/15/17 ms
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1500 df-bit count 5 timeout 1
Sun Oct 4 04:00:09.225 UTC
Type escape sequence to abort.
Sending 5, 1500-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 15/18/23 ms
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1500 count 5 timeout 1
Sun Oct 4 04:00:10.240 UTC
Type escape sequence to abort.
Sending 5, 1500-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 17/17/20 msPE1 - P1間のNo.4611が、DF付き1500バイトのecho requestです。フレーム長が1522バイトで、2段のラベルの下に1500バイトのIPパケットがそのまま入っています。
Frame Length: 1522 bytes (12176 bits)
Capture Length: 1522 bytes (12176 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:mpls:icmp:data]
Character encoding: ASCII (0)
Ethernet II, Src: 52:54:00:ee:89:fb (52:54:00:ee:89:fb), Dst: 52:54:00:05:93:9b (52:54:00:05:93:9b)
Destination: 52:54:00:05:93:9b (52:54:00:05:93:9b)
.... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: 52:54:00:ee:89:fb (52:54:00:ee:89:fb)
.... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: MPLS label switched packet (0x8847)
[Stream index: 4]
MultiProtocol Label Switching Header, Label: 24001, Exp: 0, S: 0, TTL: 254
0000 0101 1101 1100 0001 .... .... .... = MPLS Label: 24001 (0x05dc1)
.... .... .... .... .... 000. .... .... = MPLS Experimental Bits: 0
.... .... .... .... .... ...0 .... .... = MPLS Bottom Of Label Stack: 0
.... .... .... .... .... .... 1111 1110 = MPLS TTL: 254
MultiProtocol Label Switching Header, Label: 24003, Exp: 0, S: 1, TTL: 254
0000 0101 1101 1100 0011 .... .... .... = MPLS Label: 24003 (0x05dc3)
.... .... .... .... .... 000. .... .... = MPLS Experimental Bits: 0
.... .... .... .... .... ...1 .... .... = MPLS Bottom Of Label Stack: 1
.... .... .... .... .... .... 1111 1110 = MPLS TTL: 254
Internet Protocol Version 4, Src: 192.168.3.1, Dst: 192.168.4.1
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint: Default (0)
.... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 1500
Identification: 0x0000 (0)
010. .... = Flags: 0x2, Don't fragment
0... .... = Reserved bit: Not set
.1.. .... = Don't fragment: Setラベル1段のCE1からCE2も1500まで通ります。
RP/0/RP0/CPU0:CE1#ping 192.168.2.1 source 192.168.1.1 size 1496 df-bit count 5 timeout 1
Sun Oct 4 03:58:42.865 UTC
Type escape sequence to abort.
Sending 5, 1496-byte ICMP Echos to 192.168.2.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 14/15/18 ms
RP/0/RP0/CPU0:CE1#ping 192.168.2.1 source 192.168.1.1 size 1497 df-bit count 5 timeout 1
Sun Oct 4 03:58:43.795 UTC
Type escape sequence to abort.
Sending 5, 1497-byte ICMP Echos to 192.168.2.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 14/15/18 ms
RP/0/RP0/CPU0:CE1#ping 192.168.2.1 source 192.168.1.1 size 1500 df-bit count 5 timeout 1
Sun Oct 4 03:58:44.702 UTC
Type escape sequence to abort.
Sending 5, 1500-byte ICMP Echos to 192.168.2.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 13/14/16 ms上限がちょうど1522であることは、PE1からPE2(4.4.4.4)へのpingで確かめられます。PE1はP1が割り当てたラベル1段を付けるので、1504 + 4 + 14 = 1522バイトが上限です。1504は通り、1505は通りません。PE1のpingファイルはコマンドの行に端末の行編集の制御文字が入っているため、応答の行だけを載せ、コマンドはタイトルに書いています。
Sun Oct 4 03:59:09.866 UTC
Type escape sequence to abort.
Sending 5, 1504-byte ICMP Echos to 4.4.4.4 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 27/40/54 msSun Oct 4 03:59:12.021 UTC
Type escape sequence to abort.
Sending 5, 1505-byte ICMP Echos to 4.4.4.4 timeout is 1 seconds:
.....
Success rate is 0 percent (0/5)mtuを変えたインタフェースはいったん落ちるため、OSPFの隣接が張り直されます(各ルータのSTEP 1の..._log.txt)。P1のログでは、先にPE1が変わってMTUが食い違った間、PE1との隣接がEXSTARTにとどまっていました。
この張り直しの間、顧客のトラフィックは落ちます。設定変更をまたいでCE1から流したpingでは、MTUを変えたSTEP 1で80発、STEP 2で79発が落ちました(各2000発)。一方、インタフェースを触らないTTL伝搬の変更(STEP 3)は0発です。
| STEP | 操作 | 断をまたぐping |
|---|---|---|
| 1 | MPLS区間の4インタフェースをmtu 1522 | 1920/2000(ロス80発) |
| 2 | 同じインタフェースをmtu 9216 | 1921/2000(ロス79発) |
| 3 | PE1にmpls ip-ttl-propagate disable | 2000/2000(ロスなし) |
MTUの変更はインタフェースの再起動を伴うので、運用中の装置では収束の影響を見込む必要があります。TTL伝搬の切り替えは転送を止めません。ロス数から読み取れるのはpingの粒度より粗い時間だけで(interval 100 timeout 1)、ここでは「落ちるか落ちないか」の違いとして扱います。片側だけ変えるとMTUが食い違い、OSPFがEXSTARTで止まります。両端をまとめて変えてください。
MPLS区間のMTUを9216にする
1522はラベル2段の1500バイトにちょうど合わせた値です。実際のMPLS網では、ラベルを3段以上積む構成やL2VPN(利用者のイーサネットフレームを丸ごと運ぶ)、利用者のジャンボフレームにも備えて、コアのMTUを9000台に大きくとります。STEP 2では4インタフェースを9216にしました。
RP/0/RP0/CPU0:P1#show configuration commit changes last 1
Sun Oct 4 04:08:50.913 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
interface GigabitEthernet0/0/0/0
mtu 9216
!
interface GigabitEthernet0/0/0/1
mtu 9216
!
endRP/0/RP0/CPU0:P1#show ipv4 interface GigabitEthernet0/0/0/0
Sun Oct 4 04:21:59.545 UTC
GigabitEthernet0/0/0/0 is Up, ipv4 protocol is Up
Vrf is default (vrfid 0x60000000)
Internet address is 10.2.3.3/24
MTU is 9216 (9202 is available to IP)
Helper address is not set
Multicast reserved groups joined: 224.0.0.2 224.0.0.5 224.0.0.6
Directed broadcast forwarding is disabled
Outgoing access list is not set
Inbound common access list is not set, access list is not set
Proxy ARP is disabled
ICMP redirects are never sent
ICMP unreachables are always sent
ICMP mask replies are never sent
Table Id is 0xe0000000STEP 1では届かなかった1505バイトと9000バイトが、PE1からPE2へ届きます。
Sun Oct 4 04:16:24.812 UTC
Type escape sequence to abort.
Sending 5, 1505-byte ICMP Echos to 4.4.4.4 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 29/34/39 msSun Oct 4 04:16:27.278 UTC
Type escape sequence to abort.
Sending 5, 9000-byte ICMP Echos to 4.4.4.4 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 37/45/61 msPE1 - P1間では、ラベル付きで9018バイト(9000 + 4 + 14)のフレームが流れています。P1がPHPでラベルを外すため、PE2からの応答はラベルなしの9014バイトです。
$ tshark -r - -Y 'frame.number==4398 || frame.number==4399' -T fields -e frame.number -e frame.len -e mpls.label -e ip.src -e ip.dst -e ip.len \
< mpls-ttl-mtu-step2-pe1p1.pcap
4398 9018 24001 2.2.2.2 4.4.4.4 9000
4399 9014 4.4.4.4 2.2.2.2 9000CEとPEの間は1514のままなので、CEから送れるのは1500バイトまでで変わりません。MPLS区間を大きくしておけば、利用者の1500バイトはラベルが何段になってもMPLS区間で落ちなくなります。
TTLの伝搬を止めるとP1が見えなくなる
TTL伝搬ありのSTEP 0では、CE1からCE2へのtracerouteの2ホップ目にP1(10.2.3.3)が出ます。
RP/0/RP0/CPU0:CE1#traceroute 192.168.2.1 source 192.168.1.1 timeout 1 probe 2 maxttl 5
Mon Sep 28 12:40:47.375 UTC
Type escape sequence to abort.
Tracing the route to 192.168.2.1
1 10.1.2.2 42 msec 41 msec
2 10.2.3.3 [MPLS: Label 24001 Exp 0] 82 msec 25 msec
3 10.3.4.4 39 msec 61 msec
4 10.4.5.5 22 msec *同じecho requestを3リンクで追うと、PE1がIPのTTL(255から1引いた254)をラベルへ写し、P1がラベルのTTLを1引いてからラベルを外しています。P1 - PE2間のIPのTTLは253です。
$ tshark -r - -Y 'icmp.type==8 && ip.src==192.168.1.1' -T fields -e frame.number -e mpls.label -e mpls.ttl -e ip.ttl \
< mpls-ttl-mtu-step0-ce1pe1.pcap
5 255
$ tshark -r - -Y 'icmp.type==8 && ip.src==192.168.1.1' -T fields -e frame.number -e mpls.label -e mpls.ttl -e ip.ttl \
< mpls-ttl-mtu-step0-pe1p1.pcap
55 24001 254 254
$ tshark -r - -Y 'icmp.type==8 && ip.src==192.168.1.1' -T fields -e frame.number -e mpls.label -e mpls.ttl -e ip.ttl \
< mpls-ttl-mtu-step0-p1pe2.pcap
55 253PE1にmpls ip-ttl-propagate disableを入れます。
RP/0/RP0/CPU0:PE1#show configuration commit changes last 1
Sun Oct 4 04:25:17.409 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
mpls ip-ttl-propagate disable
endラベルのTTLは255から始まり、P1で尽きることがありません。P1は2番目のプローブにICMPを返さず、tracerouteは3ホップになります。
RP/0/RP0/CPU0:CE1#traceroute 192.168.2.1 source 192.168.1.1 timeout 1 probe 2 maxttl 5
Sun Oct 4 04:32:01.652 UTC
Type escape sequence to abort.
Tracing the route to 192.168.2.1
1 10.1.2.2 18 msec 28 msec
2 10.3.4.4 39 msec 26 msec
3 10.4.5.5 25 msec *$ tshark -r - -Y 'icmp.type==8 && ip.src==192.168.1.1' -T fields -e frame.number -e mpls.label -e mpls.ttl -e ip.ttl \
< mpls-ttl-mtu-step3-ce1pe1.pcap
3 255
$ tshark -r - -Y 'icmp.type==8 && ip.src==192.168.1.1' -T fields -e frame.number -e mpls.label -e mpls.ttl -e ip.ttl \
< mpls-ttl-mtu-step3-pe1p1.pcap
4 24001 254 254
$ tshark -r - -Y 'icmp.type==8 && ip.src==192.168.1.1' -T fields -e frame.number -e mpls.label -e mpls.ttl -e ip.ttl \
< mpls-ttl-mtu-step3-p1pe2.pcap
2 253P1 - PE2間のIPのTTLは254で、PE1で1減っただけです。P1はラベルを外すときに、ラベルのTTL(254)とIPのTTL(254)の小さいほうをIPヘッダーに残しています。
設定したのは入口のPE1だけなので、逆方向のCE2からCE1では入口がPE2になり、P1(10.3.4.3)が見えたままです。
RP/0/RP0/CPU0:CE2#traceroute 192.168.1.1 source 192.168.2.1 timeout 1 probe 2 maxttl 5
Sun Oct 4 04:32:58.802 UTC
Type escape sequence to abort.
Tracing the route to 192.168.1.1
1 10.4.5.4 19 msec 21 msec
2 10.3.4.3 [MPLS: Label 24000 Exp 0] 27 msec 50 msec
3 10.2.3.2 33 msec 31 msec
4 10.1.2.1 20 msec *元に戻す
STEP 4でSTEP 1〜3の設定を削除すると、CE3からCE4へDF付きで通る上限は1492に戻ります。
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1492 df-bit count 5 timeout 1
Sun Oct 4 04:47:58.045 UTC
Type escape sequence to abort.
Sending 5, 1492-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/12/15 ms
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1493 df-bit count 5 timeout 1
Sun Oct 4 04:47:59.216 UTC
Type escape sequence to abort.
Sending 5, 1493-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
.....
Success rate is 0 percent (0/5)
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1500 df-bit count 5 timeout 1
Sun Oct 4 04:48:05.385 UTC
Type escape sequence to abort.
Sending 5, 1500-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
.....
Success rate is 0 percent (0/5)
RP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 size 1500 count 5 timeout 1
Sun Oct 4 04:48:11.259 UTC
Type escape sequence to abort.
Sending 5, 1500-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/31/45 ms疎通
MTUとTTLの設定を変えても、通常の大きさのpingはどのSTEPでも届いています。
RP/0/RP0/CPU0:CE1#ping 192.168.2.1 source 192.168.1.1 count 20 timeout 1
Mon Sep 28 12:40:32.886 UTC
Type escape sequence to abort.
Sending 20, 100-byte ICMP Echos to 192.168.2.1 timeout is 1 seconds:
!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (20/20), round-trip min/avg/max = 18/20/23 msRP/0/RP0/CPU0:CE3#ping 192.168.4.1 source 192.168.3.1 count 20 timeout 1
Mon Sep 28 12:42:12.772 UTC
Type escape sequence to abort.
Sending 20, 100-byte ICMP Echos to 192.168.4.1 timeout is 1 seconds:
!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (20/20), round-trip min/avg/max = 18/18/20 ms検証Configおよびshow結果
各STEPで7台すべてから、次の種類をルータごとに分けて取得しています。検証Configはこの..._run.txtです(最終状態はSTEP 4のもの)。各STEPは「カウンタのクリア → ping → show」の順に採っています。
| ファイル | 内容 |
|---|---|
..._clear.txt | そのSTEPの最初にクリアしたカウンタ(clear counters interface、PE / Pはclear mpls forwarding countersも) |
..._ping.txt | pingとtraceroute。CEはDF付きの大きさ違い(CE1は1496 / 1497 / 1500、CE3は1492 / 1493 / 1500とDFなしの1500)。PE1はグローバルで1504 / 1505 / 9000。PE1のVRFから送った1500 / 1501は、送信元の10.2.6.0/24がCE4の経路表に無いため全STEPで応答が返っていません(MTUとは無関係) |
..._show.txt | show version / show interface description / show route / OSPF / show interfaces / show ipv4 interface / LDP / show mpls forwarding / show cef など。PEはBGPとVPNの表示を追加 |
..._log.txt | そのSTEPの範囲だけに絞ったshow logging |
..._run.txt | そのSTEP時点のshow running-config(=そのSTEPの検証Config) |
..._trace.txt | PE1 / P1 / PE2のみ。show mpls ldp trace binding / peerとshow mpls lsd trace |
..._commit.cfg | そのSTEPで実際にcommitされた設定(変更したルータのみ) |
STEP 0:初期状態(MPLS区間のMTU 1514、TTL伝搬あり)
| ルータ | show出力 | ping | clear | syslog | running-config | trace | 投入した設定 | 断の測定 |
|---|---|---|---|---|---|---|---|---|
| CE1 | show | ping | clear | log | run | — | — | — |
| PE1 | show | ping | clear | log | run | trace | — | — |
| P1 | show | — | clear | log | run | trace | — | — |
| PE2 | show | ping | clear | log | run | trace | — | — |
| CE2 | show | ping | clear | log | run | — | — | — |
| CE3 | show | ping | clear | log | run | — | — | — |
| CE4 | show | ping | clear | log | run | — | — | — |
STEP 1:MPLS区間の4インタフェースをmtu 1522
| ルータ | show出力 | ping | clear | syslog | running-config | trace | 投入した設定 | 断の測定 |
|---|---|---|---|---|---|---|---|---|
| CE1 | show | ping | clear | log | run | — | — | outage |
| PE1 | show | ping | clear | log | run | trace | cfg | — |
| P1 | show | — | clear | log | run | trace | cfg | — |
| PE2 | show | ping | clear | log | run | trace | cfg | — |
| CE2 | show | ping | clear | log | run | — | — | — |
| CE3 | show | ping | clear | log | run | — | — | — |
| CE4 | show | ping | clear | log | run | — | — | — |
STEP 2:MPLS区間の4インタフェースをmtu 9216
| ルータ | show出力 | ping | clear | syslog | running-config | trace | 投入した設定 | 断の測定 |
|---|---|---|---|---|---|---|---|---|
| CE1 | show | ping | clear | log | run | — | — | outage |
| PE1 | show | ping | clear | log | run | trace | cfg | — |
| P1 | show | — | clear | log | run | trace | cfg | — |
| PE2 | show | ping | clear | log | run | trace | cfg | — |
| CE2 | show | ping | clear | log | run | — | — | — |
| CE3 | show | ping | clear | log | run | — | — | — |
| CE4 | show | ping | clear | log | run | — | — | — |
STEP 3:PE1にmpls ip-ttl-propagate disable
| ルータ | show出力 | ping | clear | syslog | running-config | trace | 投入した設定 | 断の測定 |
|---|---|---|---|---|---|---|---|---|
| CE1 | show | ping | clear | log | run | — | — | outage |
| PE1 | show | ping | clear | log | run | trace | cfg | — |
| P1 | show | — | clear | log | run | trace | — | — |
| PE2 | show | ping | clear | log | run | trace | — | — |
| CE2 | show | ping | clear | log | run | — | — | — |
| CE3 | show | ping | clear | log | run | — | — | — |
| CE4 | show | ping | clear | log | run | — | — | — |
STEP 4:STEP 1〜3を削除(最終状態)
| ルータ | show出力 | ping | clear | syslog | running-config | trace | 投入した設定 | 断の測定 |
|---|---|---|---|---|---|---|---|---|
| CE1 | show | ping | clear | log | run | — | — | — |
| PE1 | show | ping | clear | log | run | trace | cfg | — |
| P1 | show | — | clear | log | run | trace | cfg | — |
| PE2 | show | ping | clear | log | run | trace | cfg | — |
| CE2 | show | ping | clear | log | run | — | — | — |
| CE3 | show | ping | clear | log | run | — | — | — |
| CE4 | show | ping | clear | log | run | — | — | — |
パケットキャプチャーはSTEPごとに取得しています。
| STEP | CE1 - PE1間 | CE3 - PE1間 | PE1 - P1間 | P1 - PE2間 |
|---|---|---|---|---|
| 0 | pcap | pcap | pcap | pcap |
| 1 | pcap | pcap | pcap | pcap |
| 2 | pcap | pcap | pcap | pcap |
| 3 | pcap | pcap | pcap | pcap |
| 4 | pcap | pcap | pcap | pcap |
参考
| RFC | タイトル | 概要 |
|---|---|---|
| RFC 3443 | Time To Live (TTL) Processing in Multi-Protocol Label Switching (MPLS) Networks | uniform(3.1節) / short pipe(3.2節) / pipe(3.3節)の3モデル。 |
| RFC 3032 | MPLS Label Stack Encoding | ラベルスタックエントリの32ビットとTTLフィールド(2.4節)、断片化とPath MTU Discovery(3節)。 |
書籍: Luc De Ghein『MPLS Fundamentals』(Cisco Press, 2006)Chapter 3
関連記事
- MPLSとは
- MPLSラベルとラベルスタック
- MPLSのラベル操作(push / swap / pop)とPHP
- MPLSのTTL処理とMTU
- LDPとは
- LDPのラベル配布モードとラベルスペース
- LDP-IGPシンクロナイゼーションとLDPセッション保護
- LDPのラベル広告制御(フィルタリング)
- LDPのセッション認証(TCP MD5)
- MPLSのOAM(LSP Ping / LSP Traceroute)
- MPLS TE(RSVP-TE)とは
- MPLS TEのCSPFと経路の制約(帯域 / affinity / TEメトリック)
- MPLS TEトンネルへのトラフィック誘導
- MPLS TEのFRR(リンク保護とノード保護)
- MPLS TEのFRR(auto-tunnel backupとSRLG)
- MPLSのQoS(EXPとuniform / pipe / short-pipe)
- MPLSのQoSの帯域制御とキューイング(policer / shaper / priority)