Subject: Updated ABNF syntax comments

From: Renee Revis <[email-masked]>
Date: Fri, 13 Apr 2001 15:33:07 -0400

I'm just jumping in here, but have a few comments/questions on this 
updated syntax relative to the current version of draft-ietf-mmusic-sdp-new-01.
txt.

1) s= line.  The draft says one and only one s= line is required per
session description, but the syntax below shows it as optional.

2) The draft says that either an email field or a phone field must be
specified, but this isn't shown in the syntax below.  I'm not suggesting 
that it should be.  My take would be to remove this requirement from the 
text.

3) Multiple b= lines are allowed by the syntax at either the session
level or the media levels, but there is no mention in the draft of how 
an application should interpret this.  Are multiple b= lines really 
allowed at each level?  If so, what is the intended meaning, in 
particular if the same modifier is specified more than once?  If this
is allowed, it might be good to mention this case in the draft.

4) The m= media line shows the port as allowing only one '/' character.
Some transport types may want to allow more than that - e.g. for some 
ATM transport types.  May want to modify this to:
    port *("/" integer)  instead of port ["/" integer ]

Also with this, I'm curious as to why the port rule specifies 1*DIGIT
instead of integer as in the media-field rule.

5) As for the proto rule, I would vote for the latter option - i.e.,
token *("/" token).  The other, 1*(token-char|"/"), would allow /AVP which I 
don't think is really intended.

>   Alternately, we could define it as 1*(token-char|"/"), or as
>   token *("/" token).  What semantics does the group want for this field?

			   Renee Revis		

Jonathan Lennox wrote:

> On Sunday, April 1 2001, "Flemming Andreasen" wrote to "Jonathan Lennox, Tom-PT Taylor, confctrl" saying:
>
> > > I've been playing around with this off and on, and have a re-worked ABNF
> > > largely done. I can send this to the list on Monday
> >
> > That would be most welcome.
>
> Here it is.
>
> A few notes on it:
>
> * The ABNF syntax used complies with RFC 2234, with two exceptions:
>   "|" rather than "/" is the alternation character, and literal strings are
>   case-sensitive.  The RFC 2234 "core" productions (ALPHA, DIGIT, CRLF, SP,
>   VCHAR) are used where appropriate.
>
> * Since the group decided that the "media" and "fmt" parameters would be
>   MIME types, I've aligned their ABNF definitions to align with those of RFC
>   2045.  (Before they were just "alphanum", which was too restrictive.)
>   This introduced the "token" production, which I've then also used in other
>   places that used to have a too-restrictive alphanum.
>
> * Grammar components that come from external sources (IPv4 and v6 addresses,
>   e-mail addresses, and URIs) are included by reference rather than by
>   value.
>
> * The "addr-spec" production (e-mail addresses, from the RFC 822bis draft)
>   says "modified to remove CFWS".  This is because 822bis allows addresses
>   to contain folding whitespace, which obviously can't be allowed in SDP.
>   I'm wondering if maybe the syntax should be some core of a mailto: URL
>   instead.
>
> * I've added an "addr = extension-addr" production to allow for the PINT and
>   ATM extensions to SDP.  I *believe* that this grammar will fully accept
>   PINT and ATM SDP messages.
>
> * I've added IPv6.  I think this is the same as the syntax defined by
>   draft-olson-sdp-ipv6, but I'm not positive.
>
> * For the specific issue raised by the beginning of this thread -- the fact
>   that "RTP/AVP" doesn't match the production for "proto" -- I've redefined
>   "proto" as
>           proto = token "/" token
>                 | token
>
>   Alternately, we could define it as 1*(token-char|"/"), or as
>   token *("/" token).  What semantics does the group want for this field?
>
> Comments are welcome.
>
>   ------------------------------------------------------------------------
>    ; SDP Syntax (cleaned up)
>    announcement =        proto-version
>                          origin-field
>                          session-name-field
>                          information-field
>                          uri-field
>                          email-fields
>                          phone-fields
>                          connection-field
>                          bandwidth-fields
>                          time-fields
>                          key-field
>                          attribute-fields
>                          media-descriptions
>
>    proto-version =       "v=" 1*DIGIT CRLF
>                          ;this memo describes version 0
>
>    origin-field =        "o=" username SP sess-id SP sess-version SP
>                          nettype SP addrtype SP addr CRLF
>
>    session-name-field =  ["s=" text CRLF]
>
>    information-field =   ["i=" text CRLF]
>
>    uri-field =           ["u=" uri CRLF]
>
>    email-fields =        *("e=" email-address CRLF)
>
>    phone-fields =        *("p=" phone-number CRLF)
>
>    connection-field =    ["c=" nettype SP addrtype SP
>                          connection-address CRLF]
>                          ;a connection field must be present
>                          ;in every media description or at the
>                          ;session-level
>
>    bandwidth-fields =    *("b=" bwtype ":" bandwidth CRLF)
>
>    time-fields =         1*( "t=" start-time SP stop-time
>                          *(CRLF repeat-fields) CRLF)
>                          [zone-adjustments CRLF]
>
>    repeat-fields =       "r=" repeat-interval SP typed-time
>                          1*(SP typed-time)
>
>    zone-adjustments =    "z=" time SP ["-"] typed-time
>                          *(SP time SP ["-"] typed-time)
>
>    key-field =           ["k=" key-type CRLF]
>
>    attribute-fields =    *("a=" attribute CRLF)
>
>    media-descriptions =  *( media-field
>                          information-field
>                          *connection-field
>                          bandwidth-fields
>                          key-field
>                          attribute-fields )
>
>    media-field =         "m=" media SP port ["/" integer]
>                          SP proto 1*(SP fmt) CRLF
>
>    ; sub-rules of 'o='
>    username =            non-ws-string
>                          ;pretty wide definition, but doesn't include space
>
>    sess-id =             1*DIGIT
>                          ;should be unique for this originating username/host
>
>    sess-version =        1*DIGIT
>                          ;0 is a new session
>
>    nettype =             token
>                          ;typically "IN"
>
>    addrtype =            token
>                          ;typically "IP4" or "IP6"
>
>    ; sub-rules of 'u='
>    uri =                 URI-reference; defined in RFC2396/2732
>
>    ; sub-rules of 'e='
>    email-address =       email *SP "(" 1*email-safe ")" |
>                          1*email-safe "<" email ">" |
>                          email
>
>    email =               addr-spec ; defined in drums msgfmt (RFC822bis)
>                                    ; modified to remove CFWS
>
>    ; sub-rules of 'p='
>    phone-number =        phone *SP "(" 1*email-safe ")" |
>                          1*email-safe "<" phone ">" |
>                          phone
>
>    phone =               "+" POS-DIGIT 1*(SP | "-" | DIGIT)
>                          ;there must be a space or hyphen between the
>                          ;international code and the rest of the number.
>
>                          ; Should this use the tel: URL syntax?
>
>    ; sub-rules of 'c='
>    connection-address =  multicast-address
>                          | addr
>
>    ; sub-rules of 'b='
>    bwtype =              token
>
>    bandwidth =           1*DIGIT
>
>    ; sub-rules of 't='
>    start-time =          time | "0"
>
>    stop-time =           time | "0"
>
>    time =                POS-DIGIT 9*DIGIT
>                          ; 10-digit NTP time represents times between
>                          ; 1931 and 5068 AD.  9* allows times after that
>                          ; as well.
>
>    ; sub-rules of 'r=' and 'z='
>    repeat-interval =     typed-time
>
>    typed-time =          POS-DIGIT *DIGIT [fixed-len-time-unit]
>
>    fixed-len-time-unit = "d" | "h" | "m" | "s"
>
>    ; sub-rules of 'k='
>    key-type =            "prompt" |
>                          "clear:" text |
>                          "base64:" base64 |
>                          "uri:" uri |
>                          key-method [ ":" text ]
>
>    base64      =         *base64-unit [base64-pad]
>    base64-unit =         4base64-char
>    base64-pad  =         2base64-char "==" | 3base64-char "="
>    base64-char =         ALPHA | DIGIT | "+" | "/"
>
>    key-method =          token
>
>    ; sub-rules of 'a='
>    attribute =           (att-field ":" att-value) | att-field
>
>    att-field =           token
>
>    att-value =           byte-string
>
>    ; sub-rules of 'm='
>    media =               token
>                          ;typically "audio", "video", "application"
>                          ;or "data"
>
>    fmt =                 token
>                          ;typically an RTP payload type for audio
>                          ;and video media
>
>    proto  =              token "/" token
>                          | token
>                          ;typically "RTP/AVP" or "udp" for IP4
>
>    port =                1*DIGIT
>                          ;should in the range "1024" to "65535" inclusive
>                          ;for UDP based media
>
>    ; generic sub-rules: addressing
>    multicast-address =   addr "/" ttl [ "/" integer ]
>                          ;IPv4 multicast addresses must be in the range
>                          ;224.0.0.0 to 239.255.255.255
>                          ;IPv6 multicast addresses must begin with the byte
>                          ;FF or include an IPv4 multicast address
>
>    ttl =                 (POS-DIGIT *2DIGIT) | "0"
>
>    addr =                IPv4address | IPv6address | FQDN | extension-addr
>
>    FQDN =                *( domainlabel "." ) toplabel
>
>    domainlabel =         alpha-numeric restoflabel
>
>    toplabel =            ALPHA restoflabel
>
>    restoflabel =         *(*("-") alpha-numeric)
>
>    extension-addr =      non-ws-string
>
>    ; generic sub-rules: datatypes
>    text =                byte-string
>                          ;default is to interpret this as IS0-10646 UTF8
>                          ;ISO 8859-1 requires a "a=charset:ISO-8859-1"
>                          ;session-level attribute to be used
>
>    byte-string =         1*(%x01-09|%x0b-0c|%x0e-ff)
>                          ;any byte except NUL, CR or LF
>
>    non-ws-string =       1*(VCHAR|%x80-ff)
>                          ;string of visible US-ASCII, or high-bit, characters
>
>    token-char =          %x21|%x23-27|%x2a-2b|%x2d-2e|%x30-39|
>                              %x41-5a|%x5e-7e
>                          ; definition from RFC 2045 -
>                          ; "any (US-ASCII) CHAR except SPACE, CTLs,
>                          ; or tspecials".
>                          ; the tspecials are ()<>@,;:\"/[]?=
>
>    token =               1*(token-char)
>
>    email-safe =          1*(%x01-09|%x0b-0c|%x0e-27|
>                             %x2a-3b|%x3d|%x3e-ff)
>                          ;any byte except NUL, CR, LF, or the quoting
>                          ;characters ()<>
>
>    integer =             POS-DIGIT *DIGIT
>
>    ; generic sub-rules: primitives
>
>    alpha-numeric =       ALPHA | DIGIT
>
>    POS-DIGIT =           %x31-39 ; 1 - 9
>
>    ; external references:
>    ; addr-spec: from draft-ietf-drums-msg-format (RFC822bis)
>    ; IPv4address, IPv6address: From RFC 2373
>    ; URI-reference: from RFC 2396, as modified by RFC 2732
>    ; ALPHA, DIGIT, CRLF, SP, VCHAR: from RFC 2234
>
>   ------------------------------------------------------------------------
>
> --
> Jonathan Lennox
> [email-masked]

---

From: Flemming Andreasen <[email-masked]>
Date: Fri, 27 Apr 2001 10:32:54 -0400

Reposting as I haven't seen any responses.

Anybody ?

-- Flemming

--
Flemming Andreasen
Cisco Systems

---

From: Jonathan Lennox <[email-masked]>
Date: Fri, 27 Apr 2001 12:43:20 -0400 (EDT)

> > session description, but the syntax below shows it as optional.

A mistake.  That line shouldn't be bracketed.  It isn't in 2327.

> > that it should be.  My take would be to remove this requirement from the

There's no terribly clean way in BNF to specify "at least one" of two
fields.  (I guess you could do "(e|p|e p)", but that's ugly.)  Better to
make it a semantic requirement.

> > is allowed, it might be good to mention this case in the draft.

I have no idea -- this is copied literally from 2327.  Anyone?

> >     port *("/" integer)  instead of port ["/" integer ]

I'm fine with this, if other people are.  There would need to be discussion
of what syntaxes are meaningful for what nettypes.

> > instead of integer as in the media-field rule.

"integer" is non-zero in SDP.  Port zero is used for some things as an
exception case.  (E.g. 0.0.0.0 0 for "hold" in SIP.)

> > don't think is really intended.

Works for me.

-- 
Jonathan Lennox
[email-masked]