Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows networking using only Ethernet Frames

I'm doing a project where I must write a network library for a device connected to a Windows machine. The complication comes in that I may only communicate with the device using ethernet frames. So there is no TCP/UDP/IP at all. I don't think the bind/listen/accept approach can be applied here, but maybe I am wrong. Also, there is no routing or switching involved.

I have a few questions. How do I use a socket to communicate with this device? Does winsock have any support for just frames? I haven't been able to find many resources on this. Does anyone have any ideas about how I should proceed?

Is using sockets even a good idea or can I just send out the information with the appropriate headers?

like image 651
devin Avatar asked Nov 05 '22 21:11

devin


2 Answers

Use WinPCap, it has an an API to send and listen to raw data.
You can build your communicate layer with it.

like image 51
Shay Erlichmen Avatar answered Nov 16 '22 06:11

Shay Erlichmen


Give the WinAoE code a look-see - it says it lets Windows talk to ATA over Ethernet devices which means it has to communicate without any of the upper layers of the network stack.

Edited:

As near as I can tell, if you want to send raw ethernet frames, you want NdisSend and friends.

like image 42
BonkaBonka Avatar answered Nov 16 '22 08:11

BonkaBonka