Ip

硬體不會響應彼此的 ARP 請求

  • July 11, 2011

我有兩個硬體(嵌入式設備),我已經設置它們通過乙太網上的 TCP 以客戶端/伺服器方式進行通信。

網路拓撲如下:

-----
| S ||=|== Debug PC (w/ Wireshark) 192.168.10.41
| W ||=|== Hardware 1 TCP Client 192.168.10.42
| I ||=|== Hardware 2 TCP Server 192.168.10.40
| T |
| C |
| H |
-----

當硬體 1 嘗試向伺服器硬體 2 發送數據包時,它首先發送一個 ARP 數據包以獲取硬體 2 的 MAC 地址:

No.     Time        Source             Destination  Protocol Length Info
157 11772.776136 Microchi_13:c3:6a     Broadcast    ARP      60     Who has 192.168.10.40?  Tell 192.168.10.42

但是,它沒有收到來自伺服器的回复,並且稍後會收到客戶端 MAC 的伺服器 ARP:

No.     Time        Source             Destination  Protocol Length Info
158 12183.800839 00:3f:2d:02:1a:35     Broadcast    ARP      60     Who has 192.168.10.42?  Tell 192.168.10.40

它也沒有收到客戶的回复。我很迷茫。

我知道伺服器正在正確回复,因為我用 C# 編寫了一個簡單的 TCP 客戶端,它可以從調試 PC 連接並向伺服器發送數據包。

我不確定為什麼我的硬體客戶端無法通信。

提前感謝您的幫助。

ARP 數據包的詳細資訊(如果需要):

來自客戶:

Ethernet II, Src: Microchi_13:c3:6a (00:04:a3:13:c3:6a), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
   Destination: Broadcast (ff:ff:ff:ff:ff:ff)
   Source: Microchi_13:c3:6a (00:04:a3:13:c3:6a)
   Type: ARP (0x0806)
   Trailer: 000000000000000000000000000000000000
Address Resolution Protocol (request)
   Hardware type: Ethernet (1)
   Protocol type: IP (0x0800)
   Hardware size: 6
   Protocol size: 4
   Opcode: request (1)
   [Is gratuitous: False]
   Sender MAC address: Microchi_13:c3:6a (00:04:a3:13:c3:6a)
   Sender IP address: 192.168.10.42 (192.168.10.42)
   Target MAC address: Broadcast (ff:ff:ff:ff:ff:ff)
   Target IP address: 192.168.10.40 (192.168.10.40)

從伺服器:

Frame 158: 60 bytes on wire (480 bits), 60 bytes captured (480 bits)
Ethernet II, Src: 00:3f:2d:02:1a:35 (00:3f:2d:02:1a:35), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
   Destination: Broadcast (ff:ff:ff:ff:ff:ff)
   Source: 00:3f:2d:02:1a:35 (00:3f:2d:02:1a:35)
   Type: ARP (0x0806)
   Trailer: 000000000000000000000000000000000000
Address Resolution Protocol (request)
   Hardware type: Ethernet (1)
   Protocol type: IP (0x0800)
   Hardware size: 6
   Protocol size: 4
   Opcode: request (1)
   [Is gratuitous: False]
   Sender MAC address: 00:3f:2d:02:1a:35 (00:3f:2d:02:1a:35)
   Sender IP address: 192.168.10.40 (192.168.10.40)
   Target MAC address: 00:00:00_00:00:00 (00:00:00:00:00:00)
   Target IP address: 192.168.10.42 (192.168.10.42)

您不會在“調試 PC”交換機埠上看到任何 ARP 回复,因為這些回复單播到目標主機。您的交換機正在為您的“調試 PC”過濾到外部目的地的單播數據包。如果您還需要監控單播流量,您可以使用集線器代替交換機,或者在交換機上啟用“監控”或“鏡像埠”功能(大多數託管交換機都有類似的功能)以獲取所有流量,包括外國單播湧入“調試PC”埠。

引用自:https://serverfault.com/questions/288482