LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-07-2009, 12:32 PM   #1
pratyushvb
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Rep: Reputation: 0
Question raw sockets in wireless network (802.11)


Hi,
I need help regarding the raw sockets in wireless (802.11 or wifi) networking.
I want to send a packet using raw socket (on data-link-layer or layer 2) from STAtion to AP (Access Point).

Just for info: I am using madwifi as wifi-driver. So, I want to send packet of ath0 of one device to ath0 of other device. Of course using raw sockets....

I searched on the net extensively (believe me, i am doing it rigourously from last 5 days). But all I get is information regarding raw sockets in ethernet. The problem is, since packet structure of ethernet and wifi is different on data-link-layer, I may not use the code which is working perfectly for ethernet. "To use the ethernet code for wifi" is not that simple as it seems [at least for me ]. I am no more interested in ehternet raw sockets. I want exact information regarding raw sockets in wifi.

I am not sure whether there are any dedicated libraries for this or not?
I am not sure which libraries (or api) I have to use.


Can anyone of you would help me in this?

Yours Sincerely,
 
Old 05-26-2010, 07:35 PM   #2
dhlii
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
raw sockets wifi

Did you ever work out this problem ?
I am basically looking at the same issue. I want to be able to inject 802.11 packets. So far everything I am seeing suguests that using raw sockets with wifi results in 802.3 ethernet packets
 
Old 05-27-2010, 08:15 AM   #3
pratyushvb
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Thumbs up It is simple :)

Well,

1. The code that works for ethernet works just perfect for wifi also. Provided, you put correct NIC (ath0 in case of madwifi driver).

2. You don't need to pay attention to MAC header of 802.11.

3. You just send an ethernet frame formulating, destination address, source address, type and the data correctly in memory.

4. It is the job of source and destination driver to "translate" if vice-versa.

5. On destination machine, you can see "802.11 MAC layer frame" on wireshark.

If you still need some help, revert back to me on this thread. I would be happy to help you.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora C2 - Wireless network drivers? Broadcom 802.11g Network Adapter FragTek Linux - Wireless Networking 7 01-22-2010 12:10 AM
raw sockets in c wee-face Programming 1 02-01-2007 09:35 AM
Raw Sockets Srikanth0210 Programming 2 12-05-2005 03:22 AM
raw sockets and C wrongman Programming 3 05-04-2004 02:17 PM
raw sockets BashTin Programming 1 06-07-2003 06:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration