{"articleId":"art_886893c2a1","slug":"nw-basics-10-gre","title":"社内あてのパケットを、別のパケットの中に入れて運ぶ","version":1,"area":"tech","topic":"ネットワーク","tags":["ネットワーク","gre","トンネル","ルーティング","concept"],"date":"2026-09-14","updated":"2026-09-14","records":[{"id":"rev_ecae9b5774","at":"2026-09-14","actor":{"kind":"ai","id":"claude-fable-5","label":"AI (claude-fable-5)"},"version":1,"kind":"ai-check","scope":{},"text":"出典 4 件を再取得した。配送ヘッダ・GRE ヘッダ・中のパケットという 3 層の並び、GRE ヘッダの最小 4 バイト、IPv4 に包むときのプロトコル番号 47 を RFC 2784 の §2・§2.1・§4 で確認した。同 §9 が「既存の GRE 実装は経路 MTU 探索を行わず、配送ヘッダに分割禁止の印を立てない」と書いていることも確認し、分割禁止の印で捨てられるという記述は IPv4 一般の決まり（RFC 791 §2.3）として書き分けた。トンネルインターフェースの既定の IP MTU が物理より 24 バイト小さく 1476 になることを Cisco のページで確認した。再帰ルーティングについては、Cisco が同社のページで現象・検知したときにトンネルを数分間 down にすること・トンネルの宛先に別の経路を持たせる直し方まで公開していることを確認したので、未検証としては扱っていない。ただし RFC 2784 が捨てると書いているのは包んだ中身の宛先が自分自身の場合で別の話なので、そちらには寄せていない。ログの文字列が他社の機器でも同じかは確認していないため未検証に残した。1500 と 1476 が規格の値ではないことも本文に書いた。校正チェックリストを通し、例え話・体言止め・断定を示す禁止語の混入を機械検査した。守秘: 実名・社名・会場名・地名・金額なし","status":"open","source":"frontmatter"},{"id":"rev_834a016b1d","at":"2026-09-14","actor":{"kind":"ai","id":"claude-fable-5","label":"AI (claude-fable-5)"},"version":1,"kind":"edit","scope":{},"text":"公開前の校閲。frontmatter のタグ GRE を小文字の gre に直した。本文は、図 7 の 3 つの問題のうち解く 2 つの言い回しが公開済みの図 7 と一致すること、外側のプロトコル番号 47・GRE ヘッダ最小 4 バイト・24 バイト減・再帰ルーティングの記述が図の担当メモと一致することを確認し、修正はしていない。","status":"open","source":"frontmatter"}],"blocks":[{"id":"blk_5629df","type":"paragraph","markdown":"図 7 では、支店からデータセンターへ社内の住所のまま送ると、プロバイダのルータで止まりました。","text":"図 7 では、支店からデータセンターへ社内の住所のまま送ると、プロバイダのルータで止まりました。","line":2,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_bde396","type":"paragraph","markdown":"図 8 の書き換えは、外のサーバへ行くための道具で、拠点同士をつなぐ話には使えません。\nこの記事は、図 7 で挙げた 3 つの問題のうち「途中のルータの経路表を自分では書けません」と「社内専用の住所はインターネットでは運ばれません」の 2 つを、拠点同士について解きます。\n3 つ目の「通信の中身は誰にでも読めます」は、この図では残ったままです。","text":"図 8 の書き換えは、外のサーバへ行くための道具で、拠点同士をつなぐ話には使えません。\nこの記事は、図 7 で挙げた 3 つの問題のうち「途中のルータの経路表を自分では書けません」と「社内専用の住所はインターネットでは運ばれません」の 2 つを、拠点同士について解きます。\n3 つ目の「通信の中身は誰にでも読めます」は、この図では残ったままです。","line":4,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_bb713c","type":"paragraph","markdown":"この連載は、ネットワークの言葉を 3 つの層に置いて読みます。\nもの（物理か論理か）、結びつき（人が設定で付ける手動か、機器が学習する自動か、製造時に決まる固定か）、通信フロー（1 本の通信がそれらを順に通る道筋）の 3 つです。","text":"この連載は、ネットワークの言葉を 3 つの層に置いて読みます。\nもの（物理か論理か）、結びつき（人が設定で付ける手動か、機器が学習する自動か、製造時に決まる固定か）、通信フロー（1 本の通信がそれらを順に通る道筋）の 3 つです。","line":8,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_34ba84","type":"heading","depth":2,"markdown":"## 登場するもの","text":"登場するもの","line":11,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_e38ae6","type":"heading","depth":4,"markdown":"#### トンネルインターフェース（Tunnel0）","text":"トンネルインターフェース（Tunnel0）","line":13,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_5afc09","type":"paragraph","markdown":"論理のものです。\nケーブルも物理ポートも 1 本たりとも増えていません。\nルーティングテーブルの出口の欄に、物理ポートと同じように書ける口です。\n実体は「包んで別の口から出す」処理です。","text":"論理のものです。\nケーブルも物理ポートも 1 本たりとも増えていません。\nルーティングテーブルの出口の欄に、物理ポートと同じように書ける口です。\n実体は「包んで別の口から出す」処理です。","line":15,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_bf2e31","type":"heading","depth":4,"markdown":"#### カプセル化","text":"カプセル化","line":20,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_f01f94","type":"paragraph","markdown":"1 つのパケットの中に、別のパケットがまるごと入っている状態です。","text":"1 つのパケットの中に、別のパケットがまるごと入っている状態です。","line":22,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_a8a6e9","type":"heading","depth":4,"markdown":"#### GRE ヘッダ","text":"GRE ヘッダ","line":24,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_c7851e","type":"paragraph","markdown":"論理のもので、通信 1 つずつに付きます。\n最小 4 バイトで、この後ろに元のパケットがまるごと入ります。","text":"論理のもので、通信 1 つずつに付きます。\n最小 4 バイトで、この後ろに元のパケットがまるごと入ります。","line":26,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_9cb4b2","type":"heading","depth":4,"markdown":"#### 外側 IP ヘッダ","text":"外側 IP ヘッダ","line":29,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_5c1d16","type":"paragraph","markdown":"宛先が相手ルータの外側グローバル IP、送信元が自分の外側グローバル IP です。\nIPv4 では 20 バイトです。\nプロトコルの欄は 47 で、途中の機器はこの番号で「中に別のパケットが入っている」と分かります。\n分かるだけで、中身は読めます。","text":"宛先が相手ルータの外側グローバル IP、送信元が自分の外側グローバル IP です。\nIPv4 では 20 バイトです。\nプロトコルの欄は 47 で、途中の機器はこの番号で「中に別のパケットが入っている」と分かります。\n分かるだけで、中身は読めます。","line":31,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_118c7a","type":"heading","depth":2,"markdown":"## 結びつき","text":"結びつき","line":36,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_3ff988","type":"list","markdown":"- Tunnel0 ⇄ source と destination の外側グローバル IP は手動です。両端のルータに、互いの外側の番地を人が書きます。\n- Tunnel0 ⇄ 社内あての行（192.168.3.0/24 → Tunnel0）は手動です。この行を書かないと、社内あては相変わらずデフォルトルートへ流れて捨てられます。\n- トンネルの中の番地（10.0.0.0/30）の行だけ自動です。自分の口の IP から行が載る、という図 1 と同じ理屈が論理の口にも働きます。","text":"Tunnel0 ⇄ source と destination の外側グローバル IP は手動です。両端のルータに、互いの外側の番地を人が書きます。Tunnel0 ⇄ 社内あての行（192.168.3.0/24 → Tunnel0）は手動です。この行を書かないと、社内あては相変わらずデフォルトルートへ流れて捨てられます。トンネルの中の番地（10.0.0.0/30）の行だけ自動です。自分の口の IP から行が載る、という図 1 と同じ理屈が論理の口にも働きます。","line":38,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_df21fc","type":"heading","depth":2,"markdown":"## 通信フロー","text":"通信フロー","line":42,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_0952be","type":"paragraph","markdown":"支店の A（192.168.10.10）から、データセンターの C（192.168.3.10）へ送ります。","text":"支店の A（192.168.10.10）から、データセンターの C（192.168.3.10）へ送ります。","line":44,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_e3255b","type":"paragraph","markdown":"① A はデフォルトゲートウェイ（ルータ 1）へ送ります。図 5・図 7 の ① と同じで、PC 側は何も変わりません。","text":"① A はデフォルトゲートウェイ（ルータ 1）へ送ります。図 5・図 7 の ① と同じで、PC 側は何も変わりません。","line":46,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_f92de6","type":"paragraph","markdown":"② ルータ 1 はテーブルを探します。192.168.3.0/24 に一致する行の出口が Tunnel0 なので、そこへ渡します。","text":"② ルータ 1 はテーブルを探します。192.168.3.0/24 に一致する行の出口が Tunnel0 なので、そこへ渡します。","line":48,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_97254f","type":"paragraph","markdown":"③ Tunnel0 は元のパケットの前に GRE ヘッダと外側 IP ヘッダを付けます。外側の宛先は 198.51.100.20、送信元は 203.0.113.10 です。できた新しいパケットを、ルータ 1 はもう一度テーブルで探し直し、デフォルトルートに従って Gi1 から送り出します。","text":"③ Tunnel0 は元のパケットの前に GRE ヘッダと外側 IP ヘッダを付けます。外側の宛先は 198.51.100.20、送信元は 203.0.113.10 です。できた新しいパケットを、ルータ 1 はもう一度テーブルで探し直し、デフォルトルートに従って Gi1 から送り出します。","line":50,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_2da8cc","type":"paragraph","markdown":"④ プロバイダのルータは外側の宛先だけを見て運びます。中に入っている 192.168.3.10 は見ません。","text":"④ プロバイダのルータは外側の宛先だけを見て運びます。中に入っている 192.168.3.10 は見ません。","line":52,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_794087","type":"paragraph","markdown":"⑤ ルータ 2 の Tunnel0 が外側 IP ヘッダと GRE ヘッダを外します。出てくるのは ① とまったく同じパケットです。それを自分のテーブルで探し、Gi1 から C へ送ります。","text":"⑤ ルータ 2 の Tunnel0 が外側 IP ヘッダと GRE ヘッダを外します。出てくるのは ① とまったく同じパケットです。それを自分のテーブルで探し、Gi1 から C へ送ります。","line":54,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_887fa2","type":"heading","depth":2,"markdown":"## 図 10","text":"図 10","line":56,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_b50793","type":"paragraph","markdown":"図の上半分が構成図と包むと何が増えるか、下半分が各テーブルと設定・通信の中身の推移です。","text":"図の上半分が構成図と包むと何が増えるか、下半分が各テーブルと設定・通信の中身の推移です。","line":58,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_6eadfd","type":"html","markdown":"<svg viewBox=\"0 0 900 1594\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-label=\"GRE トンネル：社内あてのパケットを別の IP パケットに入れて運ぶ\" style=\"max-width:100%;height:auto;font-family:sans-serif\">\n  <rect x=\"0\" y=\"0\" width=\"900\" height=\"1594\" fill=\"#fbfcfe\"/>\n  <text x=\"20\" y=\"30\" text-anchor=\"start\" font-size=\"14\" font-weight=\"700\" fill=\"#1f2937\">GRE トンネル：社内あてのパケットを、グローバル IP あての別のパケットの中に入れて運ぶ</text>\n  <text x=\"20\" y=\"50\" text-anchor=\"start\" font-size=\"11\" fill=\"#6b7280\">図 7 の問題 1（途中のルータの経路表を書けない）と問題 2（社内専用の住所は運ばれない）の解。問題 3（中身が読める）は残る</text>\n  <rect x=\"20\" y=\"80\" width=\"250\" height=\"250\" rx=\"10\" fill=\"none\" stroke=\"#9aa7b5\" stroke-width=\"1.5\" stroke-dasharray=\"6 4\"/>\n  <text x=\"32\" y=\"100\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#6b7280\">支店（自分のもの）</text>\n  <rect x=\"290\" y=\"80\" width=\"320\" height=\"250\" rx=\"10\" fill=\"#fff7ed\" stroke=\"#d97706\" stroke-width=\"1.5\" stroke-dasharray=\"6 4\"/>\n  <text x=\"302\" y=\"100\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#b45309\">インターネット（他人のもの）</text>\n  <rect x=\"630\" y=\"80\" width=\"250\" height=\"250\" rx=\"10\" fill=\"none\" stroke=\"#9aa7b5\" stroke-width=\"1.5\" stroke-dasharray=\"6 4\"/>\n  <text x=\"642\" y=\"100\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#6b7280\">データセンター（自分のもの）</text>\n  <rect x=\"32\" y=\"206\" width=\"80\" height=\"56\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"72.0\" y=\"226\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">PC-A</text>\n  <text x=\"72.0\" y=\"244\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">192.168.10.10</text>\n  <text x=\"72.0\" y=\"259\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">GW 192.168.10.1</text>\n  <line x1=\"112\" y1=\"234\" x2=\"150\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"150\" y=\"192\" width=\"110\" height=\"84\" rx=\"8\" fill=\"#f2f5f9\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"205.0\" y=\"212\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">ルータ 1</text>\n  <text x=\"205.0\" y=\"230\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">Gi0 192.168.10.1</text>\n  <text x=\"205.0\" y=\"245\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">Gi1 203.0.113.10</text>\n  <text x=\"205.0\" y=\"260\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">（グローバル IP）</text>\n  <rect x=\"141\" y=\"225\" width=\"18\" height=\"18\" fill=\"#ffffff\" stroke=\"#6b7280\" stroke-width=\"1.5\"/><text x=\"150\" y=\"238\" text-anchor=\"middle\" font-size=\"8\" fill=\"#1f2937\">Gi0</text>\n  <rect x=\"251\" y=\"225\" width=\"18\" height=\"18\" fill=\"#ffffff\" stroke=\"#6b7280\" stroke-width=\"1.5\"/><text x=\"260\" y=\"238\" text-anchor=\"middle\" font-size=\"8\" fill=\"#1f2937\">Gi1</text>\n  <line x1=\"269\" y1=\"234\" x2=\"330\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"330\" y=\"206\" width=\"70\" height=\"56\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"365.0\" y=\"226\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">ISP-1</text>\n  <text x=\"365.0\" y=\"244\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">他人の</text>\n  <text x=\"365.0\" y=\"259\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">ルータ</text>\n  <line x1=\"400\" y1=\"234\" x2=\"415\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"415\" y=\"206\" width=\"70\" height=\"56\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"450.0\" y=\"226\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">ISP-2</text>\n  <text x=\"450.0\" y=\"244\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">他人の</text>\n  <text x=\"450.0\" y=\"259\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">ルータ</text>\n  <line x1=\"485\" y1=\"234\" x2=\"500\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"500\" y=\"206\" width=\"70\" height=\"56\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"535.0\" y=\"226\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">ISP-3</text>\n  <text x=\"535.0\" y=\"244\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">他人の</text>\n  <text x=\"535.0\" y=\"259\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">ルータ</text>\n  <line x1=\"570\" y1=\"234\" x2=\"640\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"640\" y=\"192\" width=\"110\" height=\"84\" rx=\"8\" fill=\"#f2f5f9\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"695.0\" y=\"212\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">ルータ 2</text>\n  <text x=\"695.0\" y=\"230\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">Gi0 198.51.100.20</text>\n  <text x=\"695.0\" y=\"245\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">（グローバル IP）</text>\n  <text x=\"695.0\" y=\"260\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">Gi1 192.168.3.1</text>\n  <rect x=\"631\" y=\"225\" width=\"18\" height=\"18\" fill=\"#ffffff\" stroke=\"#6b7280\" stroke-width=\"1.5\"/><text x=\"640\" y=\"238\" text-anchor=\"middle\" font-size=\"8\" fill=\"#1f2937\">Gi0</text>\n  <rect x=\"741\" y=\"225\" width=\"18\" height=\"18\" fill=\"#ffffff\" stroke=\"#6b7280\" stroke-width=\"1.5\"/><text x=\"750\" y=\"238\" text-anchor=\"middle\" font-size=\"8\" fill=\"#1f2937\">Gi1</text>\n  <line x1=\"759\" y1=\"234\" x2=\"790\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"790\" y=\"206\" width=\"80\" height=\"56\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"830.0\" y=\"226\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">PC-C</text>\n  <text x=\"830.0\" y=\"244\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">192.168.3.10</text>\n  <text x=\"830.0\" y=\"259\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">GW 192.168.3.1</text>\n  <rect x=\"150\" y=\"125\" width=\"110\" height=\"46\" rx=\"8\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1.5\"/>\n  <text x=\"205.0\" y=\"145\" text-anchor=\"middle\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">Tunnel0</text>\n  <text x=\"205.0\" y=\"163\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">10.0.0.1 /30</text>\n  <rect x=\"640\" y=\"125\" width=\"110\" height=\"46\" rx=\"8\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1.5\"/>\n  <text x=\"695.0\" y=\"145\" text-anchor=\"middle\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">Tunnel0</text>\n  <text x=\"695.0\" y=\"163\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">10.0.0.2 /30</text>\n  <line x1=\"205\" y1=\"192\" x2=\"205\" y2=\"171\" stroke=\"#0a7aff\" stroke-width=\"1.5\" stroke-dasharray=\"4 3\"/>\n  <line x1=\"695\" y1=\"192\" x2=\"695\" y2=\"171\" stroke=\"#0a7aff\" stroke-width=\"1.5\" stroke-dasharray=\"4 3\"/>\n  <line x1=\"260\" y1=\"148\" x2=\"640\" y2=\"148\" stroke=\"#0a7aff\" stroke-width=\"2.5\" stroke-dasharray=\"8 5\"/>\n  <text x=\"450\" y=\"118\" text-anchor=\"middle\" font-size=\"11\" font-weight=\"700\" fill=\"#0a7aff\">トンネル（論理。ケーブルは 1 本も増えていない）</text>\n  <text x=\"450\" y=\"180\" text-anchor=\"middle\" font-size=\"10\" fill=\"#6b7280\">両端のルータだけが作る「直結しているように見える 1 本」</text>\n  <text x=\"450\" y=\"194\" text-anchor=\"middle\" font-size=\"10\" fill=\"#6b7280\">source と destination は互いの外側グローバル IP（手動）</text>\n  <line x1=\"112\" y1=\"300\" x2=\"142\" y2=\"300\" stroke=\"#0a7aff\" stroke-width=\"2\"/><polygon points=\"141,295 141,305 150,300\" fill=\"#0a7aff\"/>\n  <circle cx=\"131\" cy=\"300\" r=\"9\" fill=\"#0a7aff\"/><text x=\"131\" y=\"304\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#ffffff\">1</text>\n  <circle cx=\"205\" cy=\"300\" r=\"9\" fill=\"#0a7aff\"/><text x=\"205\" y=\"304\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#ffffff\">2</text>\n  <line x1=\"269\" y1=\"300\" x2=\"623\" y2=\"300\" stroke=\"#0a7aff\" stroke-width=\"2\"/><polygon points=\"622,295 622,305 631,300\" fill=\"#0a7aff\"/>\n  <circle cx=\"450\" cy=\"300\" r=\"9\" fill=\"#0a7aff\"/><text x=\"450\" y=\"304\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#ffffff\">3</text>\n  <circle cx=\"695\" cy=\"300\" r=\"9\" fill=\"#0a7aff\"/><text x=\"695\" y=\"304\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#ffffff\">4</text>\n  <line x1=\"760\" y1=\"300\" x2=\"784\" y2=\"300\" stroke=\"#0a7aff\" stroke-width=\"2\"/><polygon points=\"783,295 783,305 792,300\" fill=\"#0a7aff\"/>\n  <circle cx=\"745\" cy=\"300\" r=\"9\" fill=\"#0a7aff\"/><text x=\"745\" y=\"304\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#ffffff\">5</text>\n  <text x=\"205\" y=\"322\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#0a7aff\">包む</text>\n  <text x=\"695\" y=\"322\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#0a7aff\">外す</text>\n  <text x=\"450\" y=\"322\" text-anchor=\"middle\" font-size=\"10\" fill=\"#b45309\">外側の宛先 198.51.100.20 だけを見て運ばれる</text>\n  <rect x=\"20\" y=\"348\" width=\"280\" height=\"120\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"32\" y=\"368\" text-anchor=\"start\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">包むと何が増えるか</text>\n  <text x=\"32\" y=\"386\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">元のパケットの前に 2 つ足す（カプセル化）</text>\n  <text x=\"32\" y=\"401\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">・GRE ヘッダ：最小 4 バイト（RFC 2784）</text>\n  <text x=\"32\" y=\"416\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">・外側 IP ヘッダ：20 バイト（IPv4）</text>\n  <text x=\"32\" y=\"431\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">合わせて 24 バイト増える</text>\n  <rect x=\"310\" y=\"348\" width=\"280\" height=\"120\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"322\" y=\"368\" text-anchor=\"start\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">テーブルに足す 1 行</text>\n  <text x=\"322\" y=\"386\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">192.168.3.0/24 → Tunnel0（手動）</text>\n  <text x=\"322\" y=\"401\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">出口が物理ポートではなく論理の口になる</text>\n  <text x=\"322\" y=\"416\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">包んだ後の新しいパケットは、もう一度</text>\n  <text x=\"322\" y=\"431\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">テーブルで探し直されて Gi1 から出る</text>\n  <rect x=\"600\" y=\"348\" width=\"280\" height=\"120\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"612\" y=\"368\" text-anchor=\"start\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">減るもの：一度に運べる大きさ</text>\n  <text x=\"612\" y=\"386\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">1500 − 24 ＝ 1476</text>\n  <text x=\"612\" y=\"401\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">Tunnel0 の既定の IP MTU は 1476 バイト</text>\n  <text x=\"612\" y=\"416\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">（物理インターフェースより 24 バイト小さい）</text>\n  <text x=\"612\" y=\"431\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">大きいパケットは分割される。「分割するな」の</text>\n  <text x=\"612\" y=\"446\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">印が立っていれば、分割できず捨てられる</text>\n  <text x=\"20\" y=\"496\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">フロー</text>\n  <text x=\"20\" y=\"516\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">① PC-A は宛先 192.168.3.10 が自分のネットワーク外なので、デフォルトゲートウェイ（ルータ 1）へ送る。図 5・図 7 の ① と同じ</text>\n  <text x=\"20\" y=\"534\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">② ルータ 1 はテーブルを探す。192.168.3.0/24 に一致する行の出口が Tunnel0（物理ポートではなく論理の口）なので、そこへ渡す</text>\n  <text x=\"20\" y=\"552\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">③ Tunnel0 は元のパケットの前に GRE ヘッダと外側 IP ヘッダを付ける。外側の宛先は 198.51.100.20、送信元は 203.0.113.10</text>\n  <text x=\"34\" y=\"570\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">できた新しいパケットを、ルータ 1 はもう一度テーブルで探し直し、デフォルトルートに従って Gi1 から送り出す</text>\n  <text x=\"20\" y=\"588\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">④ プロバイダのルータは外側の宛先（グローバル IP）だけを見て運ぶ。中に入っている 192.168.3.10 は見ない。図 7 の ③ で捨てられたのはここ</text>\n  <text x=\"20\" y=\"606\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">⑤ ルータ 2 の Tunnel0 が外側 IP ヘッダと GRE ヘッダを外す。出てきた元のパケットを自分のテーブルで探し、Gi1 から PC-C へ送る</text>\n  <text x=\"20\" y=\"622\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">増えたもの</text>\n  <text x=\"20\" y=\"642\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">トンネルインターフェース（Tunnel0）：論理。物理ポートと同じようにテーブルの出口に書けるが、実体は「包んで別の口から出す」処理</text>\n  <text x=\"20\" y=\"660\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">カプセル化：1 つのパケットの中に、別のパケットがまるごと入っている状態。外から見えるのは外側だけ</text>\n  <text x=\"20\" y=\"688\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">3 層で見ると</text>\n  <text x=\"20\" y=\"708\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">もの：トンネルインターフェース（論理）・GRE ヘッダ（通信 1 つずつに付く 4 バイト以上の札）</text>\n  <text x=\"20\" y=\"726\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">結びつき：Tunnel0 ⇄ source／destination の外側 IP（手動）。Tunnel0 ⇄ 社内あての行（手動）。10.0.0.0/30 の行だけ自動</text>\n  <text x=\"20\" y=\"744\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">フロー：図 5 の ②「一致する行の出口へ送る」の出口が論理の口になり、包んだ後にもう一度テーブルを探し直す段が増える</text>\n<line x1=\"20\" y1=\"750\" x2=\"880\" y2=\"750\" stroke=\"#d6dde5\" stroke-width=\"1\"/>\n<text x=\"20\" y=\"772\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">各テーブルと設定（②④ の番号は上のフローに対応。青字）</text>\n  <rect x=\"20\" y=\"784\" width=\"280\" height=\"105\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"30\" y=\"800\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ルータ 1: ルーティングテーブル</text>\n  <text x=\"30\" y=\"816\" font-size=\"10\" fill=\"#374151\">192.168.10.0/24 → Gi0（自動）</text>\n  <text x=\"30\" y=\"831\" font-size=\"10\" fill=\"#374151\">203.0.113.0/24 → Gi1（自動）</text>\n  <text x=\"30\" y=\"846\" font-size=\"10\" fill=\"#374151\">10.0.0.0/30 → Tunnel0（自動・トンネルの中の番地）</text>\n  <text x=\"30\" y=\"861\" font-size=\"10\" fill=\"#0a7aff\">②192.168.3.0/24 → Tunnel0（手動）</text>\n  <text x=\"30\" y=\"876\" font-size=\"10\" fill=\"#374151\">0.0.0.0/0 → 203.0.113.1（手動）</text>\n  <rect x=\"310\" y=\"784\" width=\"280\" height=\"90\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"320\" y=\"800\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ルータ 1: Tunnel0 の設定（手動）</text>\n  <text x=\"320\" y=\"816\" font-size=\"10\" fill=\"#374151\">source 203.0.113.10（自分の外側）</text>\n  <text x=\"320\" y=\"831\" font-size=\"10\" fill=\"#374151\">destination 198.51.100.20（相手の外側）</text>\n  <text x=\"320\" y=\"846\" font-size=\"10\" fill=\"#374151\">IP 10.0.0.1/30</text>\n  <text x=\"320\" y=\"861\" font-size=\"10\" fill=\"#374151\">IP MTU 1476（既定）</text>\n  <rect x=\"600\" y=\"784\" width=\"280\" height=\"75\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"610\" y=\"800\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ISP のルーティングテーブル</text>\n  <text x=\"610\" y=\"816\" font-size=\"10\" fill=\"#374151\">198.51.100.0/24 の経路は載っている</text>\n  <text x=\"610\" y=\"831\" font-size=\"10\" fill=\"#374151\">192.168.3.0/24 の行は無いままでよい</text>\n  <text x=\"610\" y=\"846\" font-size=\"10\" fill=\"#0a7aff\">④外側の宛先だけ見れば運べる</text>\n  <rect x=\"20\" y=\"899\" width=\"280\" height=\"105\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"30\" y=\"915\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ルータ 2: ルーティングテーブル</text>\n  <text x=\"30\" y=\"931\" font-size=\"10\" fill=\"#374151\">198.51.100.0/24 → Gi0（自動）</text>\n  <text x=\"30\" y=\"946\" font-size=\"10\" fill=\"#374151\">192.168.3.0/24 → Gi1（自動）</text>\n  <text x=\"30\" y=\"961\" font-size=\"10\" fill=\"#374151\">10.0.0.0/30 → Tunnel0（自動）</text>\n  <text x=\"30\" y=\"976\" font-size=\"10\" fill=\"#374151\">192.168.10.0/24 → Tunnel0（手動・戻り用）</text>\n  <text x=\"30\" y=\"991\" font-size=\"10\" fill=\"#374151\">0.0.0.0/0 → 198.51.100.1（手動）</text>\n  <rect x=\"310\" y=\"899\" width=\"280\" height=\"90\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"320\" y=\"915\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ルータ 2: Tunnel0 の設定（手動）</text>\n  <text x=\"320\" y=\"931\" font-size=\"10\" fill=\"#374151\">source 198.51.100.20</text>\n  <text x=\"320\" y=\"946\" font-size=\"10\" fill=\"#374151\">destination 203.0.113.10</text>\n  <text x=\"320\" y=\"961\" font-size=\"10\" fill=\"#374151\">IP 10.0.0.2/30</text>\n  <text x=\"320\" y=\"976\" font-size=\"10\" fill=\"#374151\">向きが逆なだけで、中身は同じ組</text>\n  <rect x=\"600\" y=\"899\" width=\"280\" height=\"105\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"610\" y=\"915\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">事故：再帰ルーティング</text>\n  <text x=\"610\" y=\"931\" font-size=\"10\" fill=\"#374151\">destination 198.51.100.20 への経路を</text>\n  <text x=\"610\" y=\"946\" font-size=\"10\" fill=\"#374151\">Tunnel0 自身から学んでしまうと、包む →</text>\n  <text x=\"610\" y=\"961\" font-size=\"10\" fill=\"#374151\">出口を探す → またトンネル、と回り続ける</text>\n  <text x=\"610\" y=\"976\" font-size=\"10\" fill=\"#374151\">Cisco はこれを %TUN-5-RECURDOWN として公開</text>\n  <text x=\"610\" y=\"991\" font-size=\"10\" fill=\"#374151\">→ 外側の宛先だけは別の経路で持たせる</text>\n<text x=\"20\" y=\"1054\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">通信の中身の推移（フローごとのフレーム／パケット）</text>\n  <text x=\"20\" y=\"1104\" font-size=\"11\" font-weight=\"700\" fill=\"#1f2937\">① PC-A → ルータ 1（図 5・図 7 の ① と同じ）</text>\n  <rect x=\"20\" y=\"1110\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"79.0\" y=\"1124\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">宛先 MAC</text>\n  <text x=\"79.0\" y=\"1139\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC R1-Gi0</text>\n  <rect x=\"138\" y=\"1110\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"197.0\" y=\"1124\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">送信元 MAC</text>\n  <text x=\"197.0\" y=\"1139\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC A</text>\n  <rect x=\"256\" y=\"1110\" width=\"118\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"315.0\" y=\"1124\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">宛先 IP</text>\n  <text x=\"315.0\" y=\"1139\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.3.10</text>\n  <rect x=\"374\" y=\"1110\" width=\"118\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"433.0\" y=\"1124\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">送信元 IP</text>\n  <text x=\"433.0\" y=\"1139\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.10.10</text>\n  <rect x=\"492\" y=\"1110\" width=\"70\" height=\"36\" fill=\"#ffffff\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"527.0\" y=\"1124\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">データ</text>\n  <text x=\"527.0\" y=\"1139\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ping</text>\n  <line x1=\"20\" y1=\"1154\" x2=\"562\" y2=\"1154\" stroke=\"#374151\" stroke-width=\"1.5\"/><line x1=\"20\" y1=\"1150\" x2=\"20\" y2=\"1154\" stroke=\"#374151\" stroke-width=\"1.5\"/><line x1=\"562\" y1=\"1150\" x2=\"562\" y2=\"1154\" stroke=\"#374151\" stroke-width=\"1.5\"/>\n  <text x=\"291.0\" y=\"1167\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">フレーム＝全部。ただしスイッチが見るのは MAC とタグの部分だけ</text>\n  <line x1=\"256\" y1=\"1096\" x2=\"562\" y2=\"1096\" stroke=\"#0a7aff\" stroke-width=\"1.5\"/><line x1=\"256\" y1=\"1096\" x2=\"256\" y2=\"1100\" stroke=\"#0a7aff\" stroke-width=\"1.5\"/><line x1=\"562\" y1=\"1096\" x2=\"562\" y2=\"1100\" stroke=\"#0a7aff\" stroke-width=\"1.5\"/>\n  <text x=\"409.0\" y=\"1092\" text-anchor=\"middle\" font-size=\"10\" fill=\"#0a7aff\">パケット＝この部分。ルータはここ（IP）を見る</text>\n  <text x=\"20\" y=\"1200\" font-size=\"11\" font-weight=\"700\" fill=\"#1f2937\">② ルータ 1 の中</text>\n  <text x=\"20\" y=\"1220\" font-size=\"10\" fill=\"#6b7280\">テーブルの 192.168.3.0/24 の行の出口が Tunnel0。Tunnel0 が ① のパケットをまるごと「データ」として抱え、前に GRE ヘッダと外側 IP ヘッダを付ける</text>\n  <text x=\"20\" y=\"1244\" font-size=\"11\" font-weight=\"700\" fill=\"#1f2937\">③ ルータ 1 → ISP-1（入れ子になった。外側だけが運ばれる）</text>\n  <rect x=\"20\" y=\"1250\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"79.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">宛先 MAC</text>\n  <text x=\"79.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC ISP-1</text>\n  <rect x=\"138\" y=\"1250\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"197.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">送信元 MAC</text>\n  <text x=\"197.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC R1-Gi1</text>\n  <rect x=\"256\" y=\"1250\" width=\"104\" height=\"36\" fill=\"#fff1dc\" stroke=\"#d97706\" stroke-width=\"1\"/>\n  <text x=\"308.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">外側 宛先 IP</text>\n  <text x=\"308.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">198.51.100.20</text>\n  <rect x=\"360\" y=\"1250\" width=\"104\" height=\"36\" fill=\"#fff1dc\" stroke=\"#d97706\" stroke-width=\"1\"/>\n  <text x=\"412.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">外側 送信元 IP</text>\n  <text x=\"412.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">203.0.113.10</text>\n  <rect x=\"464\" y=\"1250\" width=\"70\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#6b7280\" stroke-width=\"1\"/>\n  <text x=\"499.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">GRE ヘッダ</text>\n  <text x=\"499.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">4 バイト以上</text>\n  <rect x=\"534\" y=\"1250\" width=\"104\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"586.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">内側 宛先 IP</text>\n  <text x=\"586.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.3.10</text>\n  <rect x=\"638\" y=\"1250\" width=\"104\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"690.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">内側 送信元 IP</text>\n  <text x=\"690.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.10.10</text>\n  <rect x=\"742\" y=\"1250\" width=\"60\" height=\"36\" fill=\"#ffffff\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"772.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">データ</text>\n  <text x=\"772.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ping</text>\n  <text x=\"20\" y=\"1304\" font-size=\"11\" font-weight=\"700\" fill=\"#1f2937\">④ ルータ 2 の中</text>\n  <text x=\"20\" y=\"1324\" font-size=\"10\" fill=\"#6b7280\">外側の宛先が自分なので受け取る。外側 IP ヘッダと GRE ヘッダを外すと、① とまったく同じパケットが出てくる。それを自分のテーブルで探す</text>\n  <text x=\"20\" y=\"1348\" font-size=\"11\" font-weight=\"700\" fill=\"#1f2937\">⑤ ルータ 2 → PC-C（MAC は付け替わる。IP は ① のまま）</text>\n  <rect x=\"20\" y=\"1354\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"79.0\" y=\"1368\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">宛先 MAC</text>\n  <text x=\"79.0\" y=\"1383\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC C</text>\n  <rect x=\"138\" y=\"1354\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"197.0\" y=\"1368\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">送信元 MAC</text>\n  <text x=\"197.0\" y=\"1383\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC R2-Gi1</text>\n  <rect x=\"256\" y=\"1354\" width=\"118\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"315.0\" y=\"1368\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">宛先 IP</text>\n  <text x=\"315.0\" y=\"1383\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.3.10</text>\n  <rect x=\"374\" y=\"1354\" width=\"118\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"433.0\" y=\"1368\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">送信元 IP</text>\n  <text x=\"433.0\" y=\"1383\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.10.10</text>\n  <rect x=\"492\" y=\"1354\" width=\"70\" height=\"36\" fill=\"#ffffff\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"527.0\" y=\"1368\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">データ</text>\n  <text x=\"527.0\" y=\"1383\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ping</text>\n<text x=\"20\" y=\"1408\" font-size=\"10\" fill=\"#6b7280\">橙の箱＝プロバイダが見る外側。青の箱＝社内の元の宛先。GRE ヘッダの最小の大きさは 4 バイト（RFC 2784 §2.1）。外側 IP ヘッダ（IPv4）は 20 バイト</text>\n<text x=\"20\" y=\"1424\" font-size=\"10\" fill=\"#6b7280\">外側 IP ヘッダのプロトコルの欄は 47（GRE・RFC 2784 §4）。途中の機器はこの番号で「中に別のパケットが入っている」と分かる。ただし中身は読める</text>\n<text x=\"20\" y=\"1440\" font-size=\"10\" fill=\"#6b7280\">外側 IP ヘッダ 20 ＋ GRE 4 ＝ 24 バイトぶん、一度に運べる大きさが減る。Cisco の既定では Tunnel0 の IP MTU は 1500 − 24 ＝ 1476 バイト</text>\n<text x=\"20\" y=\"1456\" font-size=\"10\" fill=\"#6b7280\">入りきらないパケットは分割される。ただし「分割するな」の印（DF）が立っていると分割できず、捨てられる（RFC 791 §2.3）</text>\n<text x=\"20\" y=\"1472\" font-size=\"10\" fill=\"#6b7280\">青の箱の中身（内側の宛先・送信元・データ）は暗号化されていない。途中で開けば読める。図 7 の問題 3 は残っている（次の図で封をする）</text>\n<text x=\"20\" y=\"1488\" font-size=\"10\" fill=\"#6b7280\">再帰ルーティング: 包んだ後の宛先（トンネルの destination）への経路をトンネル自身から学んでしまうと、包む → 出口を探す → またトンネル、と回り続ける</text>\n<text x=\"20\" y=\"1504\" font-size=\"10\" fill=\"#6b7280\">　Cisco はこれを %TUN-5-RECURDOWN というログの意味として公開しており、検知するとトンネルを数分間 down にする、と説明している</text>\n<text x=\"20\" y=\"1520\" font-size=\"10\" fill=\"#6b7280\">　直し方は、トンネルの宛先への経路だけを別に（より範囲の狭い行で）持たせること。なお RFC 2784 が捨てると書いているのは別の話（包んだ中身の宛先が自分自身の場合）</text>\n<text x=\"20\" y=\"1536\" font-size=\"10\" fill=\"#6b7280\">出典（GRE の仕様・ヘッダの大きさ・プロトコル番号 47）: RFC 2784 https://www.rfc-editor.org/rfc/rfc2784</text>\n<text x=\"20\" y=\"1552\" font-size=\"10\" fill=\"#6b7280\">出典（トンネルの IP MTU 1476）: Cisco の解説 https://www.cisco.com/c/en/us/support/docs/ip/generic-routing-encapsulation-gre/25885-pmtud-ipfrag.html</text>\n<text x=\"20\" y=\"1568\" font-size=\"10\" fill=\"#6b7280\">出典（再帰ルーティングと %TUN-5-RECURDOWN）: Cisco の解説 https://www.cisco.com/c/en/us/support/docs/ip/enhanced-interior-gateway-routing-protocol-eigrp/22327-gre-flap.html</text>\n</svg>\n## 図 7・図 11 との接続","text":"<svg viewBox=\"0 0 900 1594\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-label=\"GRE トンネル：社内あてのパケットを別の IP パケットに入れて運ぶ\" style=\"max-width:100%;height:auto;font-family:sans-serif\">\n  <rect x=\"0\" y=\"0\" width=\"900\" height=\"1594\" fill=\"#fbfcfe\"/>\n  <text x=\"20\" y=\"30\" text-anchor=\"start\" font-size=\"14\" font-weight=\"700\" fill=\"#1f2937\">GRE トンネル：社内あてのパケットを、グローバル IP あての別のパケットの中に入れて運ぶ</text>\n  <text x=\"20\" y=\"50\" text-anchor=\"start\" font-size=\"11\" fill=\"#6b7280\">図 7 の問題 1（途中のルータの経路表を書けない）と問題 2（社内専用の住所は運ばれない）の解。問題 3（中身が読める）は残る</text>\n  <rect x=\"20\" y=\"80\" width=\"250\" height=\"250\" rx=\"10\" fill=\"none\" stroke=\"#9aa7b5\" stroke-width=\"1.5\" stroke-dasharray=\"6 4\"/>\n  <text x=\"32\" y=\"100\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#6b7280\">支店（自分のもの）</text>\n  <rect x=\"290\" y=\"80\" width=\"320\" height=\"250\" rx=\"10\" fill=\"#fff7ed\" stroke=\"#d97706\" stroke-width=\"1.5\" stroke-dasharray=\"6 4\"/>\n  <text x=\"302\" y=\"100\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#b45309\">インターネット（他人のもの）</text>\n  <rect x=\"630\" y=\"80\" width=\"250\" height=\"250\" rx=\"10\" fill=\"none\" stroke=\"#9aa7b5\" stroke-width=\"1.5\" stroke-dasharray=\"6 4\"/>\n  <text x=\"642\" y=\"100\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#6b7280\">データセンター（自分のもの）</text>\n  <rect x=\"32\" y=\"206\" width=\"80\" height=\"56\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"72.0\" y=\"226\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">PC-A</text>\n  <text x=\"72.0\" y=\"244\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">192.168.10.10</text>\n  <text x=\"72.0\" y=\"259\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">GW 192.168.10.1</text>\n  <line x1=\"112\" y1=\"234\" x2=\"150\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"150\" y=\"192\" width=\"110\" height=\"84\" rx=\"8\" fill=\"#f2f5f9\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"205.0\" y=\"212\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">ルータ 1</text>\n  <text x=\"205.0\" y=\"230\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">Gi0 192.168.10.1</text>\n  <text x=\"205.0\" y=\"245\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">Gi1 203.0.113.10</text>\n  <text x=\"205.0\" y=\"260\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">（グローバル IP）</text>\n  <rect x=\"141\" y=\"225\" width=\"18\" height=\"18\" fill=\"#ffffff\" stroke=\"#6b7280\" stroke-width=\"1.5\"/><text x=\"150\" y=\"238\" text-anchor=\"middle\" font-size=\"8\" fill=\"#1f2937\">Gi0</text>\n  <rect x=\"251\" y=\"225\" width=\"18\" height=\"18\" fill=\"#ffffff\" stroke=\"#6b7280\" stroke-width=\"1.5\"/><text x=\"260\" y=\"238\" text-anchor=\"middle\" font-size=\"8\" fill=\"#1f2937\">Gi1</text>\n  <line x1=\"269\" y1=\"234\" x2=\"330\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"330\" y=\"206\" width=\"70\" height=\"56\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"365.0\" y=\"226\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">ISP-1</text>\n  <text x=\"365.0\" y=\"244\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">他人の</text>\n  <text x=\"365.0\" y=\"259\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">ルータ</text>\n  <line x1=\"400\" y1=\"234\" x2=\"415\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"415\" y=\"206\" width=\"70\" height=\"56\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"450.0\" y=\"226\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">ISP-2</text>\n  <text x=\"450.0\" y=\"244\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">他人の</text>\n  <text x=\"450.0\" y=\"259\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">ルータ</text>\n  <line x1=\"485\" y1=\"234\" x2=\"500\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"500\" y=\"206\" width=\"70\" height=\"56\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"535.0\" y=\"226\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">ISP-3</text>\n  <text x=\"535.0\" y=\"244\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">他人の</text>\n  <text x=\"535.0\" y=\"259\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">ルータ</text>\n  <line x1=\"570\" y1=\"234\" x2=\"640\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"640\" y=\"192\" width=\"110\" height=\"84\" rx=\"8\" fill=\"#f2f5f9\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"695.0\" y=\"212\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">ルータ 2</text>\n  <text x=\"695.0\" y=\"230\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">Gi0 198.51.100.20</text>\n  <text x=\"695.0\" y=\"245\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">（グローバル IP）</text>\n  <text x=\"695.0\" y=\"260\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">Gi1 192.168.3.1</text>\n  <rect x=\"631\" y=\"225\" width=\"18\" height=\"18\" fill=\"#ffffff\" stroke=\"#6b7280\" stroke-width=\"1.5\"/><text x=\"640\" y=\"238\" text-anchor=\"middle\" font-size=\"8\" fill=\"#1f2937\">Gi0</text>\n  <rect x=\"741\" y=\"225\" width=\"18\" height=\"18\" fill=\"#ffffff\" stroke=\"#6b7280\" stroke-width=\"1.5\"/><text x=\"750\" y=\"238\" text-anchor=\"middle\" font-size=\"8\" fill=\"#1f2937\">Gi1</text>\n  <line x1=\"759\" y1=\"234\" x2=\"790\" y2=\"234\" stroke=\"#374151\" stroke-width=\"2\"/>\n  <rect x=\"790\" y=\"206\" width=\"80\" height=\"56\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"830.0\" y=\"226\" text-anchor=\"middle\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">PC-C</text>\n  <text x=\"830.0\" y=\"244\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">192.168.3.10</text>\n  <text x=\"830.0\" y=\"259\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">GW 192.168.3.1</text>\n  <rect x=\"150\" y=\"125\" width=\"110\" height=\"46\" rx=\"8\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1.5\"/>\n  <text x=\"205.0\" y=\"145\" text-anchor=\"middle\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">Tunnel0</text>\n  <text x=\"205.0\" y=\"163\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">10.0.0.1 /30</text>\n  <rect x=\"640\" y=\"125\" width=\"110\" height=\"46\" rx=\"8\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1.5\"/>\n  <text x=\"695.0\" y=\"145\" text-anchor=\"middle\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">Tunnel0</text>\n  <text x=\"695.0\" y=\"163\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">10.0.0.2 /30</text>\n  <line x1=\"205\" y1=\"192\" x2=\"205\" y2=\"171\" stroke=\"#0a7aff\" stroke-width=\"1.5\" stroke-dasharray=\"4 3\"/>\n  <line x1=\"695\" y1=\"192\" x2=\"695\" y2=\"171\" stroke=\"#0a7aff\" stroke-width=\"1.5\" stroke-dasharray=\"4 3\"/>\n  <line x1=\"260\" y1=\"148\" x2=\"640\" y2=\"148\" stroke=\"#0a7aff\" stroke-width=\"2.5\" stroke-dasharray=\"8 5\"/>\n  <text x=\"450\" y=\"118\" text-anchor=\"middle\" font-size=\"11\" font-weight=\"700\" fill=\"#0a7aff\">トンネル（論理。ケーブルは 1 本も増えていない）</text>\n  <text x=\"450\" y=\"180\" text-anchor=\"middle\" font-size=\"10\" fill=\"#6b7280\">両端のルータだけが作る「直結しているように見える 1 本」</text>\n  <text x=\"450\" y=\"194\" text-anchor=\"middle\" font-size=\"10\" fill=\"#6b7280\">source と destination は互いの外側グローバル IP（手動）</text>\n  <line x1=\"112\" y1=\"300\" x2=\"142\" y2=\"300\" stroke=\"#0a7aff\" stroke-width=\"2\"/><polygon points=\"141,295 141,305 150,300\" fill=\"#0a7aff\"/>\n  <circle cx=\"131\" cy=\"300\" r=\"9\" fill=\"#0a7aff\"/><text x=\"131\" y=\"304\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#ffffff\">1</text>\n  <circle cx=\"205\" cy=\"300\" r=\"9\" fill=\"#0a7aff\"/><text x=\"205\" y=\"304\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#ffffff\">2</text>\n  <line x1=\"269\" y1=\"300\" x2=\"623\" y2=\"300\" stroke=\"#0a7aff\" stroke-width=\"2\"/><polygon points=\"622,295 622,305 631,300\" fill=\"#0a7aff\"/>\n  <circle cx=\"450\" cy=\"300\" r=\"9\" fill=\"#0a7aff\"/><text x=\"450\" y=\"304\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#ffffff\">3</text>\n  <circle cx=\"695\" cy=\"300\" r=\"9\" fill=\"#0a7aff\"/><text x=\"695\" y=\"304\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#ffffff\">4</text>\n  <line x1=\"760\" y1=\"300\" x2=\"784\" y2=\"300\" stroke=\"#0a7aff\" stroke-width=\"2\"/><polygon points=\"783,295 783,305 792,300\" fill=\"#0a7aff\"/>\n  <circle cx=\"745\" cy=\"300\" r=\"9\" fill=\"#0a7aff\"/><text x=\"745\" y=\"304\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#ffffff\">5</text>\n  <text x=\"205\" y=\"322\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#0a7aff\">包む</text>\n  <text x=\"695\" y=\"322\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#0a7aff\">外す</text>\n  <text x=\"450\" y=\"322\" text-anchor=\"middle\" font-size=\"10\" fill=\"#b45309\">外側の宛先 198.51.100.20 だけを見て運ばれる</text>\n  <rect x=\"20\" y=\"348\" width=\"280\" height=\"120\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"32\" y=\"368\" text-anchor=\"start\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">包むと何が増えるか</text>\n  <text x=\"32\" y=\"386\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">元のパケットの前に 2 つ足す（カプセル化）</text>\n  <text x=\"32\" y=\"401\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">・GRE ヘッダ：最小 4 バイト（RFC 2784）</text>\n  <text x=\"32\" y=\"416\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">・外側 IP ヘッダ：20 バイト（IPv4）</text>\n  <text x=\"32\" y=\"431\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">合わせて 24 バイト増える</text>\n  <rect x=\"310\" y=\"348\" width=\"280\" height=\"120\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"322\" y=\"368\" text-anchor=\"start\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">テーブルに足す 1 行</text>\n  <text x=\"322\" y=\"386\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">192.168.3.0/24 → Tunnel0（手動）</text>\n  <text x=\"322\" y=\"401\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">出口が物理ポートではなく論理の口になる</text>\n  <text x=\"322\" y=\"416\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">包んだ後の新しいパケットは、もう一度</text>\n  <text x=\"322\" y=\"431\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">テーブルで探し直されて Gi1 から出る</text>\n  <rect x=\"600\" y=\"348\" width=\"280\" height=\"120\" rx=\"8\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"612\" y=\"368\" text-anchor=\"start\" font-size=\"13\" font-weight=\"700\" fill=\"#1f2937\">減るもの：一度に運べる大きさ</text>\n  <text x=\"612\" y=\"386\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">1500 − 24 ＝ 1476</text>\n  <text x=\"612\" y=\"401\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">Tunnel0 の既定の IP MTU は 1476 バイト</text>\n  <text x=\"612\" y=\"416\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">（物理インターフェースより 24 バイト小さい）</text>\n  <text x=\"612\" y=\"431\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">大きいパケットは分割される。「分割するな」の</text>\n  <text x=\"612\" y=\"446\" text-anchor=\"start\" font-size=\"10\" fill=\"#374151\">印が立っていれば、分割できず捨てられる</text>\n  <text x=\"20\" y=\"496\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">フロー</text>\n  <text x=\"20\" y=\"516\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">① PC-A は宛先 192.168.3.10 が自分のネットワーク外なので、デフォルトゲートウェイ（ルータ 1）へ送る。図 5・図 7 の ① と同じ</text>\n  <text x=\"20\" y=\"534\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">② ルータ 1 はテーブルを探す。192.168.3.0/24 に一致する行の出口が Tunnel0（物理ポートではなく論理の口）なので、そこへ渡す</text>\n  <text x=\"20\" y=\"552\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">③ Tunnel0 は元のパケットの前に GRE ヘッダと外側 IP ヘッダを付ける。外側の宛先は 198.51.100.20、送信元は 203.0.113.10</text>\n  <text x=\"34\" y=\"570\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">できた新しいパケットを、ルータ 1 はもう一度テーブルで探し直し、デフォルトルートに従って Gi1 から送り出す</text>\n  <text x=\"20\" y=\"588\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">④ プロバイダのルータは外側の宛先（グローバル IP）だけを見て運ぶ。中に入っている 192.168.3.10 は見ない。図 7 の ③ で捨てられたのはここ</text>\n  <text x=\"20\" y=\"606\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">⑤ ルータ 2 の Tunnel0 が外側 IP ヘッダと GRE ヘッダを外す。出てきた元のパケットを自分のテーブルで探し、Gi1 から PC-C へ送る</text>\n  <text x=\"20\" y=\"622\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">増えたもの</text>\n  <text x=\"20\" y=\"642\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">トンネルインターフェース（Tunnel0）：論理。物理ポートと同じようにテーブルの出口に書けるが、実体は「包んで別の口から出す」処理</text>\n  <text x=\"20\" y=\"660\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">カプセル化：1 つのパケットの中に、別のパケットがまるごと入っている状態。外から見えるのは外側だけ</text>\n  <text x=\"20\" y=\"688\" text-anchor=\"start\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">3 層で見ると</text>\n  <text x=\"20\" y=\"708\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">もの：トンネルインターフェース（論理）・GRE ヘッダ（通信 1 つずつに付く 4 バイト以上の札）</text>\n  <text x=\"20\" y=\"726\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">結びつき：Tunnel0 ⇄ source／destination の外側 IP（手動）。Tunnel0 ⇄ 社内あての行（手動）。10.0.0.0/30 の行だけ自動</text>\n  <text x=\"20\" y=\"744\" text-anchor=\"start\" font-size=\"11\" fill=\"#374151\">フロー：図 5 の ②「一致する行の出口へ送る」の出口が論理の口になり、包んだ後にもう一度テーブルを探し直す段が増える</text>\n<line x1=\"20\" y1=\"750\" x2=\"880\" y2=\"750\" stroke=\"#d6dde5\" stroke-width=\"1\"/>\n<text x=\"20\" y=\"772\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">各テーブルと設定（②④ の番号は上のフローに対応。青字）</text>\n  <rect x=\"20\" y=\"784\" width=\"280\" height=\"105\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"30\" y=\"800\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ルータ 1: ルーティングテーブル</text>\n  <text x=\"30\" y=\"816\" font-size=\"10\" fill=\"#374151\">192.168.10.0/24 → Gi0（自動）</text>\n  <text x=\"30\" y=\"831\" font-size=\"10\" fill=\"#374151\">203.0.113.0/24 → Gi1（自動）</text>\n  <text x=\"30\" y=\"846\" font-size=\"10\" fill=\"#374151\">10.0.0.0/30 → Tunnel0（自動・トンネルの中の番地）</text>\n  <text x=\"30\" y=\"861\" font-size=\"10\" fill=\"#0a7aff\">②192.168.3.0/24 → Tunnel0（手動）</text>\n  <text x=\"30\" y=\"876\" font-size=\"10\" fill=\"#374151\">0.0.0.0/0 → 203.0.113.1（手動）</text>\n  <rect x=\"310\" y=\"784\" width=\"280\" height=\"90\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"320\" y=\"800\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ルータ 1: Tunnel0 の設定（手動）</text>\n  <text x=\"320\" y=\"816\" font-size=\"10\" fill=\"#374151\">source 203.0.113.10（自分の外側）</text>\n  <text x=\"320\" y=\"831\" font-size=\"10\" fill=\"#374151\">destination 198.51.100.20（相手の外側）</text>\n  <text x=\"320\" y=\"846\" font-size=\"10\" fill=\"#374151\">IP 10.0.0.1/30</text>\n  <text x=\"320\" y=\"861\" font-size=\"10\" fill=\"#374151\">IP MTU 1476（既定）</text>\n  <rect x=\"600\" y=\"784\" width=\"280\" height=\"75\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"610\" y=\"800\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ISP のルーティングテーブル</text>\n  <text x=\"610\" y=\"816\" font-size=\"10\" fill=\"#374151\">198.51.100.0/24 の経路は載っている</text>\n  <text x=\"610\" y=\"831\" font-size=\"10\" fill=\"#374151\">192.168.3.0/24 の行は無いままでよい</text>\n  <text x=\"610\" y=\"846\" font-size=\"10\" fill=\"#0a7aff\">④外側の宛先だけ見れば運べる</text>\n  <rect x=\"20\" y=\"899\" width=\"280\" height=\"105\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"30\" y=\"915\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ルータ 2: ルーティングテーブル</text>\n  <text x=\"30\" y=\"931\" font-size=\"10\" fill=\"#374151\">198.51.100.0/24 → Gi0（自動）</text>\n  <text x=\"30\" y=\"946\" font-size=\"10\" fill=\"#374151\">192.168.3.0/24 → Gi1（自動）</text>\n  <text x=\"30\" y=\"961\" font-size=\"10\" fill=\"#374151\">10.0.0.0/30 → Tunnel0（自動）</text>\n  <text x=\"30\" y=\"976\" font-size=\"10\" fill=\"#374151\">192.168.10.0/24 → Tunnel0（手動・戻り用）</text>\n  <text x=\"30\" y=\"991\" font-size=\"10\" fill=\"#374151\">0.0.0.0/0 → 198.51.100.1（手動）</text>\n  <rect x=\"310\" y=\"899\" width=\"280\" height=\"90\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"320\" y=\"915\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ルータ 2: Tunnel0 の設定（手動）</text>\n  <text x=\"320\" y=\"931\" font-size=\"10\" fill=\"#374151\">source 198.51.100.20</text>\n  <text x=\"320\" y=\"946\" font-size=\"10\" fill=\"#374151\">destination 203.0.113.10</text>\n  <text x=\"320\" y=\"961\" font-size=\"10\" fill=\"#374151\">IP 10.0.0.2/30</text>\n  <text x=\"320\" y=\"976\" font-size=\"10\" fill=\"#374151\">向きが逆なだけで、中身は同じ組</text>\n  <rect x=\"600\" y=\"899\" width=\"280\" height=\"105\" rx=\"6\" fill=\"#ffffff\" stroke=\"#b9c4d0\" stroke-width=\"1.5\"/>\n  <text x=\"610\" y=\"915\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">事故：再帰ルーティング</text>\n  <text x=\"610\" y=\"931\" font-size=\"10\" fill=\"#374151\">destination 198.51.100.20 への経路を</text>\n  <text x=\"610\" y=\"946\" font-size=\"10\" fill=\"#374151\">Tunnel0 自身から学んでしまうと、包む →</text>\n  <text x=\"610\" y=\"961\" font-size=\"10\" fill=\"#374151\">出口を探す → またトンネル、と回り続ける</text>\n  <text x=\"610\" y=\"976\" font-size=\"10\" fill=\"#374151\">Cisco はこれを %TUN-5-RECURDOWN として公開</text>\n  <text x=\"610\" y=\"991\" font-size=\"10\" fill=\"#374151\">→ 外側の宛先だけは別の経路で持たせる</text>\n<text x=\"20\" y=\"1054\" font-size=\"12\" font-weight=\"700\" fill=\"#1f2937\">通信の中身の推移（フローごとのフレーム／パケット）</text>\n  <text x=\"20\" y=\"1104\" font-size=\"11\" font-weight=\"700\" fill=\"#1f2937\">① PC-A → ルータ 1（図 5・図 7 の ① と同じ）</text>\n  <rect x=\"20\" y=\"1110\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"79.0\" y=\"1124\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">宛先 MAC</text>\n  <text x=\"79.0\" y=\"1139\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC R1-Gi0</text>\n  <rect x=\"138\" y=\"1110\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"197.0\" y=\"1124\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">送信元 MAC</text>\n  <text x=\"197.0\" y=\"1139\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC A</text>\n  <rect x=\"256\" y=\"1110\" width=\"118\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"315.0\" y=\"1124\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">宛先 IP</text>\n  <text x=\"315.0\" y=\"1139\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.3.10</text>\n  <rect x=\"374\" y=\"1110\" width=\"118\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"433.0\" y=\"1124\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">送信元 IP</text>\n  <text x=\"433.0\" y=\"1139\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.10.10</text>\n  <rect x=\"492\" y=\"1110\" width=\"70\" height=\"36\" fill=\"#ffffff\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"527.0\" y=\"1124\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">データ</text>\n  <text x=\"527.0\" y=\"1139\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ping</text>\n  <line x1=\"20\" y1=\"1154\" x2=\"562\" y2=\"1154\" stroke=\"#374151\" stroke-width=\"1.5\"/><line x1=\"20\" y1=\"1150\" x2=\"20\" y2=\"1154\" stroke=\"#374151\" stroke-width=\"1.5\"/><line x1=\"562\" y1=\"1150\" x2=\"562\" y2=\"1154\" stroke=\"#374151\" stroke-width=\"1.5\"/>\n  <text x=\"291.0\" y=\"1167\" text-anchor=\"middle\" font-size=\"10\" fill=\"#374151\">フレーム＝全部。ただしスイッチが見るのは MAC とタグの部分だけ</text>\n  <line x1=\"256\" y1=\"1096\" x2=\"562\" y2=\"1096\" stroke=\"#0a7aff\" stroke-width=\"1.5\"/><line x1=\"256\" y1=\"1096\" x2=\"256\" y2=\"1100\" stroke=\"#0a7aff\" stroke-width=\"1.5\"/><line x1=\"562\" y1=\"1096\" x2=\"562\" y2=\"1100\" stroke=\"#0a7aff\" stroke-width=\"1.5\"/>\n  <text x=\"409.0\" y=\"1092\" text-anchor=\"middle\" font-size=\"10\" fill=\"#0a7aff\">パケット＝この部分。ルータはここ（IP）を見る</text>\n  <text x=\"20\" y=\"1200\" font-size=\"11\" font-weight=\"700\" fill=\"#1f2937\">② ルータ 1 の中</text>\n  <text x=\"20\" y=\"1220\" font-size=\"10\" fill=\"#6b7280\">テーブルの 192.168.3.0/24 の行の出口が Tunnel0。Tunnel0 が ① のパケットをまるごと「データ」として抱え、前に GRE ヘッダと外側 IP ヘッダを付ける</text>\n  <text x=\"20\" y=\"1244\" font-size=\"11\" font-weight=\"700\" fill=\"#1f2937\">③ ルータ 1 → ISP-1（入れ子になった。外側だけが運ばれる）</text>\n  <rect x=\"20\" y=\"1250\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"79.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">宛先 MAC</text>\n  <text x=\"79.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC ISP-1</text>\n  <rect x=\"138\" y=\"1250\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"197.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">送信元 MAC</text>\n  <text x=\"197.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC R1-Gi1</text>\n  <rect x=\"256\" y=\"1250\" width=\"104\" height=\"36\" fill=\"#fff1dc\" stroke=\"#d97706\" stroke-width=\"1\"/>\n  <text x=\"308.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">外側 宛先 IP</text>\n  <text x=\"308.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">198.51.100.20</text>\n  <rect x=\"360\" y=\"1250\" width=\"104\" height=\"36\" fill=\"#fff1dc\" stroke=\"#d97706\" stroke-width=\"1\"/>\n  <text x=\"412.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">外側 送信元 IP</text>\n  <text x=\"412.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">203.0.113.10</text>\n  <rect x=\"464\" y=\"1250\" width=\"70\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#6b7280\" stroke-width=\"1\"/>\n  <text x=\"499.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">GRE ヘッダ</text>\n  <text x=\"499.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">4 バイト以上</text>\n  <rect x=\"534\" y=\"1250\" width=\"104\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"586.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">内側 宛先 IP</text>\n  <text x=\"586.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.3.10</text>\n  <rect x=\"638\" y=\"1250\" width=\"104\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"690.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">内側 送信元 IP</text>\n  <text x=\"690.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.10.10</text>\n  <rect x=\"742\" y=\"1250\" width=\"60\" height=\"36\" fill=\"#ffffff\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"772.0\" y=\"1264\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">データ</text>\n  <text x=\"772.0\" y=\"1279\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ping</text>\n  <text x=\"20\" y=\"1304\" font-size=\"11\" font-weight=\"700\" fill=\"#1f2937\">④ ルータ 2 の中</text>\n  <text x=\"20\" y=\"1324\" font-size=\"10\" fill=\"#6b7280\">外側の宛先が自分なので受け取る。外側 IP ヘッダと GRE ヘッダを外すと、① とまったく同じパケットが出てくる。それを自分のテーブルで探す</text>\n  <text x=\"20\" y=\"1348\" font-size=\"11\" font-weight=\"700\" fill=\"#1f2937\">⑤ ルータ 2 → PC-C（MAC は付け替わる。IP は ① のまま）</text>\n  <rect x=\"20\" y=\"1354\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"79.0\" y=\"1368\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">宛先 MAC</text>\n  <text x=\"79.0\" y=\"1383\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC C</text>\n  <rect x=\"138\" y=\"1354\" width=\"118\" height=\"36\" fill=\"#f2f5f9\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"197.0\" y=\"1368\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">送信元 MAC</text>\n  <text x=\"197.0\" y=\"1383\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">MAC R2-Gi1</text>\n  <rect x=\"256\" y=\"1354\" width=\"118\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"315.0\" y=\"1368\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">宛先 IP</text>\n  <text x=\"315.0\" y=\"1383\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.3.10</text>\n  <rect x=\"374\" y=\"1354\" width=\"118\" height=\"36\" fill=\"#e6f0ff\" stroke=\"#0a7aff\" stroke-width=\"1\"/>\n  <text x=\"433.0\" y=\"1368\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">送信元 IP</text>\n  <text x=\"433.0\" y=\"1383\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">192.168.10.10</text>\n  <rect x=\"492\" y=\"1354\" width=\"70\" height=\"36\" fill=\"#ffffff\" stroke=\"#9aa7b5\" stroke-width=\"1\"/>\n  <text x=\"527.0\" y=\"1368\" text-anchor=\"middle\" font-size=\"9\" fill=\"#6b7280\">データ</text>\n  <text x=\"527.0\" y=\"1383\" text-anchor=\"middle\" font-size=\"10\" font-weight=\"700\" fill=\"#1f2937\">ping</text>\n<text x=\"20\" y=\"1408\" font-size=\"10\" fill=\"#6b7280\">橙の箱＝プロバイダが見る外側。青の箱＝社内の元の宛先。GRE ヘッダの最小の大きさは 4 バイト（RFC 2784 §2.1）。外側 IP ヘッダ（IPv4）は 20 バイト</text>\n<text x=\"20\" y=\"1424\" font-size=\"10\" fill=\"#6b7280\">外側 IP ヘッダのプロトコルの欄は 47（GRE・RFC 2784 §4）。途中の機器はこの番号で「中に別のパケットが入っている」と分かる。ただし中身は読める</text>\n<text x=\"20\" y=\"1440\" font-size=\"10\" fill=\"#6b7280\">外側 IP ヘッダ 20 ＋ GRE 4 ＝ 24 バイトぶん、一度に運べる大きさが減る。Cisco の既定では Tunnel0 の IP MTU は 1500 − 24 ＝ 1476 バイト</text>\n<text x=\"20\" y=\"1456\" font-size=\"10\" fill=\"#6b7280\">入りきらないパケットは分割される。ただし「分割するな」の印（DF）が立っていると分割できず、捨てられる（RFC 791 §2.3）</text>\n<text x=\"20\" y=\"1472\" font-size=\"10\" fill=\"#6b7280\">青の箱の中身（内側の宛先・送信元・データ）は暗号化されていない。途中で開けば読める。図 7 の問題 3 は残っている（次の図で封をする）</text>\n<text x=\"20\" y=\"1488\" font-size=\"10\" fill=\"#6b7280\">再帰ルーティング: 包んだ後の宛先（トンネルの destination）への経路をトンネル自身から学んでしまうと、包む → 出口を探す → またトンネル、と回り続ける</text>\n<text x=\"20\" y=\"1504\" font-size=\"10\" fill=\"#6b7280\">　Cisco はこれを %TUN-5-RECURDOWN というログの意味として公開しており、検知するとトンネルを数分間 down にする、と説明している</text>\n<text x=\"20\" y=\"1520\" font-size=\"10\" fill=\"#6b7280\">　直し方は、トンネルの宛先への経路だけを別に（より範囲の狭い行で）持たせること。なお RFC 2784 が捨てると書いているのは別の話（包んだ中身の宛先が自分自身の場合）</text>\n<text x=\"20\" y=\"1536\" font-size=\"10\" fill=\"#6b7280\">出典（GRE の仕様・ヘッダの大きさ・プロトコル番号 47）: RFC 2784 https://www.rfc-editor.org/rfc/rfc2784</text>\n<text x=\"20\" y=\"1552\" font-size=\"10\" fill=\"#6b7280\">出典（トンネルの IP MTU 1476）: Cisco の解説 https://www.cisco.com/c/en/us/support/docs/ip/generic-routing-encapsulation-gre/25885-pmtud-ipfrag.html</text>\n<text x=\"20\" y=\"1568\" font-size=\"10\" fill=\"#6b7280\">出典（再帰ルーティングと %TUN-5-RECURDOWN）: Cisco の解説 https://www.cisco.com/c/en/us/support/docs/ip/enhanced-interior-gateway-routing-protocol-eigrp/22327-gre-flap.html</text>\n</svg>\n## 図 7・図 11 との接続","line":60,"sources":["src_1","src_3","src_4"],"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_53d03d","type":"paragraph","markdown":"図 5 の ② は「一致する行の出口へ送る」でした。\n図 10 では、その出口が論理の口になり、包んだ後にもう一度テーブルを探し直す段が増えます。\n図 5 には無かった段はここだけで、MAC の付け替えはそのまま生きています。","text":"図 5 の ② は「一致する行の出口へ送る」でした。\n図 10 では、その出口が論理の口になり、包んだ後にもう一度テーブルを探し直す段が増えます。\n図 5 には無かった段はここだけで、MAC の付け替えはそのまま生きています。","line":286,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_8f686c","type":"paragraph","markdown":"図 7 の ③ でプロバイダのルータが運べなかったのは、宛先が社内専用の住所だったからです。\n図 10 の ④ で運べるのは、外側の宛先がグローバル IP だからです。\nプロバイダに載っているのはグローバル IP の経路だけでよく、192.168.3.0/24 の行は 1 つも要りません。","text":"図 7 の ③ でプロバイダのルータが運べなかったのは、宛先が社内専用の住所だったからです。\n図 10 の ④ で運べるのは、外側の宛先がグローバル IP だからです。\nプロバイダに載っているのはグローバル IP の経路だけでよく、192.168.3.0/24 の行は 1 つも要りません。","line":290,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_0d7125","type":"paragraph","markdown":"残った問題 3 は、図の帯で内側の宛先・送信元・データが読める状態で並んでいるところに出ています。\n次の図 11 で、この中身に封をします。","text":"残った問題 3 は、図の帯で内側の宛先・送信元・データが読める状態で並んでいるところに出ています。\n次の図 11 で、この中身に封をします。","line":294,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_703626","type":"heading","depth":2,"markdown":"## 未検証・注意","text":"未検証・注意","line":297,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_f16e47","type":"list","markdown":"- 外側 IP ヘッダ 20 バイトと GRE ヘッダ 4 バイトで、一度に運べる大きさが 24 バイト減ります。Cisco の既定では、トンネルインターフェースの IP MTU は物理インターフェースより 24 バイト小さくなり、1500 に対して 1476 です。1500 は一般的なイーサネットの値、1476 は Cisco の既定値で、どちらも規格が定めた値ではありません。回線によって違います。\n- 入りきらないパケットは分割されます。ただし「分割するな」の印（DF）が立っていると分割できず、捨てられます。これは IPv4 一般の決まりです。なお RFC 2784 §9 は「既存の GRE 実装は経路 MTU 探索を行わず、配送ヘッダに分割禁止の印を立てない」と書いているので、外側そのものは途中で分割されることがあります。\n- GRE ヘッダは「最小 4 バイト」です。チェックサムを付ける設定では長くなります。\n- 再帰ルーティングという事故があります。包んだ後の宛先（トンネルの destination）への経路をトンネル自身から学んでしまうと、包む・出口を探す・またトンネル、と回り続けます。Cisco はこれを `%TUN-5-RECURDOWN` というログの意味として公開しており、検知するとトンネルを数分間 down にする、と説明しています。直し方は、トンネルの宛先への経路だけを、より範囲の狭い行で別に持たせることです。このログの文字列は Cisco 機器の表示で、他社の機器で同じ言い方をするかは確認していません。\n- RFC 2784 にも捨てるという記述はありますが、それは包んだ中身の宛先が自分自身だった場合の話で、再帰ルーティングとは別です。\n- 勉強会のラボは 3 拠点・トンネル 3 本という構成でしたが、この図は 2 拠点・トンネル 1 本に単純化しています。","text":"外側 IP ヘッダ 20 バイトと GRE ヘッダ 4 バイトで、一度に運べる大きさが 24 バイト減ります。Cisco の既定では、トンネルインターフェースの IP MTU は物理インターフェースより 24 バイト小さくなり、1500 に対して 1476 です。1500 は一般的なイーサネットの値、1476 は Cisco の既定値で、どちらも規格が定めた値ではありません。回線によって違います。入りきらないパケットは分割されます。ただし「分割するな」の印（DF）が立っていると分割できず、捨てられます。これは IPv4 一般の決まりです。なお RFC 2784 §9 は「既存の GRE 実装は経路 MTU 探索を行わず、配送ヘッダに分割禁止の印を立てない」と書いているので、外側そのものは途中で分割されることがあります。GRE ヘッダは「最小 4 バイト」です。チェックサムを付ける設定では長くなります。再帰ルーティングという事故があります。包んだ後の宛先（トンネルの destination）への経路をトンネル自身から学んでしまうと、包む・出口を探す・またトンネル、と回り続けます。Cisco はこれを %TUN-5-RECURDOWN というログの意味として公開しており、検知するとトンネルを数分間 down にする、と説明しています。直し方は、トンネルの宛先への経路だけを、より範囲の狭い行で別に持たせることです。このログの文字列は Cisco 機器の表示で、他社の機器で同じ言い方をするかは確認していません。RFC 2784 にも捨てるという記述はありますが、それは包んだ中身の宛先が自分自身だった場合の話で、再帰ルーティングとは別です。勉強会のラボは 3 拠点・トンネル 3 本という構成でしたが、この図は 2 拠点・トンネル 1 本に単純化しています。","line":299,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_240080","type":"heading","depth":2,"markdown":"## 出典","text":"出典","line":306,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_13ac6c","type":"list","markdown":"- 勉強会での本人の観察（2026-09-13 実機ハンズオン。資料は非公開）\n- [RFC 2784: Generic Routing Encapsulation (GRE)](https://www.rfc-editor.org/rfc/rfc2784) — §2 の「Delivery Header / GRE Header / Payload packet」、§2.1 の最小 4 オクテット、§4「The IPv4 protocol 47 is used when GRE packets are encapsulated in IPv4」、§9「既存の実装は経路 MTU 探索を行わず、配送ヘッダに DF を立てない」\n- [RFC 791: Internet Protocol](https://www.rfc-editor.org/rfc/rfc791) — §2.3「If internet datagram marked don't fragment cannot be delivered to its destination without fragmenting it, it is to be discarded instead」\n- [Cisco: GRE と IPsec の断片化・MTU・PMTUD](https://www.cisco.com/c/en/us/support/docs/ip/generic-routing-encapsulation-gre/25885-pmtud-ipfrag.html) — トンネルインターフェースの IPv4 MTU は既定で物理より 24 バイト小さく、1476 になる\n- [Cisco: GRE Tunnel Interface Flaps](https://www.cisco.com/c/en/us/support/docs/ip/enhanced-interior-gateway-routing-protocol-eigrp/22327-gre-flap.html) — 宛先への経路がトンネル自身を指すと回り続ける。検知すると数分間トンネルを down にする。トンネルの宛先には範囲の狭いスタティックルートを持たせる","text":"勉強会での本人の観察（2026-09-13 実機ハンズオン。資料は非公開）RFC 2784: Generic Routing Encapsulation (GRE) — §2 の「Delivery Header / GRE Header / Payload packet」、§2.1 の最小 4 オクテット、§4「The IPv4 protocol 47 is used when GRE packets are encapsulated in IPv4」、§9「既存の実装は経路 MTU 探索を行わず、配送ヘッダに DF を立てない」RFC 791: Internet Protocol — §2.3「If internet datagram marked don't fragment cannot be delivered to its destination without fragmenting it, it is to be discarded instead」Cisco: GRE と IPsec の断片化・MTU・PMTUD — トンネルインターフェースの IPv4 MTU は既定で物理より 24 バイト小さく、1476 になるCisco: GRE Tunnel Interface Flaps — 宛先への経路がトンネル自身を指すと回り続ける。検知すると数分間トンネルを down にする。トンネルの宛先には範囲の狭いスタティックルートを持たせる","line":308,"sources":["src_1","src_2","src_3","src_4"],"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_1f7c1f","type":"heading","depth":2,"markdown":"## 関連","text":"関連","line":314,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}},{"id":"blk_05ddf9","type":"list","markdown":"- [ネットワーク\\_INDEX](/notes/nw-basics-index) — 連載の目次\n\n- 連載の入口: [ネットワーク\\_00\\_3層で言葉を置く](/notes/nw-basics-00-three-layers)（`/notes/nw-basics-00-three-layers`）\n\n- 前の記事（図 9）: [ネットワーク\\_09\\_ACL](/notes/nw-basics-09-acl)（`/notes/nw-basics-09-acl`）\n\n- 次の記事（図 11）: [ネットワーク\\_11\\_IPsec](/notes/nw-basics-11-ipsec)（`/notes/nw-basics-11-ipsec`）\n\n- 3 つの問題を出した記事: [ネットワーク\\_07\\_インターネットを挟む](/notes/nw-basics-07-internet)（`/notes/nw-basics-07-internet`）","text":"ネットワーク_INDEX — 連載の目次連載の入口: ネットワーク_00_3層で言葉を置く（/notes/nw-basics-00-three-layers）前の記事（図 9）: ネットワーク_09_ACL（/notes/nw-basics-09-acl）次の記事（図 11）: ネットワーク_11_IPsec（/notes/nw-basics-11-ipsec）3 つの問題を出した記事: ネットワーク_07_インターネットを挟む（/notes/nw-basics-07-internet）","line":316,"lineage":[],"authoredBy":{"kind":"human","id":"owner","label":"ぴぐお"}}]}