EHB
415E
DATA
COMMUNICATIONS
İstanbul
Teknik
Üniversitesi
Elektrik
Elektronik
Fakültesi
Elektronik
Haberleşme
Mühendisliği
Fall
2014
WEEK
Course
Outline
DATE
1
IntroducKon
08/09
Protocol
Architecture,
TCP/IP,
and
Internet-‐Based
ApplicaKons
2
NO
LECTURE
(VTC
Fall
2014)
15/09
3
Data
Transmission
22/09
Transmission
Media
4
Signal
Encoding
Techniques
(+
Project
Proposals)
29/09
5
NO
LECTURE
(Kurban
Bayramı)
06/10
6
Digital
Data
CommunicaKons
Techniques
13/10
7
Midterm
Exam
20/10
8
Data
Link
Control
Protocols
27/10
9
MulKplexing
(+
Project
Progress
Reports)
03/11
10
Circuit
Switching
and
Packet
Switching
10/11
11
Midterm
Exam
17/11
12
RouKng
in
Switched
Data
Networks
24/11
13
Ethernet
01/12
14
Project
Workshop
(+
Project
Final
Reports)
08/12
2
Project
Proposals
• Proposals
will
be
evaluated:
– Accept/Reject
• Proposals
that
are
NOT
ACCEPTED
are
listed
on
NINOVA
– Come
&
talk
to
me
– Update
your
proposal:
• Hand-‐in
print
out
of
the
NEW
proposal
• Send
an
e-‐mail
of
pdf
copy
3
PROGRESS
REPORT
• DEADLINE:
NOVEMBER
03
• Contents:
– Project
DescripKon
– Progress
Table
ITEM
NUMBER
WORK
RELATION
WITH
THE
RESOURCES
DURATION
DESCRIPTION
PROJECT
(PEOPLE
+
HARDWARE
...)
1
2
3
– References
4
Data
and
Computer
CommunicaKons
Chapter 7 – Data Link Control
Protocols
Ninth
EdiKon
by
William
Stallings
Data
and
Computer
CommunicaKons,
Ninth
EdiKon
by
William
Stallings,
(c)
Pearson
EducaKon
-‐
PrenKce
Hall,
2011
Data
Link
Control
Protocols
“Great and enlightened one,” said Ten-teh,
as soon as his stupor was lifted, “has this
person delivered his message competently, for
his mind was still a seared vision of snow and
sand and perchance his tongue has stumbled?”
“Bend your ears to the wall,” replied the
Emperor, “and be assured.”
—Kai Lung's Golden Hours,
Earnest Bramah
Data
Link
Control
Protocols
• when
sending
data,
to
achieve
control,
a
layer
of
logic
is
added
above
the
Physical
layer
– data
link
control
or
a
data
link
control
protocol
• to
manage
exchange
of
data
over
a
link:
– frame
synchronizaKon
– flow
control
– error
control
– addressing
– control
and
data
– link
management
Flow
Control
• ensure
sending
enKty
does
not
overwhelm
receiving
enKty
– prevent
buffer
overflow
• influenced
by:
– transmission
Kme
• Kme
taken
to
emit
all
bits
into
medium
– propagaKon
Kme
• Kme
for
a
bit
to
traverse
the
link
• assumpKon
is
all
frames
are
successfully
received
with
no
frames
lost
or
arriving
with
errors
Model
of
Frame
Transmission
VerKcal
Kme
sequence
diagram
Stop
and
Wait
• simplest
form
of
flow
• works
well
for
a
control
message
sent
in
a
few
large
frames
@
low
bit
error
rates
– stop
and
wait
becomes
inadequate
if
large
block
of
data
is
split
into
small
frames
by
source
Why
do
we
need
smaller
blocks?
• Receiver
buffer
size
may
be
limited
• The
longer
the
frame
size,
the
higher
the
FER
for
a
fixed
BER
(REMEMBER
LAST
LECTURE!)
• On
a
shared
medium
(e.g.
LAN),
one
staKon
may
not
be
permiqed
to
transmit
for
an
extended
period
11
Bit
Length
of
a
Link
• B
=
R
x
d/V
• B
–
Length
of
the
link
in
bits
(The
number
of
bits
present
on
the
link
at
an
instance
of
Kme
when
a
stream
of
bits
fully
occupy
the
link)
• R
–
Bit
rate
(bps)
• d
–
Distance
between
staKons
(m)
• V
–
velocity
of
propagaKon
(m/s)
• a
=
B/N
(N
–
number
of
bits
in
a
frame)
12
Stop
and
Wait
Link
UKlizaKon
For
a
>
1,
the
line
is
always
underuKlized
and
even
for
a
<
1,
the
line
is
inefficiently
uKlized
Examples
• 200
m
opKcal
fiber
link
@
1Gbps,
N
=
8000
V
=
2x108
– B
=
200x109/
2x108
=1000,
a
=
1000/8000
=
0.125
• Satellite
link
@
1Mbps,
AlKtude
=
36,000
km
– B
=
2x36000000x106/
3x108
=240,000,
a
=
240,000/8000
=
30
(transmission
Kme
=
448ms)
14
Sliding
Windows
Flow
Control
• allows
mulKple
numbered
frames
to
be
in
transit
– receiver
has
buffer
W
long
– transmiqer
sends
up
to
W
frames
without
ACK
– ACK
includes
number
of
next
frame
expected
(RR
–
Receive
ready)
– sequence
number
is
bounded
by
size
of
field
(k)
• frames
are
numbered
modulo
2k
• giving
max
window
size
of
up
to
2k
–
1
– receiver
can
ACK
frames
without
permiwng
further
transmission
(RNR
-‐
Receive
Not
Ready)
– must
send
a
normal
acknowledge
to
resume
• if
have
full-‐duplex
link,
can
piggyback
ACKs
Sliding
Window
Diagram
Sliding
Window
Example
Error
Control
Techniques
detecKon
and
correcKon
of
errors
such
as:
TOOLS:
error
detecIon
lost
frames
-‐a
frame
fails
to
posiIve
arrive
at
the
other
acknowledgment
side
(ACK)
damaged
frames
negaIve
-‐frame
arrives
but
acknowledgement
some
of
the
bits
(NACK)
&
are
in
error
retransmission
retransmission
aQer
Imeout
(TO)
AutomaKc
Repeat
Request
(ARQ)
• collecKve
name
for
error
control
mechanisms
• effect
of
ARQ
is
to
turn
an
unreliable
data
link
into
a
reliable
one
• versions
of
ARQ
are:
– stop-‐and-‐wait
– go-‐back-‐N
– selecKve-‐reject
Stop
and
Wait
ARQ
• source
transmits
single
frame
• waits
for
ACK
• no
other
data
can
be
sent
unKl
desKnaKon’s
reply
arrives
• if
frame
received
is
damaged,
discard
it
– transmiqer
has
Kmeout
– if
no
ACK
within
Kmeout,
retransmit
• if
ACK
is
damaged,
transmiqer
will
not
recognize
– transmiqer
will
retransmit
– receiver
gets
two
copies
of
frame
– use
alternate
numbering
and
ACK0
/
ACK1
Stop
and
Wait
ARQ
pros
• simplisKc
cons
• inefficient
Go-‐Back-‐N
ARQ
• most
commonly
used
error
control
• based
on
sliding-‐window
• use
window
size
to
control
number
of
outstanding
frames
• if
no
error,
ACK
as
usual
• if
error,
reply
with
rejecKon
– desKnaKon
will
discard
that
frame
and
all
future
frames
unKl
frame
in
error
is
received
correctly
– transmiqer
must
go
back
and
retransmit
that
frame
and
all
subsequent
frames
Go
Back
N
-‐
Handling
• Damaged
frame
– error
in
frame
i
so
receiver
rejects
frame
i
– transmiqer
retransmits
frames
from
i
• Lost
frame
– frame
i
lost
and
either
• transmiqer
sends
i+1
and
receiver
gets
frame
i+1
out
of
sequence
and
rejects
frame
i
• or
transmiqer
Kmes
out
and
sends
ACK
with
P
bit
set
which
receiver
responds
to
with
ACK
i
– transmiqer
then
retransmits
frames
from
i
Go
Back
N
-‐
Handling
Damaged
Acknowledgement
Damaged
RejecIon
receiver
gets
frame
i,
sends
ACK
(i
reject
for
damaged
frame
is
lost
+1)
which
is
lost
ACKs
are
cumulaIve,
so
next
ACK
(i
handled
as
lost
frame
when
+n)
may
arrive
before
transmiZer
transmiZer
Imes
out
Imes
out
on
frame
i
if
transmiZer
Imes
out,
it
sends
ACK
with
P
bit
set
can
be
repeated
a
number
of
Imes
before
a
reset
procedure
is
iniIated
SelecKve-‐Reject
(ARQ)
• also
called
selecKve
retransmission
• only
rejected
frames
are
retransmiqed
• subsequent
frames
are
accepted
by
the
receiver
and
buffered
• minimizes
retransmission
• receiver
must
maintain
large
enough
buffer
• more
complex
logic
in
transmiqer
– less
widely
used
• useful
for
satellite
links
with
long
propagaKon
delays
Go-‐Back-‐N
vs.
SelecKve
Reject
High
Level
Data
Link
Control
(HDLC)
most
important
staIon
types:
link
configuraIons
data
link
control
• Primary
-‐
• Unbalanced
-‐
1
protocol
controls
primary,
mulIple
• specified
as
ISO
operaIon
of
link
secondary
3009,
ISO
4335
• Secondary
-‐
• Balanced
-‐
2
• basis
for
other
under
control
of
combined
staIons
data
link
control
primary
staIon
protocols
• Combined
-‐
issues
commands
and
responses
A
few
different
versions
of
the
HDLC
frame
include
the
PPP
[Point-‐to-‐Point
Protocol]
HDLC
frame,
and
the
Ethernet
HDLC
frame.
HDLC
Transfer
Modes
Normal
Response
Mode
(NRM)
• used
with
an
unbalanced
configuraIon
• primary
iniIates
transfer
Asynchronous
Balanced
Mode
(ABM)
• used
with
a
balanced
configuraIon
• either
staIon
iniIates
transmission
• has
no
polling
overhead
• most
widely
used
Asynchronous
Response
Mode
(ARM)
• used
with
unbalanced
configuraIon
• secondary
may
transmit
without
permission
from
primary
• rarely
used
HDLC
Frame
Structure
– uses
synchronous
transmission
– transmissions
are
in
the
form
of
frames
– single
frame
format
used
FCS:
Frame
check
sequence
Flag
Fields
and
Bit
Stuffing
• delimit
frame
at
both
ends
with
01111110
• receiver
hunts
for
flag
sequence
to
synchronize
• bit
stuffing
used
to
avoid
confusion
with
data
containing
flag
sequence
01111110
– 0
inserted
a}er
every
sequence
of
five
1s
– if
receiver
detects
five
1s
it
checks
next
bit
– if
next
bit
is
0,
it
is
deleted
(was
stuffed
bit)
– if
next
bit
is
1
and
seventh
bit
is
0,
accepted
as
flag
– if
sixth
and
seventh
bits
1,
sender
is
indicaKng
abort
Address
Field
• idenKfies
secondary
staKon
that
transmiqed
or
will
receive
frame
• usually
8
bits
long
• may
be
extended
to
mulKples
of
7
bits
– le}most
bit
indicates
if
is
the
last
octet
(1)
or
not
(0)
• address
11111111
allows
primary
to
broadcast
Control
Field
• different
frame
types
– InformaIon
-‐
data
transmiqed
to
user
(next
layer
up)
• flow
and
error
control
piggybacked
on
informaKon
frames
– Supervisory
-‐
ARQ
when
piggyback
is
not
used
– Unnumbered
-‐
supplementary
link
control
funcKons
• first
1-‐2
bits
of
control
field
idenKfy
frame
type
Control
Field
• use
of
Poll/Final
(P/F)
bit
depends
on
context
• in
command
frame
P
bit
set
to
1
to
solicit
(poll)
response
from
peer
• in
response
frame
F
bit
set
to
1
to
indicate
response
to
soliciKng
command
• sequence
number
usually
3
bits
– can
extend
to
8
bits
as
shown
below
InformaKon
and
Frame
Check
Sequence
(FCS)
Fields
InformaIon
Field
• in
I-‐frames
and
some
U-‐frames
• must
contain
integral
number
of
octets
• variable
length
Frame
Check
Sequence
Field
(FCS)
• used
for
error
detecIon
• either
16
bit
CRC
or
32
bit
CRC
HDLC
OperaKon
§consists
of
exchange
of
I-‐frames,
S-‐frames
and
U-‐frames
§involves
three
phases
IniIalizaIon
Data
Transfer
Disconnect
• either
side
• with
flow
• when
fault
may
request
and
error
noted
or
at
by
issuing
control
request
of
one
of
the
• using
both
I
higher-‐layer
six
set-‐ and
S-‐ user
mode
frames
(RR,
• sends
a
commands
RNR,
REJ,
disconnect
Responses:
SREJ)
(DISC)
UA:
Unnumbered
ACK
(OK)
DM:
Disconnected
Mode
(NOK)
frame
HDLC
OperaKon
Example
HDLC
OperaKon
Example
Summary
• data
link
protocols
– frame
synchronizaKon
– flow
control
• stop-‐and-‐wait,
sliding
window
• ACK
frame
• error
control
– lost
frame,
damaged
frame
– stop-‐and-‐wait,
go-‐back-‐N,
selecKve-‐reject
ARQs
• HDLC
– NRM,
ABM,ARM
QUESTIONS
?
39