<s>
T.38	B-Protocol
is	O
an	O
ITU	O
recommendation	O
for	O
allowing	O
transmission	O
of	O
fax	B-Protocol
over	I-Protocol
IP	I-Protocol
networks	O
(	O
FoIP	B-Protocol
)	O
in	O
real	O
time	O
.	O
</s>
<s>
The	O
T.38	B-Protocol
fax	I-Protocol
relay	O
standard	O
was	O
devised	O
in	O
1998	O
as	O
a	O
way	O
to	O
permit	O
faxes	O
to	O
be	O
transported	O
across	O
IP	B-Protocol
networks	I-Protocol
between	O
existing	O
Group	O
3	O
(	O
G3	O
)	O
fax	O
terminals	O
.	O
</s>
<s>
In	O
the	O
late	O
1990s	O
,	O
VoIP	B-Application
,	O
or	O
Voice	B-Application
over	I-Application
IP	I-Application
,	O
began	O
to	O
gain	O
ground	O
as	O
an	O
alternative	O
to	O
the	O
conventional	O
Public	O
Switched	O
Telephone	O
Network	O
(	O
PSTN	O
)	O
.	O
</s>
<s>
However	O
,	O
because	O
most	O
VoIP	B-Application
systems	O
are	O
optimized	O
(	O
through	O
their	O
use	O
of	O
aggressive	O
lossy	O
bandwidth-saving	O
compression	O
)	O
for	O
voice	O
rather	O
than	O
data	O
calls	O
,	O
conventional	O
fax	O
machines	O
worked	O
poorly	O
or	O
not	O
at	O
all	O
on	O
them	O
due	O
to	O
the	O
network	O
impairments	O
such	O
as	O
delay	O
,	O
jitter	O
,	O
packet	B-Protocol
loss	I-Protocol
,	O
and	O
so	O
on	O
.	O
</s>
<s>
Thus	O
,	O
some	O
way	O
of	O
transmitting	O
fax	B-Protocol
over	I-Protocol
IP	I-Protocol
was	O
needed	O
.	O
</s>
<s>
In	O
practical	O
scenarios	O
,	O
a	O
T.38	B-Protocol
fax	I-Protocol
call	O
has	O
at	O
least	O
part	O
of	O
the	O
call	O
being	O
carried	O
over	O
PSTN	O
,	O
although	O
this	O
is	O
not	O
required	O
by	O
the	O
T.38	B-Protocol
definition	O
,	O
and	O
two	O
T.38	B-Protocol
devices	O
can	O
send	O
faxes	O
to	O
each	O
other	O
.	O
</s>
<s>
This	O
particular	O
type	O
of	O
device	O
is	O
called	O
Internet-Aware	O
Fax	O
device	O
,	O
or	O
IAF	O
,	O
and	O
it	O
is	O
capable	O
of	O
initiating	O
or	O
completing	O
a	O
fax	O
call	O
towards	O
the	O
IP	B-Protocol
network	I-Protocol
.	O
</s>
<s>
The	O
typical	O
scenario	O
where	O
T.38	B-Protocol
is	O
used	O
is	O
-	O
T.38	B-Protocol
Fax	I-Protocol
relay	O
-	O
where	O
a	O
T.30	O
fax	O
device	O
sends	O
a	O
fax	O
over	O
PSTN	O
to	O
a	O
T.38	B-Protocol
Fax	I-Protocol
gateway	B-Application
which	O
converts	O
or	O
encapsulates	O
the	O
T.30	O
protocol	O
into	O
T.38	B-Protocol
data	O
stream	O
.	O
</s>
<s>
This	O
is	O
then	O
sent	O
either	O
to	O
a	O
T.38	B-Protocol
enabled	O
end	O
point	O
such	O
as	O
fax	O
machine	O
or	O
fax	B-Application
server	I-Application
or	O
another	O
T.38	B-Protocol
Gateway	B-Application
that	O
converts	O
it	O
back	O
to	O
PSTN	O
PCM	O
or	O
analog	O
signal	O
and	O
terminates	O
the	O
fax	O
on	O
a	O
T.30	O
device	O
.	O
</s>
<s>
The	O
T.38	B-Protocol
recommendation	O
defines	O
the	O
use	O
of	O
both	O
TCP	B-Protocol
and	O
UDP	B-Protocol
to	O
transport	O
T.38	B-Protocol
packets	O
.	O
</s>
<s>
Implementations	O
tend	O
to	O
use	O
UDP	B-Protocol
,	O
due	O
to	O
TCP	B-Protocol
's	O
requirement	O
for	O
acknowledgement	O
packets	O
and	O
resulting	O
retransmission	O
during	O
packet	B-Protocol
loss	I-Protocol
,	O
which	O
introduces	O
delays	O
.	O
</s>
<s>
When	O
using	O
UDP	B-Protocol
,	O
T.38	B-Protocol
copes	O
with	O
packet	B-Protocol
loss	I-Protocol
by	O
using	O
redundant	O
data	O
packets	O
.	O
</s>
<s>
T.38	B-Protocol
is	O
not	O
a	O
call	O
setup	O
protocol	O
,	O
thus	O
the	O
T.38	B-Protocol
devices	O
need	O
to	O
use	O
standard	O
call	O
setup	O
protocols	O
to	O
negotiate	O
the	O
T.38	B-Protocol
call	O
,	O
e.g.	O
</s>
<s>
H.323	B-Protocol
,	O
SIP	B-Application
&	O
MGCP	B-Protocol
.	O
</s>
<s>
T.38	B-Protocol
,	O
however	O
,	O
defines	O
a	O
protocol	O
that	O
supports	O
the	O
use	O
of	O
the	O
T.30	O
protocol	O
in	O
both	O
the	O
sender	O
and	O
recipient	O
terminals	O
.	O
</s>
<s>
T.38	B-Protocol
lets	O
one	O
transmit	O
a	O
fax	O
across	O
an	O
IP	B-Protocol
network	I-Protocol
in	O
real	O
time	O
,	O
just	O
as	O
the	O
original	O
G3	O
fax	O
standards	O
did	O
for	O
the	O
traditional	O
(	O
time-division	O
multiplexed	O
(	O
TDM	O
)	O
)	O
network	O
,	O
also	O
called	O
the	O
public	O
switched	O
telephone	O
network	O
or	O
PSTN	O
.	O
</s>
<s>
A	O
special	O
protocol	O
is	O
needed	O
for	O
real-time	O
fax	B-Protocol
over	I-Protocol
IP	I-Protocol
(	O
Internet	O
Protocol	O
)	O
since	O
existing	O
fax	O
terminals	O
only	O
supported	O
PSTN	O
connections	O
,	O
where	O
the	O
information	O
flow	O
was	O
generally	O
smooth	O
and	O
uninterrupted	O
,	O
as	O
opposed	O
to	O
the	O
jittery	O
arrival	O
of	O
IP	O
packets	O
.	O
</s>
<s>
The	O
trick	O
was	O
to	O
come	O
up	O
with	O
a	O
protocol	O
that	O
makes	O
the	O
IP	B-Protocol
network	I-Protocol
“	O
invisible	O
”	O
to	O
the	O
endpoint	O
fax	O
terminals	O
,	O
which	O
would	O
mean	O
the	O
user	O
of	O
a	O
legacy	O
fax	O
terminal	O
need	O
not	O
know	O
that	O
the	O
fax	O
call	O
was	O
traversing	O
an	O
IP	B-Protocol
network	I-Protocol
.	O
</s>
<s>
The	O
network	O
interconnections	O
supported	O
by	O
T.38	B-Protocol
are	O
shown	O
above	O
.	O
</s>
<s>
Interconnection	O
of	O
the	O
PSTN	O
with	O
the	O
IP	O
packet	O
network	O
requires	O
a	O
“	O
gateway	B-Application
”	O
between	O
the	O
PSTN	O
and	O
IP	B-Protocol
networks	I-Protocol
.	O
</s>
<s>
PSTN-IP	O
Gateways	B-Application
support	O
TDM	O
voice	O
on	O
the	O
PSTN	O
side	O
and	O
VoIP	B-Application
and	O
FoIP	B-Protocol
on	O
the	O
packet	O
side	O
.	O
</s>
<s>
For	O
voice	O
sessions	O
,	O
the	O
gateway	B-Application
will	O
take	O
in	O
voice	O
packets	O
on	O
the	O
IP	O
side	O
,	O
accumulate	O
a	O
few	O
packets	O
to	O
ensure	O
a	O
smooth	O
flow	O
of	O
TDM	O
data	O
upon	O
their	O
release	O
,	O
and	O
then	O
meter	O
them	O
out	O
over	O
TDM	O
where	O
they	O
eventually	O
are	O
heard	O
by	O
a	O
human	O
or	O
stored	O
on	O
a	O
computer	O
for	O
later	O
playback	O
.	O
</s>
<s>
The	O
gateway	B-Application
employs	O
packet-management	O
techniques	O
to	O
enhance	O
the	O
quality	O
of	O
the	O
speech	O
in	O
the	O
presence	O
of	O
network	O
errors	O
by	O
taking	O
advantage	O
of	O
the	O
natural	O
ability	O
of	O
a	O
listener	O
to	O
not	O
really	O
hear	O
the	O
occasional	O
missing	O
or	O
repeated	O
packet	O
.	O
</s>
<s>
But	O
facsimile	O
data	O
are	O
transmitted	O
by	O
modems	B-Application
,	O
which	O
are	O
n't	O
as	O
forgiving	O
as	O
the	O
human	O
ear	O
is	O
for	O
speech	O
.	O
</s>
<s>
So	O
the	O
job	O
of	O
T.38	B-Protocol
is	O
to	O
“	O
fool	O
”	O
the	O
terminal	O
into	O
“	O
thinking	O
”	O
that	O
it	O
's	O
communicating	O
directly	O
with	O
another	O
T.30	O
terminal	O
.	O
</s>
<s>
Spoofing	O
refers	O
to	O
the	O
logic	O
implemented	O
in	O
the	O
protocol	O
engine	O
of	O
a	O
T.38	B-Protocol
relay	O
that	O
modifies	O
the	O
protocol	O
commands	O
and	O
responses	O
on	O
the	O
TDM	O
side	O
to	O
keep	O
network	O
delays	O
on	O
the	O
IP	O
side	O
from	O
causing	O
the	O
transaction	O
to	O
fail	O
.	O
</s>
<s>
Networks	O
that	O
do	O
not	O
have	O
packet	B-Protocol
loss	I-Protocol
or	O
excessive	O
delay	O
can	O
exhibit	O
acceptable	O
fax	O
performance	O
without	O
T.38	B-Protocol
,	O
provided	O
the	O
PCM	O
clocks	O
in	O
all	O
gateways	B-Application
are	O
of	O
very	O
high	O
accuracy	O
(	O
explained	O
below	O
)	O
.	O
</s>
<s>
T.38	B-Protocol
not	O
only	O
removes	O
the	O
effect	O
of	O
PCM	O
clocks	O
not	O
being	O
synchronized	O
,	O
but	O
also	O
reduces	O
the	O
required	O
network	O
bandwidth	O
by	O
a	O
factor	O
of	O
10	O
,	O
while	O
it	O
corrects	O
for	O
packet	B-Protocol
loss	I-Protocol
and	O
delay	O
.	O
</s>
<s>
As	O
shown	O
in	O
the	O
diagram	O
below	O
,	O
a	O
T.38	B-Protocol
gateway	B-Application
is	O
composed	O
of	O
two	O
primary	O
elements	O
:	O
the	O
fax	O
modems	B-Application
and	O
the	O
T.38	B-Protocol
subsystem	O
.	O
</s>
<s>
The	O
fax	O
modems	B-Application
modulate	O
and	O
demodulate	O
the	O
PCM	O
samples	O
of	O
the	O
analog	O
data	O
,	O
turning	O
the	O
sampled-data	O
representation	O
of	O
the	O
fax	O
terminal	O
's	O
analog	O
signal	O
to	O
its	O
binary	O
translation	O
,	O
and	O
vice	O
versa	O
.	O
</s>
<s>
The	O
PSTN	O
network	O
samples	O
the	O
analog	O
signal	O
of	O
a	O
voice	O
or	O
modem	B-Application
signal	O
(	O
it	O
does	O
n't	O
know	O
the	O
difference	O
)	O
8,000	O
times	O
per	O
second	O
(	O
SPS	O
)	O
,	O
and	O
encodes	O
them	O
as	O
8-bit	O
data	O
bytes	O
.	O
</s>
<s>
This	O
means	O
8000	O
samples-per-second	O
times	O
8-bits	O
per	O
sample	O
,	O
or	O
64,000	O
bits	O
per	O
second	O
(	O
bit/s	O
)	O
to	O
represent	O
the	O
modem	B-Application
(	O
or	O
voice	O
)	O
data	O
in	O
one	O
direction	O
.	O
</s>
<s>
For	O
both	O
directions	O
the	O
modem	B-Application
transaction	O
consumes	O
128,000	O
bits	O
of	O
network	O
bandwidth	O
.	O
</s>
<s>
However	O
,	O
the	O
typical	O
modem	B-Application
in	O
a	O
fax	O
terminal	O
transmits	O
the	O
image	O
data	O
at	O
33,600	O
bit/s	O
,	O
so	O
if	O
the	O
analog	O
data	O
are	O
first	O
converted	O
to	O
the	O
digital	O
content	O
they	O
represent	O
,	O
only	O
33,600	O
bits	O
(	O
plus	O
network	O
overhead	O
of	O
a	O
few	O
bytes	O
)	O
are	O
needed	O
.	O
</s>
<s>
In	O
the	O
diagram	O
above	O
,	O
there	O
is	O
a	O
sample-rate	O
clock	O
in	O
the	O
fax	O
terminal	O
and	O
one	O
in	O
the	O
gateway	B-Application
's	O
modems	B-Application
that	O
is	O
used	O
to	O
trigger	O
the	O
sampling	O
of	O
the	O
analog	O
line	O
8,000	O
times	O
per	O
second	O
.	O
</s>
<s>
These	O
clocks	O
are	O
usually	O
quite	O
accurate	O
,	O
but	O
in	O
some	O
low-cost	O
terminal	O
adapters	O
(	O
a	O
one	O
or	O
two-line	O
gateway	B-Application
)	O
the	O
PCM	O
clock	O
can	O
be	O
surprisingly	O
inaccurate	O
.	O
</s>
<s>
If	O
the	O
terminal	O
is	O
sending	O
data	O
to	O
the	O
gateway	B-Application
,	O
and	O
the	O
gateway	B-Application
's	O
clock	O
is	O
too	O
slow	O
,	O
the	O
buffers	O
(	O
jitter	O
buffers	O
)	O
in	O
the	O
gateway	B-Application
will	O
eventually	O
overflow	O
,	O
causing	O
the	O
transaction	O
to	O
fail	O
.	O
</s>
<s>
Since	O
the	O
difference	O
is	O
often	O
quite	O
small	O
,	O
this	O
problem	O
occurs	O
on	O
long	O
,	O
detailed	O
fax	O
images	O
giving	O
the	O
clocks	O
more	O
time	O
to	O
cause	O
the	O
jitter	O
buffer	O
in	O
gateway	B-Application
to	O
either	O
underflow	O
or	O
overflow	O
,	O
which	O
is	O
just	O
the	O
same	O
as	O
missing	O
or	O
duplicated	O
packets	O
.	O
</s>
<s>
T.38	B-Protocol
provides	O
facilities	O
to	O
eliminate	O
the	O
effects	O
of	O
packet	B-Protocol
loss	I-Protocol
through	O
data	O
redundancy	O
.	O
</s>
<s>
This	O
increases	O
the	O
network	O
bandwidth	O
required	O
(	O
it	O
's	O
still	O
much	O
less	O
than	O
not	O
using	O
T.38	B-Protocol
)	O
but	O
it	O
allows	O
the	O
receiving	O
gateway	B-Application
to	O
reconstruct	O
the	O
complete	O
packet	O
sequence	O
,	O
even	O
with	O
a	O
fairly	O
high	O
level	O
of	O
packet	B-Protocol
loss	I-Protocol
.	O
</s>
<s>
It	O
specifies	O
the	O
standard	O
image	O
sizes	O
,	O
two	O
forms	O
of	O
image-data	O
compression	O
(	O
encoding	O
)	O
,	O
the	O
image-data	O
format	O
,	O
and	O
references	O
,	O
T.30	O
and	O
the	O
various	O
modem	B-Application
standards	O
.	O
</s>
<s>
T.30	O
also	O
references	O
the	O
various	O
modem	B-Application
standards	O
.	O
</s>
<s>
V.21	O
,	O
V.27ter	O
,	O
V.29	O
,	O
V.17	O
,	O
V.34	O
:	O
ITU	O
modem	B-Application
standards	O
used	O
in	O
facsimile	O
.	O
</s>
<s>
G.711	B-Algorithm
pass	O
through	O
-	O
this	O
is	O
where	O
the	O
T.30	O
fax	O
call	O
is	O
carried	O
in	O
a	O
VoIP	B-Application
call	I-Application
encoded	O
as	O
audio	O
.	O
</s>
<s>
This	O
is	O
sensitive	O
to	O
network	O
packet	B-Protocol
loss	I-Protocol
,	O
jitter	O
and	O
clock	O
synchronization	O
.	O
</s>
<s>
When	O
using	O
voice	O
high-compression	O
encoding	O
techniques	O
such	O
as	O
,	O
but	O
not	O
limited	O
to	O
,	O
G.729	B-Algorithm
,	O
some	O
fax	O
tonal	O
signals	O
may	O
not	O
get	O
correctly	O
transported	O
across	O
the	O
packet	O
network	O
.	O
</s>
<s>
defines	O
the	O
image/t38	O
media	B-Application
type	I-Application
(	O
formerly	O
known	O
as	O
MIME	B-Application
type	I-Application
)	O
for	O
use	O
with	O
the	O
Session	B-Language
Description	I-Language
Protocol	I-Language
.	O
</s>
