バックナンバーはこちら。
https://www.simulationroom999.com/blog/In-vehicle-network-backnumber/
はじめに
BLFに埋まっていたEthernetFrameをIPフラグメントの断片化位置に着目して解析する。
登場人物
博識フクロウのフクさん

イラストACにて公開の「kino_k」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=iKciwKA9&area=1
エンジニア歴8年の太郎くん

イラストACにて公開の「しのみ」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=uCKphAW2&area=1
2つ目のEthernetFrame

じゃ、2つ目のEthernetFrameを見てみよう。
// Ehternetヘッダ
0x01,0x00,0x5e,0x00,0x01,0x01,
0x10,0x6f,0x3f,0x0f,0xd6,0xdd,
0x08,0x00,
// IPヘッダ
0x45,
0x00,
0x05,0xdc,
0x6a,0xdc,
0x20,0xb9,// (フラグ=001b=継続,断片化位置=0xb9=1480[byte])
0xff,
0x11,
0x69,0x56,
0xc0,0xa8,0x0A,0x0B,
0xec,0x00,0x01,0x03,
// UDPデータの続き
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,…

あー、UDPデータの続きだから、UDPヘッダは居ないのね。

んー、今回のフレームも継続bitが1だからまだ続くのか。
まぁUDPのデータ長が10861[byte]だったから、2,3フレームじゃ終わらないよね。

あれ?
断片化位置=0xb9=1480[byte]
ってのはどういうこと?

0xb9が1480[byte]を意味するってことなんだろうけど、
どういう表現方法になってるんだ???
断片化位置の表現方法

なかなかいい感じに疑問にぶち当たってくれて
ホント有難い。

それは皮肉なのか?!

いやいや、疑問に思えるってことは一個一個精査している証拠だからね。
良いことだよ。

わーい、褒められたー。

(扱いやすいな。)

話はシンプルで、
8[byte]単位の数値ってことになってるだけ。
0xb9=185
185を8倍して
185×8=1480

ほー。
そんなルールなのか。
8byte境界ルール

あれ?
ということはIPフラグメントって必ず8byte境界で分割されるってこと?

冴えてるね。
その通り。

UDPのデータ長って10861[byte]で8byte境界じゃないんだけど、
この場合どうなるんだろ???
最後のフレームは0パディングされるとか???

さぁどーなるんだろうねー。

(これは次回に続くパターン!)
まとめ

まとめだよ。
- 2フレーム目を確認。
- これもIPヘッダのフラグは継続。
- 断片化位置の値は、その値×8が実際のデータオフセット位置となる。
- よって、IPフラグメントは8byte境界の仕様が暗黙的に発生する。
バックナンバーはこちら。
コメント