Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sockets WireShark捕获时,仅在C程序中接收UDP数据包_Sockets_Arduino_Udp_Wireshark - Fatal编程技术网

Sockets WireShark捕获时,仅在C程序中接收UDP数据包

Sockets WireShark捕获时,仅在C程序中接收UDP数据包,sockets,arduino,udp,wireshark,Sockets,Arduino,Udp,Wireshark,我使用ENC28J60模块将UDP数据包从Arduino发送到我的计算机。它们在本地网络上 从Arduino传入我的计算机。如果wireshark未捕获数据包,则数据包不会到达c程序。当我开始捕获时,我的C程序和WireShark都会接收数据包 Frame 4: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0 Interface id: 0 (\Device\NPF_{F869D758-198B-4

我使用ENC28J60模块将UDP数据包从Arduino发送到我的计算机。它们在本地网络上

从Arduino传入我的计算机。如果wireshark未捕获数据包,则数据包不会到达c程序。当我开始捕获时,我的C程序和WireShark都会接收数据包

Frame 4: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Interface id: 0 (\Device\NPF_{F869D758-198B-4C57-B587-27F011DF5CB6})
    Interface name: \Device\NPF_{F869D758-198B-4C57-B587-27F011DF5CB6}
Encapsulation type: Ethernet (1)
Arrival Time: Nov 15, 2017 02:10:38.086980000 Tonga Standart Saati
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1510701038.086980000 seconds
[Time delta from previous captured frame: 0.405971000 seconds]
[Time delta from previous displayed frame: 0.405971000 seconds]
[Time since reference or first frame: 1.216288000 seconds]
Frame Number: 4
Frame Length: 60 bytes (480 bits)
Capture Length: 60 bytes (480 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:udp:data]
[Coloring Rule Name: UDP]
[Coloring Rule String: udp]

Ethernet II, Src: 1a:2b:3c:4d:5e:6f (1a:2b:3c:4d:5e:6f), Dst: 00:ff:7e:73:a3:81 (00:ff:7e:73:a3:81)
Destination: 00:ff:7e:73:a3:81 (00:ff:7e:73:a3:81)
    Address: 00:ff:7e:73:a3:81 (00:ff:7e:73:a3:81)
    .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
    .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: 1a:2b:3c:4d:5e:6f (1a:2b:3c:4d:5e:6f)
    Address: 1a:2b:3c:4d:5e:6f (1a:2b:3c:4d:5e:6f)
    .... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
    .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IPv4 (0x0800)
Padding: 000000000000000000

Internet Protocol Version 4, Src: 192.168.2.200, Dst: 192.168.2.100
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
    0000 00.. = Differentiated Services Codepoint: Default (0)
    .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 37
Identification: 0x0000 (0)
Flags: 0x02 (Don't Fragment)
    0... .... = Reserved bit: Not set
    .1.. .... = Don't fragment: Set
    ..0. .... = More fragments: Not set
Fragment offset: 0
Time to live: 64
Protocol: UDP (17)
Header checksum: 0xb44b [validation disabled]
[Header checksum status: Unverified]
Source: 192.168.2.200
Destination: 192.168.2.100
[Source GeoIP: Unknown]
[Destination GeoIP: Unknown]

User Datagram Protocol, Src Port: 1338, Dst Port: 1337
Source Port: 1338
Destination Port: 1337
Length: 17
Checksum: 0x349e [unverified]
[Checksum Status: Unverified]
[Stream index: 0]

Data (9 bytes)
Data: 746573742031323300
[Length: 9]

0000  00 ff 7e 73 a3 81 1a 2b  3c 4d 5e 6f 08 00 45 00   ..~s...+ <M^o..E.
0010  00 25 00 00 40 00 40 11  b4 4b c0 a8 02 c8 c0 a8   .%..@.@. .K......
0020  02 64 05 3a 05 39 00 11  34 9e 74 65 73 74 20 31   .d.:.9.. 4.test 1
0030  32 33 00 00 00 00 00 00  00 00 00 00               23...... ....

非常感谢。

Wireshark对套接字接收数据包的能力没有影响。还有一些事情正在发生。这真的取决于WireShark,我几个小时都想不出来,我会发疯的:)在正常情况下,WireShark不应该阻止任何套接字接收数据包。您无需启动应用程序捕获以接收数据包。因此,我唯一能想到的是,如果1)你有一个坏的pcap驱动程序,它正在破坏操作系统的网络系统,2)数据包被破坏,因此操作系统无法将它们发送到套接字,或者3)Wireshark在不捕获时重新配置接收接口,导致它阻塞通信。请参阅Wireshark的QA站点上的和。Wireshark对套接字接收数据包的能力没有影响。还有一些事情正在发生。这真的取决于WireShark,我几个小时都想不出来,我会发疯的:)在正常情况下,WireShark不应该阻止任何套接字接收数据包。您无需启动应用程序捕获以接收数据包。因此,我唯一能想到的是:1)你有一个坏的pcap驱动程序,它扰乱了操作系统的网络系统;2)数据包被破坏,因此操作系统无法将它们发送到套接字;3)Wireshark在不捕获时重新配置接收接口,导致其阻塞通信。请参阅Wireshark的QA网站和。
Frame 15: 57 bytes on wire (456 bits), 57 bytes captured (456 bits) on interface 0
Interface id: 0 (\Device\NPF_{F869D758-198B-4C57-B587-27F011DF5CB6})
    Interface name: \Device\NPF_{F869D758-198B-4C57-B587-27F011DF5CB6}
Encapsulation type: Ethernet (1)
Arrival Time: Nov 15, 2017 02:05:47.757225000 Tonga Standart Saati
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1510700747.757225000 seconds
[Time delta from previous captured frame: 0.000010000 seconds]
[Time delta from previous displayed frame: 0.000010000 seconds]
[Time since reference or first frame: 17.941385000 seconds]
Frame Number: 15
Frame Length: 57 bytes (456 bits)
Capture Length: 57 bytes (456 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:udp:data]
[Coloring Rule Name: UDP]
[Coloring Rule String: udp]

Ethernet II, Src: CompalIn_3b:23:7a (f0:76:1c:3b:23:7a), Dst: 70:69:69:2d:30:31 (70:69:69:2d:30:31)
Destination: 70:69:69:2d:30:31 (70:69:69:2d:30:31)
    Address: 70:69:69:2d:30:31 (70:69:69:2d:30:31)
    .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
    .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: CompalIn_3b:23:7a (f0:76:1c:3b:23:7a)
    Address: CompalIn_3b:23:7a (f0:76:1c:3b:23:7a)
    .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
    .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IPv4 (0x0800)

Internet Protocol Version 4, Src: 192.168.2.100, Dst: 192.168.2.200
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
    0000 00.. = Differentiated Services Codepoint: Default (0)
    .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 43
Identification: 0x0f12 (3858)
Flags: 0x00
    0... .... = Reserved bit: Not set
    .0.. .... = Don't fragment: Not set
    ..0. .... = More fragments: Not set
Fragment offset: 0
Time to live: 128
Protocol: UDP (17)
Header checksum: 0xa533 [validation disabled]
[Header checksum status: Unverified]
Source: 192.168.2.100
Destination: 192.168.2.200
[Source GeoIP: Unknown]
[Destination GeoIP: Unknown]

User Datagram Protocol, Src Port: 55044, Dst Port: 1337
Source Port: 55044
Destination Port: 1337
Length: 23
Checksum: 0x6118 [unverified]
[Checksum Status: Unverified]
[Stream index: 4]

Data (15 bytes)
Data: 48656c6c6f20454e4332384a363021
[Length: 15]

0000  70 69 69 2d 30 31 f0 76  1c 3b 23 7a 08 00 45 00   pii-01.v .;#z..E.
0010  00 2b 0f 12 00 00 80 11  a5 33 c0 a8 02 64 c0 a8   .+...... .3...d..
0020  02 c8 d7 04 05 39 00 17  61 18 48 65 6c 6c 6f 20   .....9.. a.Hello 
0030  45 4e 43 32 38 4a 36 30  21                        ENC28J60 !