Alternating Bit Protocol Protocol for simplex data-transfer channel: data flows from sender to receiver control flows in both directions the transfer medium.

Slides:



Advertisements
Similar presentations
1 Data Link Protocols By Erik Reeber. 2 Goals Use SPIN to model-check successively more complex protocols Using the protocols in Tannenbaums 3 rd Edition.
Advertisements

Chapter 3 The Data Link Layer.
Data Link Layer (cont’d)
The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
1 Carnegie Mellon UniversitySPIN ExamplesFlavio Lerda Bug Catching SPIN Examples.
CS 290C: Formal Models for Web Software Lecture 3: Verification of Navigation Models with the Spin Model Checker Instructor: Tevfik Bultan.
PROTOCOL VERIFICATION & PROTOCOL VALIDATION. Protocol Verification Communication Protocols should be checked for correctness, robustness and performance,
Assume that a file is transferred from a node A to a node B. The file has been fragmented in 5 frames (denoted as f0, f1, f2, f3, f4). Show the flow of.
Assume that a file is transferred from a node A to a node B. The file has been fragmented in 5 frames. Frame 0 is corrupted, the ACK of frame 1 is corrupted,
An Overview of PROMELA. A protocol Validation Language –A notation for the specification and verification of procedure rules. –A partial description of.
תרגול 9 META LABELS. Basic types of claims State properties.
Wishnu Prasetya Model Checking with SPIN Modeling and Verification with SPIN.
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
The Spin Model Checker Promela Introduction Nguyen Tuan Duc Shogo Sawai.
Data and Computer Communications Updated: 2/9/2009.
1 Spin Model Checker Samaneh Navabpour Electrical and Computer Engineering Department University of Waterloo SE-464 Summer 2011.
© 2011 Carnegie Mellon University SPIN: Part Bug Catching: Automated Program Verification and Testing Sagar Chaki October 31, 2011.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
CSC 3352 Computer Communications Chapter 3&41 The Link Layer Has 2 main Components The Data Link Layer Medium Access Control (MAC) Examples:SLIP, PPP,
1 Chapter Six - Errors, Error Detection, and Error Control Chapter Six.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 13 Introduction to Computer Networks.
Software Engineering, COMP201 Slide 1 Protocol Engineering Protocol Specification using CFSM model Lecture 30.
CSC 450/550 Part 2: The Data Link Layer. CSC 450/550 Summary Part A Functions (1)Functions of the data link layer (2)Framing (3)Error control (3.1) Error.
1 Diagnostics Project Introduction Matt Morgan. 2 Diagnostic ’ s Project Purpose Develop the Network layer services for diagnostics on CAN for road vehicle.
20101 The Data Link Layer Chapter Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.
Adapted from Tanenbaum's Slides for Computer Networking, 4e The Data Link Layer Chapter 3.
1 Reliable Data Transfer. 2 r Problem: Reliability  Want an abstraction of a reliable link even though packets can be corrupted or get lost r Solution:
Lect11.ppt - 03/15/05 CDA 6505 Network Architecture and Client/Server Computing Lecture 11 Link-Level Flow and Error Control by Zornitza Genova Prodanoff.
Link-Level Flow and Error Control
Data Link Control Protocols
ARQ Mechanisms Rudra Dutta ECE/CSC Fall 2010, Section 001, 601.
Correctness requirements. Basic Types of Claims Basic assertions End-state labels Progress-state labels Accept-state labels Never claims Trace assertions.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.
Transport Layer Moving Segments. Transport Layer Protocols Provide a logical communication link between processes running on different hosts as if directly.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 14.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 15.
Concurrency. A process is a program executing on a virtual computer Processor speed and multiplexing of shared resources are ignored Order of thread execution.
Chapter 5 Peer-to-Peer Protocols and Data Link Layer PART I: Peer-to-Peer Protocols ARQ Protocols and Reliable Data Transfer Flow Control.
The data link layer. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
The Data Link Layer. Functions of the Data Link Layer Provide service interface to the network layer Dealing with transmission errors Error detection.
The Data Link Layer Chapter 3 10/28/2015www.noteshit.com1.
1 Chapter Six - Errors, Error Detection, and Error Control Chapter Six.
Temporal Logic Model-checking with SPIN
CSE 555 Protocol Engineering Dr. Mohammed H. Sqalli Computer Engineering Department King Fahd University of Petroleum & Minerals Credits: Dr. Abdul Waheed.
Protocol Specification Prof Pallapa. Venkataram Department of Electrical Communication Engineering Indian Institute of Science Bangalore – , India.
Data Transmission n Keep errors to an acceptable low probability n Bit-serial transmission n Parallel transmission.
Lecture 4 Introduction to Promela. Promela and Spin Promela - process meta language G. Holzmann, Bell Labs (Lucent) C-like language + concurrency dyamic.
The Data Link Layer Chapter 3 1/21/2016www.ishuchita.com1.
CS 453 Computer Networks Lecture 11 Layer 2 – Data Link Layer Protocols.
Data Link Layer. Data link layer The communication between two machines that can directly communicate with each other. Basic property – If bit A is sent.
Wishnu Prasetya Model Checking with SPIN Modeling and Verification with Promela.
Using SPIN. INTRODUCTION To extend the protocol simulator from Chapter 12 with an validator generator, all we have to do is to activate two command line.
INF3190 – Home Exam 2. Goal The goal of this exercise is to provide network layer reliability for the monitoring/administration tool presented in “home.
1 The utopia protocol  Unrealistic assumptions: –processing time ignored –infinite buffer space available –simplex: data transmitted in one direction.
Chapter 3: The Data Link Layer –to achieve reliable, efficient communication between two physically connected machines. –Design issues: services interface.
PROTOCOL BASICS. 2 Introduction In chapter 3: Circuits and techniques can be employed to transmit a frame of information between 2 DTEs Error detection.
2.10 Flow and Error Control Before that ...
Data Link Layer Flow Control.
Data Transmission Keep errors to an acceptable low probability
CSE 503 – Software Engineering
Chapter 3 – Part 1 The Data Link Layer.
Data Link Layer: Data Link Control
Overview Jaringan Komputer (2)
Protocol Basics.
CS412 Introduction to Computer Networking & Telecommunication
Data Link Layer (cont’d)
Data Link Layer (cont’d)
Selective Repeat.
CSE 503 – Software Engineering
Presentation transcript:

Alternating Bit Protocol Protocol for simplex data-transfer channel: data flows from sender to receiver control flows in both directions the transfer medium may corrupt messages The protocol attaches a status bit, the alternation bit to messages. Assume send from A to B B receives message and accepts it only if bits differ B sends verification message (an ack) to A (receipt of message) A receives ack and deduces message sent was received correctly send next message with flipped bit message sent was corrupted resend message nothing - because ack was corrupted resend message We do not indicate the exact corrpution of a message, just turn any corrupted message into error message.

2 Alternating Bit Protocol messages mtype = {data, control, error} channels chan fromA =[N] of {byte, byte, bit} /* messagetype1, data, statusbit */ chan toB =[N] of {byte, byte, bit} /* messagetype1, data, statusbit */ chan fromB =[N] of {byte, bit} /* messagetype2, statusbit */ chan toA =[N] of {byte, bit} /* messagetype2, statusbit */ messagetype1 = {data, error} messagetype2 = {control, error} lower layer A B fromB toB fromA toA

3 Lower Layer transfer medium (perfect channel) proctype lower (chan fromA, toA, fromB, toB) { byte d; bit b; do :: fromA?data(d,b) -> toB!data(d,b) :: fromB?control(b) -> toA!control(b) od } transfer medium (imperfect channel) proctype lower (chan fromA, toA, fromB, toB) { byte d; bit b; do :: fromA?data(d,b) -> if :: toB!data(d,b) /* correct */ :: toB!error(d,b) /* error */ fi :: fromB?control(b) -> if :: toA!control(b) /* correct */ :: toA!error(b) /* error */ fi od }

4 Sender Sender - without initialisation proctype A (chan in, out) { byte mt;/* message type */ bit at;/* status bit */ bit vr;/* verification bit */ FETCH; /* get actual data */ out!data(mt,at);/* send the data */ do/* wait for correct response */ :: in?control(vr) -> /* got a control message */ if :: (vr == 1) ->/* correct ! */ FETCH; /* get next actual data */ at = at -1;/* alternate status bit */ :: (vr == 0) -> /* an error in send */ skip /* do nothing, resend */ fi; out!data(mt,at) /* send the data */ :: in?error(vr) ->/* got an error message */ out!data(mt,at)/ resend the data */ od }

5 Receiver Receiver - without initialisation proctype B (chan in, out) { byte mr;/* message type */ byte last_mr;/* mr of last error-free msg */ bit ar;/* status bit */ bit lar;/* ar of last error-free msg */ do :: in?error(mr,ar) ->/* receive corrupted msg */ out!control(0) :: in?data(mr,ar) -> /* receive correct msg */ out!control(1); if :: (ar == lar) -> /* retransmission, do not accept */ skip :: (ar != lar) ->/* new message, accept */ ACCEPT; lar = ar;/* set last variables */ last_mr = mr fi od }

6 Initialisation Send message from A to B (error-free, but not necessarily accepted) which forces setting of B’s alternation bit.

7 Sender Sender - with initialisation proctype A (chan in, out) { byte mt=0;/* message type */ bit at =0;/* status bit */ bit vr;/* verification bit */ out!data(0,1)/* initialise */ do :: in?error(vr) -> /* an error in ack*/ out!data(0,1)/* resend */ :: in?control(0) -> /*an error in send */ out!data(0,1)/* resend */ :: in?control(1) -> /* successful initialisation */ break od FETCH; /* get actual data */ out!data(mt,at);/* send the data */ do/* wait for correct response */ :: in?control(vr) -> /* got a control message */ if :: (vr == 1) ->/* correct ! */ FETCH; /* get next actual data */ at = at -1;/* alternate status bit */ :: (vr == 0) -> /* an error in send */ skip /* do nothing, resend */ fi; out!data(mt,at) /* send the data */ :: in?error(vr) ->/* got an error message */ out!data(mt,at)/ resend the data */ od }

8 Receiver Receiver - with initialisation proctype B (chan in, out) { byte mr;/* message type */ byte last_mr;/* mr of last error-free msg */ bit ar;/* status bit */ bit lar;/* ar of last error-free msg */ bit ini=0;/* initialised */ do :: in?error(mr,ar) ->/* receive corrupted msg */ out!control(0) :: in?data(mr,ar) -> /* receive correct msg */ out!control(1); if :: (!ini) ->/* not initialised */ ini = 1; lar =ar/* initialise */ :: (ini) ->/* initialised */ if :: (ar == lar) ->/* retransmission, do not accept */ skip :: (ar != lar) ->/* new message, accept */ ACCEPT; lar = ar;/* set last variables */ last_mr =mr fi od }

9 Assertions #define ACCEPT assert(mr == (last_mr+1)%MAX) Full program: #define N 2 #define MAX 8 #define FETCH mt = (mt+1)%MAX /* sequence of numbers */ #define ACCEPT assert (mr == (last_mr+1)%MAX) /* messages received in sequence */ init {chan fromA =[N] of {byte, byte, bit} chan toB =[N] of {byte, byte, bit} chan fromB =[N] of {byte, bit} chan toA =[N] of {byte, bit} atomic{run A(toA, fromA); run B(toB, fromB); run lower(fromA, toA, fromB, toB)}

10 Message Sequence Charts 1. Message and ack is successful, 2 times. 2. Message is corrupted first time, success 2nd time. 3. Message is received, but ack is corrupted first time; success 2nd time. Use global channel names; show states of variables.

11 Using Spin for Simulation Run spin on a linux machine by: /local/fda/tools/install/i386-unkown-linux/bin/xspin-linux Run from *your* own directory. Set Simulation Parameters Display Mode Simulation Style MSC Panel Random Seed:1 Timed Sequence Guided Steps skipped: 0 Interactive Data Values Full Queue Blocks New Messages Loses New Messages x x x