开发者

Communicate between two systems using only MAC address

I want to know how to communicate between two systems using only MAC address using C program (without using IP address). I think this is raw ethernet communication. My requirement is to send data from client to server only by using the MAC address. May be this can be done by crea开发者_如何学JAVAting our own raw ethernet frame.

Please help me regarding this. If anybody has written code in C, please share.

This link may help you, http://aschauf.landshut.org/fh/linux/udp_vs_raw/ch01s03.html


The libpcap library allows you to assemble raw Ethernet packets and send them directly to an adapter: the hardest part being the discovery of the correct adapter. This is designed for C/C++ usage on most platforms (Win PCAP etc.).

Be sure this is what you want though: I have seen several projects where raw Ethernet packet interfaces have been used, only for more and more protocol to be put in place for re-transmission and windowing etc. until you end up with your own version of TCP/IP (only one that hasn't been tested by millions of people using Windows/Linux or whatever your platform is). Most Ethernet chips have functions to accelerate TCP/IP stacks these days too: so you will be missing out on that too.


Here are examples for C#, maybe you can leverage this. The right code depends on OS and even from the used chips when programming for microcontrollers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜