IPv4 - ARP

課程影片

man 可以參考 arp(8)arping(8)。另外,netfilters 中有 ARP 的 hook,命令列工具方面,nft 也整合了舊有的 arptables 功能。所以那些 *tables 可以考慮直接參考新的 nft 中與 ARP 有關的功能。

另外,在 IPv6 中,在 IPv4 中的 ARP 該具有的功能整合進了 ICMPv6 中的 Neighbor Discovery

arp for Showing Address Resolution Table in Linux

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

第 7LMN 講 路由器運作原理以及網路互連技術 L07 12 13 14

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

目標:已知 IP,求 MAC 位址

ARP 封包格式

請求方

        0        7        15       23       31
        +--------+--------+--------+--------+
        |       HT        |        PT       |
        +--------+--------+--------+--------+
        |  HAL   |  PAL   |        OP       |
        +--------+--------+--------+--------+
        |         S_HA (bytes 0-3)          |
        +--------+--------+--------+--------+
        | S_HA (bytes 4-5)|S_L32 (bytes 0-1)|
        +--------+--------+--------+--------+
        |S_L32 (bytes 2-3)|S_NID (bytes 0-1)|
        +--------+--------+--------+--------+
        |         S_NID (bytes 2-5)         |
        +--------+--------+--------+--------+
        |S_NID (bytes 6-7)| T_HA (bytes 0-1)|
        +--------+--------+--------+--------+
        |         T_HA (bytes 3-5)          |
        +--------+--------+--------+--------+
        |         T_L32 (bytes 0-3)         |
        +--------+--------+--------+--------+
        |         T_NID (bytes 0-3)         |
        +--------+--------+--------+--------+
        |         T_NID (bytes 4-7)         |
        +--------+--------+--------+--------+

回覆方

        0        7        15       23       31
        +--------+--------+--------+--------+
        |       HT        |        PT       |
        +--------+--------+--------+--------+
        |  HAL   |  PAL   |        OP       |
        +--------+--------+--------+--------+
        |         S_HA (bytes 0-3)          |
        +--------+--------+--------+--------+
        | S_HA (bytes 4-5)|S_L32 (bytes 0-1)|
        +--------+--------+--------+--------+
        |S_L32 (bytes 2-3)|S_NID (bytes 0-1)|
        +--------+--------+--------+--------+
        |         S_NID (bytes 2-5)         |
        +--------+--------+--------+--------+
        |S_NID (bytes 6-7)| T_HA (bytes 0-1)|
        +--------+--------+--------+--------+
        |         T_HA (bytes 3-5)          |
        +--------+--------+--------+--------+
        |         T_L32 (bytes 0-3)         |
        +--------+--------+--------+--------+
        |         T_NID (bytes 0-3)         |
        +--------+--------+--------+--------+
        |         T_NID (bytes 4-7)         |
        +--------+--------+--------+--------+