Chapter 3 - Data Link Layer
Chapter 3 - Data Link Layer
Chapter 3 - Data Link Layer
Hi
Got the time?
2:00
time
<file>
Providing service interface to the network layer. Data Link Protocols must take circuit errors, Flow regulating.
3
Data link
frame, encapsulates datagram Data link layer has responsibility of transferring datagram from one node to adjacent node over a data link
Network Layer
In some cases, functions of error control and flow control are allocated in transport or other upper layer protocols and not in the DLL, but principles are pretty much the same. 5
Ht M Hn Ht M Hl Hn Ht M
Three reasonable services to the NL are: 1. Unacknowledged connectionless service. 2. Acknowledged connectionless service. 3. Acknowledged connection-oriented service.
Techniques for error control are: Error detection. Positive Acknowledgment. Retransmission after time-out. Negative acknowledgment and retransmission These 4 mechanisms are all referred to as Automatic Report reQuest (ARQ); the effect of ARQ is to turn an unreliable data link into a reliable one. Three standardized versions Of ARQ:
15
Link Layer Job (Cont) Flow Control: Two approaches are commonly used:
1. Feedback-based flow control, the receiver sends back information to the sender giving it permission to send more data or at least telling the sender how the receiver is doing. You may send me n frames now, but after they have been sent, do not send any more until I have told you to continue. 2. Rate-based flow control, the protocol has a built-in mechanism that limits the rate at which senders may transmit data. Since rate16 based schemes are never used in the DLL
Stop-and-Wait ARQ
A B
Timeout
19
Lost:
Timer
Time-out
Frame resend (Copies are maintained)
20
T T T T
R R R R
T T T T
R R R R
T
(a) >1
T
(b) <1
21
Prtcl.2. Simplex prtcl for Noisy Channel; Time-out Data are transmitted in one direction only (simplex channel), that makes error. Frames may be either damaged or lost completely. Stop-and-wait protocol would work: adding a timer. a. The sender could send a frame, but the receiver would only send an ACK frame if the data were correctly received. b. If a damaged frame arrived at the receiver, it would be discarded. c. After a while the sender would time out and sends the frame again. This process would be repeated until the frame finally arrives intact.
22
23
Fast Retransmit
Time-out period often relatively long:
long delay before resending lost packet
If sender receives 3 ACKs for the same data, it presumes that frame after ACKed data was lost:
fast retransmit: resend frame immediately, before timer expires
24
Protocol scenario:
1. The network layer on A gives packet 1 to its DLL. The packet is correctly received at B and passed to the network layer on B. B sends an ACK frame back to A. 2. The ACK frame gets lost completely. It just never arrives at all. 3. The DLL on A times out. Not having received an ACK, it (incorrectly) assumes that its data frame was lost or damaged and sends the frame containing packet 1 again. 4. The duplicate frame also arrives at the DLL on B perfectly and is randomly passed to the network layer there. If A is sending a file to B, part of the file will be duplicated (i.e., the copy of the file made by B will be incorrect and the error will not have been detected). In other words, the protocol will fail. 25
Sliding-Window
Better idea is to use the Duplex Channel. Data frame from A to B are intermixed with the acknowledgment frames from B to A. By looking at the kind field in the header of an incoming frame, the receiver can tell whether the frame is data or ACK. Station B,-buffer space for n frames. Thus, B can accept n frames, and A is allowed to send n frames without waiting for any ACK. 3-bit field, the sequence number can range from 0 to 7 0 through , from 0 to 2k 1 26
Sliding-Window
Window of frames that Frames already received may be transmitted
Last frame Window shrinks Frame Sequence transmitted from trailing edge as frames are sent number
Window expands from leading edge as received acknowledgment (a) Transmitters perspective
Pipeline
Window expands from leading edge as sent acknowledgment (b) Receivers perspective
27
0 1 2 3 4 5 6 7 0 1 23
RR3 0 1 2 3 4 5 6 7 0 1 2 3
(RR6); (RNR)
0 1 2 3 4 5 6 7 0 1 2 3 0 1 2 3 4 5 6 7 0 1 2 3
F3 F4 F5 F6 RR7
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3
28
A; T-O short
B sends (0,1,B0) B gets (0,1,A0)* B sends (0,0,B0)
Two scenario: (a) Normal case. (b) Abnormal case. The notation is (seq, ack, 29 packet number). An asterisk indicates where a network layer accepts a packet.
Pr.5.A Protocol Using Go Back N (Cont) If the channel capacity is b bits/sec, the frame size l bits, and the round-trip propagation time R sec, the time required to transmit a single frame is l/b sec. After the last bit of data frame has been sent, there is a delay of R/2 before that bit arrives at the receiver and another delay of at least R/2 for ACK to come back, for a total delay of R. In stop-and-wait the line is busy for l/b and idle for R, giving: Line utilization = l / (l+bR).=4% 31
0
0
1
1 Error E D D D D D
2 D
2 3
3
4
5
5
a
0 Selective repeat (NAK) 1 2
Time 11 12 13
NAK2
10
11
1 Error
10
11
12
13
Data flow (a) receivers window size is 1 and (b) receivers window size is large; Selective Repeat
ACK flow
32
Sender:
Pr.5 .Go-Back-N
ACK(n): ACKs all pkts up to, including seq # n cumulative ACK may receive duplicate ACKs (see receiver) timer for each in-flight pkt timeout(n): retransmit pkt n and all higher seq # pkts in window 33
34
35
Master
Slave
Flag- synchronization. Address- address of the secondary station. Control- keep track of transmitted and received frames for acknowledgment and flow control. CRC- contains a checksum to ensure data integrity.
Flag- used
to signal the end of a frame, and possibly the start 36 of the next frame.
(a)
0
1 0 1 1
Seq
Type Type
P/F
P/F P/F
Next
Next Modifier
(b)
(c)
(b)-RNR
For ACK is used the number of the first frame not yet received (i.e.., the next frame expected).
Type RECEIVE Acknowledges all 2 NOT frames, but not READY including Next. Stop sending Type SELECTIE Retransmission 3 REJECT of only the frame specified.
A U.S. backbone
A European backbone
Regional network 2 B
39
A IP Ethernet LAN
Host
ATC PC
Service provider
40
modem
Router
Routing process
Protocol
PPP provides three features: A framing method that clearly determines the: end of one frame and the start of the next one, Error detection. A link control protocol for bringing lines up, testing them, negotiating options, and bringing them down again when they are no longer needed, This protocol is called LCP (Link Control Protocol). It supports synchronous and asynchronous circuits and byte-oriented and bit-oriented encodings. A way to negotiate network-layer options in a way that is independent of the network layer protocol to be used. The method chosen is to have a different NCP (Network Control Protocol) for each network layer supported.
42
Pr.8. PPPRouter
Steps
1. PC calls the providers router via a modem. 2. The routers modem has answered the phone and established a physical connection
ATC
3. PC sends to the router a series of LCP packets in the payload field of one or more PPP frames
These packets and their responses select the PPP parameters to be used. Once the parameters have been agreed upon, a series of Network Control Protocol packets are sent to configure the network layer. Typically, the PC wants to run a TCP/IP protocol stack, so it needs an IP address.
43
Difference between
Bytes
1 Flag 01111110 1 Address 11111111 1 1 or 2 variable Payload 2 or 4 1 Flag 01111110
Checksum
PPP-summary
PPP is a multiprotocol framing mechanism suitable for use over: Modems, HDLC,SONET, Other physical layers. It supports: Error detection, Option negotiating, Header compression. DLL converts the raw bit stream (from physical layer) into a stream of frames (for network layer). Various framing methods are used: character count, byte stuffing, and bit stuffing. Data link protocols can provide: 1. Error control to retransmit damaged or lost frames. 2.To prevent a fast sender from overrunning a slow receiver. The data link protocol also provide flow control. The sliding window mechanism is used to integrate error 46 control and flow control in a convenient way