8107 - File - Network Lect No.7

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Chapter – 3

“Network Protocols”
Cont..
Network Latency
 Defined as total time delay taken by one frame to reach Tx Rx

destination which contains many items:

1- Transmission time: defined as time taken by


transmitter to prepare data in output buffer
given by
𝑫𝒂𝒕𝒂 𝑺𝒊𝒛𝒆 (𝒃𝒊𝒕)
𝑻𝒕 =
𝒃𝒊𝒕
𝑻𝒂𝒓𝒏𝒎𝒊𝒕𝒕𝒆𝒓 𝒃𝒊𝒕 𝒓𝒂𝒕𝒆 ( )
𝒔𝒆𝒄
𝑻𝑷𝒓

𝑻𝒂𝒄𝒌
2- Propagation time: defined as time taken by one
bit to reach destination given by
𝑫𝒊𝒔𝒕𝒂𝒏𝒄𝒆 𝒃𝒆𝒕𝒘𝒆𝒆𝒏 𝑻𝒙 𝒂𝒏𝒅 𝑹𝒙 (𝒎)
𝑻𝑷 = 𝒎
𝑺𝒑𝒆𝒆𝒅 𝒐𝒇 𝒍𝒊𝒏𝒌 ( )
𝒔𝒆𝒄
3- Que time (𝑻𝑸 ): defined as time delay may data Tx Rx
wait in transmitter buffer if the output link is busy

4- Processing time (𝑻𝑷𝒓 ): defined as time taken


by receiver to prepare acknowledge frame

𝑳𝒂𝒕𝒆𝒏𝒄𝒚 = 𝑻𝒕 + 𝟐𝑻𝑷 + 𝑻𝑸 + 𝑻𝑷𝒓 + 𝑻𝒂𝒄𝒌


𝑻𝑷𝒓
𝑻𝒓𝒂𝒏𝒔𝒎𝒊𝒔𝒔𝒊𝒐𝒏 𝑻𝒊𝒎𝒆 𝑻𝒂𝒄𝒌
𝑳𝒊𝒏𝒌 𝑼𝒕𝒊𝒍𝒊𝒛𝒂𝒕𝒊𝒐𝒏 𝑼 =
𝑳𝒂𝒕𝒆𝒏𝒄𝒚
𝑻𝒕
= %
𝑻𝒕 + 𝟐𝑻𝑷 + 𝑻𝑸 + 𝑻𝑷𝒓 + 𝑻𝒂𝒄𝒌

Note: Sometimes we neglect 𝐓𝐐 , 𝐓𝐏𝐫 𝐚𝐧𝐝 𝐓𝐚𝐜𝐤 w.r.t. 𝐓𝐭 𝐚𝐧𝐝 𝐓𝐏


Flow and Error Control

 Defined as process of frame reception confirmation dialogue between


transmitter and receiver in order to guarantee correct data transfer in case
of non- real time data connection (i.e. TCP applications)

 Two algorithms could be applied for flow and error control:

1- Stop- and- Wait Algorithm

2- Sliding Window Algorithm


1- Stop- and- Wait Algorithm

 In this case, only one frame is transmitted and then transmitter waits Rx
Tx
for acknowledge frame reception before transmitting next frame

Frame1
 After waiting of time duration ≈ 𝟐𝑻𝑷 , if no acknowledge is
received back to transmitter, then it has to re-transmit
previous frame again

Case1- Error- free case 𝑻𝑷𝒓

𝑻𝒂𝒄𝒌

𝑻𝒕
𝑼= %
𝑻𝒕 + 𝟐𝑻𝑷 + 𝑻𝑸 + 𝑻𝑷𝒓 + 𝑻𝒂𝒄𝒌

Frame2
Tx Rx
Case2- Lost frame case

Frame1
𝑻𝒕
𝑼= %
𝟐𝑻𝒕 + 𝟐𝑻𝑷 + 𝟐𝑻𝑸 + 𝑻𝑷𝒓 + 𝑻𝒂𝒄𝒌 + 𝑻𝑾𝒂𝒊𝒕

Frame1
𝑻𝒕
= %
𝟐𝑻𝒕 + 𝟐𝑻𝑷 + 𝟐𝑻𝑸 + 𝑻𝑷𝒓 + 𝑻𝒂𝒄𝒌 + (𝟐𝑻𝑷 )

𝑻𝑷𝒓
𝑻𝒕
= % 𝑻𝒂𝒄𝒌
𝟐𝑻𝒕 + 𝟒𝑻𝑷 + 𝟐𝑻𝑸 + 𝑻𝑷𝒓 + 𝑻𝒂𝒄𝒌

Frame2
2- Sliding Window Algorithm

 In this case, only N frames are transmitted called window and then
transmitter waits for acknowledge frame nominated by N+1
reception before transmitting next frame Tx Rx

 If any frame in the window is lost, say frame j, then


transmitter will receive 𝑨𝒄𝒌𝒋 , which means that it has to

Win1 (
transmit new window from frame 𝒋 + 𝟏 to 𝒋 + 𝑵

Case1- Error- free case 𝑻𝑷𝒓


𝐴𝑐𝑘𝑁+1 𝑻𝒂𝒄𝒌
𝑵𝑻𝒕
𝑼= %
𝑵𝑻𝒕 + 𝟐𝑻𝑷 + 𝑻𝑸 + 𝑻𝑷𝒓 + 𝑻𝒂𝒄𝒌

Win2(
Tx Rx
Case2- Lost frame case

j
𝑵𝑻𝒕
𝑼= %
𝑵𝑻𝒕 + 𝟐𝑻𝑷 + 𝑻𝑸 + 𝑻𝑷𝒓 + 𝑻𝒂𝒄𝒌 + (𝑵 − 𝒋 − 𝟏)𝑻𝒕

𝑻𝑷𝒓

𝑨𝒄𝒌𝒋+𝟏 𝑻𝒂𝒄𝒌

J+1

Repeated
J+N frames
Example
Assume that the network configuration shown in the figure runs the Stop-and-Wait protocol. The
signal propagation speed for both links is 𝟐 × 𝟏𝟎𝟖 𝒎/𝒔. The length of the link from the sender to the
router is 100 m and from the router to the receiver is 10 km. Assume frame length = 1500 byte:
(a) Determine the link utilization considering error – free case.
(b) Repeat part (a) considering lost frame case.
(c) Repeat part (a) considering window size = 30.
(d) Repeat part (b) considering and only 10 frames reach correct
Solution
a) Stop – and – wait “ Error – free case”
𝑇𝑡1
𝑈=

Frame1
Tt1
𝑇𝑡1 + 𝑇𝑡2 + 2𝑇𝑃1 + 2𝑇𝑃2

𝑓𝑟𝑎𝑚𝑒 𝑙𝑛𝑔𝑡ℎ 1500 × 8

Tp1
𝑇𝑡1 = = = 0.0012 𝑠𝑒𝑐
𝑏𝑖𝑡𝑒 𝑟𝑎𝑡𝑒 𝑜𝑓 𝑆𝑒𝑛𝑑𝑒𝑟 10 × 106

Frame1
Tt2
𝑓𝑟𝑎𝑚𝑒 𝑙𝑛𝑔𝑡ℎ 1500 × 8
𝑇𝑡2 = = = 0.012 𝑠𝑒𝑐
𝑏𝑖𝑡𝑒 𝑟𝑎𝑡𝑒 𝑜𝑓 𝑅𝑜𝑢𝑡𝑒𝑟 1 × 106

Tp2
𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑓𝑟𝑜𝑚 𝑠𝑒𝑛𝑑𝑒𝑟 𝑡𝑜 𝑟𝑜𝑢𝑡𝑒𝑟 100
𝑇𝑃1 = =

Ack
𝑃𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛 𝑠𝑝𝑒𝑒𝑑 2 × 108
= 5 × 10−7 𝑠𝑒𝑐

Tp2
𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑓𝑟𝑜𝑚 𝑟𝑜𝑢𝑡𝑒𝑟 𝑡𝑜 𝑟𝑒𝑐𝑒𝑖𝑣𝑒𝑟 10,000
𝑇𝑃2 = = = 5 × 10−5 𝑠𝑒𝑐
𝑃𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛 𝑠𝑝𝑒𝑒𝑑 2 ×108

Tp1
0.0012
∴𝑈= = 0.0902

Frame2
0.0012 + 0.012 + 10 × 10−7 + 10 × 10−5
b) Stop – and – wait “ Lost frame case”

Frame1
Tt1
𝑇𝑡1
𝑈=

Frame1
Twait
𝑇𝑡1 + 𝑇𝑊𝑎𝑖𝑡 + 𝑇𝑡1 + 𝑇𝑡2 + 2𝑇𝑃1 + 2𝑇𝑃2

Frame1
𝑇𝑡1

Tt1
=
𝑇𝑡1 + (2𝑇𝑃1 + 2𝑇𝑃2 ) + 𝑇𝑡1 +𝑇𝑡2 + 2𝑇𝑃1 + 2𝑇𝑃2 X

Tp1
𝑇𝑡1

Frame1
=

Tt2
2𝑇𝑡1 + 𝑇𝑡2 + 4𝑇𝑃1 + 4𝑇𝑃2

Tp2
∴ 𝑈 =? ? ? ?

Ack
Tp2
Tp1

Frame2
`
c) Sliding Window – 30 “ Error – free case”
1

Wind.1
TW1
2
𝑇𝑊1 30
𝑈=
𝑇𝑊1 + 𝑇𝑊2 + 2𝑇𝑃1 + 2𝑇𝑃2

Tp1
𝑇𝑊1 = 30𝑇𝑡1 = 30 × 0.0012 = 0.036 𝑠𝑒𝑐 1

Wind.1
TW2
2

𝑇𝑊2 = 30𝑇𝑡2 = 30 × 0.012 = 0.36 𝑠𝑒𝑐 30

Tp2

Ack31
0.036
∴𝑈=
0.036 + 0.36 + (2 × 5 × 10−7 ) + (2 × 5 × 10−5 )

Tp1
= 0.0909

Tp1
d) Sliding Window – 30 “ Lost Frames case”-
only 10 Frames Received 1

Wind.1
TW1
2

30
𝑇𝑊1
𝑈=
𝑇𝑊1 + 𝑇𝑤𝑎𝑖𝑡 + 10𝑇𝑡2 1

Wind.1
2

30𝑇𝑊1 30
=
30𝑇𝑊1 + 2𝑇𝑃1 + +2𝑇𝑃2 + 10𝑇𝑡2

Twait
X

Ack11
=? ? ? ? ?

11

Wind.2
12

40

You might also like