Download presentation
Presentation is loading. Please wait.
1
1 K. Salah Module 4.0: Data Link Layer The Logical Link Control (LLC) sublayer –Framing –Flow Control –Error Control The Media Access Control (MAC) sublayer –Random Access (CSMA) –Token Passing Ch 10- 11
2
2 K. Salah LLC Framing Framing is partitioning a bit stream into discrete units or blocks of data. To distinguish between same bit pattern of real user data and the start-stop, bit stuffing is employed. –E.g., stuff a bit after every 5 th consecutive ones.
3
3 K. Salah Ethernet/802.3 Frame Preamble is for synchronization Source and destination are 48 bits each and have the MAC address, e.g, 08:00:20:01:D6:2A. The left 3 bytes are vendor specific, and the others are serial number of device assigned by Sun. 00:00:0C is CISCO. This MAC address is different than the IP address !!!
4
4 K. Salah LLC Flow Control Flow Control is the process that controls the rate at which data is exchanged between two nodes. It involves a feedback mechanism. –Ensuring the sending entity does not overwhelm the receiving entity, and thus preventing buffer overflow. Transmission time: Time taken to emit all bits into medium Propagation time: Time for a bit to traverse the link Two Protocols: –Stop-and-Wait –Sliding Window
5
5 K. Salah Stop-and-Wait Source transmits frame Destination receives frame and replies with acknowledgement Source waits for ACK before sending next frame Destination can stop flow by not send ACK Works well for a few large frames Only one frame at a time can be in transit. Providing multiple ACKs for one big message is inadequate.
6
6 K. Salah Sliding Window Allow multiple frames to be in transit Receiver has buffer W long Transmitter can send up to W frames without ACK Each frame is numbered Sequence number bounded by size of field (k) –Frames are numbered modulo 2 k
7
7 K. Salah
8
8 Sliding Window Comments If the maximum window size is one, then we have stop-and-wait protocol. If duplex, use piggybacking –Attach ACK with data frames. –If no data to send, use acknowledgement frame –If data but no acknowledgement to send, send last acknowledgement number again.
9
9 K. Salah LLC Error Control Error correction implies error detection. –Parity bits –CRC Two forms of error correction: –Autonomous error correction (e.g. CRC) Transmitted frame contains redundancy bits (or check bits) correct bit errors without retransmission. Using parity bits Using Hamming code Expensive operation, especially when having multiple bits. –Error correction through retransmission Use of ACKs for lost frames Use of timers for lost ACKs Use of sequence number for duplicate frames. Few LAN DL do this sequencing. The concept of error detection, ACK, and retransmission is called automatic repeat request (ARQ). Stop-and-wait ARQ Sliding window ARQ »Go-back-n ARQ »Selective reject ARQ
10
10 K. Salah Stop-and-Wait ARQ For identification, both data and ACK frames are numbered alternately 0 and 1. –Data 0 is acknowledged by ACK 1, meaning Receiver got data 0 and expecting Data 1. –Numbering is important in case of duplicate transmission of data and acks when lost or delayed. 1. Damaged Frames 2. Lost Frames 3. Lost Ack
11
11 K. Salah Go-back-n Sliding Window ARQ –ACK 3 means frame 0,1, & 2 are received correctly. NAK 3 means frame 3 is lost, in error, and frames 0-2 were received correctly. 1. Damaged Frames2. Lost Frames 3. Lost Ack
12
12 K. Salah Selective-Reject Sliding Window ARQ Uses ACK as in go-back-n algorithm. Only the specific damaged or lost frame is retransmitted. The frame is resent out of sequence when NAK is received. Better performance –Retransmit only damaged or lost frames. But more complex –Requires storage and search at the receiver. –Extra logic also needed at sender Need to buffer Must be able to send frames out of sequence
13
13 K. Salah Cyclic Redundancy Check (CRC) For a block of k bits transmitter generates n bit sequence Transmit k+n bits which is exactly divisible by some number Receiver divides frame by that number –If no remainder, assume no error Nice animation at: http://www.mhhe.com/engcs/compsci/forouzan/dcn/graphics/animations/09_09.swf
14
14 K. Salah CRC Example
15
15 K. Salah Standard Polynomials (Divisors) CRC-16 used for various file transfers CRC-CCITT serves as an international standard CRC-32 used in Ethernet and token ring LANs. The chances of bad data being received and not detected is 1 in 4.3 billion (2 32 -1)
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.