430 likes | 707 Views
Lecture #13: Example Data Link Protocols. C o n t e n t s Types of services provided by DLL protocols Flow control functions Flow control protocols Stop-and-Wait protocols Sliding window protocols Go-back- n Selective Repeat/Reject Performance comparison HDLC Internet DLL protocols. 4.
E N D
Lecture #13: Example Data Link Protocols. C o n t e n t s Types of services provided by DLL protocols Flow control functions Flow control protocols Stop-and-Wait protocols Sliding window protocols Go-back-n Selective Repeat/Reject Performance comparison HDLC Internet DLL protocols 4 7 9 11 12 19 21 23 24 27
Communication Functions according to the OSI Model User application 1 ... Application layer Encryption/ decryption compression/ expansion Choice of syntax Presentation layer Session control Session synch. Session to transport mapping Session management Session layer Layer and flow control Error recovery Multiplexing Transport layer Connection control Routing Addressing Network layer Data link establishment Error control Flow control Framing Synch Link layer Access to transm. media Physical and electrical interface Activation/ deactivation of con. Physical layer • Framing: considers frame format/ length issues (incl. error detection/correction implementation • Flow control: SAW, Sliding Window • Error control: correction, detection, recovery (ARQ: SAW, GBN, SR)
Data link layer • The data link layer provides functional and procedural means to establish, maintain and release data link connections among network entities and to transfer data link service data units. • A data link connection is built upon one or several physical-connections. • The data link layer detects and possibly corrects errors which may occur in the physical layer. • In addition, the data link layer enables the network layer to control the interconnection of data circuits within the physical layer.
DLL Services • Types of DLL services: • Unacknowledged connectionless service • frames are sent independently (connectionless) • no recovering of the lost/damaged frames (unack.) • for reliable links or upper levels recovery architecture • Acknowledged connectionless service • possible implementation of damaged/lost frames • Connection-oriented services • correct and in-order frame delivery
DLL Services • Services provided to the network layer by the data link layer are: • data-link-connection; • data-link-connection-endpoint-identifiers; • sequencing; • error notification; • flow control; • quality of service parameters.
Data Link Layer Functions • Functions within the data link layer • data-link-connection establishment and release; • delimiting and synchronization; • sequence control; • error detection; • error recovery; • flow control; • identification and parameter exchange; • control of data-circuit interconnection; • data link layer management.
Flow Control • Terminology • Simplex: Signal flows always in one direction (e.g., computer - to - printer) • Half Duplex: Alternating one-way. Signal flows in both directions not simultaneously but alternatively. • Full Duplex: Signal flow is in both directions simultaneously • Logical Connectivity: • Peer-to-Peer: Either station can initiate a call • Primary-Secondary: Only the Primary may initiate a call. There is no Secondary-to-Secondary calls initiated separately. • Connection Phases: Apply to both logical connectivity types: Peer - to - Peer, Primary - Secondary • Connection Establishment: Determines which station transmits, which receives, and whether the receiver is ready to receive. • Data Transfer: Data are transferred in one or more acknowledgment blocks • Connection Termination: Terminates the logical connection, physical connection upon which that logical connection was based may remain connected • Frame transmission models: • Error free transmission • Transmission with errors or losses 13/1
Flow Control • Flow Control (Physical Connectivity Possibilities) • Point-to-Point (P-P) • Logical Connectivity: Can use either Peer-to-Peer or Primary-Secondary depending on whether a Primary station has been designated or not • Addressing: No addressing is required. • Multipoint • Logical Connectivity • Peer-to-Peer: Uses contest access methods • Primary-Secondary: Uses Poll (The primary request data from the secondary) and Select (The primary has data to send to the secondary) • Addressing: • Peer-to-Peer: Two addresses required (transmitter and receiver) • Primary-Secondary: One address needed, to identify the secondary
Flow Control Protocols Network Layer • Time-Driven Control (for synchronous transmission, dedicated service, simplex error-free channel … • Event-Driven Control (some SAW: for asynchronous transmission, multiple service, half-duplex error-free channel … • Event-Driven Control with Timeouts (SAW, PAR/ARQ, sliding window: for asynchronous transmission, multiple service, full-duplex channel with losses/errors … Virtual packet transfer DLL PackBuff FromNL ToNL RcvTimer TrmCount Sender Receiver ToPhL FromPhL RcvCount TrmTimer FrameBuff Virtual frame transfer Physical Layer Physical bit transfer (signaling)
Examples of Flow Control Protocols • SAW (Stop And Wait protocols) • PAR/ARQ (Positive Acknowledge with Retransmission [of the non-acknowledged frames]/Automatic Repeat reQuest) • sliding window protocols • Applicable mechanisms: • piggybackingemploys the outgoing traffic for carrying frame receive acknowledgements; timeout control over the delayed acknowledgments in case of no outgoing data frames. • pipelining: sequential frame transmission upon the new Network Layer’s requests prior toacknowledgement for the frames already sent. Outstanding frames form so called sender window. Vasil Georgiev: Piggyback 1: to carry up on the shoulders and back 2: to set up or cause to function in conjunction with something larger or more important 3: to function or be carried on or as if on the back of another
Stop-And-Wait Protocols 3/12 13/5 • SAW Protocol (Idle ARQ) • Algorithm • Send frame • Wait for an ACK before sending the next frame ( good for half duplex links) • Channel Utilization, U: • 0 > U > 1 • U depends on the channel length D: U = Tfr/Tt(1) where Tfris the frame transmission time and Ttis the total transmission time including Tfr, Tp(propagation delay), TACK (acknowledgement generation, propagation and transmission) , Tproc (frame processing time). Approximation for error-free channel (BER-->0): Tt =Tfr + 2 Tp(2) Tp = (D/2)10-8 [S] (by signal speed = 2.108m/S in copper) a = Tp /Tfr=(sfr/Drb)c [non-dimensional] (3) relative channel length [with respect to the frame duration] (1), (2) and (3) yieldU=1/(1+2a) i.e. Ua(4) Bit Error RateBER: BER = nerr/nt channel bit rate [b/S] 13/2 EM-waves’ speed
Sliding Window Protocols • Duplex (bi-directional) data connection based on pipelining • Event-driven synchronization with system of timeouts. Timers are required for each frame being tracked. • ACKsare usually “piggybacked” onto the forward traffic from receiver • Cyclic sequenced numbering of the outgoing frames; cycle length L = 2n- 1 1 • Sender window SW keeps the numbers of frames that are to be transmitted • Receiver window RW keeps the numbers of frames that are to be received and acknowledged cont ...
Sliding Window Protocols … cont. • Buffers are required for each frame being transmitted (received) • Frames are buffered in seq_number order at the sender for possible retransmission • Frames are buffered in seq_number order at the receiver for delivery to the Network Layer when Selective Repeat error handling is applied • Sliding window protocols guarantee the number and the order of the transmitted frames thus simulating connection-oriented transmission • SW and RW can differ in the limits and window-size • Important performance and robust parameters are the maximal sender/receiver window sizewS/R and the timeouts in context to the actual throughput and the frame round-trip transit time.
Sliding Window Protocols Sender Window First frame waiting transmission Last frame waiting transmission 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 Transmitted frames zone Leading edge expands as ACKs are received Trailing edge shrinks as frames are sent Receiver Window First frame that might be accepted Last frame that might be accepted 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 Acknowledged frames zone Trailing edge shrinks as frames are received Leading edge expands as ACKs are sent
Sliding Window Protocols 5 5 5 Sliding windows 0 0 0 6 6 6 3 1 1 1 1 0 4 4 6 4 7 3 3 5 3 2 2 4 2 Step 1. A Sender B Rec-er 1 0 7 A ready to transmit 7 frames beginning with frame 0; B ready to receive 7 frames beginning with frame 0 A Sender Step 2. B Rec-er A have sent 3 frames, sender window shrinks to 4 frames 2 1 0
Sliding Window Protocols 3 3 3 3 4 1 1 0 0 6 6 6 8 7 5 5 5 6 4 5 4 4 Step 3. A Sender B Rec-er B received 3 frames; receiver window shrinks to 4 frames too 2 1 0 A Sender Step 4. B Rec-er Ack3 B transmits acknowledge for frames 0-2 which causes receiver window to expand back
Sliding Window Protocols 0 5 3 3 1 6 4 4 1 0 0 1 7 7 0 6 6 8 7 7 5 5 A Sender Step 5. B Rec-er Ack3 Sender window expands with 3 positions when the acknowledge-ment for the 3 frames is received A Sender B Rec-er Step 6. Ack4 1 A has transmitted frame 3 and then frames 4, 5 and 6; B processed frame 3, 4, 5 and 6 and transmits Ack4 4 3 2 6 4 3
Sliding Window Protocols 7 4 3 1 0 2 2 0 7 0 1 6 7 7 0 A Sender B Rec-er Step 7. Ack4 2 Receiver window expands with 1 position upon the departure of the acknowledge-ment for the 4 frames. 1 5 A Sender B Rec-er Step 8. Ack4 4 A window expands with a position upon the receiving of the Ack4; B processes frames 5 and 6 3 2 1
Sliding Window Protocols - Go-back-n • Sender window sizewSn (but still wSL-1) • Receiver window size wR= 1 • Sender may send multiple frames up to wS • Receiver buffers only one received frame. It cannot receive frames out of order. Frames are passed in order to the NL. • Damaged Frame: • B detects error in frame (i): B sends REJ(i). When A receives REJ(i) it must resend (i) and all subsequent frames. • B does not detect frame (i) (frame is lost) and A already sent (i+1): B receives (i+1) out of order and sends REJ(i) • Frame (i) is lost and A does not send anything after frame (i): A timeouts and resend (i). cont ... 3/15a 13/6 13/6
Sliding Window Protocols - Go-back-n { 1, wS (2a+1) wS/(2a+1),wS (2a+1) cont … • Damaged ACK • ACKs (Receiver Ready, RRs) are cyclic-cumulative. If an ACK (i) get lost and: • a subsequently higher ACK (i+n) is received: this ACK will account for intervening ACKs • peer A timeouts without ACK: A requests retransmission of the cumulated ACK • Damaged NACK (REJ): peer A timeouts. • Performance • More complex than SAW:wSbuffers/timers at the transmitter, 1 buffer/timer at receiver • More efficient that SAW - allows for pipelining, but inefficient for noisy channels • Channel utilization (only by “error free” assumption!): U= 13/6 wSis greater than the number of frames that can fit into the channel; peer A can transmit frames without pausing
Sliding Window Protocols - Selective Repeat/Reject 3/15b • wS=wR - the receiver buffers all the received frame. It can receive frames out of order and only NACKed frames are retransmitted. Frames are passed in order to the NL. • Channel utilization (only by BER-->0!) is the same as for GBN ARQ. • Performance • More complex than GBN: wSbuffers/timers both at the transmitter and receiver • More efficient than GBN for noisy channels
Sliding Window Protocols - Performance Effect of the Window Size Mb/S 100 Mb/SEthernet LAN 24 20 16 12 10 Mb/SEthernet LAN 8 4 wS 4 8 12 16 20 24 • Effect of saturation whenwS becomes greater than the number of frames that can fit into the channel • Possible effect (for LANs and other multiple access systems) of degradation if receiver’s buffer is overloaded
DLL Protocols - Performance Comparison { { 1 - Pfr; wS 2a+1 (1 - Pfr,) / (1+2aPfr) ; wS 2a+1 wS (1 - Pfr) / (2a+1); wS 2a+1 wS (1 - Pfr) / ((2a+1)(1- Pfr +wS Pfr)); wS 2a+1 • Single bit error probability (or bit error rate)BER= nERR/nt • Frame error probability Pfr=1-(1-BER)Sfr [for BER-1>>Sfr] SfrBER(whereSfris the frame size) • Channel utilization as a function of the relative channel lengthaand frame error probabilityPfr: • SAW:U = (1 - Pfr) / (1 + 2a) • GBN:U = • SR:U = 13/10
Example DLL Protocols - HDLC • HDLC - High-level Data Link Control • Widely applied standard • LLC in IEEE802.2 (Upper part of DLL in LANs/MANs) • LAPB (Link Access Protocol - Balanced) in X.25 • LAPD (Link Access Protocol of the D-channel) in ISDN • Bit-oriented protocol - with bit stuffing • Applies sliding window algorithms (GBN or SR) • HDLC-defined station types: • primary (link establishment and control - issues commands) • secondary (controlled by primary - issues responses) • combined • Link configuration: balanced (P-P only)/unbalanced (P-P and multi-P operations; obsolete - terminal complexes)
HDLC - frame format 13/7 • Address field (8 b extendible to 16): contains destination by multi-P configuration; in P-P mode this field distinguish commands and responses • Information - variable data length • FCS - CCITT-CRC • Control field - distinguish 3 types of frames: • Information frames: • N(S) field (3b) sequence number of the frame being sent i.e. the sliding window may contain up to 7 outstanding frames • N(R) field (3b) sequence number of the next frame expected • Poll/Final bit: primary invites secondary to send data with a P/F set to P; the secondary data frames also have P/F=P but the last of them has P/F=F ; (somewhere used to suspend piggybacking ACK delays) • Supervisory frames - protocol (sliding window) control frames : • S field (2b) for supervisory function: ACK (RR), NACK (REJ), RNR (receiver not ready) and SR (Selective Retransmission) cont …
HDLC - frame format • Control field types cont.: • unnumbered frames for control and specific data transfer: • M (5b, split by the P/F bit) field - up to 32 command/info codes including: • connection mode setting (peer A: SABM “Set Asynchronous Balanced Mode”, “Disconnect”…, B: UA “Unnumbered ACK” for acknowledgement of control frames etc.) • information commands and responses (ID exchange, test, provide day time, setup link …) • recovery commands and responses for untypical problems (e.g. long data field, invalid control field …) • Example HDLC operations 13/8
Internet DLL • Internet P-P architectures: • leased lines to the Internet communication subnets • dial-up lines to time-sharing shell account or router • Internet DLL protocols - SLIP and PPP • SLIP (Serial Line IP) • character stuffing • no error handling • IP support only (not Novel IPX...) • static IP addressing • not approved as Internet standard 3/26
Internet DLL • PPP (Point-to-Point Protocol) - RFC 1661; provides 3 mechanisms • Framing Method providing also error control. • A Link Control Protocol (LCP) which brings line up, tests it, negotiates options, and brings lines down in the end. • Negotiation of the NL options (independence of the network protocol being used). The method used is to have a different NCP (Network Control Protocol) for each network layer used. • Phases of data link setup/termination in Internet • Dead - no physical layer present • Establish a Physical Connection: (The user’s PC first calls the provider’s router via a modem • Authenticate - Establish a Link Connection: (PPP next sends a series of LCP packets to configure the data link layer.) • LCP provides a mechanism (proposal - acceptance/rejection between the two sides) to negotiate link options 3/28
Internet DLL • Authenticate- Establish a Link Connection: (PPP next sends a series of LCP packets to configure the data link layer.) • LCP provides a mechanism (proposal - acceptance/rejection between the two sides) to negotiate link options • Options may include • setting the maximum payload size for data frames • enabling authentication to be conducted • choosing a protocol to use • LCP also allows for testing of the line (Echo - types) • Network - Establishes the Network Connection: (PPP next sends a series of NCP packets to configure the network layer.) • Typically this is the TCP/IP protocol stack (so an IP address is needed) • Each Internet provider manages a block of addresses, (one of which is dynamically assigned at login time). • Open- The PC is now an internet host (and is permitted to send and receive IP packets.) • Terminate - Procedure is reversed at the end of the session - • Disestablish Network Connection - release IP address • Disestablish the Data Link Connection - release the logical connection • Disestablish Physical Connection - release the TP line
Internet DLL • PPP Frame • Similar to HDLC (except it is based on eight-bit word size - character stuffing is used) • Preamble - HDLC flag byte (0111 1110) (Character stuffed if it occurs within the frame) • Address Field - All 1’s • Control Field - used to indicate that PPP is using unnumbered frames. (I.e., no seq-nums, ACKs -- therefore is an unreliable CLS) • Protocol - used to indicate which Data Link or Network Layer Protocol is being used. • Payload (variable length) • Checksum (2 or 4 bytes) 3/27
Sender Receiver