Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

data packet or control packet?

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I distinguish the packet I received is data packet or control packet. based on procotol from IP head or the other place?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're going to have to give us a little more info. TCP/IP itself doesn't have a notion of control and data packets. Are you developing a custom protocol, or implementing some existing protocol?
 
Forrest Xu
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're going to have to give us a little more info. TCP/IP itself doesn't have a notion of control and data packets. Are you developing a custom protocol, or implementing some existing protocol?
Thank you for your replay.
I am going to develop the code in Layer 2 ethernet layer. If I receive
a data frame, I can find a way to distinguish if it includes a IP datagram
via protocol head. But I do not know if the IP datagram is control or data packets. So what is IP, tcp oR UDP control packet looks like. For example, in TCP/IP, when destination end has not received a data package, It will send a re-send request message to the source end. The re-send request message is a kind of control packet.
Any comments?
Thanks,
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
reply
    Bookmark Topic Watch Topic
  • New Topic