Closed qianfan-Zhao closed 6 years ago
ping win10 from zephyr's console continued, seems the first time after ARP failed and the next time successful.
shell> select net
net> ping 192.168.3.101
Sent a ping to 192.168.3.101
Ping timeout
net> ping 192.168.3.101
Sent a ping to 192.168.3.101
Received echo reply from 192.168.3.101 to 192.168.3.25
net> ping 192.168.3.101
Sent a ping to 192.168.3.101
Ping timeout
net> ping 192.168.3.101
Sent a ping to 192.168.3.101
Received echo reply from 192.168.3.101 to 192.168.3.25
net> ping 192.168.3.101
Sent a ping to 192.168.3.101
Received echo reply from 192.168.3.101 to 192.168.3.25
net> ping 192.168.3.101
Sent a ping to 192.168.3.101
Ping timeout
net>
capture from wireshark:
22 33.645701 Broadcast ARP 60 Who has 192.168.3.101? Tell 192.168.3.25
23 33.646615 Stmicroe_69:00:be ARP 60 192.168.3.101 is at e0:94:67:d6:eb:a1
24 33.646683 192.168.3.25 192.168.3.101 ICMP 60 Echo (ping) request id=0x53fb, seq=7771/23326, ttl=64 (no response found!)
31 43.645714 192.168.3.25 192.168.3.101 ICMP 60 Echo (ping) request id=0xa83d, seq=29341/40306, ttl=64 (reply in 32)
32 43.646177 192.168.3.101 192.168.3.25 ICMP 60 Echo (ping) reply id=0xa83d, seq=29341/40306, ttl=128 (request in 31)
36 48.501918 Stmicroe_69:00:be ARP 60 Who has 192.168.3.25? Tell 192.168.3.101
37 48.501968 IntelCor_d6:eb:a1 ARP 60 192.168.3.25 is at 00:80:e1:69:00:be
47 64.323065 192.168.3.25 192.168.3.101 ICMP 60 Echo (ping) request id=0x2e23, seq=63619/33784, ttl=64 (no response found!)
54 73.565826 192.168.3.25 192.168.3.101 ICMP 60 Echo (ping) request id=0x7fb9, seq=18969/6474, ttl=64 (reply in 55)
55 73.566479 192.168.3.101 192.168.3.25 ICMP 60 Echo (ping) reply id=0x7fb9, seq=18969/6474, ttl=128 (request in 54)
59 78.265330 192.168.3.25 192.168.3.101 ICMP 60 Echo (ping) request id=0x0617, seq=53367/30672, ttl=64 (no response found!)
60 78.265954 192.168.3.101 192.168.3.25 ICMP 60 Echo (ping) reply id=0x0617, seq=53367/30672, ttl=128 (request in 59)
61 78.513619 Stmicroe_69:00:be ARP 60 Who has 192.168.3.25? Tell 192.168.3.101
62 78.513662 IntelCor_d6:eb:a1 ARP 60 192.168.3.25 is at 00:80:e1:69:00:be
66 83.093363 192.168.3.25 192.168.3.101 ICMP 60 Echo (ping) request id=0x4cf1, seq=5969/20759, ttl=64 (no response found!)
According to your wireshark logs, it's the responses that are not sent, so the issue does not seem to be on your Zephyr enabled board.
@tbursztyka yes zephyr has sent ICMP packet but doens't get reply sometimes.
yes, and according to your wireshark logs the response is not sent by the destination (win10), so either your win10 does not receives it or something else, but zephyr does not seem to have any issue here.
but sometimes ping successful and sometimes failed. not only my computer but also my route(193.168.3.1)has same appears
@tbursztyka @jukkar I had enable "Validata the IPv4 checksum if possible" option and found the checksum in IP part is incorrent. please refer Frame 47
Frame 47: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Stmicroe_69:00:be (00:80:e1:69:00:be), Dst: IntelCor_d6:eb:a1 (e0:94:67:d6:eb:a1)
Internet Protocol Version 4, Src: 192.168.3.25, Dst: 192.168.3.101
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
Total Length: 28
Identification: 0x0000 (0)
Flags: 0x00
Fragment offset: 0
Time to live: 64
Protocol: ICMP (1)
Header checksum: 0xd5cd incorrect, should be 0xf312(may be caused by "IP checksum offload"?)
[Expert Info (Error/Checksum): Bad checksum [should be 0xf312]]
[Header checksum status: Bad]
[Calculated Checksum: 0xf312]
Source: 192.168.3.25
Destination: 192.168.3.101
[Source GeoIP: Unknown]
[Destination GeoIP: Unknown]
Internet Control Message Protocol
AND seems checksum always incorrect if there has an ARP packet before ICMP.
I print all IPv4's data in calc_chksum in this way:
--- a/subsys/net/ip/utils.c
+++ b/subsys/net/ip/utils.c
@@ -379,6 +379,14 @@ static u16_t calc_chksum(u16_t sum, const u8_t *ptr, u16_t len)
const u8_t *end;
end = ptr + len - 1;
+ const u8_t *p = ptr;
+
+ if (len == 20) {
+ while (p <= end) {
+ printk("%02x ", *p++);
+ }
+ printk("\n");
+ }
If I always ping a const ip address, the data in IPv4 part should be fixed, but it doesn't.
shell> select net
net> ping 192.168.3.101
45 00 00 1c 00 00 00 00 40 01 00 00 00 00 00 00 00 00 00 00
Sent a ping to 192.168.3.101
Ping timeout
net> ping 192.168.3.101
45 00 00 1c 00 00 00 00 40 01 00 00 c0 a8 03 19 c0 a8 03 65
Sent a ping to 192.168.3.101
Received echo reply from 192.168.3.101 to 192.168.3.25
net> ping 192.168.3.101
45 00 00 1c 00 00 00 00 40 01 00 00 01 d2 c0 a8 03 19 e0 94
Sent a ping to 192.168.3.101
Ping timeout
AND I had fixed this issue in #8058
That clarifies indeed, good catch
my custom board(ip: 192.168.3.25) can't ping others(ip: 192.168.3.101, win10) in console.
but from my win10 computer can ping Zephyr:
this is the capture from wireshark: