IPv4 (ipv4)
- レイヤ: L3 (ネットワーク)
- ヘッダ: 可変長
- 疑似ヘッダ: 上位レイヤのチェックサムに
src/dstを提供 - 補足: カプセル化・トンネル, IS-IS (P2), MACsec / GTPv2-C / Diameter / SIP / RTP (P2), LDP / RSVP-TE / BFD (P2), マルチキャスト制御プロトコル, ユーザ定義プロトコル (protocols.d)
下位レイヤからの到達
| 下位レイヤ | 判別フィールド | 値 |
|---|---|---|
ethernet2 | ethertype | 2048 (0x0800) |
dot1q | ethertype | 2048 (0x0800) |
dot1ad | ethertype | 2048 (0x0800) |
snap | pid | 2048 (0x0800) |
ipv4 | protocol | 4 (0x04) |
ipv6 | next_header | 4 (0x04) |
ipv6_hopopts | next_header | 4 (0x04) |
ipv6_route | next_header | 4 (0x04) |
ipv6_srh | next_header | 4 (0x04) |
ipv6_frag | next_header | 4 (0x04) |
ipv6_dstopts | next_header | 4 (0x04) |
ppp | protocol | 33 (0x0021) |
gre | protocol_type | 2048 (0x0800) |
mpls | s = 1 のときのペイロード先頭 4 ビット | 4 |
gtpu | message_type = 255 (0xff) のときのペイロード先頭 4 ビット | 4 |
geneve | protocol_type | 2048 (0x0800) |
pim_register | type = 1 のときのペイロード先頭 4 ビット | 4 |
フィールド
| フィールド | 型 | 既定値 | Auto | 説明 |
|---|---|---|---|---|
version | uint(4) | 4 | IP バージョン。常に 4。 | |
ihl | uint(4) | ヘッダの長さ (32 ビットワード単位) | ヘッダ長 (32 ビット語単位、5〜15。Auto、オプションを含む)。 | |
dscp | uint(6) | 0 | DSCP (QoS クラス、0〜63)。 | |
ecn | uint(2) | 0 | 明示的輻輳通知 (0 = 非 ECT、1 / 2 = ECT、3 = CE)。 | |
total_length | uint(16) | ヘッダとペイロードの長さ (オクテット単位) | ヘッダとペイロードの合計長 (バイト、Auto)。 | |
identification | uint(16) | 0 | 同じデータグラムのフラグメントで共通の識別子。 | |
flags | flags(3) | 0x0 | フラグ: DF (分割禁止) と MF (後続フラグメントあり)。最上位ビットは予約。 | |
frag_offset | uint(13) | 0 | このフラグメントのオフセット (8 バイト単位)。 | |
ttl | uint(8) | 64 | 生存時間。ルータごとに減算され、0 は送信されない。 | |
protocol | enum(8) | 253 (experimental) | 次レイヤのプロトコル番号 (「次レイヤ」参照) | 次レイヤのプロトコル番号 (Auto。次レイヤ不明時は 253 = 実験用)。 |
header_checksum | uint(16) | ヘッダに対するインターネットチェックサム | ヘッダのインターネットチェックサム (Auto)。 | |
src | ipv4 | 192.0.2.1 | 送信元 IPv4 アドレス。 | |
dst | ipv4 | 192.0.2.2 | 宛先 IPv4 アドレス。 | |
options | tlv — ihl * 4 - 20 オクテット | IPv4 オプション (TLV: EOL、NOP、セキュリティ、経路記録、タイムスタンプなど)。 | ||
padding | padding(4) | オプションを 32 ビット境界に揃えるゼロパディング (Auto)。 |
flags
| ビット | マスク | 名前 |
|---|---|---|
| 2 | 4 | reserved |
| 1 | 2 | df |
| 0 | 1 | mf |
protocol
| 値 | 名前 |
|---|---|
| 1 (0x01) | icmp |
| 2 (0x02) | igmp |
| 4 (0x04) | ipip |
| 6 (0x06) | tcp |
| 17 (0x11) | udp |
| 41 (0x29) | ipv6 |
| 46 (0x2e) | rsvp |
| 47 (0x2f) | gre |
| 50 (0x32) | esp |
| 51 (0x33) | ah |
| 58 (0x3a) | ipv6_icmp |
| 88 (0x58) | eigrp |
| 89 (0x59) | ospf |
| 103 (0x67) | pim |
| 112 (0x70) | vrrp |
| 115 (0x73) | l2tp |
| 132 (0x84) | sctp |
| 253 (0xfd) | experimental |
options
- タイプ 8 ビット、長さ 8 ビット。
- 長さはタイプと長さのフィールドも含みます。
- 未知のタイプは値をオクテット列のまま保持します。
| タイプ値 | 名前 | 値のフィールド | 説明 |
|---|---|---|---|
| 0 (0x00) | eol | (タイプのみ。長さと値なし) | |
| 1 (0x01) | nop | (タイプのみ。長さと値なし) | |
| 148 (0x94) | router_alert | value |
options › router_alert
| フィールド | 型 | 既定値 | Auto | 説明 |
|---|---|---|---|---|
value | uint(16) |
次レイヤ
次レイヤは protocol で判別します。このフィールドが Auto のときは、上に積んだプロトコルの値を書き込みます。
| 値 | プロトコル | 備考 |
|---|---|---|
| 1 (0x01) | icmpv4 | |
| 2 (0x02) | igmp | |
| 4 (0x04) | ipv4 | |
| 6 (0x06) | tcp | |
| 17 (0x11) | udp | |
| 41 (0x29) | ipv6 | |
| 46 (0x2e) | rsvp | |
| 47 (0x2f) | gre | |
| 88 (0x58) | eigrp | |
| 89 (0x59) | ospfv2 | |
| 103 (0x67) | pim | |
| 103 (0x67) | pim_register | |
| 112 (0x70) | vrrpv3 | |
| 112 (0x70) | vrrpv2 | |
| 115 (0x73) | l2tpv3 | |
| 132 (0x84) | sctp |
制約
| レベル | 規則 |
|---|---|
| 警告 | version が 4 |
| エラー | ihl が 5..15 の範囲 |
| 警告 | ttl が 0 以外 |
サンプルテンプレート
- interop-bfd-session-up —
templates/interop/bfd-session-up.wpg.yaml - interop-ldp-link-hello —
templates/interop/ldp-link-hello.wpg.yaml - interop-ospfv2-hello-2way —
templates/interop/ospfv2-hello-2way.wpg.yaml - interop-pim-hello-neighbor —
templates/interop/pim-hello-neighbor.wpg.yaml - interop-ripv2-response-route —
templates/interop/ripv2-response-route.wpg.yaml - interop-vrrpv3-preempt —
templates/interop/vrrpv3-preempt.wpg.yaml - bad-fcs —
templates/malformed/bad-fcs.wpg.yaml - bad-ipv4-checksum —
templates/malformed/ipv4-bad-checksum.wpg.yaml - bad-ipv4-ihl —
templates/malformed/ipv4-bad-ihl.wpg.yaml - bad-ipv4-total-length —
templates/malformed/ipv4-total-length-too-long.wpg.yaml - bad-ipv4-total-length-short —
templates/malformed/ipv4-total-length-too-short.wpg.yaml - truncated-ipv4-udp —
templates/malformed/ipv4-truncated.wpg.yaml - bad-tcp-checksum —
templates/malformed/tcp-bad-checksum.wpg.yaml - bad-udp-checksum —
templates/malformed/udp-bad-checksum.wpg.yaml - bad-udp-length —
templates/malformed/udp-bad-length.wpg.yaml - 6in4 —
templates/protocols/encap/6in4.wpg.yaml - ipip —
templates/protocols/encap/ipip.wpg.yaml - frame-with-fcs —
templates/protocols/frame/fcs-auto.wpg.yaml - jumbo-frame-9000 —
templates/protocols/frame/jumbo-9000.wpg.yaml - dot1ad-qinq-frame —
templates/protocols/l2/dot1ad.wpg.yaml - dot1q-frame —
templates/protocols/l2/dot1q.wpg.yaml - dot3-llc-snap-frame —
templates/protocols/l2/dot3-llc-snap.wpg.yaml - icmpv4-echo-request —
templates/protocols/l3/icmpv4-echo.wpg.yaml - ipv4-dscp-ecn-matrix —
templates/protocols/l3/ipv4-dscp-ecn-matrix.wpg.yaml - ipv4-fragments —
templates/protocols/l3/ipv4-fragment.wpg.yaml - ipv4-router-alert —
templates/protocols/l3/ipv4-router-alert.wpg.yaml - ipv4-udp —
templates/protocols/l3/ipv4.wpg.yaml - sctp-abort —
templates/protocols/l4/sctp-abort.wpg.yaml - sctp-data —
templates/protocols/l4/sctp-data.wpg.yaml - sctp-heartbeat —
templates/protocols/l4/sctp-heartbeat.wpg.yaml - sctp-init-ack —
templates/protocols/l4/sctp-init-ack.wpg.yaml - sctp-init —
templates/protocols/l4/sctp-init.wpg.yaml - sctp-over-udp —
templates/protocols/l4/sctp-over-udp.wpg.yaml - sctp-sack —
templates/protocols/l4/sctp-sack.wpg.yaml - tcp-data-psh-ack —
templates/protocols/l4/tcp-data.wpg.yaml - tcp-syn-options —
templates/protocols/l4/tcp-syn.wpg.yaml - udp-datagram —
templates/protocols/l4/udp.wpg.yaml - diameter-ccr-initial —
templates/protocols/mobile/diameter-ccr-initial.wpg.yaml - diameter-cer —
templates/protocols/mobile/diameter-cer.wpg.yaml - gtpv2-create-session-request —
templates/protocols/mobile/gtpv2-create-session-request.wpg.yaml - gtpv2-create-session-response —
templates/protocols/mobile/gtpv2-create-session-response.wpg.yaml - gtpv2-echo-request —
templates/protocols/mobile/gtpv2-echo-request.wpg.yaml - ldp-hello —
templates/protocols/mpls/ldp-hello.wpg.yaml - ldp-initialization —
templates/protocols/mpls/ldp-initialization.wpg.yaml - ldp-label-mapping —
templates/protocols/mpls/ldp-label-mapping.wpg.yaml - ldp-label-withdraw —
templates/protocols/mpls/ldp-label-withdraw.wpg.yaml - ldp-targeted-hello —
templates/protocols/mpls/ldp-targeted-hello.wpg.yaml - rsvp-hello —
templates/protocols/mpls/rsvp-hello.wpg.yaml - rsvp-path-err —
templates/protocols/mpls/rsvp-path-err.wpg.yaml - rsvp-path-tear —
templates/protocols/mpls/rsvp-path-tear.wpg.yaml - rsvp-te-path —
templates/protocols/mpls/rsvp-te-path.wpg.yaml - rsvp-te-resv —
templates/protocols/mpls/rsvp-te-resv.wpg.yaml - sr-mpls-entropy —
templates/protocols/mpls/sr-mpls-entropy.wpg.yaml - bfd-auth —
templates/protocols/oam/bfd-auth.wpg.yaml - bfd-single-hop —
templates/protocols/oam/bfd-single-hop.wpg.yaml - micro-bfd —
templates/protocols/oam/micro-bfd.wpg.yaml - srv6-h-encaps-ipv4 —
templates/protocols/srv6/srv6-h-encaps-ipv4.wpg.yaml - ptp-announce-udp —
templates/protocols/timing/ptp-announce-udp.wpg.yaml - ptp-delay-req-udp —
templates/protocols/timing/ptp-delay-req-udp.wpg.yaml - ptp-delay-resp-udp —
templates/protocols/timing/ptp-delay-resp-udp.wpg.yaml - ptp-signaling-unicast —
templates/protocols/timing/ptp-signaling-unicast.wpg.yaml - rtcp-feedback-app —
templates/protocols/voip/rtcp-feedback-app.wpg.yaml - rtcp-rr-bye —
templates/protocols/voip/rtcp-rr-bye.wpg.yaml - rtcp-sr-sdes —
templates/protocols/voip/rtcp-sr-sdes.wpg.yaml - rtp-pcmu —
templates/protocols/voip/rtp-pcmu.wpg.yaml - sip-invite —
templates/protocols/voip/sip-invite.wpg.yaml - sip-register —
templates/protocols/voip/sip-register.wpg.yaml - scenario-dhcp-discover-flood —
templates/scenarios/dhcp-discover-flood.wpg.yaml - scenario-frame-size-sweep —
templates/scenarios/frame-size-sweep.wpg.yaml - scenario-jumbo-udp-mtu-probe —
templates/scenarios/jumbo-udp-mtu-probe.wpg.yaml - scenario-mac-flood —
templates/scenarios/mac-flood.wpg.yaml - scenario-ping-sweep-pattern —
templates/scenarios/ping-sweep-pattern.wpg.yaml - scenario-qinq-service-sweep —
templates/scenarios/qinq-service-sweep.wpg.yaml - sr-mpls-prefix-sid-sweep —
templates/scenarios/sr-mpls-prefix-sid-sweep.wpg.yaml - scenario-tcp-syn-port-scan —
templates/scenarios/tcp-syn-port-scan.wpg.yaml - scenario-ttl-sweep —
templates/scenarios/ttl-sweep.wpg.yaml - scenario-udp-qos-matrix —
templates/scenarios/udp-qos-matrix.wpg.yaml - scenario-vlan-id-sweep —
templates/scenarios/vlan-id-sweep.wpg.yaml - scenario-vlan-syn-flood —
templates/scenarios/vlan-syn-flood.wpg.yaml