Subject: [Dime] A tiny bug in Command Code ABNF specification in rfc3588bis-19

From: Fortune HUANG <[email-masked]>
Date: Tue, 08 Dec 2009 14:53:01 +0800

Dear all,
 
I think there is a tiny bug in the Command Code ABNF specification in
rfc3588bis-19.
 
Here is how the Diameter header is defined:
 
  header           = "<" "Diameter Header:" command-id
                     [r-bit] [p-bit] [e-bit] [application-id] ">"
 
  application-id   = 1*DIGIT
 
  command-id       = 1*DIGIT
                     ; The Command Code assigned to the command
  r-bit            = ", REQ"
                     ; If present, the 'R' bit in the Command
                     ; Flags is set, indicating that the message
                     ; is a request, as opposed to an answer.

  p-bit            = ", PXY"
                     ; If present, the 'P' bit in the Command
                     ; Flags is set, indicating that the message
                     ; is proxiable.

  e-bit            = ", ERR"
                     ; If present, the 'E' bit in the Command
                     ; Flags is set, indicating that the answer
                     ; message contains a Result-Code AVP in
                     ; the "protocol error" class.

According to this specification, there is no separator (e.g. a comma)
between the application-id and its previous field.
So here are the legal examples which do not look good:
1) header = <Diameter Header:555, REQ1111111> 
2) header = <Diameter Header:5551111111>
In the latter example, we can't even figure out the values of the command
code and the application-id.
 
There might be three potential solutions to fix the bug (any of them will be
OK for me):
1) simply adding ", " before application-id as follows:
     header           = "<" "Diameter Header:" command-id
                     [r-bit] [p-bit] [e-bit] [", " application-id] ">"
 
2) redefine application-id with a comma as follows: 
       application-id   = ", " 1*DIGIT
3) create a new name for application-id plus the comma as follows:
header           = "<" "Diameter Header:" command-id
                     [r-bit] [p-bit] [e-bit] [a-new-name-x] ">"
a-new-name-x = ", " application-id

Best regards,
Fortune