CEG3185 TUT6. Prepared by Zhenxia Zhang Revisited by Jiying Zhao

Similar documents
Data Link Control Protocols

3. Data Link Layer 3-2

Flow control: Ensuring the source sending frames does not overflow the receiver

INTERNET ARCHITECTURE & PROTOCOLS

Data Link Control. Claude Rigault ENST Claude Rigault, ENST 11/3/2002. Data Link control 1

Data and Computer Communications

(Sicherungsschicht) Chapter 5 (part 2) [Wa0001] HDLC - 1.

Data Link Layer (cont.) ( h h h ) (Sicherungsschicht) HDLC - 1.

Data link layer functions. 2 Computer Networks Data Communications. Framing (1) Framing (2) Parity Checking (1) Error Detection

William Stallings Data and Computer Communications. Chapter 7 Data Link Control

Chapter 3. The Data Link Layer. Wesam A. Hatamleh

HDLC. King of the Link 2005/03/11. (C) Herbert Haas

Advanced Computer Networks. Rab Nawaz Jadoon DCS. Assistant Professor COMSATS University, Lahore Pakistan. Department of Computer Science

Chapter 7: Data Link Control. Data Link Control Protocols

Chapter 7: Data Link Control. CS420/520 Axel Krings Page 1


HDLC (High level Data Link Control)

Line Protocol Basics. HDLC (High level Data Link Control) Agenda. Additional Issues

HDLC PROTOCOL. Michel GARDIE

Data Link Protocols DATA LINK PROTOCOLS. Asynchronous Protocols. Types of Data Link Protocols XMODEM. Asynchronous Protocols.

SRI RAMAKRISHNA INSTITUTE OF TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY COMPUTER NETWORKS UNIT - II DATA LINK LAYER

Data Link Layer. Learning Objectives. Position of the data-link layer. MCA 207, Data Communication & Networking

Chapter 5 Data-Link Layer: Wired Networks

HDLC. Telecom Systems Chae Y. Lee

This Lecture. BUS Computer Facilities Network Management. Line Discipline. Data Link Layer

TYPES OF ERRORS. Data can be corrupted during transmission. Some applications require that errors be detected and corrected.

POS SDLC EXPLAINED WHAT IS SDLC? SDLC on POS terminals SYNCHRONOUS DATA LINK CONTROL ON PAYMENT TERMINAL NETWORKS

The University of Sydney AUSTRALIA. Advanced Communication Networks

Chapter 3. The Data Link Layer

Data Link Layer, Part 4. Exemplary Protocols

Other Data Link Protocols: Computer Networks by Prof Kamal K Mehta Associate Professor Dept of Computer Science & Engineering

DATA LINK LAYER: NEED

INTERNATIONAL TELECOMMUNICATION UNION. SERIES X: DATA NETWORKS AND OPEN SYSTEM COMMUNICATION Public data networks Interfaces

INTERNATIONAL TELECOMMUNICATION UNION. SERIES X: DATA COMMUNICATION NETWORKS: SERVICES AND FACILITIES, INTERFACES Interfaces

DATA LINK CONTROL PROTOCOLS

Chapter 5 Peer-to-Peer Protocols. School of Info. Sci. & Eng. Shandong Univ..

Chapter 11 Data Link Control 11.1

Appendix. Pioneering Protocols

Telecom Systems Chae Y. Lee. Contents. Flow Control Error Detection/Correction Link Control (Error Control) Link Performance (Utility)

1.Describe the layer presentation in the TCPIP model and explain the protocol of each layer. July 2014/Jan 2015

Chapter 11 Data Link Control 11.1

Institute of Computer Technology - Vienna University of Technology. L02 - Protocol Principles

Packet Switching. Communication Networks Chapter 10: Connection-Oriented PDNs

OSI Reference Model. Application Layer. Presentation Layer. Session Layer. Chapter 4: Application Protocols. Transport Layer.


Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

Data Link Control. Outline. DLC functions

King Fahd University of Petroleum & Minerals Computer Engineering g Dept

3GPP TS V ( )

Infrared Data Association. Serial Infrared Link Access Protocol (IrLAP)

ISO/IEC INTERNATIONAL STANDARD

Transmission SIGNALs

Computer Network : Lecture Notes Nepal Engineering College Compiled by: Junior Professor: Daya Ram Budhathoki Nepal Engineering college, Changunarayan

3GPP TS V7.2.0 ( )

INTERNATIONAL TELECOMMUNICATION UNION. SERIES Q: DIGITAL SUBSCRIBER SIGNALLING SYSTEM No. 1 (DSS 1), DATA LINK LAYER

Request for Comments: 935 January 1985

AX.25 Link Access Protocol. for Amateur Packet Radio. Version 2.2 Revision: 28 August 2017

Data Link Layer (part 2)

Data Link Control Protocols

ETSI TS V7.1.0 ( )

Communication Networks

COMPUTER NETWORKS Data link layer protocols

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING

CSMC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 4. September 09 CMSC417 Set 4 1

CS 4453 Computer Networks Winter

DTIC. NAVAL POSTGRADUATE SCHOOL Monterey, California i45. 7' t A D. 'Il NETWORKS199. June Thesis Advisor: Tr T. Ha.

ETSI TS V5.2.0 ( )

3GPP TS V8.0.0 ( )

Protocol Principles. Framing, FCS and ARQ 2005/03/11. (C) Herbert Haas

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

Automatic Repeat Request Data Link Layer Traffic Management

ETSI TS V4.1.0 ( )

ETSI TS V ( ) Technical Specification

COMPUTER NETWORKS UNIT 3

Framing and Stuffing. Advanced Computer Networks

Point-to-Point Links. Outline Encoding Framing Error Detection Sliding Window Algorithm. Fall 2004 CS 691 1

CS 640 Introduction to Computer Networks. Role of data link layer. Today s lecture. Lecture16

DNx-SL-504. User Manual

Telematics. 5rd Tutorial - LLC vs. MAC, HDLC, Flow Control, E2E-Arguments

Design of a High-Level Data Link Controller

CSE 123: Computer Networks

I. INTRODUCTION. each station (i.e., computer, telephone, etc.) directly connected to all other stations

The Data Link Layer. Data Link Layer Design Issues

CS422 Computer Networks

DCO2310. Tutorial Questions. for. Data Communications. CHOI yiu kuen (15/1/2000)

Data Link Technology. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science

MYcsvtu Notes UNIT II

Communication Networks. Part I

Politecnico di Milano Scuola di Ingegneria Industriale e dell Informazione. Link Layer. Fundamentals of Communication Networks

Overview ISDN. Agenda. Some ISDN Facts

(Larry Butler) Solectek Corporation Fax: Nancy Ridge Dr Suite #109

INTERNATIONAL CIVIL AVIATION ORGANIZATION

Chapter 9: Data Transmission

Narrowband ISDN. (ISDN = Integrated Services Digital Network)

Direct Link Networks. Framing. Lecture - Encoding & Framing 1. Problems. Areas for Discussion

CONNECTION-ORIENTED & CONNECTIONLESS NETWORKS

COMPUTER NETWORKS UNIT I. 1. What are the three criteria necessary for an effective and efficient networks?

The data link layer has a number of specific functions it can carry out. These functions include. Figure 2-1. Relationship between packets and frames.

Flexibility in Frame Size with the 8044

Line Protocols. Protocol Principles. Two Important Principles for Data Communication. Agenda

Transcription:

CEG3185 TUT6 Prepared by Zhenxia Zhang Revisited by Jiying Zhao

HDLC High Level Data Link Control (HDLC) is a bit oriented synchronous data link layer protocol developed by the International Organization for Standardization (ISO). Unbalanced Normal Response Mode (NRM) Asynchronous Response Mode (ARM) Balanced Asynchronous Balanced Mode (ABM)

HDLC Primary station Controls operation of link Frames issued are called commands Maintains separate logical link to each secondary station Secondary station Under control of primary station Frames issued called responses

Framing Frame delimiter: 8bits Each frame begins and ends with a frame delimiter. This sequence is '01111110', or, in hexadecimal notation, 7E Address: 8 or more bits In NRM, frames include only one address, that of the secondary terminal.

Framing Control: 8bits or 16 bits Information frames, or I frames, transport user data from the network layer. In addition they can also include flow and error control information piggybacked on data. Supervisory Frames, or S frames, are used for flow and error control whenever piggybacking is impossible or inappropriate, such as when a station does not have data to send. S frames do not have information fields. Unnumbered frames, or U frames, are used for various miscellaneous purposes, including link management. Some U frames contain an information field, depending on the type.

Framing I frame The least significant bit (first transmitted) is 0. N(S) defines the sequence number of send frame. P/F N(R) defines the receive sequence number.

Framing S frame The first two bits are 10. The 2 bit code field encodes the type of S frame Receive Ready (RR): 00 Receive Not Ready (RNR): 01 Reject (REJ): 10 Selective Reject (SREJ): 11 P/F N(R)

Framing U frame

Framing Poll/Final bit Poll bit Command frame 1 to solicit (poll) response from peer The primary only sends a Poll when it has received a Final back from the secondary, or after a timeout indicating that the bit has been lost. Final bit Response frame The secondary only sends a Final when it has received a Poll from the primary.

Framing Bit stuffing Any time that 5 consecutive 1 bits appear in the transmitted data, the data is paused and a 0 bit is transmitted. This ensures that no more than 5 consecutive 1 bits will be sent. The receiving device knows this is being done, and after seeing 5 1 bits in a row, a following 0 bit is stripped out of the received data. If the following bit is a 1 bit, the receiver has found a flag.

Framing FCS: Frame Check Sequence a cyclic redundancy check computed over the entire frame, including the 'Address', 'Control' and 'Information' fields. The Frame Check Sequence is either a 16 bit CRC CCITT or a 32 bit CRC 32.

Lab4 At least three stations: A is primary. B and C are secondary. Assumption: All the stations will initialize and keep correct N(S) and N(R) for the sending and receiving. We don t need implement time out, FCS and bit stuffing. We can use string to represent flag, address and control fields. Java socket is used to simulate the physical layer. SmtpClient: one point to another Chat: one to multipoint

Lab4 pseudo codes for A P0: send SNRM to B /*initialization*/ send SNRM to C wait for UA from B wait for UA from C P1: send RR,*,P to B received RR,*,F from B? yes, goto P2 no, received I, *, * from B? goto P5

Lab4 pseudo codes for A P2: send RR,*,P to C /*ask C whether there is anything to send*/ received RR,*,F from C? /* no data to send from C? */ yes, goto P3 no, received I, *, * from B? goto P6 P3: any frame to send to B? yes, send I,*,* to B P4: any frame to send to C? yes, send I,*,* to C goto P0 /* next loop */

Lab4 pseudo codes for A P5: is the frame to A or C? /* process the frame form B*/ to A, consume to C, buffer the frame to send goto P2 P6: is the frame to A or B? /* process the frame from C */ to A, consume to B, buffer the frame to send goto P3

Lab4 pseudo codes for B & C S0: wait for SNRM from A send UA to A S1: wait for frame from A /* the frame could be RR or I */ RR,*,P? yes, any frame to send? /* RR frame */ yes, send I,*,* to A goto S1 no, send RR,*,F to A goto S1 S2: no, receive I frame from A /* I frame */ consume goto S1

Lab 4 Week of 02/24/2014 and week of 03/03/2014 Due: one week after respective sessions, at noon Lab report is required to detail the design of the medium access control, all assumptions made, algorithms (flowcharts) for the primary and secondary stations, and all other information needed for the design and implementation. The Java programs for both the primary and secondary stations must be submitted. The lab will be conducted in group of three students.

Lab 4 Marking HDLC basic function: 70% Sending, receiving Sliding window: 10% Report: 20%

Bitwise operation in Java The unary bitwise complement operator "~" inverts a bit pattern The bitwise & operator performs a bitwise AND operation. The bitwise ^ operator performs a bitwise exclusive OR operation. The bitwise operator performs a bitwise inclusive OR operation.

BitSet class Constructor BitSet(int nbits) Creates a bit set whose initial size is large enough to explicitly represent bits with indices in the range 0 through nbits 1. void set(int bitindex) Sets the bit at the specified index to true. void clear(int bitindex) Sets the bit specified by the index to false.

Converting Between a BitSet and a Byte Array public static BitSet frombytearray(byte[] bytes) { BitSet bits = new BitSet(); for (int i=0; i<bytes.length*8; i++) { if ((bytes[bytes.length i/8 1]&(1<<(i%8))) > 0) { bits.set(i); } } return bits; }

Converting Between a BitSet and a Byte Array public static byte[] tobytearray(bitset bits) { byte[] bytes = new byte[bits.length()/8+1]; for (int i=0; i<bits.length(); i++) { if (bits.get(i)) { bytes[bytes.length i/8 1] = 1<<(i%8); } } return bytes; }