Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 69 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
69
Dung lượng
5,03 MB
Nội dung
Data Communication and Ema sonv il: Networ q@hcmut.edu king Telecomm Dept Faculty of EEE DCN‐ 2013 HCM UT Cont Chapter 3: Data Link Layer Protocolsent Flow Control Error Control Connection Management Data Link Protocols Chapter 4: Netwo Industrial rks CAN Networks MODBUS Networks Applications Telecomm Dept Faculty of EEE DCN‐ 2013 HCM UT Framing The data link layer needs to s that each frame is fro anot pack bits into frames, o distinguishable m her Variabl Frami Fixed‐Size Framing e‐Size Telecomm Dept Faculty of EEE ng DCN‐ 2013 HCM UT Flow and Error The most important Control 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 implemented in b usi on o th com procedures used to restrict program langua software ydata ng that e f the e mon Telecomm DCN‐ the amount of sender ming ges Dept 2013 Faculty of send before HCM can EEE UT Error Forward Error Control (FEC) Control Usually used in real‐time application (e.g voice, video) Requ Accept Error Detection + ARQ (Automatic errors if can not correct est) Retransmission List some FEC methods? Require absolutely correct data transmission Used in non real‐time application (e.g email, file Telecomm DCN‐ transmission) Dept 2013 Facultybasic of HCM 2 ARQ protocols: EEE UT P P: Notations I‐ fram ACK frame e or NAK frame S Primary, sending data sendi ACK frames ng back to S: Secondary, receiving data frames and Primary ACK (Acknowledge) frame: I frame: data/Information frame response/reply sent from S back to I(N): Data frame with sequence N SP,back confi receiv acorrup I‐ (err confirm receiving a good I‐frame NAK toTelecomm P,(Negative rmAcknowledge) ing frame: ted response/reply fram orsent DCN‐ from Dept 2013 frame) e Faculty of HCM EEE UT Idl R Princi P can have only ple: I‐frame e Q 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 Telecomm given timeout Dept Faculty of interval: EEE DCN‐ 2013 HCM UT Implicit retransmission P has to wait a timeout If S receives a interval before corrupted I‐ retransmission return frame: What is the an NAK to P drawback of this If P receives an ACK, mechanism? How stop the to improve timer, and transmit Explicit the next Telecomm frame retransmission Dept Faculty of If P receives a NAK, EEE Idle RQ DCN‐ 2013 HCM UT Idle Advantages : RQ Send and Wait Small buffers: S (Stop both Pand andWait) keeps only frame Disadvantages: Low link utilization Used N(R): in seque transmission of receive nce Telecomm Dept printable number Faculty of EEE DCN‐ 2013 HCM UT Link utilization : In case BER=0: Idle‐RQ T ix = U T T ix=+2T1p Tt = Total average1+2T delayp /Tix 1+2a ≈ ix per frame? Telecomm Dept Faculty of EEE DCN‐ 2013 HCM UT High‐level Data Link Control (HDLC) is a bit‐oriented protocol for communication over point‐to‐point and multipoint links HDLC Support full‐duplex, transparent mode operation Variations: LAPB, LAPD,LAPM Used in Frame Relay, PPP Primary station Control the operation of the data link Telecomm Dept Send the command frames Secondary Faculty ofstation EEE Controlled by Primary station DCN‐ 2013 HCM UT 5 HDLC Operational • modes: Used in unbalanced configuration • Slave stations (secondaries) can transmit only •Normal Response when specially instructed Mode (NRM) Asynchronous by the master (primary) station Used in unbalanced configuration Response The linkMode may be(ARM) point‐to‐point, multipoint Allow a secondary to initiate a • (only primary allowed) transmission without receiving Asynchronous Mode (ABM) permission fromBalanced the primary • Normally Mainly used point‐to‐point usedoninduplex point‐to‐point links configuration and duplex links • Each station has an equal status and Telecomm DCN‐ performs both primary and Dept 2013 Faculty of HCM secondary functions EEE UT • • frame HD LC Frame formats: both data and control messages are carried in a standard format Flag Field determine the beginning and (0x7E): the end of a frame Receiver must hunt this value • If the next bit is bit 0, it for • synchronization If the next bit is 7t bit is bit • will be removed the next bit is bit 7th bit is bit 1: continue Bit If stuffing if there ish a1, and bit 0: Flag – 1, and If number of bits 1=15: DCN‐ bits “1”: Dept 2013 Faculty of idle channel HCM EEE UT Address Field: HDLC Depending on operational mode In NRM mode, multidrop line: each station has unique address If the primary wants to connect with the slave, it will put the slave 8 bit in length, can be o 7bit addresswiinha this address field Certain Last th fir bi equ t expanded with multiple f s addresses known octet ll ve e st as t al o Telecomm DCN‐ group address can be assigned to more Dept 2013 Faculty of HCM than one EEE UT HDLC Control field: There are Unnumbered frames (U—frame): used for such functions asin linkHDLC: setup frame types 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 Telecomm DCN‐ Supervisory frame (S‐frame): are used for Dept 2013 Faculty HCM errorof and flow control and EEE UT HD Control field: 1 byte or bytes in LC length type (S,I,U) P/F: Select thefrom a secondary 1• Command: or 2Poll first bitor P, bits request the response depending • Response: onbit F, indicating this is the context: define the frame response to asequence command N(S): send number N(R): receive 0 sequence number Telecomm Dept Faculty of EEE 1 DCN‐ 2013 HCM UT HDLC Telecomm Dept Faculty of EEE DCN‐ 2013 HCM UT HDLC cont bi fiel definiti Extende rol t d ons d Telecomm Dept Faculty of EEE DCN‐ 2013 HCM UT Information an U‐ field: Contained in I‐ frame Variable length Multiple of bytes HDLC d fram e CRC FCS field:o CRC 16 r 32 Error detection Telecomm Dept Faculty of EEE DCN‐ 2013 HCM UT Link Management HDLC Setup connection Disconnect ion Telecomm Dept Faculty of EEE DCN‐ 2013 HCM UT Data V(S) indicates the next send sequence transfer: 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 Telecomm frame needs an Dept response from the Faculty of receiver (by bit F) EEE HD LC DCN‐ 2013 HCM UT Data transfer: HDLC Negative Acknowledg ement Go‐back‐N Using REJ/RR Telecomm Dept Faculty of EEE DCN‐ 2013 HCM UT 6 Piggyback Example: an exchange using piggybacking Node A without errors: 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 I‐ frame is also numbered [N(S) field] and contains a in its N(R) field, acknowledging the receipt of A’s Telecomm frames and and indicating that Dept it expects frame Faculty of EEE to arrive next Node B transmits its HDLC DCN‐ 2013 HCM UT HD Piggyback with Example: an exchange in errors: which a frame is LC 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 Telecomm frame as a NAK Dept Faculty of frame The NAK frame does EEE DCN‐ 2013 HCM UT So oth cas me er es: Telecomm Dept Faculty of EEE HDLC DCN‐ 2013 HCM UT ...Cont Chapter 3: Data Link Layer Protocolsent Flow Control Error Control Connection Management Data Link Protocols Chapter 4: Netwo Industrial rks CAN Networks... most important Control 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 implemented... protocol Determine the 2.1 velocity of i m an link utilization for /s d propagation of the s twisted the following types1of data link pair cable link A km in length assuming a data satell lin