定期的にMLD General Queryを送信ツールのページです。
MLDv2(MLDv1)スヌーピング機能付のL2-SWをサーバと端末間に使用した際、動的にMLDスヌーピンを行うためにサーバでMLD General Queryを定期的に送信するツールを作成しました。これにより対応する端末がリスナーリポートを送信することになり、L2-SWでMLDスヌーピンが実行されます。
Cisco Catalyst C2960Gでの動作を確認しています。
コマンド仕様 †
mld_query [-v] [-h] [-d] [-f log_facility] [-r <n>] [-t <sec>] [-x <msec>] <interface>
| オプション | 機能 |
|---|
| -v | バージョンを表示します。 |
| -h | ヘルプを表示します。 |
| -d | デーモンとして動作します。(セッションのデタッチ) |
| -f <log_facility> | Syslog出力のファシリティを設定します。(デフォルト:user) |
| -r <n> | Robustnessを指定します。(デフォルト:2) |
| -t <sec> | Query Packetの送信周期を指定します。(125 sec) |
| -x <msec> | 最大応答遅延(デフォルト:10,000 ms) |
参照規格 †
| 規格番号 | タイトル | 記事 |
| 1 | RFC 1883 | Internet Protocol, Version 6 (IPv6) Specification | |
| 2 | RFC 3810 | Multicast Listener Discovery Version 2 (MLDv2) for IPv6 | |
| 3 | RFC 3542 | Advanced Sockets Application Program Interface (API) for IPv6 | |
| 4 | RFC 2711 | IPv6 Router Alert Option | |
General Query Packet Format †
| Offset | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
|---|
| 00 | Version(4) | Priority(4) | Flow Label(24) |
|---|
| 01 | Payload Length(16) | Next Header=Hop by Hop Option(8) | Hop Limit(8) |
|---|
| 02 | Source Address(128) |
|---|
| 03 |
|---|
| 04 |
|---|
| 05 |
|---|
| 06 | Destination Address(128) |
|---|
| 07 |
|---|
| 08 |
|---|
| 09 |
|---|
| 10 | Next Header(8)=ICMPv6 Option | Hdr Ext Len(8)=0 | Options(32+16)=Router Alart |
|---|
| 11 | Options |
|---|
| 12 | Type(8) = Multicast Listener Query(130) | Code(8)= 00 | Checksum(16) |
|---|
| 13 | Maximum Response Code(16) | Reserved(16) |
|---|
| 14 | Multicast Address(128) |
|---|
| 15 |
|---|
| 16 |
|---|
| 17 |
|---|
| 18 | Reserved(4) | S | QRV(3) | Number of Sources (24) N=0 |
|---|
| 19 | Source Address(128) [1](None) |
|---|
| 20 |
|---|
| 21 |
|---|
| 22 |
|---|
| 23 | Source Address(128) [2](None) |
|---|
| 24 |
|---|
| 25 |
|---|
| 26 |
|---|
| 27 | .. |
|---|
| 28 |
|---|
| 4xN+15 | Source Address(128) [N](None) |
|---|
| 4xN+16 |
|---|
| 4xN+17 |
|---|
| 4xN+18 |
|---|
※General Queryでは
- Destination Address = ff02::1
- Source Address = Link Local Address
- Number of Sources = 0
MAX Response Code † Edit †
- msec単位の応答遅延時間を指定しますが、32768以上の値を指定する際は浮動小数点フォーマットになります。
- 32768以上の場合は以下のようにコーディングされます。
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|
| Max Response Code | "1" | exp | mant |
|---|
f( code < 32768 )
{
res = code;
}
else
{
exp = (code & 0x7000) >> 20;
mant = code & 0x0fff;
res = (mant | 0x1000) << (exp + 3);
}
S(Suppress Router-Side Processing) † Edit †
- S Flag="1"の場合、マルチキャストルータは通常のタイマー処理を停止します。
IGMP General Queryの場合は”0”
QRV(Querier's Robustness Variable) † Edit †
- ロバストネスを指定します。パケットロスの補償として、メッセージの送信回数を指定します。
通常は"2"が指定されます。
QQIC(Querier's Query Interval Code) † Edit †
- Querier側の送信間隔が指定されます。(単位:sec)
Eathernet Frame Format †
| Offset | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Remarks |
| 00 | 0xAA | 0xAA |
|---|
| 01 | 0xAA | 0xAA |
|---|
| 02 | 0xAA | 0xAA |
|---|
| 03 | 0xAA | 0xAA |
|---|
| 04 | 0xAA | 0xAA |
|---|
| 05 | 0xAA | 0xAA |
|---|
| 06 | 0xAA | 0xAA |
|---|
| 07 | 0xAB | 0xAB |
|---|
| 08 | Dist MAC(0) | 0x33 |
|---|
| 09 | Dist MAC(1) | 0x33 |
|---|
| 10 | Dist MAC(2) | 0x00 |
|---|
| 11 | Dist MAC(3) | 0x00 |
|---|
| 12 | Dist MAC(4) | 0x00 |
|---|
| 13 | Dist MAC(5) | 0x01 |
|---|
| 14 | Src MAC(0) | |
|---|
| 15 | Src MAC(1) | |
|---|
| 16 | Src MAC(2) | |
|---|
| 17 | Src MAC(3) | |
|---|
| 18 | Src MAC(4) | |
|---|
| 19 | Src MAC(5) | |
|---|
| 20 | Type(0) | 0x86 |
|---|
| 21 | Type(1) | 0xdd |
|---|
| 22 | Payload(0) | |
|---|
| 23 | Payload(1) | |
|---|
| ...... | |
|---|
| 22+N | Payload(N) | |
|---|
| 23+N | FCS | X | |
|---|
※GeneralQuery?では
- Dist Mac = 33:33:00:00:00:01
- Type = 0x86DD(IPv6)