Link to home
Start Free TrialLog in
Avatar of sandy1234
sandy1234

asked on

Putting Data in Ethernet frame

I want to communicate between two ends... for that I want to fill my data in the Eternet frame.. Since i have only two ends i thought it will be better if i use the ethernet frame for putting my data... Whether it is possible. If yes .. Some links please..

regards
Avatar of bbao
bbao
Flag of Australia image

certainly, you can. if the two nodes are running general operating systems (same or not), you'd better use common network protocol to implement data communication, such as via TCP/IP or IPX. if the two nodes are running dedicated software on specialized hardware, you may implement it with your customized protocol or special protocol.

as for how to do programming at ethernet frame layer, see the followings:

RAW ethernet programming
http://www.landshut.org/bnla01/members/Faustus/fh/linux/udp_vs_raw/ch01s03.html

Ethernet Programming
http://www.vijaymukhi.com/vmis/ethernet.htm

Network Driver Programming Considerations
http://msdn.microsoft.com/library/en-us/network/hh/network/103prog_65cbf788-84ba-4c97-9068-3d00782de290.xml.asp

hope it helps,
bbao
Avatar of sandy1234
sandy1234

ASKER


 i have same OS on both the nodes... if i use TCP/IP then the data field of the ethernet frame will have TCP header, IP header also.. I want to put the data to be sent to the other node completely to come in the data field of the ethernet frame..
 and does it require the NIC we use for TCP/IP communication or we need other card..

thanks
The NIC puts Ethernet frames on the media and takes them off.  If you're talking about Ethernet, you want a NIC that talks to whatever kind of Ethernet you have in mind.

The NIC collects incoming Ethernet frames if their destination MAC address matches this NIC, or is the broadcast address.  A byte in the Ethernet header tells the NIC driver what upper-level protocol or process should receive the packet.  If you will write your own code instead of re-using an available stack, you become responsibile for this mechanism.

since there are only two nodes to communicate... I can fill the destination MAC address and source MAC address in the ethernet frame and by seeing the dest. MAC address the receiver will get the data which is the data to be used by the user not with the other overhead (like TCP and IP header)..
andy1234, you are right, you can just send ethernet frame to transfer your raw data. i am not sure if you have tried this already. commonly, you need programming at network driver layer. for example, for windows platform, you need programming at NDIS layer. of course, you can do programming at an even lower layer, by hard coding for the registers of network card, but you have to change your program once you change the network adapter.

FYI: NDIS - Network Driver Interface Specification
http://www.microsoft.com/whdc/device/network/ndis/default.mspx

btw, are the three links in my last comment helpful?

hope it helps,
bbao
ya thanks bbao..
 if i do programming at NDIS level then do i need to change my code if NIC changes... As i am working in windows u have some link on raw ethernet programming over windows..

regards
ASKER CERTIFIED SOLUTION
Avatar of bbao
bbao
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial