Solutions for Assignment 2

Similar documents
cs/ee 143 Communication Networks

Orientation. Connections between network coding and stochastic network theory. Outline. Bruce Hajek. Multicast with lost packets

5. Stochastic processes (1)

Homework 4 (Stats 620, Winter 2017) Due Tuesday Feb 14, in class Questions are derived from problems in Stochastic Processes by S. Ross.

1. Kinematics I: Position and Velocity

Spring Ammar Abu-Hudrouss Islamic University Gaza

Lecture 4 Notes (Little s Theorem)

Operating Systems Exercise 3

20. Applications of the Genetic-Drift Model

T L. t=1. Proof of Lemma 1. Using the marginal cost accounting in Equation(4) and standard arguments. t )+Π RB. t )+K 1(Q RB

Predator - Prey Model Trajectories and the nonlinear conservation law

Simulation-Solving Dynamic Models ABE 5646 Week 2, Spring 2010

Reading from Young & Freedman: For this topic, read sections 25.4 & 25.5, the introduction to chapter 26 and sections 26.1 to 26.2 & 26.4.

A First Course on Kinetics and Reaction Engineering. Class 19 on Unit 18

KINEMATICS IN ONE DIMENSION

UNIVERSITY OF CALIFORNIA College of Engineering Department of Electrical Engineering and Computer Sciences EECS 121 FINAL EXAM

Random Walk with Anti-Correlated Steps

Biol. 356 Lab 8. Mortality, Recruitment, and Migration Rates

Matlab and Python programming: how to get started

Learning Objectives: Practice designing and simulating digital circuits including flip flops Experience state machine design procedure

The Contradiction within Equations of Motion with Constant Acceleration

) were both constant and we brought them from under the integral.

control properties under both Gaussian and burst noise conditions. In the ~isappointing in comparison with convolutional code systems designed

3.1.3 INTRODUCTION TO DYNAMIC OPTIMIZATION: DISCRETE TIME PROBLEMS. A. The Hamiltonian and First-Order Conditions in a Finite Time Horizon

Lecture Notes 2. The Hilbert Space Approach to Time Series

Demodulation of Digitally Modulated Signals

Ensamble methods: Bagging and Boosting

Scheduling of Crude Oil Movements at Refinery Front-end

8. Basic RL and RC Circuits

Problem Set 9 Due December, 7

1 Differential Equation Investigations using Customizable

Vehicle Arrival Models : Headway

Robotics I. April 11, The kinematics of a 3R spatial robot is specified by the Denavit-Hartenberg parameters in Tab. 1.

Phys1112: DC and RC circuits

SPH3U: Projectiles. Recorder: Manager: Speaker:

PHYS 1401 General Physics I Test 3 Review Questions

Lecture 2-1 Kinematics in One Dimension Displacement, Velocity and Acceleration Everything in the world is moving. Nothing stays still.

Continuous Time Markov Chain (Markov Process)

LabQuest 24. Capacitors

Ensamble methods: Boosting

Comparison between the Discrete and Continuous Time Models

Zürich. ETH Master Course: L Autonomous Mobile Robots Localization II

Proposal of atomic clock in motion: Time in moving clock

E β t log (C t ) + M t M t 1. = Y t + B t 1 P t. B t 0 (3) v t = P tc t M t Question 1. Find the FOC s for an optimum in the agent s problem.

ERROR LOCATING CODES AND EXTENDED HAMMING CODE. Pankaj Kumar Das. 1. Introduction and preliminaries

Written Exercise Sheet 5

Innova Junior College H2 Mathematics JC2 Preliminary Examinations Paper 2 Solutions 0 (*)

Optima and Equilibria for Traffic Flow on a Network

Seminar 4: Hotelling 2

The field of mathematics has made tremendous impact on the study of

The average rate of change between two points on a function is d t

Network Flows: Introduction & Maximum Flow

5.2. The Natural Logarithm. Solution

Transform Techniques. Moment Generating Function

Topic Astable Circuits. Recall that an astable circuit has two unstable states;

Supplementary Document

Analyze patterns and relationships. 3. Generate two numerical patterns using AC

3.6 Derivatives as Rates of Change

IB Physics Kinematics Worksheet

Math 105 Second Midterm March 16, 2017

Solutions to the Exam Digital Communications I given on the 11th of June = 111 and g 2. c 2

Physics 20 Lesson 5 Graphical Analysis Acceleration

Stochastic models and their distributions

Delivering Better Time-of-Day Using Synchronous Ethernet and Yaakov (J) Stein, Alon Geva, Gabriel Zigelboim RAD Data Communications

MEI Mechanics 1 General motion. Section 1: Using calculus

Echocardiography Project and Finite Fourier Series

A Shooting Method for A Node Generation Algorithm

Written HW 9 Sol. CS 188 Fall Introduction to Artificial Intelligence

DATA DRIVEN DONOR MANAGEMENT: LEVERAGING RECENCY & FREQUENCY IN DONATION BEHAVIOR

Dynamic Econometric Models: Y t = + 0 X t + 1 X t X t k X t-k + e t. A. Autoregressive Model:

Supplement for Stochastic Convex Optimization: Faster Local Growth Implies Faster Global Convergence

04. Kinetics of a second order reaction

15. Bicycle Wheel. Graph of height y (cm) above the axle against time t (s) over a 6-second interval. 15 bike wheel

Math 111 Midterm I, Lecture A, version 1 -- Solutions January 30 th, 2007

Displacement ( x) x x x

EXPLICIT TIME INTEGRATORS FOR NONLINEAR DYNAMICS DERIVED FROM THE MIDPOINT RULE

Physics 235 Chapter 2. Chapter 2 Newtonian Mechanics Single Particle

Position, Velocity, and Acceleration

Numerical Dispersion

Guest Lectures for Dr. MacFarlane s EE3350 Part Deux

INDEX. Transient analysis 1 Initial Conditions 1

Math 2142 Exam 1 Review Problems. x 2 + f (0) 3! for the 3rd Taylor polynomial at x = 0. To calculate the various quantities:

Chapter 10 INDUCTANCE Recommended Problems:

The equation to any straight line can be expressed in the form:

Resource Allocation in Visible Light Communication Networks NOMA vs. OFDMA Transmission Techniques

Block Diagram of a DCS in 411

SOLUTIONS TO ECE 3084

STA 114: Statistics. Notes 2. Statistical Models and the Likelihood Function

Problem Set If all directed edges in a network have distinct capacities, then there is a unique maximum flow.

Non-uniform circular motion *

Applying Genetic Algorithms for Inventory Lot-Sizing Problem with Supplier Selection under Storage Capacity Constraints

Solutions to Assignment 1

Math 116 Practice for Exam 2

Some Basic Information about M-S-D Systems

6.003 Homework #9 Solutions

More Digital Logic. t p output. Low-to-high and high-to-low transitions could have different t p. V in (t)

Maximum Flow and Minimum Cut

CHAPTER 12 DIRECT CURRENT CIRCUITS

Chapter 2: Principles of steady-state converter analysis

Transcription:

Faculy of rs and Science Universiy of Torono CSC 358 - Inroducion o Compuer Neworks, Winer 218 Soluions for ssignmen 2 Quesion 1 (2 Poins): Go-ack n RQ In his quesion, we review how Go-ack n RQ can be used o ensure a reliable daa ransfer. Use n = 3 for Quesion (a)-(c). Use he convenion ha when has o reransmi packes i sars wih he SN a he beginning of he window and reransmis packes in order of heir sequence number. (a) (Error in Transmission from o ) Fill in he values for SN and RN, indicae he window size, as well as he packes delivered o he nex higher layer. Window Size[,2] [1,3] [2,4] [3,5] [4,6] SN 1 2 1 2 3 4 5 3 4 5 6 RN 1 2 2 2 2 3 3 3 3 4 5 1 2 3 4 (b) (Error in Transmission from o ): Repea (a). 1

Window Size SN [,2] 1 2 [1,3] [2,4] [3,5] [5,7][6,8] 1 2 3 4 5 3 4 5 RN 1 1 2 3 3 1 2 3 3 3 5 6 6 6 3 4 5 (c) Repea (a). 2

Window Size SN [4,6] [,2] [1,3] [3,5] [5,7] [6,8] 1 2 1 2 3 1 3 4 5 3 4 5 6 7 5 3 RN 1 1 1 1 2 3 4 4 4 5 5 5 5 6 7 8 1 2 3 4 5 6 7

Quesion 2 (2 Poins): Selecive Repea RQ In his quesion, we review how Selecive Repea RQ can be used o ensure a reliable daa ransfer. Use n = 5 for Quesion (a)-(c). Use he convenion ha always acknowledges he las error-free packe from, and when has o reransmi packes i sars wih he SN a he beginning of he window and reransmis packes ha have no ye been acknowledge by in order of heir sequence number. (a) (Error in Transmission from o ) Fill in he values for SN and RN, indicae he window size a and, as well as he packes delivered o he nex higher layer. CK s in uffer Window Size [,4] [1,5] [2,6] SN 1 2 3 4 5 4 6 7 5 6 2 4 6 2 4 2 [7,1 RN 1 2 4 4 4 6 7 7 5 7 3 Window Size Packes in uffer [,4] [1,5] [2,6] 3 5 6 4 [7,11] 1 2,3,4,5,6 (b) (Error in Transmission from o ): Repea (a). CK s in uffer Window Size [,4] [1,5] SN 1 2 3 4 3 5 1 4 6 4 5 1 4 1 5 RN 1 1 2 3 3 4 5 6 Window Size Packes in uffer [,4] [1,5] [2,6] [3,7] [4,8] [5,9] [6,1] 5 6 6 5 [6,9] 1 2 3 4 5 5 4

(c) Repea (a). CK s in uffer 3 4 5 Window Size [,4] [1,5] [5,9] [6,1] [7,11] [8,12 SN 1 2 3 4 5 1 5 1 5 1 5 6 7 8 9 1 5 RN [,4] [1,5] Window Size Packes in uffer 1 3 4 4 5 5 2 2 [5,9] 2 6 6 6 7 8 9 1 [6,1] [7,11][8,12][9,13] [1,14] 2 3 4 1,2,3,4 5 5 5 5 5

Quesion 3 (2 Poins): Sop-and-Wai RQ This quesion regards Sop-and-Wai RQ. In he following, we give several varians of Sop-and-Wai RQ proocols, and we consider hem in a few differen communicaion channel models. For each combinaion of proocol and channel pairs (see proocol and channel descripions below), answer wheher he proocol works correcly for ha channel model; if no, give a couner-example. Use he following assumpions for his quesion, Packes (daa packes and CK-packes) may be corruped during ransmission; ll packes wih error are deeced; Packes ha arrive are in he same order as ransmied. lgorihm : Sender: 1. ccep a packe from he nex higher layer; if no packe is available, wai unil i is; 2. Transmi he packe; 3. If an CK is received from he receiver, go o Sep 1; if a NK is received from he receiver, go o Sep 2. Receiver: 1. Whenever an error-free packe is received, release he packe o he higher layer and send an CK o he sender; 2. Whenever a packe is received wih an error, send a NK o he sender. Noe: for his algorihm only, assume CK s and NK s are always received error-free. 6

lgorihm : Sender: 1. Se he ineger variable SN o ; 2. ccep a packe from he nex higher layer; if no packe is available, wai unil i is; assign number SN o he new packe; 3. Transmi he packe wih SN in he sequence number field; 4. If an CK is received from he receiver, incremen SN and go o Sep 2; if no acknowledgmen is received wihin T ou, go o Sep 3, where T ou is a finie amoun of ime, which is larger han he maximum round-rip ime if he maximum delay is known. Receiver: 1. Whenever an error-free packe is received, use a local variable o rack he sequence number of he received packes. If i is he firs ime ha an error-free packe wih his paricular sequence number has been received, release he packe o he higher layer, and send an CK o he sender; 2. Whenever a packe is received wih an error, simply ignore i. Communicaion Channels: We consider he following communicaion channels beween he Sender and he Receiver. Channel I The maximum delay is known, and packes and CK s never ge los during ransmissions; Channel II The maximum delay is known, and packes and CK s may be los during ransmissions; Channel III Packes can have an arbirary and variable delay, and packes and CK s never ge los during ransmissions; Soluion: lgorihm lgorihm Channel I Channel II Channel III (a) (b) 7

Noes: (a) deadlock if an CK is los: S R CK (b) deadlock if an CK is los: S T ou T ou R CK 8

Quesion 4 (1 Poins): Modulus m For Go-ack n RQ and Selecive Repea RQ we have o be careful how we apply a modulus m o he sequence number. In his quesion, we illusrae his issue. (a) Give an example where Go-ack n wih modulus m fails if m = n. Use n = 5 for your example. The simples example is for node o send packe hrough n 1. In case of delayed acknowledgmens (i.e. no reurn packes in he inerim), node goes back andreransmispacke(seefigure6). Ifheohernodehasreceivedallhepackes, i is waiing for packe n, and if he modulus m equals o n, his repea of packe is inerpreed as packe n. Window Size SN...... 1 n-2 n-1 1 RN 1 2 n-2 n-1 n Figure 1: Examples where go back n RQ fails when he modulus m is equal o n (b) Give an example where Selecive Repea wih modulus m fails if m = 2n 1. Use n = 5 for your example. CK s in uffer [,3] Window Size SN 1 2 3 RN Window Size [,3] Packes in uffer 1 2 3 4 [2,5] [4,] [1,4] [3,6] 1 2 3 Figure 2: Noe ha in he above example all CK s are los. s a resul, reransmis packe (afer a ime-ou), bu he receiver inerpres as an ou-of-order packes and sores i in he buffer. 9

Quesion 5 (1 Poins): Sop-and-Wai RQ In class, we discussed ha we can employ he RQ proocol a any layer - for example, we could implemen RQ a he ranspor layer (end-o-end RQ) or a he link layer (hopby-hop RQ). In his quesion, we sudy how he decision where we use RQ impacs he nework performance (in erms of average packe delay). Consider a Sop-and-Wai proocol beween wo peer processes X (sender) and Y (receiver) where Y sends immediaely an CK (wih he corresponding RN number) o X whenever i receives an error-free a packe from X. ssumeahoswansosendpackesoa(disan)hos. Inorderocommunicaewih hos, hos has o send is packes firs o a swich C, where packes ge forwarded o hos. llpackeshavehesamesizeofn bis. SwichC mushavereceivedhecomplee packe before i can be forwarded o (why?). During he ransmission of a packe from hos o swich C, bis are corruped independenly wih a bi error probabiliy P bi, < P bi < 1. Similar, during he ransmission of a packe from swich C o hos, bis are corruped independenly wih he same bi error probabiliy P bi. The ransmission rae of he link beween hos and swich C is R bis per second - he ransmission rae of he link beween swich C and hos is also R bis per second. For he quesions below, provide all relevan derivaions. (a) Wha is he probabiliy P packe ha a packe from hos arrives error-free a swich C? P packe = (1 P bi ) N (b) ssume ha hos and swich C implemen he above Sop-and-Wai RQ. In addiion, make he following assumpion regarding he channel beween and C: CK s from swich C always arrive error-free a and no packes or CK s are dropped. ssuming ha hos never exceeds he ime-ou (when waiing for an CK), wha is he probabiliy P k, k = 1,2,..., ha has o ransmi a packe k imes o ge i acceped a swich C? P k = (1 P packe ) k 1 P packe = [ 1 (1 P bi ) N ] k 1(1 Pbi ) N. (c) (Hop-by-Hop RQ) ssume ha swich C and hos also implemen he above Sop-and-Wai RQ o send packes from C o, and ha he same assumpion ha we made in (b) for he channel beween and C also hold for he channel beween C and. Wha is he average delay of a packe, i.e. he average lengh of he inerval beween he ime ha hos sars sending a packe for he firs ime and he ime ha hos passes he packe o he nex higher layer? Ignore queueing and processing delays, as well as ransmission delays of CK s (bu no of packes), and assume ha hos and swich C never exceed he ime-ou (waiing for a CK). Le E[T C ] be he oal delay for one hop from o C, and le k be he even ha 1

has o send he packe k imes o ge i acceped. Then we have E[T C ] = E[T k]p k k=1 = k N k=1 R P k = k N k=1 R (1 P packe) k 1 P packe = L 1 = N 1 RP packe R (1 P bi ) N Le E[T C ] be he oal delay for he hop from C o. Noe ha nd he oal delay E[T] is equal o E[T C ] = E[T C ] E[T] = E[T C ]+E[T C ] = 2 N R 1 = 2 N 1 P packe R (1 P bi ) N. (d) (End-o End RQ) Suppose ha swich C does no check packes for errors, bu forwards each packe from immediaely o hos (wihou sending an CK o hos ). However, hos and hos use he above Sop-and-Wai RQ o ensure a reliable daa ransfer. ssume ha CK s from hos always arrive error-free a hos and ha no CK s are dropped. For his case, wha is he average delay of a packe? gain, ignore queueing and processing delays, as well as ransmission delays of CK s, and assume ha hos never exceeds he imes-ou (waiing for a CK). The probabiliy P packe ha a packe from arrives error free a is given by P packe = (1 P bi ) N (1 P bi ) N = (1 P bi ) 2N. nd he oal delay E[T ] is given by E[T ] = 2N R 1 P packe = 2N R 1 (1 P bi ) 2N. (e) Evaluae he answers for (c) and (d) for P packe =.99,.1,.1. For P packe =.99 For P packe =.1 For P packe =.1 E[T] = 2.2 N R E[T] = 2 N R E[T] = 2 N R ande[t ] = 2.4 N R, and E[T ] = 2 N R, and E[T ] = 2 1 6N R, 11

(f) Using he resul of (e), in wha siuaion would you use Hop-by-Hop RQ (End-o- End RQ)? IfhebierrorprobabiliyP bi isquiehigh(suchasforawirelesschannel),henusing Hop-by-Hop RQ significanly reduces he exepced delay. If he bi error probabiliy P bi is very low (such as for an opical channel), hen using End-o-End RQ does no significanly increase exepced delay and is less expensive o implemen. 12