Thanks, Derek

inline

On Tue, Aug 23, 2022 at 07:27:40AM -0400, Derek Atkins wrote:
> On Tue, August 23, 2022 6:30 am, Toerless Eckert wrote:
> > On Mon, Aug 22, 2022 at 08:43:57PM +0200, Carsten Bormann wrote:
> >> Grasp-option really is the lower layer of extensibility, which allows
> >> you to create new messages that then conform to message-structure.
> >> These should provide maximum flexibility.
> >>
> >> (Message should be/employ a socket, to make this extension point more
> >> visible.)
> >
> > Then let me understand the IMHO fundamental issue about sockets, using the
> > RFC8610 3.9 tcp-header example:
> >
> > Lets say i define:
> >
> >   tcp-header-structure [ tcp-header ]
> >
> > And i have not defined any $$tcp-option
> >
> > When an implementation of this now receives a CBOR array with not only
> > 2 elements (seq, ack), but with more elements:
> 
> Well, if you go back to 3.9, it defines tcp-header as:
> 
>             tcp-header = {seq: uint, ack: uint, * $$tcp-option}
> 
> This means tcp-header is a map.  (Not a group).

argh.. yes. sorry. To relate to my GRASP case, the example wouldhave
have to be:

             tcp-header = (seq: uint, ack: uint, * $$tcp-option)

Which would then be in array context.

> > MUST it recognize this as a tcp-header-structure - according to CBOR
> > parsing rules ?
> 
> If you define tcp-header-structure like that and get an array of anything
> more than a single map element (with at least two entries), then no, it
> would NOT be a valid tcp-header-structure.

Right. How about the tcp-header was just a group and is put into an
array context ?

> > (the way i read rfc8610, the answer is no)
> >
> > MUST it ignore the array elements after ack ?
> 
> Let me rephrase this question.  If you get a map structure that has at
> least two entries (and two of the keys must be seq and ack), then it's a
> tcp-header.  If it has fewer than two entries, or you don't have a seq and
> ack key in the map, then it is not a tcp-header object.

Ok. That would mean that the rfc8610, 3.9 tcp-header as a map is
really extensible as i would like it, because when a map with
any additional map elements (beside seq and ack) is received, that
would be matching tcp-header.

However, i have a real hard time reading this from the text in 3.9.
The way i read 3.9, the only thing that is novel about a socket "$" or "$$"
is the non-complaint of the CDDL parser if its an empty definition.

Aka:

    tcp-header = {seq: uint, ack: uint}

If i receive a CBOR with a map, and that map did have seq and ack, but it
also had other map entries, would that be matched by this definition of
tcp-header ?

But again, we're using array context, so it is quite unclear to me,
how sockets would work in array context othre than also assuming it
could be enty/unspecified.

Cheers
    Toerless

> > Cheers
> >     Toerless
> 
> -derek
> 
> > _______________________________________________
> > CBOR mailing list
> > [email protected]
> > https://www.ietf.org/mailman/listinfo/cbor
> >
> 
> 
> -- 
>        Derek Atkins                 617-623-3745
>        [email protected]             www.ihtfp.com
>        Computer and Internet Security Consultant
> 

-- 
---
[email protected]

_______________________________________________
Anima mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/anima

Reply via email to