Subject: [SIP] ipv4 addresses in SDP

From: [email-masked]
Date: Thu, 17 Aug 2000 17:00:00 +0530 (IST)

Another query on SDP grammar:

[If this isn't the right forum for SDP related questions, please let
me know.]

Consider the following in rfc 2327:
------------------------------------------------------------------------
   IP4-address =         b1 "." decimal-uchar "." decimal-uchar "." b4

   decimal-uchar =       ("1" 2*(DIGIT))
                         | ...

   DIGIT =               "0" | POS-DIGIT
   POS-DIGIT =           "1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
------------------------------------------------------------------------

Is there a mistake in the following production?
    decimal-uchar = ("1" 2*(DIGIT))

I ask because there's a similar rule for IPv4 addresses in the 
SIP-URL grammar (2543bis).
  IPv4address     = 1*3DIGIT"."1*3DIGIT"."1*3DIGIT"."1*3DIGIT
This rule unambiguously states that each token between the '.'
must not be more than 3 digits.

But SDP's ("1" 2*(DIGIT)) rule seems to suggest any number beginning
with a "1" and having atleast 3 digits.

Thanks.

_______________________________________________
SIP mailing list
[email-masked]
http://lists.bell-labs.com/mailman/listinfo/sip

---

From: James Undery <[email-masked]>
Date: Thu, 17 Aug 2000 13:01:21 +0000 (GMT)

> with a "1" and having atleast 3 digits.

I'd reread RFC 2234 on ABNF as you are misreading this.

James Undery

---

From: Jonathan Rosenberg <[email-masked]>
Date: Thu, 17 Aug 2000 23:30:03 -0400

> [If this isn't the right forum for SDP related questions, please let

It isn't. SDP queries belong on [email-masked].

> Consider the following in rfc 2327:

The BNF is correct. You need to examine complete production for
decimal-uchar:

>  decimal-uchar =       DIGIT
>                          | POS-DIGIT DIGIT
>                          | ("1" 2*(DIGIT))
>                          | ("2" ("0"|"1"|"2"|"3"|"4") DIGIT)
>                          | ("2" "5" ("0"|"1"|"2"|"3"|"4"|"5"))

The production defines one of five rules; the first covers the numbers
0-9. The second covers 10 through 99. The thrid 100 through 199 (thus a
1 followed by two digits), the fourth 200 through 249, and the final,
250 through 255. Thus, the overall production for decimal-uchar allows
any number from 0 to 255, which is correct.

-Jonathan R.

-- 
Jonathan D. Rosenberg                       72 Eagle Rock Ave.
Chief Scientist                             First Floor
dynamicsoft                                 East Hanover, NJ 07936
[email-masked]                     FAX:   (973) 952-5050
http://www.cs.columbia.edu/~jdrosen         PHONE: (732) 741-7244
http://www.dynamicsoft.com

---

From: [email-masked]
Date: Fri, 18 Aug 2000 09:26:58 +0530 (IST)

On Thu, 17 Aug 2000, Jonathan Rosenberg wrote:

>SDP queries belong on [email-masked].

Thanks, I'll post it there.

>0-9. The second covers 10 through 99. 

>The thrid 100 through 199 (thus a 1 followed by two digits), 

Right, but the third production also allows 
1000 through 1999, 10000 through 19999 ...

That is, it doesn't restrict the length of decimal-uchar to three
digits like the fourth & fifth productions do, does it?

>the fourth 200 through 249, and the final,
>250 through 255. 
>Thus, the overall production for decimal-uchar allows

It seems to allow more than just 0 to 255, hence the query.
Thanks.

---

From: Jonathan Rosenberg <[email-masked]>
Date: Fri, 18 Aug 2000 10:58:58 -0400

> digits like the fourth & fifth productions do, does it?

Oops, you're right. This BNF is wrong; it should be:

...
| ("1" 2DIGIT)
...

This should be corrected in the draft version.

-Jonathan R.

---

From: James Undery <[email-masked]>
Date: Fri, 18 Aug 2000 16:02:50 +0100

> Oops, you're right. This BNF is wrong; it should be:

Shouldn't this be | ("1" 2*2(DIGIT))

James Undery

---

From: Jonathan Rosenberg <[email-masked]>
Date: Fri, 18 Aug 2000 11:21:53 -0400

According to rfc2234:

> Specific Repetition                                  nRule
> 
>    A rule of the form:
> 
>         <n>element
> 
>    is equivalent to
> 
>         <n>*<n>element
> 
>    That is, exactly  <N>  occurrences  of <element>. Thus 2DIGIT is a
>    2-digit number, and 3ALPHA is a string of three alphabetic
>    characters.

Thus, Nelement and N*Nelement are the same.

-Jonathan R.