Coe540 3
Coe540 3
Courtesy of:
Dr. Ashraf S. Hasan Mahmoud
1
Lecture Contents
1. ARQ: Retransmission Strategies
a. Stop-and-Wait
b. Go Back n ARQ
c. Selective Repeat ARQ
2. Examples: ARPANET ARQ
3. Framing
a. Character-Based Framing
b. Bit Oriented Framing
4. Standard DLCs
2
Issues with Frame Transmission
Source Destination Source Destination
frame 1 frame 1
frame 4 frame 4
time time
Error-free transmission Transmission with losses
(frame 2) and error (frame 4)
• The destination has a limited buffer space. How will the source know that
destination is ready to receive the next frame? Need for flow control
• Two types of damaged frames: erroneous frame or frame lost!
• In case of errors or lost frame, the source need to retransmit frames – i.e.
a copy of transmitted frames must be kept. How will the source know
when to discard copies of old frames?
• Etc.
3
Issues with Frame Transmission
• A scheme to ensure that transmitter does not
overwhelm receiver with data
• Transmission of one frame:
• Tf: time to transmit frame
• Tprop: time for signal to propagate
• Tproc: time for destination to process received frame –
small delay (usually ignored if not specified)
Source Destination
• Tproc may be ignored if not
specified Tf
Tprop
Very important representation
Tproc
time
4
Issues with Frame Transmission
• Typical frame structure:
• SN – sequence number for the packet being transmitted
• RN – sequence number for the NEXT packet in the
opposite direction
• Packet – payload
• CRC – See previous set of notes
• Piggybacking
SN RN Packet CRC
5
What is ARQ?
• Def: to detect frames in error and then request the
transmitter to repeat the erroneous frames
• Using ARQ, systems can automatically request the
retransmission of missing packets or packets with errors.
• Error Control:
• ARQ
• Forward Error Correction – Def = ?
• ARQ Algorithms Figures of Merit
• Correctness (i.e. only one packet released to upper layer)
• Efficiency (i.e. throughput)
• Three common schemes
• Stop & Wait
• Go Back N
• Selective
6
Stop-and-Wait Algorithm
• The simplest ARQ algorithm!
• Operation Rules:
• Algorithm at node A for A-to-B transmission:
1. Set the integer variable SN to 0
2. Accept a packet from the next higher layer at A; if no packet is
available, wait until it is; assign number SN to the new packet
3. Transmit the SNth packet in a frame containing SN in the sequence
number field
4. If an error-free frame is received from B containing a request number
RN greater than SN, increase SN to RN and go to step 2, if no such
frame is received within some finite delay, go to step 3
• Algorithm at node B for A-to-B transmission
1. Set the integer variable RN to 0 and then repeat step 2 and 3 forever
2. Whenever an error-free frame is received from A containing the
sequence number SN equal to RN, release the received packet to the
higher layer and increment RN
3. At arbitrary times, but within bounded delay after receiving any error
free data from A, transmit a frame to A containing RN in the request
number field.
• The textbook provides an informal proof for the correctness of
the above algorithm:
• Liveness: can continue for ever to accept new packets at A and
release them to B
• Safety: never produces an incorrect result (i.e. never releases a
packet out of the correct order to the higher layer) 7
Modulo 2 Stop-and-Wait
ARQ
• Uses Modulo 2 sequence
numbers (SN and RN)
• Both frames and ACKs are
numbered damaged
frame
8
Important Performance Figures
• Utilization (U) – fraction of time the link is used
for transmitting data
• Throughput (b/s) – effective b/s as experienced
by user data
• Throughput = R * U (b/s)
• Throughput (frame/s) – average data frames per
second the link is supporting
• Throughput = R*U/data_frame_size (frame/sec)
A Stop-and-Wait B
Utilization = ?
Throughput = ? 9
Stop-and-Wait Protocol: Efficiency
• After every frame, source must wait till acknowledgment
Hence link propagation time is significant
• Total time to for one frame:
T_total = Tf + 2Tprop + Tproc + Tack
if we ignore Tproc and Tack (usually very small)
T_total = Tf + 2Tprop Source Destination
= 1 / (1+2(Tprop/Tf)) = 1 / (1 + 2 a) Tprop
T_total
where a = Tprop/Tf = length of link in bits
• Tproc
If a < 1 (i.e. Tf > Tprop – when 1st transmitted bit
reaches destination, source will still be Tprop
transmitting U is close 100%
• If a > 1 (i.e. Tf < Tprop – frame transmission is Tack
completed before 1st bit reaches destination U
is low time
10
Stop-and-Wait Protocol: Efficiency (2)
• Remember: a = Tprop/Tf = length of link in bits
• If a < 1 (i.e. Tf > Tprop –
when 1st transmitted
bit reaches destination,
source will still be
transmitting U is
close 100%
• If a > 1 (i.e. Tf < Tprop –
frame transmission is
completed before 1st
bit reaches destination
U is low
• Stop-and-Wait is
efficient for links where
a << 1 (long frames
compared to
propagation time)
11
Stop-and-Wait Protocol: Efficiency With
Errors (3)
• Assume a frame is in error with probability P
• Therefore, average utilization can be written as
U = Tf / (Nr T_total)
• Note that for P = 0 (i.e. error free), the expression reduced to the
previous result!
12
Sliding Window Protocol
• Stop-and-Wait can be very inefficient when a > 1
• Protocol:
• Assumes full duplex line
• Source A and Destination B have buffers each of size W
frames
• For k-bit sequence numbers:
• Frames are numbered: 0, 1, 2, …, 2 k-1, 0, 1, … (modulo 2k)
• ACKs (RRs) are numbered: 0, 1, 2, …, 2 k-1, 0, 1, … (modulo
2 k)
• A is allowed to transmit up to W frames without waiting for
an ACK
• B can receive up to W consecutive frames
• ACK J (or RR J), where 0<=J<= 2 k-1, sent by B means B is
have received frames up to frame J-1 and is ready to
receive frame J
• Window size, W can be less or equal to 2k-1
13
Sliding Window Protocol (2)
• Example of Sliding-Window-Protocol: k = 3 bits, W = 7
Observations:
• A may tx W = 7 frames
(F0, F1, …, F6)
• After F0, F1, & F2 are
W
tx-ed, window is
shrunk (i.e. can not
transmit except F3, F4,
…, F6)
W
• When B sends RR3, A
knows F0, F1 & F2
have been received
and B is ready to
receive F3 W
• Window is advanced to
cover 7 frames
(starting with F3 up to
F1)
• A sends F3, F4, F5, & W
F6
• B responds with RR4 W = distance between first unacknowledged
when F3 is received – W frame and last frame that can be14
sent
A advances the
Sliding Window Protocol - Piggybacking
15
Sliding Window Protocol -
Efficiency
• Again we can distinguish two cases:
• Case 1: W ≥ 2a + 1
• Case 2: W < 2a + 1
16
Sliding Window Protocol -
Efficiency - Case 1
• Assume k=3, W = 7 Source Destination
(ignoring Tack)
• Source can Tf
completed F6
F7
• Utilization = 100% F0
F0 WTf
• Because the ACK can NOT
Tprop
arrive to source before the F1
window is completed F2
Tprop K1
W Tf AC
C K2
• Utilization = ------------------ A
Tf + 2 Tprop
F3
F4
W
= ------------
1 + 2a time
18
Sliding Window Protocol -
Efficiency
20
Go-Back-N ARQ
• Based on the sliding-window flow control procedure -
Sliding Window Protocol slide
• Three types of errors:
1. ith frame damaged:
a. If A send subsequent frames (i+1, i+2, …), B responds with
REJ i A must retransmit ith frame and all subsequent
frames
Check for status of b. If A does not send subsequent frames and B does not respond
B before resending with RR or REJ (since frame was damaged) timeout timer
the frame at A expires – send a POLL signal to B; B sends an RR i, i.e. it
expect the ith frame – A sends the ith frame again
2. Damaged RR (B receives i th frame and sends RR i+1 which is
lost or damaged):
a. Since ACKs are cumulative – A may receive a subsequent RR j
(j >i+1) before A times out
b. If A times out, it sends a POLL signal to B – if B fails to
respond (i.e. down) or its response is damaged subsequent
POLLs are sent; procedure repeated certain number of time
before link reset
3. Damaged REJ – same as 1.b
21
Go-Back-N ARQ – Efficiency With Errors
• Remember that Go-back-N ARQ utilization for error-free channels is given by:
U= 1 for W > 2a + 1
= W/(2a+1) for W < 2a + 1
• If a frame is transmitted i times (i.e. first (i-1) times are erroneous while it was received
correctly in the ith time), then f(i) is the total number of frame transmissions if our original frame
is in error.
• f(i) is given by
f(i) = 1 + (i-1)K
Identities:
• Substituting f(i) in the above relation, yields Σ (Xi-1,i=1,∞) =1/(1-X) for -1<X<1
Σ (iXi-1,i=1,∞) =1/(1-X)2 for -1<X<1
Nr = (1-P+KP)/(1-P)
23
Window Size for Selective-Reject ARQ –
Why?
• Window size: should be less or equal to
half range of sequence numbers
• For n-bit sequence numbers, Window size is
≤2n-1 (remember sequence numbers range
from 0,1, …, 2n-1)
• Why? See next example
24
Window Size for Selective-Reject ARQ –
Why? (2)
• Example: Consider 3-bit sequence number and window size of 7
NODE A NODE B
0 1 2 3 4 5 6 7 0 1 2 F ra m e
0
0 1 2 3 4 5 6 7 0 1 2
F ra m e
Transmitter can only advance its transmit 1
window with the frames it sent are F ra m e
2
acknowledged F ra m e
3
F ra m e
4
F ra m e
5
timeout F ra m e
for frame 0 6
Receiver advances its receive window
R R7 0 1 2 3 4 5 6 7 0 1 2
• With Go-back-N
frames 4,5 and 6 are
retransmitted
• With Selective-
Reject only frame 4
is retransmitted
26
Selective Reject ARQ – Efficiency With
Errors
• Remember that Selective Reject utilization for error-free channels is
given by:
U= 1 for W > 2a + 1
= W/(2a+1) for W < 2a + 1
Go-Back-N
A Selective Reject B
Utilization = ?
Throughput = ? 28
ARQ Utilization as a Function of a
• Remember a is
given by Tprop/Tf –
i.e. the length of
the link in bits
• The curves are for P
= 10-3
• Note for W = 1, go-
back-N and
selective reject
degenerate to the
case of stop-and-
wait
29
Example:
Problem: Two neighboring nodes A and B use a
sliding-window protocol with a 3-bit
sequence numbers. As the ARQ mechanism,
go-back-N is used with a window size of 4.
Assuming A is transmitting and B is
receiving, show the window positions for the
following succession of events:
a) Before A sends any frames
b) After A sends frame 0, 1, 2 and B
acknowledges 0, 1 and the ACKs are received
by A
c) After A sends frames 3, 4, and 5 and B
acknowledges 4 and the ACK is received by A
30
Example: Solution
a)
••• 0 1 2 3 4 5 6 7 0 •••
b)
••• 0 1 2 3 4 5 6 7 0 •••
c)
••• 0 1 2 3 4 5 6 7 0 •••
31
4000 km 1000 km
A B C
Example:
Problem: In the shown figure, frames are generated at
node A and send to node C through node B. The
following specifies the two communication links:
• The data rate between node A and node B is 100 kb/s
• The propagation delay is 5 μsec/km for both links
• Both links are full-duplex
• All data frames are 1000 bits long; ACK frames are
separate frames of negligible length
• Between A and B sliding window protocol with a window
size of 3 is used
• Between B and C, stop-and-wait is used.
There are no errors (lost or damaged frames)
a) Calculate the utilization for link AB?
b) What is the throughput for link AB in bits per second?
What is the throughput in frames per second?
c) Calculate the minimum rate required between nodes
B and C so that the buffers of node B are not flooded.
d) What is the efficiency of the communication on link
BC?
32
4000 km 1000 km
A B C
Example:
Solution:
Link AB: T f _ AB =f rame length / RAB =1000/ 100 =10 msec
T prop_ AB =4000 km X 5 sec =20 msec
Link BC: T f _ BC =f rame length / RBC =1000 / RBC
T prop_ BC =1000 km X 5 sec =5 msec
a) aAB =T prop_ AB / T f _ AB =20 / 10 =2
W =3 is equal or less than (2 X aAB +1) =5
Utilization =W/ (2 X aAB +1) =3/ 5 =60%
b) Throughput =100 X 0.6 =60 kb/ s;
Throughput =60 kb/ s / (1000 bit) =60 f rame/ second
c) Throughput f or link BC in f rames/ second =1 / (T f _ BC +2XT prop_ BC)
=1/ (1000/ RBC +2X5X10-3)
=1/ (1000/ RBC +10-2)
For not overfl owing: f rame throughput f or link AB should be less or equal to f rame
throughput f or link BC
60 <=1/ (1000/ RBC +10-2)
1/ 60 >=1000/ RBC +10-2
1/ 60 - 10-2 >=1000/ RBC
RBC >=1000/ (1/ 60 - 10-2) = 150 kb/ s
d) T f _ BC =1000/ 150 kb/ s =6.667 msec
Effi ciency (utilization) of link BC: aBC =T prop_ BC/ T f _ BC =5/ 6.666 =0.75;
Effi ciency =1/ (2a+1) =1/ (2*0.75+1) =40%
33
Framing
• How will the receiving DLC decide on the
frame boundaries?
• How will the two ends of the DLC remain
in sync?
• Three types of framing:
• Character-based framing
• Bit-oriented framing
• Length counts
34
Character-Based Framing
• Utilizes character codes such as ASCII
• A 7-bits code 128 distinct codes
• 96 printable characters (26 upper case letter, 26 lower case
letters, 10 decimal digits, 34 non-alphanumeric characters)
• 32 non-printable character
• Formatting effectors (CR, BS, …)
• Info separators (RS, FS, …)
• Communication control (STX, ETX, …)
• A parity bit may be used
• Special characters:
• SYN – synchronous idle – idle fill between frames when no
data
• STX – start of text
• ETX – end of text
Frame
SY ST Heade ET
SYN Packet CRC SYN SYN
N X r X
35
Character-Based Framing – cont’d
• What happens if an error produces control character in the
header or CRC field?
• If the packet field is an “arbitrary bit string” – it too could
contain character
• ETX – leads to false frame boundary
• Any other character
• Solution to false ETX – transparent mode
• Insert DLE (data link escape) before STX character
• Insert DLE before intentional use of communication control
characters within the frame
• What if DLE itself appears in the binary data field
• Insert another DLE (stuffing) for every appearance of DLE
• Receiving DLC can strip off the first DLE from the arriving
pair
Frame
SY SY ST Heade DL ET
DLE Packet CRC SYN SYN
N N X r E X
36
Bit Oriented Framing
• Frame can be of any length – need not be multiples of 8
• Subject to minimum and maximum
• A flag is used to identify the end of the frame
• Flag = a known bit string (similar to DLE ETX) that
indicates the end of frame
• Bit stuffing – a process to prevent the occurrence of the
flag in the data string
• The flag string is 01111110 or 0160
• 1j notation means a string of j ones
• Bit stuffing:
• Sender rule – insert a 0 after the appearance of five
successive 1s
• Receiver rule – the first 0 after each string of five
consecutive 1’s is deleted
• If the five consecutive 1’s are followed by 1 this is a flag
37
Related Textbook Problem: 2.31 and 2.32
0 0 0 0
1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0
1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 0
1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
38
Other Uses of Bit Stuffing
• Abort capability of standard DLCs
• A frame can be aborted by sending 7 or more 1’s in a
row
• A link is regarded idle if 15 or more 1’s arrive in a
row
• Distinguishing normal vs. abnormal termination
• A 016 followed by a 0 normal termination
• A 016 followed by a 1 abnormal termination
• Bit stuffing guards against 016 pattern in data
40
Overhead Calculations for Bit-
Oriented Framing – cont’d
• The expected number of insertions is the sum of the
expected insertions per position, i.e.
= 2-j+1 + 2-j(K-j+1)
= (K-j+3)2-j
• We have also j+1 bits for the end flag, the expected
overhead is given by
E{OV} = (E{K} – j + 3)2-j + j + 1
• Since E{K} is typically >> j
E{OV} <=E{K}2-j + j + 1
• Minimum overhead occurs at j = log2E{K}
• Where minimum overhead is given by E{OV} <= log 2E{K}
+2
(K-j+1) positions
j-1 i>=j
41
Length Fields
• An alternative to end flags or special characters is to
include a length field
• Length of the length field should be at least log2 Kmax + 1
• Kmax is the maximum frame length
• Similar to the overhead for bit-oriented framing
• Could any other method of encoding frame lengths require
smaller expected number of bits?
• Information theory
• Given any probability assignment P(K) on frame lengths,
then the minimum expected number of bits that can
encode such lengths is at least the entropy of that
distribution, given by
H = Σ P(K) log2 P(K)-1
• Example – let P(K) = 1/Kmax (i.e. all lengths are equally
probable) H = log2 Kmax
• Example – let P(K) = p(1-p)K-1 where p = 1/E{K} H =
log2E{K} + log2e for large E{K}
42
Source Coding for Frame Lengths
• The idea is to
• map more likely values of K into short bit strings
• Map less likely values of K into longer bit strings
• That is: map a given K into log2 P(K)-1 bits
• For geometric distribution of K
• Maximum # of required bits
• The resulting code is called: Unary-binary encoding
• Unary-Binary Encoding:
• For some j, K is written as K = i2j+r (0 r <2j) – that is the number
K is written in terms of i integer multiples of 2 j plus a remainder.
• The encoding is then given by [Code_i,Code_r] – where Code_i is the
binary representation for i while Code_r is the binary representation
for r. Note Code_r is j bits wide, while Code_i can be of any size
depending on i
• Example: K = 7 for j=2 K = 1x22+3 Unary-Binary Encoding is
given by 111 – note Code_i is 1 while Code_r is 11.
• Example: K = 30 for j=2 K = 7x22+2 Unary-Binary Encoding is
11110 – note Code_i =111 while Code_r = 10
• Overhead: K is mapped into a bit string of length K/2j + 1+j, then
the expected overhead is given by E{OV} = E{K}2-j+1+j
• This is the same results of bit-oriented framing
43
Framing With Errors
• All previous framing techniques are
sensitive to errors
• Bit-oriented framing with a flag is the
least sensitive
• If an error happens in a flag – another flag
eventually appears and an erroneous
packet is created
• ARQ handles the problem
• Refer to textbook for partial solutions to
the above problem used in DECNET;
longer CRC; etc.
44
Maximum Frame Size
• Most networks accept variable frame sizes
• Large frame size
• Transmission and processing efficiency
• Small frame size
• Reduced frame errors
• Real-time applications
• Reduce network congestion/load
• Pipelining effect (refer to next slide)
• Fixed frame size
• Simplifies (speeds) network hardware
• E.g. ATM – cells are 53 bytes
45
Pipelining is
Packet
Transmission
46
Optimal Frame Size
• Assume:
• Each frame contains a fixed no of bits, V, as
overhead
• Maximum length of packet = Kmax
• Message length = M
• No of required frames = M/Kmax
• Each of the first M/Kmax are of length equal to
Kmax
• The last packet contains less than Kmax bits
• Total bits in frames
total bits = M + M/Kmax V
• For very long M, the fraction of V/(V+Kmax) is
the overhead
• Considering overhead and processing – it is of
interest to have a large Kmax less overhead
and number of segments (less processing)
47
Optimal Frame Size – with
Pipelining
• Assume:
• A packet must be received completely before a node can transmit
it
• Packets must be transmitted over j equal-capacity links – equal to C
bps
• No queuing at nodes (lightly loaded)
• No errors on links
• M≥Kmax
• Message length is uniformly distributed
• The total time, T, is the time for first packet to travel over the first
j-1 links plus the time it takes the entire message to travel over
the last link
• The number of message bit transmission times, TC is given by
TC = (Kmax + V)(j-1) + M + M/Kmax V
• Taking the expectation
E{TC} ≈ (Kmax + V)(j-1)+E{M}+E{M}V/Kmax + V/2
• Optimal packet size, Kmax, that minimizes TC is given by
Kmax ≈ √(E{M}V/(j-1))
• Trade-offs:
• For large V, optimal (i.e. for small E{TC}) Kmax should be large
• For large number of links, Kmax should be small for small E{TC} 48
High-Level Data Link Control
Protocol (HDLC)
• One of the most important data link control
protocols
• Basic Characteristics:
• Primary Station: issues commands
• Secondary Station: issues responses –
operates under the control of a primary station
• Combined Station: issues commands and
responses
• Two link configurations are defined:
• Unbalanced: one primary plus one or more
secondary
• Balanced: two combined (functions as primary
and/or secondary) stations
49
High-Level Data Link Control
Protocol (HDLC) (2)
• Three transfer modes are defined:
• Normal Response Mode (NRM) – used in
unbalanced conf.; secondary may only tx data
in response to a command from primary
• Asynchronous Balanced Mode (ABM) – used in
balanced conf.; either combined station may
tx data without receiving permission from
other station
• Asynchronous Response Mode (ARM) – used
in unbalanced conf.; Secondary may initiate
data tx without explicit permission; primary
still retains line control (initialization, error
recovery, …)
• Animation for HDLC
50
HDLC - Applications
• NRM:
• Point-multi-point (multi-drop line): one
computer (primary) polls multiple terminals
(secondary stations)
• Point-to-point: computer and a peripheral
• ABM: most widely used (no polling
involved)
• Full duplex point-to-point
• ARM: rarely used
51
HDLC – Frame Structure – Flag
Field
53
HDLC – Frame Structure -Control
Field
55
HDLC – Frame Structure –
Information/FCS Fields
• Information field:
• Present ONLY in I-frames and some U-frames
• Contains integer number of octets
• Length is variable – up to some system defined
maximum
• FCS field:
• Error detecting code
• Calculated from ALL remaining bits in frame
• Normally 16 bits (CRC-CCITT polynomial =
X16+X12+X5+1)
• 32-bit optional FCS
56
HDLC Operation
• Initialization
• One side signals to the other the need for initialization
• Specifies which of the three modes to use: NRM, ABM, or
ARM
• Specifies 3- or 7-bit sequence numbers
• The other side can accept by sending unnumbered
acknowledgment (UA)
• The other side can reject by sending - A disconnected mode
(DM) frame is sent
• Data Transfer
• Exchange of I-frames: data and can perform flow/error
control
• S-frames can be used as well: RR, RNR, REJ, or SREJ
• Disconnect
• DISC frame UA 57
HDLC – Operation
a) Link Setup &
Disconnect:
• SABM command –
starts timer
• B responds with UA
(or DM if not
interested)
• A receives UA and
initializes its
variables
• To disconnect: issue
DISC command
b)Two-Way Data
Exchange:
• Full-duplex
exchange of I-
frames
c) Busy Condition:
• Note the use of the
P and F bits
58
HDLC – Operation (2)
a)Reject Recovery:
• I-frame 4 was lost
• B receives I-frame 5 (out of
order) – responds with REJ 4
• A resend I-frame 4 and all
subsequent frames (Go-
back-N)
b)Timeout Recovery:
• A sends I-frame 3 – but it is
lost
• Timer expires before
acknowledgement arrives
• A polls Node B
• B responds indicating it is
still waiting for frame 3 – B
set the F bit because this a
response to A’s solicitation
59
Other Data Link Control Protocols
62
Other Data Link
Control Protocols
(4)
• Frame
Formats
63
Point-2-Point Protocol at the
Network Layer
• Network layer main functions:
• routing and flow control
• Other functions involving pairs of
nodes
• Transfer of packets between adjacent
nodes or sites
• You need to distinguish packets of one
session from another
• The following material describes:
1. Addressing and Session identification
2. Packet numbering in relation to control
and error control
3. X.25 network layer
64
Session Identification and
Addressing
• A received packet by a router must contain
information to allow correct forwarding
• Solution: let packets contain explicit addresses for
source and destination sites and additional
identification numbers to indicate the session within
each site
• Very general, but
• Problem: lots of overhead
• Use virtual circuits
• A virtual circuit identifies a path (a way) through the
network at a given time
• A link may carry more than one virtual circuit (or
sessions)
• Use of virtual circuit identifier
• Usually encoded in binary
• There is a maximum number of VCs per link
• Other methods of identification exist – to be
discussed later
65
Session Identification and
Addressing - Example
• Path for a session:
358
• Uses virtual
channel # 13 on
link (3, 5)
• Uses virtual
channel # 7 on line
(5, 8)
• Node 8 will map VC
# 7 to the external
access link
destination
• Each link has its
own set of virtual
channels
• No coordination
needed to assign a
VC
• Each packet needs
to contain virtual
channel ID
66
Does a network utilizing VC have ordered delivery always? How?
Packet Numbering
• Datagram network – Problems
• Packets may arrive out of order
• Some packets may be lost
• Some packets may be arbitrarily delayed
• Solution – use packet sequence numbers – modulo 2k
numbers
• k-bit sequence number placed in the packet header – if the
network layer at the source and destination have the
responsibility of re-ordering and retransmission
• In IP networks – the sequence number is placed in the
transport layer header since reordering and retransmission is
done at the transport layer
• Error events helped by sequence numbers:
• Channel errors that lead to a frame that still satisfied CRC
• If some nodes do not check CRC at DLC
• If a link on the session fails how many packets were
successfully received? Which ones to retransmit?
• If a node fails stored packets are lost? Which ones to
retransmit?
Need error recovery at Network OR Transport layer
67
Error Recovery at Network or
Transport Layer
• Very similar to ARQ at the DLC
• Uses modulo m = 2k at the source site as SN
• Destination site sends ACK containing RN equal
(mod m) to the lowest-numbered yet-unreceived
packet in the session
• Can be go-back-N or selective-reject
• Some differences exist
• End-to-end recovery involving two sites (source
and destination) and the subnet in between – For
DLC two nodes with the link in between are
involved only.
• Sequence numbers: for end-to-end, the numbering
is done per session; i.e. only packets or messages
belonging to one session – For DLC all packets
crossing the link are numbered sequentially.
• Order: packets of one session may be out of order
for network layer for example – For DLC all
transmissions are in order and will be ordered at
the other end of the link
68
Error Recovery at Network or
Transport Layer – cont’d
• At Transport Layer check sum is used
• Supplementary to CRC
• E.g. TCP uses 16-bit long – 1’s
complement of the 1’s complement sum
of the 16 bit words making up the packet
• Easy to compute in software
• At Network Layer
• Again check sum could also be used
• Since parts of the header do change (i.e.
VC numbers), compute check sum over
data part only or include the source and
destination addresses
69
Flow Control
• Is achieved by the ARQ schemes described earlier
• With a window of size n, at most n packets can be in
transmit
• HDLC utilizes RNR frames to stop the transmitter
• Flow control and congestion
• Allow the window size to adapt to network congestion
(e.g. TCP window)
• Delayed ACKs
• Difficult to distinguish between an intentionally
delayed ACK and that because of congestion
• Rather than delaying ACKs (confuses the Sender) use
permits
• Permit – allow receiver to change the window with
each ACK
• Sends two numbers RN and j – meaning the
transmitter can send packets from number RN to RN
+ j – 1 inclusive
• Used in X.25 network
70
Should Error Recovery Be AT
Transport Layer or Network Layer?
• The natural place is at the Transport layer
• Examples: TCP and TP4 (ISO transport layer)
• Larger number of interconnected networks
that DO NOT provide reliable service
• Major disadvantage – transport can not
distinguish between ACKs that are slow
because of network congestion and those
that will never arrive (may be lost)
• Serious problem for TCP over wireless links
• Slowed or lost acks lead to more
retransmissions more congestion
slower and more losses more congestion
…
• The key is to make the networks more
reliable (somehow) and ask little error-
recovery of transport!
71
The X.25 Network Layer Standard
• Developed by CCITT to provide standard interface between
external sites and subnet nodes
• Utilizes X.21 as physical layer and LAPB (a variant of HDLC) as
DLC
• Packet structure (as shown) – significant of Q, D, M, and C bits
• Utilizes end-to-end VC
• Designed for low 64kb/s links
• Error control and flow control are provided both at data link and
network layers
• Provides per-hop control
• Flow control – using “permits”
• Error control – using LAPB
• Virtual circuit establishments
• Call-request / call-accept packets
• Session setup
• Can be used to encapsulate IP datagrams!
1 2 3 4 5 6 7 8
Q D Modulus Virtual channel Byte 1
Virtual channel Byte 2
RN M SN C Byte 3
72
The Internet Protocol
• See material on 2.8.4
• Figure 2.51 (Encapsulation and
Layering concept)
• The Internet protocol is the
subject of the last third of the
course (Kurose’s book)
73
The Transport Layer
• Main functions
• Two examples
• TCP/IP suite
• ISO – classes of TPs: class0, class1,
…, class4
• The TCP layer will be covered in
details later in the course
74
Asynchronous Transfer Mode
(ATM)
• 1990’s vision: Broadband Integrated Digital
Services (B-ISDN)
• ATM is the network layer
• Provides speeds from 155-622 Mb/s
• A slimmer version, ISDN, existed
• Provides INTEGRATED end-to-end voice, video
and data communications on one network
• Main characteristics:
• Provides degrees of QoS requirement – not
available in IP
• Facilitates digital telephony – 64kb/s circuits
• Utilizes cell (packet) switching – short 53 bytes
long packets
• Can provide very high transport speeds for
applications requiring extreme bandwidths such as
high-resolution image/video, high-speed LAN
connections, etc.
75
ATM Characteristics
• STM versus ATM
• ATM can provide STM-like services through its adaptation layer
• See textbook discussion on pages 130 and 131
• ATM is suitable for bursty traffic
• Intended to operate over optical fibers – i.e. reliable links
• Cell structure
• Header – 5 bytes – fixed length/structure to allow high speed switching
• Payload – 48 bytes
• Error detection/correction for header only
• Note GFC is only present at the user-network interface (UNI)!
79
Class 3 – Connection Oriented
Traffic
• To facilitate establishing connection oriented
services
• Reordering – Segment type bits and sequence numbers
• Trailer containing length and CRC
Header (H):
Segment type (2 bits)
Sequence no (4 bits)
Reserved (10 bits)
Trailer (T):
Length (6 bits)
CRC (10 bits)
80
Class 4 – Connectionless Traffic
81
Congestion Control
• Three mechanism supported
• User and network agree on required bit
rate at call setup
• Mainly for class 1
• Hard (not used) for class 2 and class 3
• Can not be used for class 4
• Adaptation layer does traffic policing and
shaping – monitors user traffic
• E.g. leaky bucket method
• Excess traffic may be discarded or marked
as low priority traffic
• The priority bit (CLP) in the ATM cell
header
82