Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Raw Ethernet

 
Bob Ruth
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did a search and didn't come up with this....

Is there a way to do raw ethernet packets from Java?

I looked through java.net and didn't see anything that jumped out at me....
 
John Melton
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java as a language only supports well-formed UDP and TCP packets, not raw packets. Technically, you can drop down through JNI and do it in C, but it'd probably be better to do in another language.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that Ethernet doesn't have packets, but rather "frames". IP, which sits below TCP and UDP (the protocols Java gives you access to), has packets.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic