Subject: [websec] Is sniffing a heuristic? (was Re: more on sniffing)

From: Adam Barth <[email-masked]>
Date: Sun, 8 Jan 2012 13:03:26 -0800

On Sun, Jan 8, 2012 at 12:55 PM, Adam Barth <[email-masked]> wrote:
> On Sun, Jan 8, 2012 at 9:12 AM, Larry Masinter <[email-masked]> wrote:
>>      <t>Sniffing is by its nature a heuristic process, because there are
>>      many situations where content matches the signatures and capabilities
>>      of many different possible content-type values.
>
> I disagree with this statement as well.  The sniffing we're talking
> about here is not a heuristic.  It's a historical anomaly that needs
> to be corrected for in order for user agents to be compatible with
> some web sites.

Let me expand this point some more.  Does you view the HTML5 parsing
algorithm a heuristic?  The sniffing algorithm is the same sort of
thing as the HTML5 parsing algorithm in that it's a somewhat
unpleasant algorithm for interpreting responses from servers that's
compatible with existing deployments.

Adam

---

From: Bjoern Hoehrmann <[email-masked]>
Date: Mon, 09 Jan 2012 00:08:27 +0100

>compatible with existing deployments.

In computer science heuristics are problem-solving techniques that pro-
vide good but not neccesarily correct solutions; they are employed as a
trade-off between correctness and other desirable properties. Sniffing
produces good results that are not always correct in a trade-off between
correctness and other properties like "compatibility", so it's a heuris-
tic. The "HTML5" parsing algorithm also produces good results, but there
is no widely accepted basis for claiming it produces incorrect results.

Saying that the sniffing algorithm always generates correct solutions is
like saying the Content-Type header in HTTP responses always has correct
media type information.
-- 
Björn Höhrmann · mailto:[email-masked] · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/

---

From: Gervase Markham <[email-masked]>
Date: Mon, 09 Jan 2012 09:13:01 +0000

On 08/01/12 23:08, Bjoern Hoehrmann wrote:
> trade-off between correctness and other desirable properties. 

(Slightly off-topic) I rather like this definition:
http://lwn.net/Articles/461584/
(quote 2)

Gerv

---

From: SM <[email-masked]>
Date: Mon, 09 Jan 2012 02:02:13 -0800

>http://lwn.net/Articles/461584/

   "No matter if it is a white cat or a black cat; as long as it can catch
    mice, it is a good cat."

The question is whether the focus should be about catching the mice 
or determining whether the cat should be white or black.

 From RFC 4960:

   "Since there is no explicit identifier that can be used to detect
    out-of-order SACKs, the data sender must use heuristics to determine
    if a SACK is new."

I'd say that sniffing is a heuristic.

Regards,
-sm