Computer Networks Week 3 Link Layer Issues. Mr. Bilal Ahmad 1 Module contents: • Protocol stacks • Protocol basics • Application/Network QoS • Link Layer issues • Error control (ARQ, CRC, FEC) • Flow control • Internet Protocol • • • • • • Addressing IPv6 (IPv4 interoperability) Routing (link-state, distance vector, Internet, routers) QoS Routing Routing problems in wireless networks Geographic Routing • QoS Support • IntServe • DiffServe • MPLS 2 Link layer Issues • The Link Layer sits directly above the physical layer (PHY). • At the PHY we have defined the connectors, the interconnection types, the required voltage levels, the clock speeds, the type of modulation etc. The link layer has to make use of this to actually exchange useful data over the links. 3 4 Link layer Issues • The study here is the mechanisms used for successful exchange of data. In particular: • Error control • ARQ • CRC • FEC • Flow Control 5 Link layer Issues • Our aim is to • Convert raw ‘PHY layer bit stream’ to stream of ‘frames for network layer’. • Take raw transmission facility and make it free of undetected transmission errors. • Break up data stream into ‘data frames’ • Process the ‘acknowledgment frames’. • Creates and recognizes frame boundaries (adding special bit patterns to beginning and end of each frame). • We must consider that: • An error burst might destroy/corrupt a frame; the acknowledgement mechanism should cause a re-transmission. Care is needed to ensure they are recovered in the correct order and duplication does not occur. • We need to use: • Traffic regulation. • Single/Multiple lines, piggybacking. • Medium access control (MAC). 6 Link layer Issues • Error control • LANs and the Internet both discard packets if an error is detected (at the link layer). • In the link layer of a leased line from PSTNs error recovery is performed. • In wireless links some form of error recovery is performed. • In the simplest form error control requests a repeat of any packets found to contain errors. This is an Automatic Repeat reQuest (ARQ) mechanism. 7 ARQ • The most basic ARQ mechanism is ‘idle-RQ’: ARQ error control scheme: (a) error free 8 Idle-RQ ARQ error control scheme: (b) corrupted I-frame 9 Idle-RQ ARQ error control scheme: (c) corrupted ACK-frame 10 Idle-RQ • Note that for this ARQ system to work: • P (the source) must retain a copy of the sent message. • In order that S (the destination), can determine a duplicate, each frame must contain a unique identifier, N(S). • S must know which was the last frame received without error. • The scheme is known as ‘Stop and Wait’. • We could have a system where the unique identifier is just a single bit in length, i.e. 1 or 0. This is what is used in the Bluetooth system. 11 Idle-RQ The utilisation, U, will be U=Tix/Tt , Where, Tt=Tix + time transmitter is waiting for an ACK. 12 Idle-RQ • Since the processing time will be short and the ACK will be short as compared to the data frame. The utilisation can be approximated to: U= Tix . (Tix +2Tp) Letting a=Tp/Tix U= 1 . 1 + 2a 13 Idle-RQ QUIZ NO. 1 “Total Time 30 minutes” • A series of 1000-bit frames are to be transmitted using the idle-RQ protocol. Determine the link utilization, U, for the following 3 types of data link, assuming a transmission bit rate of: (i) 1 kbps, and (ii) 1 Mbps. Assume that the velocity of propagation of the first two links is 2x 108 m/s and for the third link is 3 x 108 m/s. Assume bit error rate is negligible. Data link a) A twisted pair cable of length 1km. Data link b) A leased line 200km in length. Data link c) A satellite link of 50,000km. 14 Idle-RQ • Answer: U = 1. 15 Answer: (i) U = 1. (ii) U = 0.33 16 • Answer: (i) U = 0.75 (ii) U = 0.003 17 Idle-RQ efficiency observations: • For relatively short links U ~ 100%, and independent of the bit rate, i.e. idle-RQ is adequate for short links and modest bit rates. • For longer terrestrial links the link utilisation is high for low bit rates but reduces significantly as the bit rate increases. • For very long links, e.g. extra-terrestrial links, then even for low bit rates, utilization is poor. • Hence idle-RQ protocol is unsuitable for high bit rate terrestrial links and extra-terrestrial links. 18 Continuous RQ • The next ARQ scheme we examine gets improved link utilization at the expense of increased buffer storage requirements. • Note: • Duplex link is required. • Sender, P, sends data frames continuously. • P holds a copy of sent frames awaiting acknowledgement. • An ACK is sent for each correctly received data frame. • When a data frame is acknowledged it is removed frames held by P. 19 Continuous-RQ (no errors). 20 Continuous-RQ (with errors). • If errors occur then the receiver, S can: 1. Just request repeat transmission of corrupted frames, i.e. ‘selective repeat’ or, 2. Request that the transmission goes back to the where the last correctly received frame, ‘go-back-N’. • • In both cases corrupted frames are discarded and retransmission requests are issued after the next error free frame is received. A timeout is still necessary in case the last frame of a sequence is corrupted. 21 1. Selective repeat. Effect of corrupted data-frame. 22 1. Selective repeat. Effect of corrupted ACK-frame. 23 2. Go-back-N. Effect of corrupted data-frame. 24 2. Go-back-N. Effect of corrupted ACK-frame. 25 Flow Control • The transmitter and the receiver entities maintain buffers of frames for operation of the ARQ mechanisms. • The rate of frame transmission must be limited to avoid buffer overflow at the receiver. • To control the rate of flow a sliding window is used. • This limits the number of unacknowledged frames which may be transmitted. This limit is set in the Send Window, K for the link. • Factors determining size of K: frame size, available buffer storage, link propagation delay, transmission bit rate. 26 Sliding window example: Send and receive window limits. 27 Sequence numbers • The counters used to determine the received and acknowledged frames etc. are (obviously) finite in size. • In the idle-RQ scheme only 1 or 0 was used to identify the frames and hence only one frame was required to buffered. • With a go-back-N scheme and send window of K, then K+1 identifiers are needed. • With selective repeat and send and receive windows of K, then 2K identifiers are required. 28 • Sequence numbers: a) max for each scheme, b) example assuming 8 sequence numbers. 29 Sequence numbers • In fact sequence numbers will use a binary register so a certain number of bits will be reserved. • Idle-RQ requires little buffering but has poor link efficiency (though OK for short, slow links) • Selective repeat and Go-back-N schemes are more efficient and more generally used but require more available memory for buffers and counters. 30 Summary • The link layer takes the PHY bit stream and using basic error control and flow control protocols creates a useful data stream. • Error control mechanisms include repeat request schemes (Selective repeat, Go-back-N). • Flow control is maintained through use of buffers and counters to control the sliding window. 31