Re: Suggestions for custom application-layer protocol?

From: Grant Edwards (grante_at_visi.com)
Date: 05/27/05


Date: Fri, 27 May 2005 00:04:16 -0000

On 2005-05-26, Mark <mark_2811nospam@excite.com> wrote:

> I expect I will end up with a text-based protocol, with a header
> that indicates the number of bytes in the payload.

If you're using a text-based protocol, you don't nead a header
with a payload count to tell you where the message ends. Use
an end-of-message character or string. The cr/lf pair is used
as the end-of-message delimiter by a lot of text-based
runs-on-top of TCP protocols. That approach works wonderfully
with line-oriented high-level text-handling libraries and
utilties -- you can do all sorts of useful stuff using nothing
but a few utilities like netcat, expect, and so on.

I've also seen protocols that use STX/ETX to frame messages,
and that works nicely as well, but isn't as compatible with
pre-existing utilities.

> The payloads will be composed of field=value pairs.

That Sounds like a good plan.

> Thanks guys I really appreciate it, this discussion has helped
> me out a great deal!

-- 
Grant Edwards                   grante             Yow!  Hey, LOOK!! A pair of
                                  at               SIZE 9 CAPRI PANTS!! They
                               visi.com            probably belong to SAMMY
                                                   DAVIS, JR.!!


Relevant Pages

  • Re: Suggestions for custom application-layer protocol?
    ... with a payload count to tell you where the message ends. ... an end-of-message character or string. ... I've also seen protocols that use STX/ETX to frame messages, ... pre-existing utilities. ...
    (comp.os.linux.embedded)
  • Re: [Full-Disclosure] modifying shadowchode exploit
    ... vulnerability need _any_ payload, ... alert on any specific payloads but just alert on the specific protocols. ... Yes, such signatures can be noisey, but this all depends on your network ... the 4 and the TTL is 0 or 1 is the right thing. ...
    (Full-Disclosure)