TRUYỀN SỐ LIỆU VÀ MẠNG Ch03 data link layer protocols

70 3 0
TRUYỀN SỐ LIỆU VÀ MẠNG Ch03 data link layer protocols

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Data Communication and Networking Dr –Ing Vo Que Son Email: sonvq@hcmut.edu.vn Telecomm Dept Faculty of EEE DCN HCMUT Content Chapter 3: Data Link Layer Protocols Flow Control Error Control Connection Management Data Link Protocols Chapter 4: Telecommunication Networks 802.x standard and TCP/IP Model Ethernet, Token Pass, Token Ring IP Addressing: Classfull and VLSM Network devices Switching and Routing STP, VLAN Telecomm Dept Faculty of EEE DCN HCMUT Framing The data link layer needs to pack bits into frames, so that each frame is distinguishable from another Fixed-Size Framing Variable-Size Framing Telecomm Dept Faculty of EEE DCN HCMUT Flow and Error Control The most important responsibilities of the data link layer are flow control and error control Collectively, these functions are known as data link control Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment Error control in the data link layer is based on automatic repeat request, which is the retransmission of data  Now let us see how the data link layer can combine framing, flow control, and error control to achieve the delivery of data from one node to another The protocols are normally implemented in software by using one of the common programming languages Telecomm Dept Faculty of EEE DCN HCMUT Error Control Forward Error Control (FEC) Usually used in real-time application (e.g voice, video) Accept errors if can not correct List some FEC methods? Error Detection + ARQ (Automatic Retransmission Request) Require absolutely correct data transmission Used in non real-time application (e.g email, file transmission) 2 basic ARQ protocols: • Idle RQ: Bisync (IBM), XModem • Continuous RQ: – Go-back N: e.g HDLC, V.42 – Selective-Repeat: TCP, Service Specific Connection Oriented Protocol Telecomm Dept Faculty of EEE DCN HCMUT Notations P I -frame S ACK frame or NAK frame  P: Primary, sending data frames  S: Secondary, receiving data frames and sending ACK back to Primary  I frame: data/Information frame  I(N): Data frame with sequence N  ACK (Acknowledge) frame: response/reply sent from S back to P, confirm receiving a good I-frame  NAK (Negative Acknowledge) frame: response/reply sent from S back to P, confirm receiving a corrupted I-frame (error frame) Telecomm Dept Faculty of EEE DCN HCMUT Idle RQ  Principle:  P can have only I-frame outstanding (awaiting for an ACK) at a time  On receipt of an error-free ACK frame, P transmits another I-frame  If S receives an I-frame or P receives an ACK containing transmission error: the frame is discarded  If P does not receive an ACK within a given timeout interval: retransmits the waiting I-frame  If an ACK is corrupted, the S receives another copy of the frame and it is rejected by S Telecomm Dept Faculty of EEE DCN HCMUT Idle RQ  Implicit retransmission  P has to wait a timeout interval before retransmission  What is the drawback of this mechanism? How to improve  Explicit retransmission  If S receives a corrupted Iframe: return an NAK to P  If P receives an ACK, stop the timer, and transmit the next frame  If P receives a NAK, retransmit the I-frame  If P does not receives ACK or NAK during a timeout interval, the retransmission by timer Telecomm Dept Faculty of EEE DCN HCMUT Idle RQ Advantages : Send and Wait (Stop and Wait) Small buffers: both P and S keeps only frame Disadvantages: Low link utilization Used in transmission of printable characters Half-duplex applications Notation: N(S): send sequence number N(R): receive sequence number Telecomm Dept Faculty of EEE DCN HCMUT Idle-RQ  Link utilization:  In case BER=0: Tix Tix 1 U=  = = Tt Tix +2Tp 1+2Tp /Tix 1+2a  What is the meaning of parameter a? Telecomm Dept Faculty of EEE DCN HCMUT 10 HDLC  High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-to-point and multipoint links  Support full-duplex, transparent mode operation  Variations: LAPB, LAPD, LAPM  Used in Frame Relay, PPP  Primary station  Control the operation of the data link  Send the command frames  Secondary station  Controlled by Primary station  Send the response frames  Combined station (Both Primary and Secondary)  Can send commands or responses Telecomm Dept Faculty of EEE DCN HCMUT 56 HDLC  Operational modes:  Normal Response Mode (NRM) • Used in unbalanced configuration • Slave stations (secondaries) can transmit only when specially instructed by the master (primary) station • The link may be point-to-point, multipoint (only primary allowed)  Asynchronous Response Mode (ARM) • Used in unbalanced configuration • Allow a secondary to initiate a transmission without receiving permission from the primary • Normally used in point-to-point configuration and duplex links  Asynchronous Balanced Mode (ABM) • Mainly used on duplex point-to-point links • Each station has an equal status and performs both primary and secondary functions Telecomm Dept Faculty of EEE DCN HCMUT 57 HDLC  Frame formats: both data and control messages are carried in a standard format frame  Flag Field (0x7E):     determine the beginning and the end of a frame Receiver must hunt this value for synchronization Bit stuffing if there is a continuous bits “1” If receiver detects continuous bits “1”: • If the next bit is bit 0, it will be removed • If the next bit is bit 1, and 7th bit is bit 0: Flag • If the next bit is bit 1, and 7th bit is bit 1: continue to count number of bits – If number of bits 1=15: idle channel Telecomm Dept Faculty of EEE DCN HCMUT 58 HDLC  Address Field: Depending on operational mode In NRM mode, multi-drop line: each station has unique address If the primary wants to connect with the slave, it will put the slave address in this address field Certain addresses known as group address can be assigned to more than one secondary If the address is all bits 1: broadcast address Not used in ABM mode (point-to-point) Instead, it is used to indicate the direction of commands and their associated responses 8 bit in length, can be expanded with multiple of bits Last octet will have the first bit equal to Telecomm Dept Faculty of EEE DCN HCMUT 59 HDLC Control field: There are frame types in HDLC:  Unnumbered frames (U—frame): used for such functions as link setup and disconnection They not contain any acknowledgement information  Information frame (I-frame): carry the actual information I-frames can be used to piggyback acknowledgement information if the operational mode is ABM or ARM  Supervisory frame (S-frame): are used for error and flow control and hence contain send and receive sequence numbers Telecomm Dept Faculty of EEE DCN HCMUT 60 HDLC  Control field: 1 byte or bytes in length 1 or first bits define the frame type (S,I,U) N(S): send sequence number N(R): receive sequence number P/F: Poll or Select depending on the context: • Command: bit P, request the response from a secondary • Response: bit F, indicating this is the response to a command o Primary to Secondary: If P=1, address is destination o Secondary to Primary: If F=1, address is source Telecomm Dept Faculty of EEE 00 10 01 11 DCN HCMUT 61 HDLC Telecomm Dept Faculty of EEE DCN HCMUT 62 HDLC Extended control bit field definitions Telecomm Dept Faculty of EEE DCN HCMUT 63 HDLC Information field: Contained in I-frame and U-frame Variable length Multiple of bytes FCS field: Error detection CRC 16 or CRC32 Telecomm Dept Faculty of EEE DCN HCMUT 64 HDLC Link Management Setup connection Disconnection Telecomm Dept Faculty of EEE DCN HCMUT 65 HDLC  Data transfer:  V(S) indicates the next send sequence number N(S), which is allocated to an I-frame transmitted by that station  V(R) is the send sequence number of the next in-sequence I-frame expected by that station  At receiver, if N(S)= V(R): receive correct sequenced frame  Bit P means: this frame needs an response from the receiver (by bit F) Telecomm Dept Faculty of EEE a with RR frames only and Go-back-N strategy DCN HCMUT 66 HDLC  Data transfer:  Negative Acknowledgement  Go-back-N  Using REJ/RR b with NAK frames and Go-back-N strategy Telecomm Dept Faculty of EEE DCN HCMUT 67 HDLC  Piggyback without errors:  Example: an exchange using piggybacking Node A begins the exchange of information with an I-frame followed by another I-frame  Node B piggybacks its acknowledgment of both frames onto an I-frame of its own Node B’s first Iframe is also numbered [N(S) field] and contains a in its N(R) field, acknowledging the receipt of A’s frames and and indicating that it expects frame to arrive next Node B transmits its second and third Iframes (numbered and 2) before accepting further frames from node A Its N(R) information, therefore, has not changed: B frames and indicate that node B is still expecting A’s frame to arrive next Node A has sent all its data Therefore, it cannot piggyback an acknowledgment onto an I-frame and sends an Sframe instead The RR code indicates that A is still ready to receive The number in the N(R) field tells B that frames 0, 1, and have all been accepted and that A is now expecting frame number Telecomm Dept Faculty of EEE DCN HCMUT 68 HDLC  Piggyback with errors:  Example: an exchange in which a frame is lost Node B sends three data frames (0, 1, and 2), but frame is lost  When node A receives frame 2, it discards it and sends a REJ frame for frame Note that the protocol being used is Go-Back-N with the special use of an REJ frame as a NAK frame The NAK frame does two things here: It confirms the receipt of frame and declares that frame and any following frames must be resent  Node B, after receiving the REJ frame, resends frames and Node A acknowledges the receipt by sending an RR frame (ACK) with acknowledgment number Telecomm Dept Faculty of EEE DCN HCMUT 69 HDLC  Some other cases: Telecomm Dept Faculty of EEE DCN HCMUT 70

Ngày đăng: 12/04/2023, 21:00

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan