Anyone knows how can I create a connection without help of IP? Something like Winbox connection? Is it possible to create socket connection by means of MAC address?
Asked
Active
Viewed 284 times
0
-
If you have the MAC address, why not just resolve it to an IP address? – Max Feb 12 '12 at 01:21
-
Please explain your use case a bit more. Are you on an ethernet connection? What are you trying to achieve? – Maarten Bodewes Feb 12 '12 at 01:23
-
See [this](http://stackoverflow.com/questions/3574036/java-library-for-raw-ethernet) and [this](http://stackoverflow.com/questions/3854961/best-way-to-do-raw-socket-programming-involving-java) question. – Piotr Praszmo Feb 12 '12 at 01:30
-
Java Sockets and DatagramSockets seem to work at Application Layer and Transport Layer of TCP/IP model in OSI architecture. What you are asking (host-to-network layer) is more at Network Layer and Physical Layer which Java networking doesn't provide any software interface for this. http://books.google.com.my/books?id=NyxObrhTv5oC&pg=PT47&lpg=PT47&dq=Java+networking+at+Physical+layer&source=bl&ots=1ebSrCSlSS&sig=pt8GA0MdRxvVX9gcXMHWf_Kv0Qo&hl=en&sa=X&ei=ohU3T5nDHYqJhQfS5cShAg&redir_esc=y#v=onepage&q=Java%20networking%20at%20Physical%20layer&f=false – ecle Feb 12 '12 at 01:31
-
What you are trying to do is better suited for pcap library. Java has a pcap library http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/ – ecle Feb 12 '12 at 01:34
1 Answers
0
Well, this may be an overkill, and I'm sure there are much better opinions, but just to get some of the job done, you may look at WinPcap and it's perfect .NET wrapper Pcap.net.
You may inject (and capture) any packet using your network card, and you can easily build any packet that fits your need. I'm sure such a thing would require something more low-level than, say, sockets programming, that's why I recommend using Pcap, if no better solution is found.

Can Poyrazoğlu
- 33,241
- 48
- 191
- 389