Upload
vandieu
View
217
Download
0
Embed Size (px)
Citation preview
HDLC - 1 www.comnets.uni-bremen.de
Data Link Layer (cont.) (Sicherungsschicht)
Chapter 5 (part 2) [Wa0001 ]
Dr.-Ing. Koojana Kuladinithi (koo) (comnets.uni-bremen.de)
HDLC - 2 www.comnets.uni-bremen.de
LOGICAL LINK CONTROL
MEDIUM ACCESS CONTROL
PHYSICAL SIGNALING
PHYSICAL MEDIA ATTACHMENT
MEDIUM
DATA LINK LAYER
PHYSICAL LAYER
ACCESS UNIT INTERFACE
OSI-model for local networks with partitioning of the link layer in media access control and logical link control, as defined by IEEE 802.
HDLC - 3 www.comnets.uni-bremen.de
Bit-Oriented Protocols: HDLC – High Level Data Link Control
Low overhead Bit streams are transmitted without breaking it into
characters. Bit streams that are not integral multiples of character
lengths can be transmitted. Subsets:
High Level Data Link Control (ISO standard): HDLC Synchronous DLC: SDLC HDLC Subsets: CCITT's Link Access Protocol - Balanced (LAP-B) Link Access Protocol for the ISDN D-channel (LAP-D) Link Access Protocol for Modems (LAP-M)
HDLC - 4 www.comnets.uni-bremen.de
HDLC Stations
Two types of Stations Primary Secondary
Types of Commands Commands: sent from primary to secondary Responses: sent from secondary to primary
Only one primary can be active at any given time, while multiple secondaries can be active simultaneously
HDLC - 5 www.comnets.uni-bremen.de
HDLC Link Structures Unbalanced point-to-point link
One primary, one secondary
Unbalanced multi-point link One primary, multiple secondaries
secondary station A
secondary station B
primary station
"
One-way controlled channel commands
answers
HDLC - 6 www.comnets.uni-bremen.de
HDLC Link Structures (cont.)
Balanced point-to-point link Both stations have primary/secondary status. While one
station is transmitting, the other has to be a secondary.
primary station A
secondary station A
secondary station B
primary station B
symmetric channel
answers commands
answers commands
combined station
combined station
both-way controlled channel commands
answers
HDLC - 7 www.comnets.uni-bremen.de
HDLC Modes of Operation
Normal Response Mode (NRM) Used in unbalanced configurations In this unbalanced mode, secondaries can transmit
only when instructed by the primary station The link may be point-to-point or multi-point
primary station
secondary station
secondary station
primary station
1) Poll-command 2) information 3) receipt
1) select-command plus information 2) receipt
HDLC - 8 www.comnets.uni-bremen.de
HDLC Modes of Operation (cont.)
Asynchronous Response Mode (ARM) Used in unbalanced configurations. A secondary can transmit without being polled by the
primary. Used in point-to-point configurations and duplex links.
secondary station
primary station
answer command
HDLC - 9 www.comnets.uni-bremen.de
HDLC Modes of Operation (cont.) Asynchronous Balanced Mode (ABM)
Used in balanced configurations where all stations are "equal" Duplex point-to-point links
combined station
combined station
combined station
combined station
1) command 2) answer
1) command 2) answer
HDLC - 10 www.comnets.uni-bremen.de
closing flag 8 bits 01111110
frame check field 16 or 32 bits
information field variable
control field 8 or 16 bits
address field 8 x n bits (n = 1 to k)
opening flag 8 bits 01111110
F FCS I C A F
frame
span of frame check and zero insertion
HDLC Frame Format
HDLC - 11 www.comnets.uni-bremen.de
HDLC Frame Fields Flag Field
Start and End Flag pattern (01111110) Zero insertion required for data transparency
Address Field Contains the address of the secondary station Broadcast address (All 1's) Extended address option that can make the address as long as
necessary (in increments of 8 bits) The last extended address octet starts with a 1,
while the previous octets start with 0 Control Field
Identifies frame types Contains Send and Receive sequence numbers
Information Arbitrary length, arbitrary bit streams
FCS 16-bit CRC (CCITT-16) FCS calculated for Address-Information fields
without the inserted zeros (for data transparency)
HDLC - 12 www.comnets.uni-bremen.de
8 7 6 5 4 3 2 1
Address may be that of a secondary/combined station.
Global (all 1’s) or Null ( all 0’s)
8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1
Extended Address Field – 1 or more Octets
LSB transmitted first
LSB transmitted first
(LSB : Least Significant Bit)
Basic Address Field – 1 Octet
0 1 0 . . . Extend Address to next Octet Terminate
Address Field
HDLC - 13 www.comnets.uni-bremen.de
HDLC Frame Types Information Frames
Carry data In duplex links, can use piggy-backed acknowledgements Identified by a 0 in the first bit of the control field
Supervisory Frames Used for error and flow control Uses CRC-CCITT Contain sequence numbers Identified by a 10 in the first two bits of the control field
Unnumbered Frames Used for connection establishment and disconnection No acknowledgements Identified by a 11 in the first two bits of the control field
HDLC - 14 www.comnets.uni-bremen.de
0 SN P/F RN
1 Type P/F RN
1 Type P/F Type
0
1
Bits: 1 2 3 4 5 6 7 8
Information
Supervisory
Unnumbered
HDLC Control Field
HDLC - 15 www.comnets.uni-bremen.de
8 7 6 5 4 3 2 1
LSB TRANSMITTED FIRST
INFORMATION
SUPERVISORY
UNNUMBERED
N(R)
N(R) P/F
P/F
N(S) 0
SS 0 1
MMM P/F MM 1 1
COMMENTS N(R) = RECEIVE SEQUENCE COUNT = 0 TO 7 N(S) = SEND SEQUENCE COUNT = 0 TO 7
SS specifies RR, RNR, REJ, SREJ
MMM and MM specify the U command response P/F = POLL for command, F for response
BASIC CONTROL FIELD – 1 OCTET
EXTENDED CONTROL FIELD – 2 OCTETS 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
INFORMATION
SUPERVISORY
UNNUMBERED
N(R)
N(R)
P/F
P/F
P/F 0 0 0 0 0 0 0
N(S) 0
0 0 0 0 SS 0 1
MMM 0 MM 1 1
HDLC - 16 www.comnets.uni-bremen.de
A N(S) = 3 N(R) = 5
I 3.5 P = 1 B N(R) = 3 RNR3
RR5
F = 1
P = 1
F = 1
P = 1
RNR3
RR5
RR3
?
?
A N(S) = 1 N(R) = 5
N(S) = 2 N(R) = 5
a)
b)
I 1.5
I 2.5
REJ1
I 1.5
I 2.5
FCS ERROR
HDLC - 17 www.comnets.uni-bremen.de
The Poll/Final bit Depends on whether the transmission is from the
primary or secondary If the frame is from a primary,
the P/F bit is interpreted as the Poll bit If the frame is from a secondary,
the P/F bit is interpreted as the Final bit, indicating the end of a sequence of frames
A primary cannot send another poll to a specific secondary, until it has received the final frame
HDLC - 18 www.comnets.uni-bremen.de
Supervisory Frames Used for positive/negative acknowledgements. 2 S bits in the control byte identifying
4 kinds of supervisory frames: Receive Ready (RR) Receive Not Ready (RNR) Reject (REJ) Selective Reject (SREJ)
RR Frame Used for acknowledging correctly received frames All frames with numbers less than N(R) have been received Also indicates that the receiver is ready to receive frames
RNR Frame Used to indicate that the receiver is temporarily not ready May be used for flow control as a
Wait-Acknowledgement (WACK) If a data frame is acknowledged by a WACK, the transmitter
cannot send any more frames, until it receives an ACK to the transmitter's ENQ
HDLC - 19 www.comnets.uni-bremen.de
Supervisory REJ & SREJ Frames Both REJ and SREJ act as positive acknowledgements
for all frames below number N(R) Frames with bad FCS are not necessarily rejected,
but ignored REJ Frame
Used as a negative acknowledgement The frame numbered N(R)
and all frames after N(R) are to be retransmitted Go-Back-N ARQ operation
SREJ Frame Used as a NAK for frame numbered N(R) Retransmission requested only for that frame Selective Repeat ARQ operation
HDLC - 20 www.comnets.uni-bremen.de
Unnumbered Frames Used for maintenance purposes
Link start-up and shut-down Set operational modes
No frame sequence numbers 5 Management bits in the control frame identify
32 different commands/responses X bits in the extended control field
are reserved (set to 0)
HDLC - 21 www.comnets.uni-bremen.de
Unnumbered Commands and Responses Commands
Set Asynchronous Response Mode (SARM) Set Asynchronous Response Mode Extended (SARME) Set Normal Response Mode (SNRM) Set Normal Response Mode Extended (SNRME) Set Asynchronous Balanced Mode (SABM) Set Asynchronous Balanced Mode Extended (SABME) Reset (RSET) Frame Reject (FRMR) Disconnect (DISC)
Responses Unnumbered Acknowledgement (UA) Command Reject (CMDR) Frame Reject (FRMR) Disconnect Mode (DM)
HDLC - 22 www.comnets.uni-bremen.de
Link Access Procedure Balanced (LAP-B) Used to connect a computer to the data network,
example: X.25 Balanced Mode, Connection-oriented,
Point-to-point duplex links SABM and SABME are the only two SET-commands allowed Addressing: DCE to DTE or DTE to DCE
HDLC - 23 www.comnets.uni-bremen.de
disconnect response
data indicate data
response
protocol actions
System A interaction between
System B interaction between
network layer
data link layer
signals on the channel
between A and B
data link layer
network layer
connect request
connect confirm data request
data confirm disconnect
request
disconnect confirm
SABM
UA
information frame(s)
acknowledge frame(s) DISC
connect indicate connect response
disconnect indicate UA
Example: Bit oriented protocol (HDLC)
HDLC - 24 www.comnets.uni-bremen.de
DLCA DLCB
B (1,1)
B (2,2)
B (3,3)
B (2,4)
A (1,1)
A (2,1) A demands erroneous
packet once more REJ (1)
RR (3)
B initializes data transmission SABM
UA A confirms
A (0,0) A sends data
RR (2) A has no data left to send
RR (4)
DM A confirms end of connection
Reliable data transmission with HDLC
B (0,0) B receives UA and sends data
A (3,1) B (1,3) B repeats starting with packet 1
B (3,4) B has no data left to send
DISC B demands end of connection
Formats: Sender (SN, RN), message (RN) Meaning of message: SABM Set Asynchronous Balanced Mode UA Unnumbered Acknowledge REJ Reject RR Receive Ready DISC Disconnect DM Disconnect Mode
Go-Back-N ARQ
HDLC - 25 www.comnets.uni-bremen.de
Logical Link Control (LLC) HDLC subset used with LANs Data link layer in LANs consists
of two sublayers Logical Link Control (LLC) sublayer Medium Access Control (MAC) sublayer
LLC supports connection-oriented and connectionless services.
HDLC - 26 www.comnets.uni-bremen.de
Limitations of HDLC
Too many options Communicating HDLC devices
will need to have the same options Only a single address field works fine with a single primary station HDLC came before OSI (layering is not totally aligned) Flags may have errors and synchronization may be lost Only one FCS for the entire frame NAKs are not sent immediately causing a lower
transmission efficiency under high error rate situations
HDLC - 27 www.comnets.uni-bremen.de
Example protocol: PPP PPP is a form of HDLC, which is commonly used today When you dial up using your modem and connect your PC
to your ISP's router/remote access server, the data link layer protocol run on the link is PPP
PPP uses the ABM mode of HDLC and provides a connectionless unacknowledged service
Since it is ABM, multipoint is not used; this means the address byte does not change. It is set to all 1's. This means all stations accept the frame. But since PPP has only two nodes, one node accepts any frame sent from the other node.
Since it is unacknowledged, no supervisory frames are sent. So the control field is always 0000 0011. First two bits are ’11’ to represent unnumbered frames. Unnumbered frames must be allowed to carry data in addition to carrying SABM (Set ABM mode - open connection), SABME (E: Extended - control field is 16 bits and sequence numbers are 7 bits), unnumbered acks, etc. There are no "numbers" meaning no sequence numbers. The M bits of 0 must indicate a data type of the unnumbered frame. In PPP the header control field is shown as 0000 0011.
PPP has one additional field over HDLC - it has a protocol type field to indicate what the type of higher layer protocols carried in the PPP frame.
Also, PPP is byte-oriented, unlike HDLC, which is bit-oriented; therefore bit stuffing is not used when the flag pattern appears in the payload; instead an escape character is used.
HDLC - 28
Example protocol: PPP (cont..)
www.comnets.uni-bremen.de
HDLC - 29 www.comnets.uni-bremen.de
Assumptions: Symmetric bit errors: equal probability of 0 1, 1 0 errors Independence assumption
Bit error probability p Probability of correct bit transmission? Block of n bits (frame/packet) is corrupted,
if one or more bits are corrupted, p(n) also known as PER
Calculation of Error Probabilities
P [i specific bits corrupted] =
P [i bits corrupted] = pi =
1 - p
ini pp −− )1(
ini ppin −−
)1(
HDLC - 30 www.comnets.uni-bremen.de
Calculation of Error Probabilities (cont.)
p(n) = P [≥ 1 bit corrupted] =
Probability that a block of n bits arrived with no errors,
p0 = P [0 bit corrupted] = correct transmission
p(n) =
Approximation for small values of p:
∑=
n
iip
1
npp )1(11 0 −−=−
1)1(1)1(1 <<=−−≈−− pnpnpp n
np)1( −
HDLC - 31 www.comnets.uni-bremen.de
Calculation of Error Probabilities (cont.)
Size of a packet F = 500 bytes Bit error probability P = 10-6 Compute the probability of PER, p(n) ? How many packets (frames) will be corrupted
at 100 kbps?
HDLC - 32 www.comnets.uni-bremen.de
Calculation of Error Probabilities (cont.)
Size of a frame F = 500 bytes (4000 bits) Bit error probability P = 10-6 P(0)= (1- 10-6)4000 = 0.9960 P(n)= 1-(1- 10-6) 4000 = 0.0040 4 out of every 1000 packets (frames) have
errors At 100 kbps, this means 6 packets (frames)
per minute are in error
HDLC - 33 www.comnets.uni-bremen.de
Error Handling Methods ARQ: Automatic Repeat Request
3 Schemes Stop-and-Wait Go Back N Selective Reject
Packets contain sequence number NS Correctly received packet: Receiver sends positive Acknowledgement ACK[NS] Erroneous packet: Receiver sends negative Acknowledgement NAK[NS] Sender must keep copy of packet until an ACK is received Error Detection with FCS, e.g. CRC (Cyclic Redundancy Check)
Checking Frame Sequence
HDLC - 34 www.comnets.uni-bremen.de
time of transmission
sending window
receiving window
5 5 6
5 5 6
Round-Trip-Delay
Stop-and-Wait Automatic Repeat Request
Sequence: Packet, Acknowledgement, Packet, Ackknowledgement, ...
HDLC - 35 www.comnets.uni-bremen.de
Throughput
Throughput (Durchsatz): the amount of work that can be performed by a computer system or component in a given period of time [IEEE 90]. [IEEE 90] Institute of Electrical and Electronics Engineers. IEEE Standard Computer Dictionary: A Compilation of IEEE Standard Computer Glossaries. New York, NY: 1990.
Throughput: The amount of data transferred from one place to another or processed in a specified amount of time. Data transfer rates for disk drives and networks are measured in terms of throughput. Typically, throughputs are measured in kbps, Mbps and Gbps.
Often S (English) or D (German) is used as an abbreviation for throughput.
HDLC - 36 www.comnets.uni-bremen.de
Throughput (cont.) However, there is no standard, universally recognized definition of throughput and it is important to understand the definition of throughput that is being used in each situation. The throughput is often given in normalized form; that is, it is the rate at which user data is carried over the channel divided by the channel capacity. Sometimes this is referred to as normalized throughput, but often it is not. Another way of describing normalized throughput: portion of time used for transmitting “useful” information. Sometimes this is also called “goodput”.
HDLC - 37 www.comnets.uni-bremen.de
Stop-and-Wait-ARQ
Formula? n: packet length in bits PER: Packet Error probability c: round trip delay (sec), delay between the end of the last packet and the start of the
next one v: transmission speed in bit/sec Throughput? Low, especially for small packets and long propagation delays!
e.g. not suitable for satellite links
vcnPERnD*
)1(*+−
=
HDLC - 38 www.comnets.uni-bremen.de
Normalized Throughput = Useful load of the channel (portion of time used for the transmission of information over
some time T) ndata: packet length in bits nack: ACK lenghth in bits v: transmission speed in bit/sec tn: change over time /processing time td: Propagation delay Transmission delay vs Propagation delay ?
HDLC - 39 www.comnets.uni-bremen.de
HDLC - 40 www.comnets.uni-bremen.de
HDLC - 41 www.comnets.uni-bremen.de
Error Handling Methods ARQ: Automatic Repeat Request
Go-Back-N-ARQ Continuous data flow is possible Data is sent until a NAK[NSe] is received Sender restarts sending beginning with packet NSe
Receiver ignores all packets until packet NSe
Sufficient buffer space is needed A positive acknowledgement ACK[NS] acknowledges all
packets up to packet NS
HDLC - 42 www.comnets.uni-bremen.de
transmission time
sending window
receiving window
4 5 6 7 8 9 5 6 7 8 9
4 5 5 6
Round-Trip-Delay
for packet 5
Go-Back-N- Automatic Repeat Request
HDLC - 43 www.comnets.uni-bremen.de
Throughput? Formula? n: packet length in bits PER: Packet Error Rate c: round trip delay, delay between end of last
packet and the start of next one v: transmission speed in bit/sec
Go-Back-N-ARQ
Higher, because data can be sent continuously
vcPERnPERnD
**)1(*
+−
=
HDLC - 44 www.comnets.uni-bremen.de
HDLC - 45 www.comnets.uni-bremen.de
HDLC - 46 www.comnets.uni-bremen.de
Error Handling Methods ARQ: Automatic Repeat Request
Selective Reject Data can be sent continuously All correctly received packets are acknowledged
and if necessary buffered Erroneous packets are selectively requested by NAKs Buffering is needed to guarantee the right sequence of
packets to higher layers
HDLC - 47 www.comnets.uni-bremen.de
transmission time
sending window
receiving window
4 5 6 7 8 9 5 10 11 8 12
4 5 6 7 8 9 5 10 11
Round-Trip-Delay
Selective-Reject- Automatic Repeat Request
HDLC - 48 www.comnets.uni-bremen.de
Selective-Reject-ARQ
Throughput? Formula? n: packet length in bits PER: Packet Error probability c: round trip delay, delay between end of last
packet and the start of the next one v: transmission speed in bit/sec
Highest possible throughput, because data can be sent continuously and only erroneous packets have to be retransmitted
PERD −=1
HDLC - 49 www.comnets.uni-bremen.de
HDLC - 50 www.comnets.uni-bremen.de
ARQ methods
Sender Buffer
Receiver Buffer
Stop & Wait ARQ
1 PDU
1 PDU
Go-Back-N ARQ
W PDUs
1 PDU
Selective Reject ARQ
W PDUs
W PDUs
HDLC - 51 www.comnets.uni-bremen.de
PACKET ERROR RATE vs THROUGHPUT
HDLC - 52 www.comnets.uni-bremen.de
ROUND TRIP DELAY vs THROUGHPUT
HDLC - 53 www.comnets.uni-bremen.de
TRANSMISSION SPEED vs THROUGHPUT
HDLC - 54 www.comnets.uni-bremen.de
Comparison FEC and ARQ
ARQ: Automatic Repeat Request Pros:
• High throughput for good channel quality • Guarantee for very low rest bit error rate • No complex decoding
Cons: • Return channel necessary • Throughput fluctuates with the channel quality • Varying delay, not suitable for real time applications • Additional buffers in sender and receiver necessary
FEC: Forward Error Correction Pros:
• No return channel necessary • Constant throughput independent of channel quality • Constant delay between sender and receiver
Cons: • Low Throughput because of high redundancy • Rest bit error rate depends on channel quality • Coding and Decoding algorithms highly complex
HDLC - 55 www.comnets.uni-bremen.de
no
yes error
cluster b1 cluster b2
bit timing
definition of a cluster error
Error Clusters
Errors are usually not independent Errors are correlated Clusters are one possible description