Closed laochonlam closed 5 years ago
Thanks for reporting this issue! It seems that the link layer of your NIC is not Ethernet. When Wireshark/libpcap cannot recognize the link layer it assumes SLL link layer, please read more here: https://wiki.wireshark.org/SLL
Can you please find out the link layer and let me know?
@seladb Hi, thanks for the reply
the link layer of my NIC is Ethernet, I have tested several NIC cards and run the code in two Ubuntu 16.04 machine, but that's the same situation. Therefore I think that isn't the problem of my NIC card.
I think the situation can be easily reproduced from your machine.
Thanks!
Lam
I'll try to run your code and let you know
hi, I ran the exact same code on Ubuntu 16.04 VirtualBox VM and managed to see the generated packet in Wireshark:
Could you please print the output of ifconfig
in your machine?
Please let me know if there is any way I can reproduce this issue
@seladb Sorry for the late reply,
I gonna try this again tomorrow (maybe install the version without DPDK supported, I doubted there are something related) and let you know the further information,
thanks a lot
Lam
I figured out how to reproduce it but don't understand the reason why...
When I choose "any" interface to capture, the packet become EthernetII when I choose my "enp0s31f6" interface, It parsed the DNS packet right.
btw my ifconfig
,
Thanks!
Lam
Now it is clear :)
any
interface in Wireshark is not a real interface but rather a Wireshark thing that listens to all the interfaces on the machine. You can read about it here. One of the interfaces may be loopback
which is a virtual interface built in Linux that doesn't use Ethernet II but rather SLL - Linux Cooked Capture. That's why you probably see all packets as SLL instead of Ethernet II.
If you're getting the correct packet while listening to the real interface packets are coming to (enp0s31f6
in your case) then I think it's all good.
Please let me know if you have any questions. Otherwise you may close the issue.
Thanks for your time! @seladb
Hi,
I want to craft my own packet and use specific network interface to send that packet immediately.
Then I just follow the tutorial in the section "Packet creation" and modified the code at
PcapPlusPlus/Examples/Tutorials/Tutorial-PacketCraftAndEdit/
But then I use Wireshark to capture the [1] real-time packet, It seems broken. compared with the [2] packet through PcapFileWriterDevice to "1_new_packet.pcap"
I compared the hex of real-time packet and the packet from "1_new_packet.pcap", I found different hex.
The situation continued when the packet only contains Ethernet layer, so It might be the problem of Ethernet layer.
Instead, I try to craft the same packet by using Scapy, that works (can be recognized in Wireshark). Therefore I wanna know if there are any different implementation between PcapPlusPlus and Scapy, and the reason of this problem.
Any idea? Thanks!
Lam