2020年6月24日 星期三

udpdump

udpdump 是 wireshark 內部接收 UDP 封包的 server,由其它所在擷取的訊息裝載而成 。udpdump 接收後,把 UDP 進前的 Header 拿掉,轉著 EXPORTED_PDU 格式給 wireshark 解析。

EXPORTED_PDU 格式是訊息前面含有一些 TLV 格式的 meta 資訊
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |      Option Code              |         Option Length         |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 /                       Option Value                            /
 /             variable length, aligned to 32 bits               /
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 /                                                               /
 /                 . . . other options . . .                     /
 /                                                               /
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Option Code == opt_endofopt  |  Option Length == 0          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

依據 udpdump 原始碼,meta 資訊包含協定名稱 (在啟用時設定,預設 data)、實際來源 IP 和port、目的 IP (固定為 127.0.0.1)、實際目的 port (預設 5555)。

wireshark 依據協定名稱對訊息解析。

問題:協定如果是網路封包

參考來源
  • https://www.wireshark.org/docs/man-pages/udpdump.html 
  • https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=epan/exported_pdu.h;hb=refs/heads/master
  •  https://www.wireshark.org/docs/wsdg_html_chunked/
  • https://www.wireshark.org/docs/wsdg_html_chunked/PartDevelopment.html

沒有留言:

張貼留言

SIP header Via

所有 SIP 訊息 都要有 Via,縮寫 v。一開始的 UAC 和後續途經的每個 proxy 都會疊加一個 Via 放傳送的位址,依序作為回應的路徑。 格式 sent-protocol sent-by [ ;branch= branch ][ ; 參數 ...] s...