This chapter explores the responsibilities of the link layer in transferring data between nodes, focusing on error control and flow control. The link layer is responsible for framing, addressing, flow control, and error control. Error control methods include parity checking, internet checksum, and cyclic redundancy check. Flow control techniques include stop-and-wait and sliding window. The chapter also covers different types of framing and various error control schemes such as stop-and-wait arq, go-back-n arq, and selective repeat arq.
Download Link Layer and Local Area Networks: Error Control and Flow Control and more Lecture notes Data Communication Systems and Computer Networks in PDF only on Docsity!
Chapter 7 – The Link Layer and
Local Area Networks
1. Introduction
(^) Transferring from one node to adjacent node over a link
(^) Two different types of link-layer channels and protocols
(^) Point-to-point - no need for coordinating access protocols
(^) e.g. router-to-router, dial-up connection b/n modem and local ISP
(^) Broadcast channels – many hosts to a channel, coordinating access protocol required - (^) E.g. wired and wireless LANs, satellite networks
(^) Responsibilities of link layer include:
(^) framing
(^) addressing
(^) flow control
(^) error control, and
(^) media access control
(^) Two sublayers:
(^) LLC (Logical Link Control) – responsible for error and flow control
(^) MAC (Media Access Control) – responsible for multiple access resolution
Parity Checking
(^) In single parity check:
(^) d bits of data plus 1 parity bit (total d+1 bits) are sent
(^) Number of 1’s in the d+1 bits is even (even parity) or odd (odd parity)
(^) At the receiver, the number of 1’s in the d+1 bit data should be even (even parity) or odd (odd parity). Else, error in data.
(^) Any odd number but not even of bit errors can be detected
(^) Cannot correct errors
(^) In 2-D parity check:
(^) Data arranged in 2-D
(^) Parity bits added to each row and column
(^) At the receiver, parities are checked
(^) Can detect and correct single parity errors
(^) Can also detect (but not correct) any combination of two errors in a packet
Internet Checksum
(^) d bits of data are broken down into 16-bit integers and summed.
(^) The 1’s complement of the sum is carried as a checksum value in the segment header.
(^) The receiver computes the checksum of the received segment, including the checksum and then takes its 1’s complement.
(^) If any of the bits are 0, it indicates an error.
(^) Internet checksum requires relatively little packet overhead. However, it also provides relatively weak protection against errors compared with the cyclic redundancy check (CRC).
Cyclic Redundancy Check (Cont’d)
(^) Example
Suppose D = 101110, G = 1001 and r = 3. From the
expression above, R is calculated as. Thus:
7.3 – Data Link Control
(^) Data bits at the data link layer are framed into discernible
blocks of information.
(^) Frames have headers that contain information such as error-
checking codes.
(^) Ethernet, token ring, frame relay, and other data link layer
technologies have their own frame structures
(^) There exist three different types of framing:
(^) Byte-oriented framing – differentiates one byte from another. It is an older style of framing that was used in the terminal/mainframe environment.
(^) Bit-oriented framing allows the sender to transmit a long string of bits at one time. It is used by most LANs (e.g. Ethernet has max. frame size of 1526 bytes).
(^) Clock-based framing uses a series of repetitive pulses to maintain a constant bit rate and keep the digital bits aligned in the data stream
Flow Control (Cont’d)
Flow Control (Cont’d)
Error Control (Cont’d)
(^) Stop-and-Wait ARQ
(^) frames have 1-bit sequence numbers (SN =0 or 1)
(^) Receiver sends an ACK (1-SN) if frame SNis correctly received
(^) Sender waits for an ACK (1-SN) beforetransmitting the next frame with sequencenumber 1-SN
(^) If sender does not receive anything beforea timeout value expires, it retransmitsframe SN
Error Control (Cont’d)
(^) Go-Back-N ARQ
(^) uses the sliding window flow controlprotocol. If no errors occur the operationsare identical to the Sliding Window. Iferrors occur, its operations are asdescribed below: - (^) A station may send multiple frames as allowed by
the window size
(^) Receiver sends a NAK i if frame i is in error. After
that, the receiver discards all incoming frames until
the frame in error was correctly retransmitted
(^) If sender receives a NAK i it will retransmit frame i
and all packets i+1, i+2,... which have been sent,