0% found this document useful (0 votes)
23 views

Computer Network

Computer_Network_Section_2_a4e732df0f8c58039eb18181a07d0a15

Uploaded by

lovawi2264
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Computer Network

Computer_Network_Section_2_a4e732df0f8c58039eb18181a07d0a15

Uploaded by

lovawi2264
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Data link layer (chapter 2)

Packet Packet

Header Payload field Header Payload field Trailer


Trailer

1. Framing & encapsulation:


• Character count
• FLAG Byte (with byte stuffing)
• Starting & ending flag( with bit stuffing)
Problem
The following character encoding is used in data link protocol:
A:0100011 B:11100011 FLAG:01111110 ESC: 11100000
➢ Show the bit sequence transmitted (in binary) for the 4 character frame
A B ESC FLAG
➢ When each the following framing methods are used:
• Character count
• FLAG Byte (with byte stuffing)
• Starting & ending flag( with bit stuffing)

Solution:

• Character count
5 A B ESC FLAG
00000001 01000111 11100011 11100000 01111110
• FLAG Byte (with byte stuffing)
FLAG A B ESC ESC ESC FLAG FLAG
01111110 01000111 11100011 11100000 11100000 11100000 01111110 01111110
• Starting & ending flag( with bit stuffing)
FLAG A B ESC FLAG FLAG
01111110 01000111 11100011 11100000 01111110 01111110
01111110 01000111 101100011 111000000 011111010 01111110
2. Utilization of stop & wait flow control:
𝑇𝑓𝑟𝑎𝑚𝑒 𝑇𝑝𝑜𝑝.
𝑈= 𝑎=
2𝑇𝑝𝑜𝑝. + 𝑇𝑓𝑟𝑎𝑚𝑒 𝑇𝑓𝑟𝑎𝑚𝑒
1 𝑓𝑟𝑎𝑚𝑒 𝑠𝑖𝑧𝑒
𝑈= 𝑇𝑓𝑟𝑎𝑚𝑒 =
2𝑎 + 1 𝑏𝑖𝑡 𝑟𝑎𝑡𝑒
𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒
𝑇𝑝𝑟𝑜𝑝. =
𝑠𝑝𝑒𝑒𝑑
• Utilization of problems:
Satellite link with propagation delay 270 ms & frame size is 4000 bits, Data rate is 56kps
calculate utilization?
Given Data:
Propagation delay = 270 ms
Frame size = 4000 bits
Data rate = 56 Kbps
Solution:
1 𝑇𝑝𝑜𝑝.
• 𝑈 = 2𝑎+1 • 𝑎=𝑇
𝑓𝑟𝑎𝑚𝑒

𝑓𝑟𝑎𝑚𝑒 𝑠𝑖𝑧𝑒 4000


• 𝑇𝑓𝑟𝑎𝑚𝑒 = = 56 𝑥 103 = 71 𝑚𝑠
𝑏𝑖𝑡 𝑟𝑎𝑡𝑒
270
• 𝑎= = 3.8
71
1 1
• 𝑈 = 2𝑎+1 = = 0.12
2 𝑥 3.8+1
• 12%

• Routing Trip Time


Calculate the total time required to transfer a 1.5 MB file, given that,
• RTT = 80 ms.
• A packet size of 1 KB
• Initial 2 x RTT of “handshaking” before data is sent, the bandwidth is 10 Mbps
• Data packet can be sent continuously
Solution:
• Time required = 2 x RTT + File sending time + propagation delay
• File size = 1.5 MB = 1.5 x 106 x 8 = 12,582,912 bits
• File sending time = file size /bandwidth of channel
▪ = 12,582,912/10 x 106
▪ =1.258 sec
• Propagation delay = RTT/2
• Time required = 2 x RTT + File sending time + propagation delay

=2x80x106 + 1.258 + (80x106 / 2) = 1.458 sec


• Stop &wait, Go Back N and Selective Repeated:
• Sliding window

Sender Receiver
SWS RWS
• Stop & wait => SWS = RWS = 1 bit
• Go Back N => SWS (2n-1) , RWS (+1) = 2n => SWS =N , RWS =1
• Selective Repeater => SWS (23-1 = 7 = 8bit => SWS= N , RWS=M usually M=N

• Problem 1:
Suppose you are designing a sliding window protocol for 1Mbps P-to-P link to the stationary satellite revolving
a round the earth at an altitude of 3 x 104 km. Assuming that each frame carriers 1KB of data, What is min.
number of bit you need for the sequence number in the following cases? Assume speed of light 2 x 108m/s.
• RWS=1
• RWS=SWS
Given Data:
• Frame size = 1Kbyte
• Bandwidth of channel (bit rate) = 1Mbps
• Distance = 3 x104 km
• Speed = 3 x 108 m/s

Solution:

• SWS: sequence number = 2 x SWS


• SWS: is achieved when bandwidth the pipe between sender & receiver is full
a. RWS=1
So Protocol => Go Back N
𝑅𝑇𝑇 𝑥 𝑑𝑒𝑙𝑎𝑦 𝑜𝑓 𝑏𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ
• 𝑆𝑊𝑆 = 𝑓𝑟𝑎𝑚𝑒 𝑠𝑖𝑧𝑒
𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒 3𝑥104 𝑥 103
• Propagation delay = 𝑠𝑝𝑒𝑒𝑑 = 3𝑥108 = 0.1 𝑠𝑒𝑐
• Total Delay = Propagation delay *2 = 0.2 sec
• Bandwidth of bit rate x Total delay = 1 x 106 x 0.2 = 2x105 bits
𝑏𝑖𝑡 𝑟𝑎𝑡𝑒∗2 𝑑𝑒𝑙𝑎𝑦 2𝑥105
• No. of frame = = = 25 𝑓𝑟𝑎𝑚𝑒𝑠
𝑓𝑟𝑎𝑚𝑒 𝑠𝑖𝑧𝑒 3=1∗8𝑥103
• No. of sequence >= 25+1 => 26 (sender)
• 2 no. of sequence = 26 => no. of sequence= 5 bit
b. RWS=SWS
• So, it is protocol (Selective Repeater)
• No. of sequence should be at least 2 time the size of window (default & generate case)
• 2 x SWS <= no. of sequence number
• 2 x 25 <= no. of sequence number
• 50 <= no. of sequence number
• 2 no. of sequence = 50 => no. of sequence= 6 bit
• Problem 2:
Suppose you are designed a slideing window protocol for a 1Mbps proint to point link to moon, which
has a one way latency of 1.25 second. Assuming that each frame carries 1KB of data, what is the
minimum number of bits you need for the sequence a number?
Given data:
• Capacity =1Mbps = 1 x 106 b/s
• one way latency = 1.25 second.
• Frame size = 1KB = 8 bit
Solution:
• We need to determine the sender Max. SWSmax. Then, the minimum sequence number 2
SWS: sweNum= 2 x SWSmax.
• SWS: is achieve when the bandwidth pipe between sender & receiver is full.
• SWS = RTT(frame size x Capacity)
• One way latency = 1.25 second => RTT = 2 x latency = 2.5sec
• SWSmax. = RTT/(Frame size x capacity)
▪ = (2.5 x 106) / (8x1x106) = 305
• Minimum number of bits that need for sequence should be twice as large= 305 x 2= 610
• 2seq. Num =610
• Seq. Num= 10
• Problem 3:
3000 km long T1 Tunk (1.54 Mbps) is used to transmit 64 byte frames using protocol 5. If propagation
speed is 6Msec/km. how many bits should the sequence a number be?

Given data:
• Capacity =1.54Mbps
• Distance = 3000 km
• Prop. Speed = 6 Msec / sec
• Frame size = 64 byte
Solution:
In order to get best utilization. We want to have large window size:
2 CI
W≥1+
F
• I= speed x distance
= 6 x 10-6 x 3000 = 1.8 msec

2 (1.54 x 106 )(18)


• W≥ 1+ 64 x 8
• W ≥ 109.54 = 110
Convert to binary 101101 = 7bit

You might also like