11.3 11-1 DLC SERVICES The data link control (DLC) deals with procedures for communication between two adjacent nodes.
11.4 11-1 DLC SERVICES Data link control functions include ● Framing, ● Flow control, and ● Error control
11.5 11.1 Framing (encapsulation) The data-link layer packs bits into frames so that each frame is distinguishable from another frame..
11.6 11.1 Framing The postal system practices a type of framing. The simple act of inserting a letter into an envelope separates one piece of information from another; the envelope serves as the delimiter.
11.7 11.1 Framing Framing in the data-link layer separates a message by encapsulating a sender address and a destination address into a header.
11.8 11.1 Framing Framing in the data-link layer separates a message by encapsulating a sender address and a destination address into a header.
11.9 11.1 Framing Framing techniques include ● Character oriented framing (8 bit characters) ● Bit oriented framing
11.10 11.1 Framing Frames may have a particular bit pattern between frames to help identify the start and end of a frame. This kind of special bit pattern is referred to as a “flag”
11.11 Figure 11.1: A frame in a character-oriented protocol
11.12 11.1 Framing Problem: the flag bit pattern could appear in the data portion of the frame. The problem is solved by stuffing (inserting) a special byte pattern known as an Escape-character into the data.
11.13 Figure 11.2: Byte stuffing and unstuffing
11.14 Figure 11.3: A frame in a bit-oriented protocol
Bit Stuffing Bit oriented frames face the same issue as byte-oriented frames – the flag pattern can appear in the data. This is resolved by bit stuffing.
Bit Stuffing A zero bit is inserted after 5-consecutive one-bits.
11.17 Figure 111.4: Bit stuffing and unstuffing
11.18 11.2 Flow and Error Control Flow control and error control were introduced in Chapter 9 The data-link layer handles flow control and error control.
11.19 Figure 111.5: Flow control at the data link layer
Example of flow control: ● A single memory slot is used to hold information for the receiver node at the data-link layer. ● When this single slot is empty, the data-link layer sends a request to the sender-node to send the next frame. Example 111.1 11.20
11.21 11-2 DATA-LINK LAYER PROTOCOLS Traditionally four protocols have been defined for the data-link layer to deal with flow and error control: 1.Simple, 2.Stop-and-Wait, 3.Go-Back-N, and 4.Selective-Repeat.
11.22 11-2 DATA-LINK LAYER PROTOCOLS 1. Simple 2.Stop-and-Wait The first two protocols are common at the data-link layer, the last two are no longer used.
11.23 Figure 11.6: (Optional slide) Finite State Machine Diagram
11.24 11.2.1 Simple Protocol Our first protocol is a simple protocol with neither flow nor error control. Assume that the receiver can immediately handle any frame it receives. (The receiver can never be overwhelmed with incoming frames. )
11.25 Figure 11.7: Simple protocol (no flow control)
11.26 Figure 11.8: Finite State Machine for the simple protocol (event, action)
Figure 11.9 shows an example of communication using the Simple Protocol. The sender sends frames one after another without even thinking about the receiver (no error or flow control). Example 11.2 11.27
11.28 Figure 11.9: Flow diagram for Example 111.2
11.29 111.2.2 Stop-and-Wait Protocol The Stop-and-Wait protocol uses both flow and error control. The sender sends one frame at a time and waits for an acknowledgment before sending the next one. Corrupted frames are detected with a CRC to each data frame.
11.31 Figure 11.11: FSM for the stop-and-wait protocol (events & actions)
Figure 11.12 shows an example. The first frame is sent and acknowledged. The second frame is sent, but lost. After time-out, it is resent. The third frame is sent and acknowledged, but the acknowledgment is lost. The frame is resent. However, there is a problem with this scheme. The network layer at the receiver site receives two copies of the third packet, which is not right. In the next section, we will see how we can correct this problem using sequence numbers and acknowledgment numbers. Example 11.3 11.32
11.33 Figure 11.12: Flow diagram for Example 11.3
Figure 11.13 shows how adding sequence numbers and acknowledgment numbers can prevent duplicates. 1.The first frame is sent and acknowledged. 2.The second frame is sent, but lost. After time-out, it is resent. 3.The third frame is sent and acknowledged, but the acknowledgment is lost. The frame is resent. Example 11.4 11.34
11.35 Figure 11.13: Flow diagram for Example 11.4
11.3611.2.3 The simple & stop-n-wait protocols are designed for unidirectional half-duplex communication.
11.37 11.2.3 Piggybacking More efficient two way communication can be achieved by sending data back with each acknowledgment. This is called piggybacking.
11.38 11-3 High-level Data Link Control HDLC is a bit-oriented protocol for communication over point-to-point and multipoint links. HDLC implements the Stop-and-Wait protocol.
11.39 11-3 High-level Data Link Control HDLC is the basis for other practical protocols such as ● X.25 (old protocol) ● Some wireless protocols ● Frame relay (becoming rare)
11.40 11.3.1 Transfer Modes HDLC provides two common transfer modes that can be used in different configurations: ● normal response mode (NRM) and ● asynchronous balanced mode (ABM).
Normal Response Mode Almost never used The primary node has control of communication The secondary nodes must get approval from the primary mode before sending data.
11.42 Figure 11.14: Normal response mode (IBM X.25)
Asynchronous Balanced Mode Each node acts as a peer (both nodes can send and receive)
11.45 11.3.2 HDLC Framing HDLC defines three types of frames: 1. I-frames, information frames, 2. S-frames, supervisory frames, and 3. U-frames, unnumbered frames.
HDLC Frame Frames have up to 6 fields Stop, end flags Address Control (figure 11.17) Data The FCS section is the frame check sequence, used for error detetion.
11.47 Figure 11.16: Schematic of the HDLC frames
Control Field The control field is used for flow control and error control. P/F means either Pole or the frame is final.
11.49 Figure 11.17: Control field format for the different frame types
Figure 11.18 shows how U-frames can be used for connection establishment and connection release. Node A asks for a connection with a set asynchronous balanced mode (SABM) frame; node B gives a positive response with an unnumbered acknowledgment (UA) frame. After these two exchanges, data can be transferred between the two nodes (not shown in the figure). After data transfer, node A sends a DISC (disconnect) frame to release the connection; it is confirmed by node B responding with a UA (unnumbered acknowledgment). Example 11.5 11.50
11.51 Figure 111.18: Example of connection and disconnection
Figure 11.19 shows two exchanges using piggybacking. The first is the case where no error has occurred; the second is the case where an error has occurred and some frames are discarded. Example 11.6 11.52
11.53 Figure 111.19: Example of piggybacking with and without error
11.54 11-4 PPP A common protocol for point-to-point access is the Point-to-Point Protocol (PPP).
11.55 11-4 PPP Many broadband Internet users use PPP, DSL is an example.
11.56 111.4.1 Services The designers of PPP have included several services to make it suitable for various applications
11.57 111.4.2 Framing PPP uses a character-oriented (or byte-oriented) frame. Figure 111.20 shows the format of a PPP frame.
11.62 111.4.4 Multiplexing Although PPP is a link-layer protocol, it uses another set of protocols to establish the link, authenticate the parties involved, and carry the network-layer data.
11.63 111.4.4 Multiplexing Three sets of protocols are defined to make PPP powerful: 1.the Link Control Protocol (LCP), 2.two Authentication Protocols (APs), and 3.several Network Control Protocols (NCPs). Skip to last slide
Let us go through the phases followed by a network layer packet as it is transmitted through a PPP connection. Figure 111.29 shows the steps. For simplicity, we assume unidirectional movement of data from the user site to the system site (such as sending an e-mail through an ISP). Example 111.7 11.74