Help in designing valid ethernet packets?

This is a discussion on Help in designing valid ethernet packets? within the Linux Networking forums, part of the Linux Forums category; Hi Guyz!!! Newbie in the matter...Plz help, My aim is to read raw packets from the eth0 interface, I'...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 3 Days Ago
avi01
 
Posts: n/a
Default Help in designing valid ethernet packets?

Hi Guyz!!!

Newbie in the matter...Plz help,
My aim is to read raw packets from the eth0 interface, I'm using
Ubuntu 6.06, kernel 2.6.24-3, and to design valid packets.

I need to do this to read ethernet packets from an embedded device
we've developed. The device has no TCP/IP stack on it for the time-
being and we need to test reception and transmission to/from it.

I took 2 approaches to fulfill the above,

1) Used raw sockets to get ethernet packets
2) Used libpcap to read packets.

Both the approaches work when I'm recieving loopback ethernet packets
as well as packets from other computers.

I tried designing the following packets for the device viz:

a) Broadcast packet:
ff ff ff ff ff ff 00 01 02 03 04 05 08 06 00 01 ........G.......
08 00 06 04 00 01 01 02 03 04 05 06 c0 a8 01 c9 ........G.......
00 00 00 00 00 00 c0 a8 01 c8 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 ............

b) Ethernet frame:
00 19 db a7 9c dd 00 01 02 03 04 05 08 06 FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF

c) ARP request:
00 19 db a7 9c dd 00 01 02 03 04 05 08 06 00 01 ........G.......
08 00 06 04 00 01 01 02 03 04 05 06 c0 a8 01 c9 ........G.......
00 00 00 00 00 00 c0 a8 01 c8 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 ............

where 00:19:db:a7:9c:dd is my MAC address &
00:01:02:03:04:05 is MAC address of the device.

Another problem I face is that the wireshark S/W (which uses
libpcap) on windows detects packets, whereas ethereal on linux does
not detect any packets (ethereal also uses libpcap).

So guyz could U help me with either info about designing a packet so
that it will be detected, or tell me the reason of why the packets are
being discarded in my linux box? (is it something to do with the linux
packet filter discarding suspicious packets?),
Does windows treat packets very differently as compared to linux?

I would like to know if it is possible without a TCP/IP stack loaded
on the device?

Please also direct me to resources on the net.

Thanks Guyz!!!
Avinash.
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

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



All times are GMT +1. The time now is 10:54 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0