XML.com: XML From the Inside Out

oreilly.comSafari Bookshelf.Conferences.
  Articles | Weblogs | Newsletter | Safari Bookshelf
advertisement

Article:
 Protocol Design: How Many Bytes?
Subject: Protocol design.
Date: 2003-11-28 08:53:11
From: Jason

Just curious if you are going to venture further into the design of an actual protocol? I'm also wondering if there is a proper forum to discuss protocol design.


I'm involved in development of an application where we have built our own protocol (over TCP) from scratch. Its a binary protocol. One thing that I've had trouble with is the message header. Our header currently looks like <magic><type><len>. The magic is mainly to help track down development issues, type is the type of message and len is the total length of the message. Anything beyound the header is specific to the type. Is this sane? I've been thinking of adding an ID field to the header, so any message that requires a response would send the ID back so the application could determine what triggered that response. Anyways, I'm rambling now and look forward to more articles on protocol design.


No Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • Protocol design.
    2003-12-01 08:58:15 Itamar Shtull-Trauring [Reply]

    At some point I might look in detail at a specific protocol or two and go through their design from the ground up.


    Using type and length prefixing is a reasonable design. For matching up responses, using an id for messages is the common practice when responses are optional or may come back in different order than requests. Depending on your protocol structure it might be part of the message header or part of the message contents.


    For example, in Banana (http://twistedmatrix.com/documents/TwistedDocs/current/specifications/banana.html -- currently undergoing rewrite but this is still pretty relevant), messages are nested lists, so a protocol built on top of it might say "first item in top-level message list is the message id".


    I'll be covering these issues and more in future articles.

    • Protocol design.
      2006-04-28 22:09:50 hyderabda [Reply]

      i want to know the about protocal and how many protocal r using and what is the prot number of each protocals.
      pls let me know this.


      with regads,
      M.srinivas

Sponsored By:


Contact Us | Our Mission | Privacy Policy | Advertise With Us | | Submissions Guidelines
Copyright © 2008 O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938