19540 - Telematics 5rd Tutorial - LLC vs. MAC, HDLC, Flow Control, E2E-Arguments Matthias Wa hlisch Department of Mathematics and Computer Science Institute of Computer Science 19. November, 2009 Institute of Computer Science Telematics Tutorial 19. November, 2009 1
Outline 1. LLC vs. MAC 2. Transmission with HDLC 3. Flow Control 4. Sliding Window 5. Sliding Window Mechanism 6. Transmission Capacity 7. The End to End Argument Institute of Computer Science Telematics Tutorial 19. November, 2009 2
LLC vs. MAC Explain the difference between LLC and MAC. Background Problem Statement: Several data link layer protocols exist Data link layer provides different services to the network layer Consistent primitives to the network layer are desired Institute of Computer Science Telematics Tutorial 19. November, 2009 3
Solution LLC vs. MAC (IEEE) Data link layer consists of two sublayers: LLC Logical Link Control MAC Media Access Control LLC Hides differences between various kinds of 802 networks Single format and interface to the network layer Manages error-control and flow-control LLC header and packet are payload of MAC frame, which is transmitted MAC Implements different transmission technologies Handles multi-access on medium Decoupling: frame transmission and error/flow-control Institute of Computer Science Telematics Tutorial 19. November, 2009 4
Transmission with HDLC The High Level Data Link Protocol (HDLC) is a protocol of the Data Link Layer (DLL). One of its purposes is to protect the data communication of two adjacent hosts (A and B). Transmission errors are detected by checksums. Institute of Computer Science Telematics Tutorial 19. November, 2009 5
Transmission with HDLC Consider the bit sequence 110111110101. This sequence is to be transmitted including its CRC checksum. Compute the checksum by using the following generator polynomial instead of CCITT CRC-16: G(x) = x 4 + x + 1 Institute of Computer Science Telematics Tutorial 19. November, 2009 6
HDLC Solution 1101111101010000:10011 10011 ----- 10001 10011 ----- 0010110 10011 ----- 0010110 10011 ----- 0010110 10011 ----- 0010100 10011 ----- 1110 <- remainder Institute of Computer Science Telematics Tutorial 19. November, 2009 7
Transmission with HDLC Create/sketch the HDLC frame that is used to transfer the data from host A to B. Assume that the sequence number counters have been initialized with the value of zero. The frame shall be used to signal host B that the first two frames were received successfully. The address of host B is 11111111 2. The P/F bit shall be ignored and set to 0. Instead of the normal 16 bit HDLC checksum, the 4 bit checksum computed in part 1 shall be used. Institute of Computer Science Telematics Tutorial 19. November, 2009 8
HDLC Solution Flag Addr Control 01111110 111110111 0 011 0 010 Data 1101111100101 CRC Flag Type: 0 (Information) Sequence No.: 011 = 3 P/F: 0 (ignored) Next: 010 = 2 1110 01111110 HDLC frame Institute of Computer Science Telematics Tutorial 19. November, 2009 9
Transmission with HDLC The frame created in part 2 is now passed to the physical layer. Draw/sketch the data part of the HDLC frame using: 1. the Manchester Code 2. the Differential NRZ Code Institute of Computer Science Telematics Tutorial 19. November, 2009 10
HDLC Solution Payload of the HDLC frame on the physical layer: 1 1 0 1 1 1 1 1 0 0 1 0 1 Differential NRZ 1 1 0 1 1 1 1 1 0 0 1 0 1 Manchester Institute of Computer Science Telematics Tutorial 19. November, 2009 11
Flow Control You know the maximum processing and transmission time between sender and receiver. Choose and discuss a simple, adaptive flow control mechanism. Institute of Computer Science Telematics Tutorial 19. November, 2009 12
Flow Control You know the maximum processing and transmission time between sender and receiver. Choose and discuss a simple, adaptive flow control mechanism. Stop-and-Wait protocol... is partially adaptive (e.g. RTT) Long idle times in the case of long link delays & short processing time No parallelization: Sender has to wait for an ACK before sending next frame Think about parallelization between sender and receiver... Institute of Computer Science Telematics Tutorial 19. November, 2009 12
Solution Flow Control Sliding Window Allows continuous data transmission without waiting on each ACK Bound by window size Buffer required, volume depends on window size Problem: How to handle correct frames in case of errors (within window)? Receiving data link layer is obligated to hand packets to the network layer in sequence! Institute of Computer Science Telematics Tutorial 19. November, 2009 13
Solution Flow Control Sliding Window Allows continuous data transmission without waiting on each ACK Bound by window size Buffer required, volume depends on window size Problem: How to handle correct frames in case of errors (within window)? Receiving data link layer is obligated to hand packets to the network layer in sequence! Go-back-N Implements a receive window of size 1 Disadvantage: Sender must repeat all frames starting from invalid frame Institute of Computer Science Telematics Tutorial 19. November, 2009 13
Solution Flow Control Sliding Window Allows continuous data transmission without waiting on each ACK Bound by window size Buffer required, volume depends on window size Problem: How to handle correct frames in case of errors (within window)? Receiving data link layer is obligated to hand packets to the network layer in sequence! Go-back-N Implements a receive window of size 1 Disadvantage: Sender must repeat all frames starting from invalid frame Selective Repeat Buffer correctly received frames: increased buffer size at listeners Sender retransmits only selective packets Institute of Computer Science Telematics Tutorial 19. November, 2009 13
Sliding Window Why do we need preferably a full-duplex connection for sliding window protocols? Institute of Computer Science Telematics Tutorial 19. November, 2009 14
Solution Sliding Window Without a full-duplex connection, there is only limited parallelization. Remember, parallelization was a motivation for designing sliding window protocols. Institute of Computer Science Telematics Tutorial 19. November, 2009 15
Sliding Window Mechanism HDLC uses the sliding window mechanism for flow control. Each frame contains a sequence number N(S) as well as an acknowledgement number N(R). The acknowledgement number acknowledges all frames up to R 1. Thus, frame R is expected to be received as next. To avoid an overflow of the counter, the value is calulated modulo M. Institute of Computer Science Telematics Tutorial 19. November, 2009 16
Sliding Window Mechanism How many frames is a sender allowed to send without getting an acknowledgement? Institute of Computer Science Telematics Tutorial 19. November, 2009 17
Sliding Window Solution The maximum window size is M 1. With a window size of M the following two situations could not be distinguished by host A for W = M = 4: A 0 B A 0 B ACK 1 1 2 3 ACK 1 1 2 3 Timeout 0 ACK 1 ACK 1 0 Institute of Computer Science Telematics Tutorial 19. November, 2009 18
Sliding Window Mechanism Consider an example with M = 8 and window size W = 7. The frames with N(S) = 5, 6, 7, 0, 1 have been sent. No acknowledgement has been received yet. List the remaining sequence numbers that may be used by the sender. Institute of Computer Science Telematics Tutorial 19. November, 2009 19
Sliding Window Solution The frames with sequence numbers 2 and 3 can be sent without getting an acknowledgement: M 1 = 7 5 frames have been sent last used sequence number + {1,2} 6 5 7 4 0 3 1 2 Institute of Computer Science Telematics Tutorial 19. November, 2009 20
Sliding Window Mechanism How does the situation in part 2 change if a frame with the following acknowledgement number is received: 1. N(R) = 2 2. N(R) = 6 3. N(R) = 5 List the acknowledged sequence numbers and the window of remaining sequence numbers. Institute of Computer Science Telematics Tutorial 19. November, 2009 21
Sliding Window Solution N(R) = 2 acknowledged: 5, 6, 7, 0, 1 window: 2, 3, 4, 5, 6, 7, 0 6 7 0 7 0 1 6 1 5 2 5 2 4 3 4 3 Institute of Computer Science Telematics Tutorial 19. November, 2009 22
Sliding Window Solution N(R) = 6 acknowledged: 5 window: 2, 3, 4 6 7 0 7 0 1 6 1 5 2 5 2 4 3 4 3 Institute of Computer Science Telematics Tutorial 19. November, 2009 23
Sliding Window Solution N(R) = 5 acknowledged: 4 window: 2, 3 6 7 0 7 0 1 6 1 5 2 5 2 4 3 4 3 If a frame with sequence number 4 has been sent, the ACK=5 acknowledges this frame. The window doesn t change because sequence number 4 cannot be used. Alternatively, an error could have happened: The frame with sequence number 5 was lost or corrupted. The frame has to be retransmitted. Institute of Computer Science Telematics Tutorial 19. November, 2009 24
Transmission Capacity Consider a host-to-network technology with a sliding window mechanism and a window size of W = 7. The frames are up to 1,500 bytes long and the round trip time is given with 50 ms. Calculate the maximum data rate that can be achieved with these parameters when sending frames from host A to B. Institute of Computer Science Telematics Tutorial 19. November, 2009 25
Transmission Capacity Solution A host can send 7 1, 500 = 10, 500 bytes without getting an acknowledgement. Institute of Computer Science Telematics Tutorial 19. November, 2009 26
Transmission Capacity Solution A host can send 7 1, 500 = 10, 500 bytes without getting an acknowledgement. Let us assume that the sending and receiving of frames can be done in zero-time. Institute of Computer Science Telematics Tutorial 19. November, 2009 26
Transmission Capacity Solution A host can send 7 1, 500 = 10, 500 bytes without getting an acknowledgement. Let us assume that the sending and receiving of frames can be done in zero-time. Thus, a frame that is received by host B at time 25 ms will be acknowledged 25 ms later. Institute of Computer Science Telematics Tutorial 19. November, 2009 26
Transmission Capacity Solution A host can send 7 1, 500 = 10, 500 bytes without getting an acknowledgement. Let us assume that the sending and receiving of frames can be done in zero-time. Thus, a frame that is received by host B at time 25 ms will be acknowledged 25 ms later. Host A receives the acknowledgement at time 50 ms; RTT=50 ms Institute of Computer Science Telematics Tutorial 19. November, 2009 26
Transmission Capacity Solution A host can send 7 1, 500 = 10, 500 bytes without getting an acknowledgement. Let us assume that the sending and receiving of frames can be done in zero-time. Thus, a frame that is received by host B at time 25 ms will be acknowledged 25 ms later. Host A receives the acknowledgement at time 50 ms; RTT=50 ms The window is shifted and the next frame can be sent. Institute of Computer Science Telematics Tutorial 19. November, 2009 26
Transmission Capacity Solution A host can send 7 1, 500 = 10, 500 bytes without getting an acknowledgement. Let us assume that the sending and receiving of frames can be done in zero-time. Thus, a frame that is received by host B at time 25 ms will be acknowledged 25 ms later. Host A receives the acknowledgement at time 50 ms; RTT=50 ms The window is shifted and the next frame can be sent. Ignoring the processing times, 10,500 byte can be sent in 50 ms. Institute of Computer Science Telematics Tutorial 19. November, 2009 26
Transmission Capacity Solution A host can send 7 1, 500 = 10, 500 bytes without getting an acknowledgement. Let us assume that the sending and receiving of frames can be done in zero-time. Thus, a frame that is received by host B at time 25 ms will be acknowledged 25 ms later. Host A receives the acknowledgement at time 50 ms; RTT=50 ms The window is shifted and the next frame can be sent. Ignoring the processing times, 10,500 byte can be sent in 50 ms. In 1 s host A can receive 20 acknowledgements. Institute of Computer Science Telematics Tutorial 19. November, 2009 26
Transmission Capacity Solution A host can send 7 1, 500 = 10, 500 bytes without getting an acknowledgement. Let us assume that the sending and receiving of frames can be done in zero-time. Thus, a frame that is received by host B at time 25 ms will be acknowledged 25 ms later. Host A receives the acknowledgement at time 50 ms; RTT=50 ms The window is shifted and the next frame can be sent. Ignoring the processing times, 10,500 byte can be sent in 50 ms. In 1 s host A can receive 20 acknowledgements. Thus, 20 10, 500 byte can be sent 210, 000 byte/s 1.6 Mbps. Institute of Computer Science Telematics Tutorial 19. November, 2009 26
Transmission Capacity Solution Of course, in reality you have to consider the processing times of both hosts. To sent a frame of 1,500 byte = 12,000 bit with Fast Ethernet (100 MBit/s) about 120µs are required to set the frame on the wire. The first frame is received by host B after 25.12ms. The ACK is sent immediately. ACK frames without data are less than 100 bit long. About 1µs is required to sent the frame. Thus, after 50.121ms host A can move the window by one position and sent the next frame. Institute of Computer Science Telematics Tutorial 19. November, 2009 27
The End to End Argument Please explain the ideas of the end to end arguments. Are the arguments only valid for networking systems? Read the article End To End Arguments in System Design by Saltzer et al., 1984. Institute of Computer Science Telematics Tutorial 19. November, 2009 28
Solution End to End Argument Motivation: Context: Protocol design Distributed system with different layers Functions that might be implemented in any of several ways Key question: Where to place which function? End to End (E2) Argument: Implementing these functions at low level may be redundant or provides little usefulness Functions in question should be implemented at the endpoints of the communication system Discussion: E2E-Argument does not tell at which layer to place the functions Consider a trade-off between costs and performance Institute of Computer Science Telematics Tutorial 19. November, 2009 29
The Last Slide TM Thank you for your attention. Questions? Institute of Computer Science Telematics Tutorial 19. November, 2009 30