Networking Forums

Networking Forums > Computer Networking > Linux Networking > pcap/tcpdump datalink types

Reply
Thread Tools Display Modes

pcap/tcpdump datalink types

 
 
riccardo
Guest
Posts: n/a

 
      01-14-2011, 09:01 AM
Hi,
I'm trying to capture packets from an Intel WiFi 5100 interface, under
ubuntu 10.04. If I run tcpdump or any equivalent (like wireshark), I see
the interface datalink is set to EN10MB and the data retrieved is rather
self explaining with standard ethernet mac header plus IP/TCP headers..

Instead, if I start capturing with my application liked against libpcap
the link later type is set to LinuxSLL (namely "Linux Coocked SLL").
This configuration is imposed by default as I start capturing with
"pcap_open_live" function, and I can retrieve it with "pcap_datalink"
function, while I can list all the available datalinks for a given
interface with "pcap_list_datalinks". I can change the datalink with
"pcap_set_datalink".

What came out is that I'm using LINUX_SLL datalink type, and that's the
only available one for the interface considered.
This is odd as I see tcpdump setting the datalink to EN10MB for that
same interface.

Another strange thing is that the packet bytes retrieved seem to only
partially resemble this LinuxSLL header (which is briefly described here
http://www.manpagez.com/man/7/pcap-linktype/).

Just to give a short example: a plain retrieved packet data looks like
the following:
00 01 00 01 00 06 00 90 7f 42 01 6b 00 00 08 06 00 01 08 00 06 04 00 ...
00 01 = packet type (pkt was broadcast by somebody else)
00 01 = ?
00 06 = ?
00 90 7f 42 01 6b = THis is a mac address...
00 00 = ?
08 06 = ethernet frame type
00 01 ... = IP packet header.

I can't find a proper way to read these bytes correctly, while tcpdump
easily puts the interface in datalinktype "EN10MB" and returns the
standard ethernet headers which I'm used to!. How does it do the work?
What data am I looking at when a read these packets with these strange
header's bytes???

Thanks in advance,
RM


I'd really need your help with this.












 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pcap and packets lancer6238@yahoo.com Linux Networking 0 11-10-2008 05:42 AM
SMA connector types Adam Chapman Wireless Internet 6 07-08-2008 10:49 PM
Reading outbound packets to datalink layer using C sockets API - how? boltar2003@yahoo.co.uk Linux Networking 0 08-01-2004 05:13 PM
pcap file help jly Linux Networking 1 05-27-2004 11:27 PM
Antenna Types Martin Wireless Internet 2 12-12-2003 07:10 PM



1 2 3 4 5 6 7 8 9 10 11