•
The Logical Link Control (LLC) sublayer
– Framing
– Flow Control
– Error Control
•
The Media Access Control (MAC) sublayer
– Random Access (CSMA)
– Token Passing
K. Salah 1
•
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.
K. Salah 2
•
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 !!!
K. Salah 3
•
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
K. Salah 4
•
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.
K. Salah 5
•
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
K. Salah 6
K. Salah 7
•
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.
K. Salah 8
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
K. Salah 9
1. Damaged Frames 2. Lost Frames
•
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.
K. Salah 10
3. Lost Ack
1. Damaged Frames 2. Lost Frames
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.
K. Salah 11
3. Lost Ack
•
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
K. Salah 12
•
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
K. Salah 13
K. Salah 14
•
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)
K. Salah 15