Subject: SDP Revision

From: "Tom-PT Taylor" <[email-masked]>
Date: Fri, 30 Mar 2001 13:57:49 -0500

Has anyone pointed out that "/" is not permitted in the ABNF for the proto
token on the "m=" line?  RFC 2327 restricts proto to alpha-numeric.

Tom Taylor
Multimedia Control and Applications Standards
Ph.  +1 613 736 0961
[email-masked]

---

From: Jonathan Lennox <[email-masked]>
Date: Sat, 31 Mar 2001 15:42:35 -0500 (EST)

> token on the "m=" line?  RFC 2327 restricts proto to alpha-numeric.

The SDP ABNF has a lot more problems than just this.  (Notice the
unterminated string constants, for instance, and the fact that
supposedly-extensible parameters aren't.)

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 (it's on my laptop,
which I can't get on the net from home).

-- 
Jonathan Lennox
[email-masked]

---

From: Flemming Andreasen <[email-masked]>
Date: Sun, 01 Apr 2001 20:54:59 -0500

> supposedly-extensible parameters aren't.)

Yep.

> largely done. I can send this to the list on Monday

That would be most welcome.

-- Flemming

> (it's on my laptop,

--
Flemming Andreasen
Cisco Systems

---

From: Jonathan Lennox <[email-masked]>
Date: Tue, 3 Apr 2001 15:05:13 -0400 (EDT)

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