You are on page 1of 58

ENUM and Asterisk

VoIP Workshop
APRICOT 2008
Ed Lewis
ed.lewis@neustar.biz

Agenda

What/why is ENUM
Role in "call set up"
Provisioning
History and future
An exercise/lab

APRICOT 2008

ed.lewis@neustar.biz

The What & Why

APRICOT 2008

ed.lewis@neustar.biz

E-N-U-M vs. "ENUM"


Like all buzzwords, ENUM has two (or
more) meanings
The one in the original defining
documents
I call that E-N-U-M here

The one vendors use


I call that "ENUM" here

So I'll start trying to make the two


clear
4
Eventually, it's ed.lewis@neustar.biz
just ENUM (no hyphens, no

APRICOT 2008

What is E-N-U-M?
E(lectronic )NUM(bering)
Converts tel-numbers into Domain
Names
+866227002323 becomes
3.2.3.2.0.0.7.2.2.6.6.8.<$e164>.<$tld>
E.g.,3.2.3.2.0.0.7.2.2.6.6.8.e164.arpa

Name is used to store NAPTR records


which lead to SRV records which lead
to addresses
But, Ed, "why?"ed.lewis@neustar.biz
That's for later...

APRICOT 2008

Why "ENUM"?
If there were one Asterisk Server in the
world

Asteri
sk
Server

APRICOT 2008

ed.lewis@neustar.biz

Configurati
on
File

Four Servers?

APRICOT 2008

Confi
g
File

Confi
g
File

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

Confi
Confi
g
g
File ed.lewis@neustar.bizFile

More Servers?
Asteri
sk
Server
Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server
Asteri
sk
Server

Aaaaaaaaaagggggghhhhhhhh!!

APRICOT 2008

ed.lewis@neustar.biz

Scalable way to find numbers


Need to be able to know where to
route a call
Traditional Telephony: Signaling System 7
Internet Candidate: Domain Name System

Desirable features of DNS


Quick response
Very scalable
Can be operated for high availability,
reliability
2008
(OTOH, also easy
to "not" do it right!)
APRICOT
ed.lewis@neustar.biz

With "ENUM"
Asteri
sk
Server

Asteri
sk
Server

APRICOT 2008

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

DNS-ENUM service
Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

ed.lewis@neustar.biz

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

10

E-N-U-M vs. "ENUM"


Both are known as ENUM, but...
E-N-U-M is the mapping of E.164 to
DNS
"ENUM" refers that plus the entire
process of discovering where to send
a call
Convert telephone number to a URL
Discover the service location of the URL
Discover the network address of the
APRICOT 2008
ed.lewis@neustar.biz
server

11

ENUM in standards
IETF RFC documents
3403 "DDDS Part Three: The DNS
Database."
Part of the series 3401-3405

3761 "The E.164 to URI DDDS App.


(ENUM)"
3824 "Using E.164 numbers with the SIP"
4706 Year of the Rat/Mouse (current
lunar year)
5067 "Infrastructure ENUM Requirements"
APRICOT 2008
ed.lewis@neustar.biz
12
http://www.iana.org/assignments/enum-

Call Set-Up

APRICOT 2008

ed.lewis@neustar.biz

13

Mechanics of ENUM
User dials a number, assumption is
made that this is for a voice call
Server tries to set up a SIP session
First get a "sip:" URL for the dialed
number
Next find where the host part or URL is
serviced
Then find the network address

Failing that, use the PSTN


APRICOT 2008

ed.lewis@neustar.biz

14

Telephone Number to URL


Accomplished via a DNS NAPTR
Resource Record
NAPTR is "Naming Authority Pointer"
Beat's me

ENUM(TN) owns it
ENUM(TN) means "E.164 converted into a
domain name

When used in ENUM, it holds a URL


APRICOT 2008

ed.lewis@neustar.biz

15

ENUM(TN)
Start with an E.164 number
+866227002323 ()

Reverse it, dots between digits, drop


"+"
3.2.3.2.0.0.7.2.2.6.6.8

Append the "ENUM root" to the name


strictly as an example, "e164.tld."
3.2.3.2.0.0.7.2.2.6.6.8.e164.tld.

Reversed because that's the DNS way


APRICOT 2008

ed.lewis@neustar.biz

16

NAPTR RR
NAPTR RR
ENUM(TN) "owns" it
Record contains 6 elements
order = uninteresting
preference = uninteresting
flags = always "u" for ENUM
service = "E2U+<something>" (see IANA
page)
regular expression = interesting THE URL we
want
replacement = uninteresting

APRICOT 2008

ed.lewis@neustar.biz

17

An example
+866227002323 to
"sip:866227002323@hotel.tw.tld."
$ORIGIN 3.2.3.2.0.0.7.2.2.6.6.8.e164.tld.
@ NAPTR 10 ( ; order
10 ; preference
"u" ; flags
"E2U+sip" ; (enum)service
"!(^.*)$!sip:\1@hotel.tw.tld." ;
rpl
.) ; replacement (unused)
APRICOT 2008

ed.lewis@neustar.biz

18

Zonefile-ism
Note that in the previous slide this
"!(^.*)$!sip:\1@hotel.tw.tld."

is written
"!(^.*)$!sip:\\1@hotel.tw.tld."

in the zone files to "escape" the backslash

APRICOT 2008

ed.lewis@neustar.biz

19

So, NAPTR does what?


After finding the DNS version of the E.
164
NAPTR gives us the "rewrite rule to
determine the URL we want"
Reg Exp
+866227002323 and "(^.*$)" makes "\1"
= the TN
sip:\1@hotel.tw.tld. becomes
sip:+866227002323@hotel.tw.tld.

This isn't an HTTP, "hotel.tw.tld" isn't a


APRICOT 2008

ed.lewis@neustar.biz

20

Now we have an URL, so


what?
We want to start a SIP session with
hotel.tw.tld.
Using another DNS convention, we ask
for the service location
The DNS name for this is
<service>.<transport>.hotel.tw.tld.
<service> for SIP is _sip.
<transport> for SIP is _udp.

Ask for the SRV RR


APRICOT 2008

ed.lewis@neustar.biz

21

SRV RR
Service (location) resource record
<owner> SRV
<priority><weight><host><port>
priority= uninteresting
weight = uninteresting
host = DNS of host where process runs
port = port number

APRICOT 2008

ed.lewis@neustar.biz

22

Example
hotel.tw.tld has a SIP server on
"sip.hotel.tw.tld." and port 5060
$ORIGIN hotel.tw.tld.
_sip._udp SRV 10 10 sip.hotel.tw.tld. 5060

APRICOT 2008

ed.lewis@neustar.biz

23

Now we know where to go,


but...
+866227002323 is dialed
NAPTR says sip:
+866227002323@hotel.tw.tld
SIP says sip.hotel.tw.tld, port 5060
Still need an IP address (IPv4 or IPv6)
So we ask for the A or AAAA record of
the hostname
Now, we can send() the packet
APRICOT 2008

ed.lewis@neustar.biz

24

So, With ENUM


Asteri
sk
Server

Asteri
sk
Server

APRICOT 2008

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

NAPT

R (TN
->U
SRV (
RL)
URL>Hos
A/A
t/por
AAA
t)
(hos
t->
IP)

Asteri
sk
Server

DNS-ENUM service
Asteri
sk
Server

Asteri
sk
Server

Asteri
sk
Server

ed.lewis@neustar.biz

Asteri
sk
Server

Asteri
sk
Server

25

That seems like a lot of work


Details of DNS include
Caching of answers to speed things up
Redundant servers to scale
The SRV RR also works for sip URLs that
aren't tied to E.164 numbers. (More
flexible)

Why do this?
It's supposed to be cheaper than the
alternative (SS7 or configuring all peer
servers)
APRICOT 2008

ed.lewis@neustar.biz

26

ENUM's job
Once the call set up is over, ENUM
plays no role in the call
It only tells Asterisk where to direct SIP
traffic
After that, the SIP session is independent
of ENUM

But we aren't done just yet

APRICOT 2008

ed.lewis@neustar.biz

27

Provisioning

APRICOT 2008

ed.lewis@neustar.biz

28

Call set up is just a part of


the work
How does the ENUM data get into
DNS?
An activity called "provisioning."
Voice service providers have to register
the NAPTRs, SRVs, and address records
for the telephone numbers

APRICOT 2008

ed.lewis@neustar.biz

29

Setting up a VoIP service


offering
Install an Asterisk server (or
commercial alternative)
Get phone numbers for customers
Plan to accept incoming calls on the
server
The SRV and A/AAAA record(s) are
then set
For each of my phone numbers add an
NAPTR record where others will look a registry
APRICOT 2008

ed.lewis@neustar.biz

30

ENUM operation
Likely scenario is that ISPs will use a
separate organization to operate the
ENUM root
Currently there are a number of
"trade-associations" for this
Telephone operators seem to associate
with others on the same media, VoIP,
wireless, wireline, cable (TV), etc.

A central ENUM registry is usually


planned for the "top"
APRICOT 2008

ed.lewis@neustar.biz

31

Tiers
Infrastructure (trade association)
ENUM is usually divided into three
tiers
Tier 0, the top of the ENUM hierarchy
Tier 1, country codes
Tier 2, individual numbers

APRICOT 2008

ed.lewis@neustar.biz

32

Tier 0
Tier 0 is closely tied with the
international standards of telephone
number allocation
As you can imagine, this gets political
The ITU has instructed RIPE NCC (the
European version of APNIC) to operate
a registry with the ENUM root of
e164.arpa.
APRICOT 2008

ed.lewis@neustar.biz

33

Tier 1
There are about 200-300 Tier 1's
(possible)
1 per country code, with a few
exceptions
+1 is shared by a few countries in North
America

Tier 1's vary greatly


Depends on the numbering plan
Pooling, blocks of numbers
APRICOT
ed.lewis@neustar.biz
2008
Number portability

34

Tier 2
Usually just a block of consecutive
numbers managed by a voice service
provider
With number portability, Tier 2 might
be one number per zone
Tier 2 ENUM DNS provider is up to the
service provider

APRICOT 2008

ed.lewis@neustar.biz

35

Tree of Tiers
trad
e/
ITU

Tier 0
Tier 1 +866
Tier 2
2
2
7
0
0
2
3
3

APRICOT 2008

Tier 1 +1
Tier 2
5
7
1
5
5
5
1
2
3
4

Tier 2
5
7
1
5
5
5
1
2
3
5

ed.lewis@neustar.biz

Tier 1 +65

trad
e/
CC

V
O
I
P
Prov
run

36

Tier 0's
The ITU has designated e164.arpa as
the "public enum root"
Few, if anyone use it

Many voice trade associations are


planning their own tier 0's
Not all on the global public Internet

What's the problem with multiple


roots?
It's best if there's one, really, for SIP
APRICOT 2008
ed.lewis@neustar.biz
servers

37

Tier 0 registry
The operator builds the Tier 0 DNS
Really rather boring, only adjusted
when country codes change or when
Tier 1 registries change

APRICOT 2008

ed.lewis@neustar.biz

38

Tier 1 Registry
Produces country dialing code's DNS
Only "excitement" comes when
numbering allocations or transfers
happen
Tier 0 and Tier 1 usually only host
delegations (NS records) and no
NAPTR, SRV, nor address records

APRICOT 2008

ed.lewis@neustar.biz

39

Tier 2 "registry"
Contains the NAPTR records for fully
(and over) dialed numbers
Millions of these zones, they may not
be traditional DNS zones
This is where a lot of activity happens
in provisioning

APRICOT 2008

ed.lewis@neustar.biz

40

Other zones
SRV and address records are usually in
organization domains
Data is tied to the service provider
Not tied to the customer numbers

APRICOT 2008

ed.lewis@neustar.biz

41

In the coming lab


Tier 0, 1, and 2 are collapsed into one
zone
e164.tld. is the enum zone
We only have extenstions, not E.164
numbers

SRV and addresses are in "groupXY"


zones
Provisioning is already done
APRICOT 2008

ed.lewis@neustar.biz

42

History and Future

APRICOT 2008

ed.lewis@neustar.biz

43

ENUM started as
A way for people to attach services to
their phone number
A flop
People don't own their number, authority
to make a change is not easy
User ENUM too complicated for common
man

Some public ENUM service offerings


have already been suspended
APRICOT 2008

ed.lewis@neustar.biz

44

ENUM is emerging as
An upgrade to the existing interoperator call routing database
More flexible than voice-only traffic

Infrastructure ENUM
Still fragmented among trade associations

APRICOT 2008

ed.lewis@neustar.biz

45

A quick lab exercise

APRICOT 2008

ed.lewis@neustar.biz

46

Lab, or Exercise
Ingredients
DNS server on conference.apricot.net
169.223.11.204

Your Asterisk servers with new


configuration lines
SIP phones to dial each other

APRICOT 2008

ed.lewis@neustar.biz

47

First, a look at the DNS


For the lab, the DNS is pre-populated
to work for us
I hope

Let's see what this looks like from the


DNS perspective

APRICOT 2008

ed.lewis@neustar.biz

48

To see the ENUM zone up


close
$ dig @conference.apricot.net e164.tld.
axfr

This will show you the whole zone


The next slide will show the "relevant
bits" but you may want to see it closer
to you eyes

APRICOT 2008

ed.lewis@neustar.biz

49

First the pre-provisioned

e164.tld. zone has this:

*.1.2 NAPTR 10 10 "u" "E2U+sip" "!(^.*$)!sip:\\1@group01.tld.!" .


*.2.2 NAPTR 10 10 "u" "E2U+sip" "!(^.*$)!sip:\\1@group02.tld.!" .
*.3.2 NAPTR 10 10 "u" "E2U+sip" "!(^.*$)!sip:\\1@group03.tld.!" .
*.4.2 NAPTR 10 10 "u" "E2U+sip" "!(^.*$)!sip:\\1@group04.tld.!" .
*.5.2 NAPTR 10 10 "u" "E2U+sip" "!(^.*$)!sip:\\1@group05.tld.!" .
*.6.2 NAPTR 10 10 "u" "E2U+sip" "!(^.*$)!sip:\\1@group06.tld.!" .
*.7.2 NAPTR 10 10 "u" "E2U+sip" "!(^.*$)!sip:\\1@group07.tld.!" .
*.8.2 NAPTR 10 10 "u" "E2U+sip" "!(^.*$)!sip:\\1@group08.tld.!" .
*.9.2 NAPTR 10 10 "u" "E2U+sip" "!(^.*$)!sip:\\1@group09.tld.!" .
*.0.3 NAPTR 10 10 "u" "E2U+sip" "!(^.*$)!sip:\\1@group10.tld.!" .

APRICOT 2008

ed.lewis@neustar.biz

50

Group 16's zone


$TTL 900
$ORIGIN group16.tld.
@

IN SOA

ns1.tld. (
hostmaster.ns1.tld.
1 ; serial number
900 ; refresh
900 ; retry
604800 ; expire
900 ; negative cache

NS

ns1.tld.

_sip._udp

SRV

10 10 5060 sip.group16.tld.

sip.group16.tld. A

APRICOT 2008

169.223.10.26

ed.lewis@neustar.biz

51

Exercise the DNS


Do these three dig's to see what Asterisk
should see
dig @conference.apricot.net 0.0.6.3.e164.tld. naptr
dig @conference.apricot.net _sip._udp.group16.tld. srv
dig @conference.apricot.net sip.group16.tld. a

APRICOT 2008

ed.lewis@neustar.biz

52

Configure Your Machine


Has to be done at system level to tell
Asterisk where to go to ask DNS
questions
We are using a "improper" ENUM domain

As root, edit /etc/resolv.conf


Place this line in before the other
"nameserver" lines
nameserver 169.223.11.204

This will send queries to our "ENUM


server"
APRICOT 2008

ed.lewis@neustar.biz

53

Tell Asterisk to "do" ENUM


Add to extensions.conf under [phones]
exten => _6XXXX,1,Dial(SIP/${ENUMLOOKUP($
{EXTEN:1},sip,,1,e164.tld.)})

Add 'exten' in [default] to ring phones


(lab notes)
Set 'allowguest=yes' in sip.conf
Reload and Increase "verbosity"
Dial "6-<4digits>"
APRICOT 2008

ed.lewis@neustar.biz

54

Check to see
Dialing 63601 should result in
URL sip:3601@group16.tld.

In the live demo, I'll use 'asterisk -r'


with verbose > 10.
Looking to see a line including
'Called 3600@group16.tld.'

in response to dialing 63600


APRICOT 2008

ed.lewis@neustar.biz

55

Wrap UP
Same Sign

Xinyi Road
2008

Xinyi Road 2003

APRICOT 2008

ed.lewis@neustar.biz

56

Questions?
This is a quick introduction to ENUM
Like many things, it's components are
simple
More complex macros can be used to
handle error conditions

But the volume of work and business


factors are huge

APRICOT 2008

ed.lewis@neustar.biz

57

That's all folks


Time for the 'live demo' and then the
hands on portion

APRICOT 2008

ed.lewis@neustar.biz

58

You might also like