↓ メインコンテンツへスキップ
  1. ネットワーク 記事一覧/
  2. MPLS記事一覧/

MPLSのTTL処理とMTU

目次

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 − 41496バイト
2段MPLS VPN(トランスポート + VPN)M − 14 − 81492バイト

上限を超えたパケットが入口の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リンク
CE1XRd顧客側(AS 65101)、192.168.1.0/241.1.1.1/32Gi0/0/0/0 10.1.2.1
PE1XRv9000入口 / 出口LSR2.2.2.2/32Gi0/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)
P1XRv9000中継LSR3.3.3.3/32Gi0/0/0/0 10.2.3.3 / Gi0/0/0/1 10.3.4.3
PE2XRv9000入口 / 出口LSR4.4.4.4/32Gi0/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)
CE2XRd顧客側(AS 65102)、192.168.2.0/245.5.5.5/32Gi0/0/0/0 10.4.5.5
CE3XRdVRF CUST-Aの顧客側(AS 65103)、192.168.3.0/246.6.6.6/32Gi0/0/0/0 10.2.6.6
CE4XRdVRF CUST-Aの顧客側(AS 65104)、192.168.4.0/247.7.7.7/32Gi0/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が出ること
1MPLS区間の4インタフェースをmtu 1522L3VPNの1500バイト(ラベル2段)がDF付きのまま通ること。MPLS区間を1522バイトのフレームが流れること
2MPLS区間の4インタフェースをmtu 92161522を超えるフレームも通ること(PE1 - PE2間で9000バイト)
3PE1にmpls ip-ttl-propagate disableCE1からCE2へのtracerouteからP1が消え、逆方向は見えたままであること
4STEP 1〜3を削除(最終状態)STEP 0と同じに戻ること

既定のMTUではL3VPNの1500バイトが通らない

MPLS区間のMTUが既定の1514のとき、CE3からCE4へDF付きで通るのは1492バイトまでです。1493と1500は届きません。DFを立てなければ1500も届きます。

CE3 → CE4(L3VPN、ラベル2段、STEP 0)
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になります。

CE1 → CE2(グローバル、ラベル1段、STEP 0)
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でした。

No.64 ICMP Type 3 Code 4(PE1 → CE3)tshark -V
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: 0
上のtshark出力のパケット(No.64 ICMP Type 3 Code 4)のpcapをダウンロード

DFなしの1500バイトは、PE1が断片化してからラベルを付けています。PE1 - P1間では1492バイトと28バイトの2つに分かれ、どちらにも2段のラベルが付いています。1つ目のフレームは1514バイトで、MTUいっぱいです。

DFなしの1500バイト(PE1 → P1、STEP 0)
$ 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	184

MPLS区間のMTUを1522にするとL3VPNの1500バイトが通る

利用者の1500バイトにラベル2段(8バイト)とイーサネットヘッダー(14バイト)を足すと1522です。MPLS区間の両端のmtuを1522にします。P1では2つのインタフェースに入れています。

STEP 1 P1にcommitした設定
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
!
end

IPに使えるのは14を引いた1508バイトで、ラベル2段の1500バイトがちょうど収まります。

P1 show ipv4 interface GigabitEthernet0/0/0/0(STEP 1)
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 0xe0000000

CE3からCE4へ、1500バイトまでDF付きのまま通るようになりました。

CE3 → CE4(L3VPN、ラベル2段、STEP 1)
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 ms

PE1 - P1間のNo.4611が、DF付き1500バイトのecho requestです。フレーム長が1522バイトで、2段のラベルの下に1500バイトのIPパケットがそのまま入っています。

No.4611 Echo request(PE1 → P1、1500バイト + ラベル2段)tshark -V
    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
上のtshark出力のパケット(No.4611 Echo request)のpcapをダウンロード

ラベル1段のCE1からCE2も1500まで通ります。

CE1 → CE2(グローバル、ラベル1段、STEP 1)
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ファイルはコマンドの行に端末の行編集の制御文字が入っているため、応答の行だけを載せ、コマンドはタイトルに書いています。

PE1 ping 4.4.4.4 source 2.2.2.2 size 1504 df-bit count 5 timeout 1(STEP 1)
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 ms
PE1 ping 4.4.4.4 source 2.2.2.2 size 1505 df-bit count 5 timeout 1(STEP 1)
Sun 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
1MPLS区間の4インタフェースをmtu 15221920/2000(ロス80発)
2同じインタフェースをmtu 92161921/2000(ロス79発)
3PE1にmpls ip-ttl-propagate disable2000/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にしました。

STEP 2 P1にcommitした設定
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
!
end
P1 show ipv4 interface GigabitEthernet0/0/0/0(STEP 2)
RP/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 0xe0000000

STEP 1では届かなかった1505バイトと9000バイトが、PE1からPE2へ届きます。

PE1 ping 4.4.4.4 source 2.2.2.2 size 1505 df-bit count 5 timeout 1(STEP 2)
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 ms
PE1 ping 4.4.4.4 source 2.2.2.2 size 9000 df-bit count 5 timeout 1(STEP 2)
Sun 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 ms

PE1 - P1間では、ラベル付きで9018バイト(9000 + 4 + 14)のフレームが流れています。P1がPHPでラベルを外すため、PE2からの応答はラベルなしの9014バイトです。

9000バイトのecho request / reply(PE1 - P1、STEP 2)
$ 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	9000

CEとPEの間は1514のままなので、CEから送れるのは1500バイトまでで変わりません。MPLS区間を大きくしておけば、利用者の1500バイトはラベルが何段になってもMPLS区間で落ちなくなります。

TTLの伝搬を止めるとP1が見えなくなる

TTL伝搬ありのSTEP 0では、CE1からCE2へのtracerouteの2ホップ目にP1(10.2.3.3)が出ます。

CE1 traceroute(STEP 0)
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です。

CE1のecho requestのTTL(STEP 0)
$ 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			253

PE1にmpls ip-ttl-propagate disableを入れます。

STEP 3 PE1にcommitした設定
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ホップになります。

CE1 traceroute(STEP 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  *
CE1のecho requestのTTL(STEP 3)
$ 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			253

P1 - PE2間のIPのTTLは254で、PE1で1減っただけです。P1はラベルを外すときに、ラベルのTTL(254)とIPのTTL(254)の小さいほうをIPヘッダーに残しています。

設定したのは入口のPE1だけなので、逆方向のCE2からCE1では入口がPE2になり、P1(10.3.4.3)が見えたままです。

CE2 traceroute(STEP 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に戻ります。

CE3 → CE4(L3VPN、ラベル2段、STEP 4)
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でも届いています。

CE1 → CE2(グローバル、STEP 0)
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 ms
CE3 → CE4(L3VPN、STEP 0)
RP/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.txtpingと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.txtshow 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.txtPE1 / P1 / PE2のみ。show mpls ldp trace binding / peerとshow mpls lsd trace
..._commit.cfgそのSTEPで実際にcommitされた設定(変更したルータのみ)

STEP 0:初期状態(MPLS区間のMTU 1514、TTL伝搬あり)

ルータshow出力pingclearsyslogrunning-configtrace投入した設定断の測定
CE1showpingclearlogrun———
PE1showpingclearlogruntrace——
P1show—clearlogruntrace——
PE2showpingclearlogruntrace——
CE2showpingclearlogrun———
CE3showpingclearlogrun———
CE4showpingclearlogrun———

STEP 1:MPLS区間の4インタフェースをmtu 1522

ルータshow出力pingclearsyslogrunning-configtrace投入した設定断の測定
CE1showpingclearlogrun——outage
PE1showpingclearlogruntracecfg—
P1show—clearlogruntracecfg—
PE2showpingclearlogruntracecfg—
CE2showpingclearlogrun———
CE3showpingclearlogrun———
CE4showpingclearlogrun———

STEP 2:MPLS区間の4インタフェースをmtu 9216

ルータshow出力pingclearsyslogrunning-configtrace投入した設定断の測定
CE1showpingclearlogrun——outage
PE1showpingclearlogruntracecfg—
P1show—clearlogruntracecfg—
PE2showpingclearlogruntracecfg—
CE2showpingclearlogrun———
CE3showpingclearlogrun———
CE4showpingclearlogrun———

STEP 3:PE1にmpls ip-ttl-propagate disable

ルータshow出力pingclearsyslogrunning-configtrace投入した設定断の測定
CE1showpingclearlogrun——outage
PE1showpingclearlogruntracecfg—
P1show—clearlogruntrace——
PE2showpingclearlogruntrace——
CE2showpingclearlogrun———
CE3showpingclearlogrun———
CE4showpingclearlogrun———

STEP 4:STEP 1〜3を削除(最終状態)

ルータshow出力pingclearsyslogrunning-configtrace投入した設定断の測定
CE1showpingclearlogrun———
PE1showpingclearlogruntracecfg—
P1show—clearlogruntracecfg—
PE2showpingclearlogruntracecfg—
CE2showpingclearlogrun———
CE3showpingclearlogrun———
CE4showpingclearlogrun———

パケットキャプチャーはSTEPごとに取得しています。

STEPCE1 - PE1間CE3 - PE1間PE1 - P1間P1 - PE2間
0pcappcappcappcap
1pcappcappcappcap
2pcappcappcappcap
3pcappcappcappcap
4pcappcappcappcap

参考

RFCタイトル概要
RFC 3443Time To Live (TTL) Processing in Multi-Protocol Label Switching (MPLS) Networksuniform(3.1節) / short pipe(3.2節) / pipe(3.3節)の3モデル。
RFC 3032MPLS Label Stack Encodingラベルスタックエントリの32ビットとTTLフィールド(2.4節)、断片化とPath MTU Discovery(3節)。

書籍: Luc De Ghein『MPLS Fundamentals』(Cisco Press, 2006)Chapter 3

関連記事