Telecommunication Protocols Laboratory Course

Similar documents
Reference Models. 7.3 A Comparison of the OSI and TCP/IP Reference Models

EEC-484/584 Computer Networks

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

Chapter 3. The Data Link Layer

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Nguyễn Đức Thái

DATA LINK LAYER UNIT 7.

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

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

The flow of data must not be allowed to overwhelm the receiver

Review of Lecture 1. EEC-484/584 Computer Networks. Network Hardware. Outline. Lecture 2. Wenbing Zhao

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

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

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.

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

Lecture-4. TCP/IP-Overview:

Outline. EEC-682/782 Computer Networks I. Course Objectives. Outline of Lectures

CS422 Computer Networks

Networking Link Layer

Outline. EEC-484/584 Computer Networks. Data Link Layer Design Issues. Framing. Lecture 6. Wenbing Zhao Review.

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

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

ERROR AND FLOW CONTROL. Lecture: 10 Instructor Mazhar Hussain

Introduction to Protocols

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

Introduction to Open System Interconnection Reference Model

Peer entities. Protocol Layering. Protocols. Example

Chapter 1. Introduction

Jaringan Komputer. Data Link Layer. The Data Link Layer. Study the design principles

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

Department of Computer and IT Engineering University of Kurdistan. Data Communication Netwotks (Graduate level) Data Link Layer

Data and Computer Communications. Chapter 2 Protocol Architecture, TCP/IP, and Internet-Based Applications

Text Books. What is a network? Classification of Networks. Computer Communication and Networks 9/1/2014

The Data Link Layer Chapter 3

OSI Layer OSI Name Units Implementation Description 7 Application Data PCs Network services such as file, print,

Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission

UNIT 1. Advantages of Computer Networks

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

Overview. Data Link Technology. Role of the data-link layer. Role of the data-link layer. Function of the physical layer

APPENDIX F THE TCP/IP PROTOCOL ARCHITECTURE

Concept Questions Demonstrate your knowledge of these concepts by answering the following questions in the space that is provided.

Networking and Internetworking 1

Network Model: Each layer has a specific function.

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

CCNA Exploration1 Chapter 7: OSI Data Link Layer

Chapter Six. Errors, Error Detection, and Error Control. Data Communications and Computer Networks: A Business User s Approach Seventh Edition

CS 4453 Computer Networks Winter

infrared Disadvantage: 1. cannot use for long-range communication or outside a building due to sun s rays.

ET4254 Communications and Networking 1

Connectionless and Connection-Oriented Protocols OSI Layer 4 Common feature: Multiplexing Using. The Transmission Control Protocol (TCP)

Chapter -4 OSI Reference Model

Data Link Control Protocols

Data & Computer Communication

User Datagram Protocol (UDP):


Chapter 1 : Introduction to Computer Networks

Need For Protocol Architecture

King Fahd University of Petroleum & Minerals Computer Engineering g Dept

3. Data Link Layer 3-2

4.0.1 CHAPTER INTRODUCTION

UNIT I FUNDAMENTALS & LINK LAYER

Peer-to-Peer Protocols and Data Link Layer. Chapter 5 from Communication Networks Leon-Gracia and Widjaja

Need For Protocol Architecture

Local Area Networks and the Network Protocol Stack

Layer 2 functionality bridging and switching

Internetworking Models The OSI Reference Model

Chapter 1: OSI Model

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

Lecture (11) OSI layer 4 protocols TCP/UDP protocols

Session 1. Introduction to Computer Communications and Networking. Communication Network. A communication network consists of a set

4. Error correction and link control. Contents

The Data Link Layer Chapter 3

Chapter 6. What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control

RAJIV GANDHI COLLEGE OF ENGINEERING AND TECHNOLOGY

Data Transport over IP Networks

Overview of Networks

(a) Client server model (b) MAN (c) Interfaces and services. [4+6+6] FirstRanker

SUBJECT: DATA COMMUNICATION AND NETWORK SEMESTER: V SEMESTER COURSE: BCA SUBJECT TEACHER: Dr.K.Chitra Assistant Professor, Department of Computer

CS-461 Internetworking. Dr. Mohamed Aboutabl

IP Packet Switching. Goals of Todayʼs Lecture. Simple Network: Nodes and a Link. Connectivity Links and nodes Circuit switching Packet switching

System Programming. Introduction to computer networks

ELC 537 Communication Networks

Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

August AppleTalk tunneling, which allows AppleTalk data to pass through foreign networks and over point-to-point links

Introduction to Data Communications & Networking

Computer Communication and Networks

PART III. Data Link Layer MGH T MGH C I 204

Data Link layer (CN chap 3.1, 3.4, 3.6)

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

EEC-682/782 Computer Networks I

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

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

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

CPS221 Lecture: Layered Network Architecture

UNIT-II 1. Discuss the issues in the data link layer. Answer:

CN1047 INTRODUCTION TO COMPUTER NETWORKING CHAPTER 6 OSI MODEL TRANSPORT LAYER

THE TRANSPORT LAYER UNIT IV

Computer Network. Direct Link Networks Reliable Transmission. rev /2/2004 1

EITF25 Internet Techniques and Applications L7: Internet. Stefan Höst

Transcription:

Telecommunication Protocols Laboratory Course G721 Lecture 1

Behind the name Telecommunication: the science and technology of transmitting information (words, sounds, images) over great distances, in the form of electromagnetic signals (telegraph, telephone, radio, TV) In short: communication at a distance Protocol: a set of conventions for the treatment and formatting of data in an electronic communications system Underlying framework : COMPUTER NETWORKS March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 2

Communication Application Application Network March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 3

Practicalities Schedule: Wednesdays 14-16 Components Lectures (10h), project work (weeks 12-21) 2 credits, no examination Registration Students should register to the course via https://www.it.abo.fi/anmalan/. Webpage http://www.abo.fi/~lpetre/teleprot06/ March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 4

The book We use as textbook Computer Networks, 4th edition, by Andrew Tanenbaum, Prentice Hall, 2003. March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 5

Project work During the lectures we study various network protocols Students group into teams (2-4 members) Each team chooses 3 protocols to simulate The programming environment is chosen by the team The work of the team is documented using a given format as well as a log The programs have to work There are deadlines March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 6

Networks Definition: autonomous computing systems (NODES) are interconnected Advantage resources are accessible independently of their physical location resource sharing and redundancy parallel processing improved reliability, availability, and performance Tradeoff: increased complexity March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 7

Network applications Business applications Resource sharing (e.g. printers, data), communication medium (interoffice and internet, online collaboration, videoconferencing), e-commerce Home applications Access to remote information (e.g. newspapers, online libraries, weather, internet radio) Person-to-person communication (email, instant messaging, chat rooms, newsgroups, peer-to-peer communication, telephony, tele-learning) Interactive entertainment (video-on-demand, games) E-commerce March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 8

Network applications 2 Wireless and mobile users Portable office: conference sites, campuses Trucks, taxis, delivery vehicles, repair persons Military March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 9

Network taxonomy Criterion: transmission technology Broadcast links Point-to-point links Criterion: scale (geographical extent) Very local area networks (personal area network) Local area networks LAN Metropolitan area networks MAN Wide area networks WAN Inter-networks Criterion: organization Private networks Public networks Other criterions Wireless networks Home networks March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 10

Networks for Communication Basic form of communications shared memory message exchange Networks are loosely coupled, they are links without memory there is no shared memory applications residing on different nodes cooperate ONLY by passing messages to each other March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 11

Network Layers Networks organized as stacks of layers Each layer is built upon the one below it offers certain services to the higher layers shields higher layers from the implementation of the services The number, contents, functions and names of layers depends on the network Layer n on one machine communicates with layer n on another machine Rules and conventions used in this: layer n protocol Entities comprising the corresponding layers on different machines: peers (processes, hardware devices, humans) March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 12

Interfaces Between each pair of adjacent layers The primitive operations and services the lower layer makes available to the upper one Clean and clear-cut interfaces Each layer performs a specific collection of wellunderstood functions Simplify the replacement of a layer implementation with a completely different implementation Minimize the amount of information that must be passed between layers March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 13

Layers, protocols, and interfaces March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 14

Network architecture Is a set of layers and protocols The specification of the architecture should contain enough information for building layers that obey the protocols Interfaces and details of implementation are not part of the architecture Protocol stack list of protocols, one per layer, used by a certain system March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 15

Protocol Stack 1 Location A Location B 3 I like rabbits Message Philosopher J'aime bien les lapins 3 2 L: Dutch Ik vind konijnen leuk Information for the remote translator Translator L: Dutch Ik vind konijnen leuk 2 1 Fax #--- L: Dutch Ik vind konijnen leuk Information for the remote secretary Secretary Fax #--- L: Dutch Ik vind konijnen leuk 1 The philosopher-translator-secretary architecture.

Protocol Stack 2 Example information flow supporting virtual communication in layer 5.

Design Issues for the Layers Addressing Layers need to identify senders and receivers Data Transfer Rules Directions of data travel, logical channels Error Control Many error-detecting and error-controlling codes exist The peers have to agree on which ones are used The receiver has to inform the sender about correctly received messages Flow Control Keep a faster sender from swamping a slow receiver Arbitrarily long messages Multiplexing and de-multiplexing Using the same connection for multiple, unrelated communications Routing If multiple paths between source and destination exist, a route must be chosen

Types of services Layers offer 2 types of services to the layers above them Connection-oriented Connectionless Connection-oriented network service Service user establishes connection, uses it, then releases it Connection tube Negotiation between sender, receiver, subnet on parameters such as: maximum message size, quality of service, etc Connectionless network service Each message carries the full destination address and is routed through the system independently of all the others March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 19

Quality of service Usually refers to reliability of services (not losing data) implemented by having the receiver acknowledge the receipt of each message so the sender is sure it arrived acknowledgement process introduces overhead and delays March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 20

Reference models Network architectures OSI reference model Open System Interconnection TCP/IP reference model Transmission Control Protocol/Internet Protocol OSI The associated protocols are not really used The model is quite general and still valid Features discussed at each layer are still important TCP/IP The model is not of much use The protocols are widely used March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 21

OSI/ISO reference model Based on a proposal of ISO (International Standards Organization) Intended as a first step toward international standardization of protocols used in the various layers (1983, revised 1995) It deals with connecting open systems (systems open for communication with other systems) March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 22

OSI model

Physical layer Concerned with transmitting raw bits over a communication channel When a 1-bit is sent, a 1-bit has to be received, not a 0-bit Typical questions How many volts used to represent a 1, how many for a 0 How many ns a bit lasts Whether transmission can proceed simultaneously in both directions How the initial connection is established and how is it then torn down How many pins the network connector has and what are their uses Design issues Mechanical, electrical and timing interfaces Physical transmission medium March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 24

Data Link Layer Transforms a raw transmission facility into a line that appears free of undetected transmission errors to the above network layer Obliges the sender to break up input data into data frames (few hundred or thousands bytes each) and transmit frames sequentially If service reliable => receiver confirms correct receipt of each frame by sending back an acknowledgement frame Flow control regulations and error handling are integrated Medium access control sub-layer Controls access to a shared channel (for broadcast networks) March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 25

Network layer Controls the operation of a subnet Key design issue: how are packets routed from source to destination Routes: static / determined at initialization / highly dynamic Controls the bottlenecks in the subnet Handles quality of service issues: delay, transit time, jitter, etc Compatibility among different networks (addressing, max message sizes, different protocols) Broadcast networks: this layer is very thin March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 26

Transport layer Accepts data from the above layers and manipulates it, ensuring that it arrives correctly at the destination Efficiency is important Hiding the hardware from the above layers also important When a connection is established, the type of service is determined, e.g. Error-free, point-to-point channel Transporting isolated messages Broadcasting True end-to-end layer a program on the source machine carries on a conversation with a similar program on the destination machine using message headers and control messages In contrast, layers 1-3 are chained

Session layer Allows users on different machines to establish sessions between them Session services Dialog control: keeping track of whose turn it is to transmit Token management: preventing 2 parties from attempting the same critical operation at the same time Synchronization: check-pointing long transmissions to allow them to continue from where they were after a crash March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 28

Presentation layer Concerned with the syntax and semantics of the transmitted information Data structures to be exchanged can be defined in an abstract way, along with a standard encoding to be used on the wire Useful for computers with different data representation Manages these abstract data structures and allows higher-level data structures to be defined and exchanged E.g. banking records March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 29

Application layer Contains a variety of protocols commonly needed by users E.g. HTTP basis for WWW File transfer Electronic mail Network news March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 30

TCP/IP reference model US Department of Defense sponsored a research network called ARPANET (1960s) that needed ultimately to interconnect with satellites and radio networks a reference architecture was needed Major goal: the ability to connect multiple networks in a seamless way Another major goal: the ability to survive loss of subnet hardware with existing conversations not being broken off Also: flexible architecture a packet-switching network, based on a connectionless inter-network layer was conceived March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 31

TCP/IP model March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 32

Internet layer Connectionless inter-network layer that holds TCP/IP architecture together It permits hosts to inject packets into any network and have them travel independently to the destination (in possibly another network) Defines an official packet format and protocol called IP (internet protocol) It delivers IP packets to their destination Major issues: packet routing and avoiding congestion Similar in functionality to OSI network layer March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 33

Transport layer Allows peer entities on the source and destination hosts to carry on a conversation Similar to the OSI transport layer 2 end-to-end transport protocols are defined here: TCP (transmission control protocol) UDP (user datagram protocol) March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 34

Hybrid Model March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 35

Layers we will cover Application Layer Transport Layer Network Layer Medium Access Control Sub-layer Logical Link Sub-layer March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 36

The Logical Link sub-layer Studies algorithms for achieving reliable and efficient communication between 2 adjacent machines at DLL Adjacent machines: connected by a wirelike communication channel Bits delivered in exactly the same order in which they are sent Problems to be handled Errors made by communication circuits Finite data rate of communication circuits Non-zero propagation delay

Functions of the Logical Link Layer Interface function: provides service interface to the network layer Error control function: deals with transmission errors Framing Error detection and retransmission Flow control function: regulates data flow, so that slow receivers are not swamped by fast senders

Services Provided to Network Layer (a) Virtual communication. (b) Actual communication.

LLC services Unacknowledged connectionless service Acknowledged connectionless service Acknowledged connection-oriented service March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 40

Unacknowledged connectionless service Source sends independent frames to destination Destination does not acknowledge the frames No logical connection is used If a frame is lost, this is not detected and the frame is not recovered Appropriate when error rate is very low, recovery left to upper layers for real-time traffic (voice) where late data is worse than bad data Most LANs use unacknowledged connectionless service

Acknowledged connectionless service Each frame sent is individually acknowledged The sender knows whether a frame has arrived correctly If an acknowledgement has not arrived within a specified time, frame can be sent again No logical connection is used Appropriate in unreliable channels (e.g., wireless systems) Acknowledgements in LLC: optimization, not requirement

Acknowledged connection-oriented service Source and destination establish a connection before any data is transmitted Frames are numbered LLC guarantees that each frame sent is indeed received each frame sent is received only once all frames are received in the right order Connection-oriented service provides a reliable bit stream 3 phases: establish connection, send, release connection

Framing idea To provide service to NL, LLC uses service of PhL PhL accepts a bit stream and delivers it to destination Bit stream not guaranteed to be error-free It is up to LLC to detect and, if necessary, to correct errors LLC breaks the bit stream into discrete frames and computes some checksum C for each frame At destination the checksum of the received frames recomputed in C If C C DLL knows an error occurred Framing = breaking the bit stream into frames

Frames Relationship between packets and frames. March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 45

Framing methods Character count Flag bytes with byte stuffing Starting and ending flags with bit stuffing PhL coding violations Many LLC protocols use a combination of character count with one of the other methods, for extra safety March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 46

Character count framing A character stream. (a) Without errors. (b) With one error. March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 47

Flag bytes with byte stuffing (a) A frame delimited by flag bytes. (b) Four examples of byte sequences before and after stuffing.

Starting and ending flags, with bit stuffing Bit stuffing also prescribes 01111110 as starting and ending flag (a) The original data. (b) The data as they appear on the line. (c) The data as they are stored in receiver s memory after de-stuffing.

PhL coding violations Applicable in networks where encoding in PhL contains some redundancy 1 bit of data encoded with two physical bits: a 1-bit encoded as a high-low pair, a 0-bit encoded as a low-high pair Every data bit has a transition in the middle, so receiver can easily locate bit boundaries Combinations high-high and low-low are used for delimiting frames in some protocols March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 50

Error Detection and Correction Errors are common on twisted copper pairs and in wireless communication On reliable channels Error-Detecting Codes On prone-to-error channels Error-Correcting Codes March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 51

How to detect errors?

Types of redundancy March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 53

Vertical Redundancy Check Called also parity check A redundant bit (the parity bit) is appended to every data unit so that the total number of 1s in the unit (including the parity bit) is even March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 54

Illustration of VRC March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 55

Longitudinal Redundancy Check

Cyclic Redundancy Check Most powerful, based on binary reduction Predefined binary unit called the divisor The data unit (DU) is appended with a sequence of redundant bits (CRC remainder) so that the resulted DU is exactly divisible by the divisor At destination, the received DU is divided by the divisor If remainder is zero, ok March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 57

More on CRC Required qualities of a CRC To have exactly one bit less than the divisor Appending it to the DU must make the resulting bit sequence divisible by divisor Theory and application of CRC: straightforward The complication: deriving the CRC March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 58

Deriving the CRC March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 59

CRC generator Uses modulo-2 division

CRC checker Uses modulo-2 division in the same way

Polynomials CRC generator typically represented as an algebraic polynomial This is useful Short Proves the concept mathematically

Standard polynomials 12,16, 32 size of CRC remainders CRC divisor s size is hence 13, 17, 33 32-bit CRC used in Ethernet, Token Ring March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 63

Error control LLC has to ensure that all frames are correctly delivered to NL at destination in right order and only once Implemented at LLC and at higher layers Tools Acknowledgements Timers Sequence numbers March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 64

Why flow control? Needed because Receivers have limited memory (called buffer) to store incoming data frames Receivers have limited speed at which to process incoming data Receivers must inform senders before these limits are reached March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 65

Flow control Occurs in LLC and at higher layers Implemented at LLC sub-layer What to do with fast senders that eventually swamp slow receivers 2 methods Feedback-based flow control Set of procedures telling the sender how much data it can send before it must wait for an acknowledgement (ack) Rate-based flow control (never used at DLL, but at NL) March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 66

Types of flow control Upon getting an ack, the sender can Send fewer frames Stop temporarily

Stop-and-Wait Sender waits for an ack after every frame sent

Pros and cons for Stop-and-Wait Advantage: simplicity and safety Disadvantage: inefficiency Each frame is alone on the line If distance between devices is big => transmission time much increased March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 69

Sliding window Sender transmits several frames before needing an ack Hence, receiver acknowledges only some frames An ack confirms receipt of multiple frames Frames can be sent one after another Link efficiently carries several frames at once March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 70

The window Refers to imaginary boxes at both sender and receiver At sender it holds frames Provides the upper limit on the number of frames to be transmitted before ack needed At receiver it holds placeholders for frames Provides the number of frames that may still be received before an ack must be sent March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 71

More on the window Has a predefined length n Identification scheme for frames (sequential numbers) Used to keep track of which frames have been transmitted and which received Frames numbered modulo n+1: 0 n When receiver sends an ack Includes the number of next expected frame Window has dimension n at both ends

Illustration of the window March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 73

Sender window March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 74

Receiver window March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 75

An example

How does the window increase? When ack i is sent, the receiver (or ack i is received, the sender) Increases its window by i positions if this is the first ack Increases its window by i-j positions if the previous ack was j, j<i Increases its window by i+n+1-j positions if the previous ack was j, j>i Note that j=i, if the previous ack was j, is NOT POSSIBLE: window size is n, we have n+1 frame numbers (0 -- n) so j=i => we sent n+1 frames without ack (contradiction) March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 77

Error control In LLC, it refers to methods for error retransmission Automatic Repeat request (ARQ) allows Detection of an error in an exchange => a NAK (negative ack) is returned and the specified frames are retransmitted Existence of lost frames and their retransmission A lost frame is so damaged by noise that is beyond recognition as a frame at all (data or ACK/NAK frame) March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 78

ARQ Implemented as an adjunct to flow control March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 79

Stop-and-Wait ARQ Based on stop-and-wait flow control Extended to handle retransmission of data in case of lost/damaged frames Added features 1. Sender keeps copy of last sent frame 2. Data and ACK frames are numbered with 0/1 3. Receiver finds error => sends NAK 4. Sender has timer March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 80

Damaged frames illustration

Lost data frame illustration March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 82

Lost acknowledgement illustration March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 83

Feature 1 Sender keeps a copy of the last frame transmitted and not acknowledged yet Allows the sender to retransmit all lost or damaged frames until received correctly March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 84

Feature 2 For identification, both data and ACK frames are alternatively numbered with 0 and 1 A data 0 frame is acknowledged by ACK 1 and a data 1 frame is acknowledged by ACK 0 Allows for identification of data frames if duplicate transmission occurs When acknowledgements are lost March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 85

Feature 3 If a data frame is corrupted in transit, receiver classifies it as error and sends back a NAK NAKs are unnumbered When sender gets a NAK, it retransmits the last frame sent Frame transmitted after the last ack, regardless of number March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 86

Feature 4 Sender has a timer If ACK/NAK does not arrive in a preestablished time period, sender assumes the data frame was lost and retransmits it March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 87

Lost ACK/NAK For a retransmitted frame that arrived at receiver before, but its ACK/NAK was lost If the lost frame was a NAK the receiver accepts new copy, returns ACK (if all OK this time) If the lost frame was an ACK the receiver recognizes the new copy as duplicate (it waits for a 1 frame and gets a 0 frame) returns ACK discards the new copy March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 88

Sliding window ARQ Based on sliding window flow control Extended to handle retransmission of data in case of lost/damaged frames 2 popular protocols Go-back-n ARQ Selective-reject ARQ Added features 1. Sender keeps copies of transmitted frames 2. NAK frames also, in addition to ACK 3. Sender has timer March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 89

Feature 1 All transmitted and yet unacknowledged frames have a copy at sender If frames 0 -- n have been sent and last ACK was for frame n-3, then copies of frames n-3, n-2, n-2, n are kept until an ACK arrives for them Assume here n>3 March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 90

Feature 2 If receiver gets damaged data, it then sends back NAK NAKs are numbered NAK n indicates that frames up to n arrived fine and frame n has to be retransmitted Data frames received well do not need each a separate ACK Damaged data frames need each a NAK March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 91

Feature 3 Sender has timer If n frames have been sent and are not yet acknowledged, then timer is started When timer goes off, frames are retransmitted (all or not all, depends on protocol) Lost data frames and lost NAK are thus solved If the lost frame is an ACK, then receiver recognizes the duplicates March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 92

Go-back-n ARQ When one frame is lost/damaged, all frames sent since the last acknowledged frame are retransmitted Specific features for Damaged frame Lost data frame Lost ACK/NAK March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 93

Go-back-n, damaged frame

Go-back-n, lost data frame

Go-back-n, lost ACK/NAK

Go-back-n, more This protocol requires frames to arrive sequentially When one is damaged/lost, sequence is broken and all subsequent frames, even if correctly arrived, are discarded Technically achieved with frame numbers When the sender s timer times out All frames are retransmitted This avoids deadlock March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 97

Selective-reject ARQ Only the specific damaged/lost frame is retransmitted Retransmission is typically out-of-sequence Receiver must know how to sort the frames it has in order to insert the retransmitted one March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 98

Differences compared to go-back-n Receiver Must have some form of sorting logic to reorder out-of-sequence received frames Must have some big-enough buffer Sender keeps all previously received frames on hold, until all retransmissions have been sorted and duplications identified and discarded Must have some sorting mechanism to find and select only the requested frame to retransmit ACK numbers refer to respective frames, not expected ones Sliding window: <= (n+2)/2, if it was n for go-back-n The complexity of this algorithm requires smaller window

Selective-reject, damaged frame

On acknowledgements ACK i implies the successful receipt of frame i and all frames from j+1 to i, if j is the last acknowledged frame, j<i Frames received after a damaged/lost frame cannot be acknowledged until that frame arrived correctly Lost ACK/NAK is likewise in go-back-n March 22, 2006 http://www.abo.fi/~lpetre/teleprot06/ 101

Bidirectional transmission Data frames are sent by both sender and receiver For sending acknowledgements, piggybacking is used When receiver gets a data frame from sender, it does not acknowledge it immediately Receiver waits until its NL passes to it the next packet It then sends this packet as a data frame to sender and also embeds the acknowledgement for the previously received data frame Question: how long to wait for a new data frame, in order to piggyback the acknowledgement on it? Not too much: receiver also gets a timer