<s>
Traversal	B-Protocol
Using	I-Protocol
Relays	I-Protocol
around	I-Protocol
NAT	I-Protocol
(	O
TURN	O
)	O
is	O
a	O
protocol	O
that	O
assists	O
in	O
traversal	O
of	O
network	B-Protocol
address	I-Protocol
translators	I-Protocol
(	O
NAT	O
)	O
or	O
firewalls	B-Application
for	O
multimedia	O
applications	O
.	O
</s>
<s>
It	O
may	O
be	O
used	O
with	O
the	O
Transmission	B-Protocol
Control	I-Protocol
Protocol	I-Protocol
(	O
TCP	O
)	O
and	O
User	B-Protocol
Datagram	I-Protocol
Protocol	I-Protocol
(	O
UDP	O
)	O
.	O
</s>
<s>
It	O
is	O
most	O
useful	O
for	O
clients	O
on	O
networks	O
masqueraded	O
by	O
symmetric	O
NAT	B-Protocol
devices	I-Protocol
.	O
</s>
<s>
Session	B-Protocol
Traversal	I-Protocol
Utilities	I-Protocol
for	I-Protocol
NAT	I-Protocol
(	O
STUN	B-Protocol
)	O
provides	O
one	O
way	O
for	O
an	O
application	O
to	O
traverse	O
a	O
NAT	O
.	O
</s>
<s>
STUN	B-Protocol
allows	O
a	O
client	O
to	O
obtain	O
a	O
transport	O
address	O
(	O
an	O
IP	O
address	O
and	O
port	O
)	O
which	O
may	O
be	O
useful	O
for	O
receiving	O
packets	O
from	O
a	O
peer	O
.	O
</s>
<s>
However	O
,	O
addresses	O
obtained	O
by	O
STUN	B-Protocol
may	O
not	O
be	O
usable	O
by	O
all	O
peers	O
.	O
</s>
<s>
Therefore	O
,	O
STUN	B-Protocol
by	O
itself	O
cannot	O
provide	O
a	O
complete	O
solution	O
for	O
NAT	O
traversal	O
.	O
</s>
<s>
This	O
can	O
only	O
be	O
accomplished	O
by	O
relaying	O
data	O
through	O
a	O
server	B-Application
that	O
resides	O
on	O
the	O
public	O
Internet	O
.	O
</s>
<s>
Traversal	B-Protocol
Using	I-Protocol
Relay	I-Protocol
NAT	I-Protocol
(	O
TURN	O
)	O
is	O
a	O
protocol	O
that	O
allows	O
a	O
client	O
to	O
obtain	O
IP	O
addresses	O
and	O
ports	O
from	O
such	O
a	O
relay	O
.	O
</s>
<s>
Although	O
TURN	O
almost	O
always	O
provides	O
connectivity	O
to	O
a	O
client	O
,	O
it	O
is	O
resource	O
intensive	O
for	O
the	O
provider	O
of	O
the	O
TURN	O
server	B-Application
.	O
</s>
<s>
It	O
is	O
therefore	O
desirable	O
to	O
use	O
TURN	O
as	O
a	O
last	O
resort	O
only	O
,	O
preferring	O
other	O
mechanisms	O
(	O
such	O
as	O
STUN	B-Protocol
or	O
direct	O
connectivity	O
)	O
when	O
possible	O
.	O
</s>
<s>
If	O
STUN	B-Protocol
is	O
not	O
an	O
option	O
because	O
one	O
of	O
the	O
NATs	O
is	O
a	O
symmetric	O
NAT	O
(	O
a	O
type	O
of	O
NAT	O
known	O
to	O
be	O
non-STUN	O
compatible	O
)	O
,	O
TURN	O
must	O
be	O
used	O
.	O
</s>
<s>
First	O
,	O
the	O
client	O
contacts	O
a	O
TURN	O
server	B-Application
with	O
an	O
"	O
Allocate	O
"	O
request	O
.	O
</s>
<s>
The	O
Allocate	O
request	O
asks	O
the	O
TURN	O
server	B-Application
to	O
allocate	O
some	O
of	O
its	O
resources	O
for	O
the	O
client	O
so	O
that	O
it	O
may	O
contact	O
a	O
peer	O
.	O
</s>
<s>
If	O
allocation	O
is	O
possible	O
,	O
the	O
server	B-Application
allocates	O
an	O
address	O
for	O
the	O
client	O
to	O
use	O
as	O
a	O
relay	O
,	O
and	O
sends	O
the	O
client	O
an	O
"	O
Allocation	O
Successful	O
"	O
response	O
,	O
which	O
contains	O
an	O
"	O
allocated	O
relayed	O
transport	O
address	O
"	O
located	O
at	O
the	O
TURN	O
server	B-Application
.	O
</s>
<s>
Second	O
,	O
the	O
client	O
sends	O
in	O
a	O
CreatePermissions	O
request	O
to	O
the	O
TURN	O
server	B-Application
to	O
create	O
a	O
permissions	O
check	O
system	O
for	O
peer-server	O
communications	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
when	O
a	O
peer	O
is	O
finally	O
contacted	O
and	O
sends	O
information	O
back	O
to	O
the	O
TURN	O
server	B-Application
to	O
be	O
relayed	O
to	O
client	O
,	O
the	O
TURN	O
server	B-Application
uses	O
the	O
permissions	O
to	O
verify	O
that	O
the	O
peer-to-TURN	O
server	B-Application
communication	O
is	O
valid	O
.	O
</s>
<s>
Using	O
either	O
method	O
,	O
Send	O
or	O
channel	O
binding	O
,	O
the	O
TURN	O
server	B-Application
receives	O
the	O
data	O
from	O
the	O
client	O
and	O
relays	O
it	O
to	O
the	O
peer	O
using	O
UDP	O
datagrams	O
,	O
which	O
contain	O
as	O
their	O
Source	O
Address	O
the	O
"	O
Allocated	O
Relayed	O
Transport	O
Address	O
"	O
.	O
</s>
<s>
The	O
peer	O
receives	O
the	O
data	O
and	O
responds	O
,	O
again	O
using	O
a	O
UDP	O
datagram	O
as	O
the	O
transport	O
protocol	O
,	O
sending	O
the	O
UDP	O
datagram	O
to	O
the	O
relay	O
address	O
at	O
the	O
TURN	O
server	B-Application
.	O
</s>
<s>
The	O
TURN	O
server	B-Application
receives	O
the	O
peer	O
UDP	O
datagram	O
,	O
checks	O
the	O
permissions	O
and	O
if	O
they	O
are	O
valid	O
,	O
forwards	O
it	O
to	O
the	O
client	O
.	O
</s>
<s>
This	O
process	O
gets	O
around	O
even	O
symmetric	O
NATs	O
because	O
both	O
the	O
client	O
and	O
peer	O
can	O
at	O
least	O
talk	O
to	O
the	O
TURN	O
server	B-Application
,	O
which	O
has	O
allocated	O
a	O
relay	O
IP	O
address	O
for	O
communication	O
.	O
</s>
<s>
While	O
TURN	O
is	O
more	O
robust	O
than	O
STUN	B-Protocol
in	O
that	O
it	O
assists	O
in	O
traversal	O
of	O
more	O
types	O
of	O
NATs	O
,	O
a	O
TURN	O
communication	O
relays	O
the	O
entire	O
communication	O
through	O
the	O
server	B-Application
requiring	O
far	O
more	O
server	B-Application
bandwidth	O
than	O
the	O
STUN	B-Protocol
protocol	I-Protocol
,	O
which	O
typically	O
only	O
resolves	O
the	O
public	O
facing	O
IP	O
address	O
and	O
relays	O
the	O
information	O
to	O
client	O
and	O
peer	O
for	O
them	O
to	O
use	O
in	O
direct	O
communication	O
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
the	O
ICE	O
protocol	O
mandates	O
STUN	B-Protocol
usage	O
as	O
a	O
first	O
resort	O
,	O
and	O
TURN	O
usage	O
only	O
when	O
dealing	O
with	O
symmetric	O
NATs	O
or	O
other	O
situations	O
where	O
STUN	B-Protocol
cannot	O
be	O
used	O
.	O
</s>
