Faculy of rs and Science Universiy of Torono CSC 358 - Inroducion o Compuer Neworks, Winer 218, LEC11 ssignmen 2 Due Monday Feb. 12, 1:pm. 1
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, indicae he window size, as well as he packes delivered o he nex higher layer. SN (b) (Error in Transmission from o ): Repea (a). SN 2
(c) Repea (a). SN 3
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, indicae he window size a and, as well as he packes delivered o he nex higher layer. CK s in uffer SN Packes in uffer (b) (Error in Transmission from o ): Repea (a). CK s in uffer SN Packes in uffer 4
(c) Repea (a). CK s in uffer SN 5 Packes in uffer
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; 7
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 = 4 for your example. (b) Give an example where Selecive Repea wih modulus m fails if m = 2n 1. Use n = 4 for your example. 8
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 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? (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? (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). (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). (e) Evaluae he answers for (c) and (d) for P packe =.99,.1,.1. 9
(f) Using he resul of (e), in wha siuaion would you use Hop-by-Hop RQ (End-o- End RQ)? 1
Faculy of rs and Science Universiy of Torono CSC 358 - Inroducion o Compuer Neworks, Winer 218, LEC11 Cover shee for ssignmen 2 Complee his page and aach i o he fron of your assignmen. Name: (Underline your las name) Suden number: I declare ha his assignmen is solely my own work, and is in accordance wih he Universiy of Torono Code of ehavior on cademic Maers. Signaure: 11