Originally posted by Forrest Xu:
I am going to develop the code in Layer 2 ethernet layer.
Not in
Java, you're not! Java has support for TCP and UDP, but nothing lower-level. You can, of course, talk to lower layers using native (C) code and link it to Java code, but first you'd have to know what kind of code you wanted to write.
Sounds like you need a good reference. The definitive book is W.Richard Stevens'
TCP/IP Illustrated, Volume I. If I were you I would
not attempt any sort of programming along the lines of what you're wanting to do without owning this book.