Re: Suggestions for custom application-layer protocol?

From: James Antill (james-netnews_at_and.org)
Date: 05/27/05


Date: Fri, 27 May 2005 01:12:46 -0400

On Fri, 27 May 2005 00:04:16 +0000, Grant Edwards wrote:

> 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.

 It interacts well with telnet, which is about the best thing that can be
said for it. There are large problems with how you limit "too long" lines,
and what happens when you hit a CR or LF on it's own. Esp. if you put
something like a perl regexp directly on the socket.
 The HTTP response splitting problem is entirely the fault of pretending
CRLF terminated lines are a good idea.

-- 
James Antill -- james@and.org
http://www.and.org/vstr/httpd


Relevant Pages

  • Re: Suggestions for custom application-layer protocol?
    ... > 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. ... The HTTP response splitting problem is entirely the fault of pretending ...
    (comp.unix.programmer)
  • Re: On bit fields usage
    ... puts the header and payload in one contiguous block of memory because ... payload and i was wondering where i could have possibly gone wrong. ...
    (comp.lang.c)
  • Re: Signatures and encryption headers
    ... you don't need to sign header values, ... and payload signature check will fail. ... on the level after decryption, you do not worry about this. ... The encryption header only includes the information required ...
    (sci.crypt)
  • RE: IPsec problems/ideas.
    ... On Wed, 2002-10-16 at 20:20, Naman Latif wrote: ... > Payload and not the Packet Header. ... the original header of the IP packet is not ... >> encrypts the TCP header, so the firewall can't see that it's ...
    (Security-Basics)
  • RE: MPLS Encryption
    ... header tagged to the packet at which the network equipment looks at. ... you can use IPSec-ESP/AH with MPLS. ... gentleman called Hussein Ghazy back in June asking about payload ... Internet communications are not secure and therefore the Barclays ...
    (Security-Basics)