tobold.org

correct • elegant • free

△ Miscellany △

◅ duplicate ip address tests

SMTP Periodic downtime support? ▻

How can I know length of tcp user data?

In article <7HWy2.62$QE2.18880@burlma1-snr1.gtei.net>,
Barry Margolin  <barmar@bbnplanet.com> wrote:
>That's one way.  Many common TCP-based protocols use commands that are
>delimited by newlines, so it's not necessary to know the length.

Which, of course, has been a rich source of bugs and security holes.  If
you're designing a new protocol, it would really be wise to avoid this
particular prior art.

A simple encoding, which carries length information up front, can handle
arbitrary binary data without encoding, and preserves readability for
ASCII data, is "netstrings".

    http://pobox.com/~djb/proto/netstrings.txt

Tim.
--
Tim Goodwin       | "The FSF likes to write programs that require twice as much
Univ of Leicester | memory as your machine has today :-) ." -- Steve Summit

Original headers:

From: tjg@ltpcg.star.le.ac.uk (Tim J Goodwin)
Newsgroups: comp.protocols.tcp-ip
Subject: Re: How can I know length of tcp user data?
Date: 19 Feb 1999 10:39:09 -0000
Organization: A poorly-installed InterNetNews site
Message-ID: <7ajf0d$2oc$1@ltpcg.star.le.ac.uk>
References: <36CC1792.2A80@cnet.francetelecom.fr>
  <7HWy2.62$QE2.18880@burlma1-snr1.gtei.net>

△ Miscellany △

◅ duplicate ip address tests

SMTP Periodic downtime support? ▻