tutorial for chapter 4 - wordpress.com · 2018. 8. 17. · tutorial for chapter 4 problem 3 cen444...
TRANSCRIPT
CEN444-Computer Networks
Tutorial for Chapter 4
Pure and Slotted ALOHA problems and Solutions
Tutorial for Chapter 4 Problem 1
CEN444 – Computer Networks Page 2 of 48
Problem 1 Frames arrive randomly at a 100-Mbps channel for transmission. If the channel is
busy when a frame arrives, it waits its turn in a queue. Frame length is exponentially
distributed with a mean of 10,000 bits/frame. For each of the following frame arrival
rates, give the delay experienced by the average frame, including both queueing time
and transmission time.
(a) 90 frames/sec.
(b) 900 frames/sec.
(c) 9000 frames/sec.
Tutorial for Chapter 4 Problem 1
CEN444 – Computer Networks Page 3 of 48
Solution The delay is calculated using the formula: 𝑇 = 1/(𝜇𝐶 − 𝜆).
Data rate 𝐶 = 100 × 106 = 108 bits/sec.
Mean frame length 1
𝜇= 10000 bits/frame. Thus 𝜇 =
1
10000= 10−4 frames/bit.
Mean service rate 𝜇𝐶 = 10−4 frames/bit × 108 bits/sec = 10000 frames/sec
(a) Arrival rate 𝜆 = 90 frames/sec. 𝑇 =1
𝜇𝐶−𝜆=
1
10000−90= 0.0001009 ≈ 0.1 msec
(b) Arrival rate 𝜆 = 900 frames/sec. 𝑇 =1
𝜇𝐶−𝜆=
1
10000−900= 0.000109 ≈ 0.11 msec
(c) Arrival rate 𝜆 = 9000 frames/sec. 𝑇 =1
𝜇𝐶−𝜆=
1
10000−9000= 0.001 = 1 msec
Tutorial for Chapter 4 Problem 2
CEN444 – Computer Networks Page 4 of 48
Problem 2 A group of 𝑁 stations share a 56-kbps pure ALOHA channel. Each station outputs a
1000-bit frame on average once every 100 sec, even if the previous one has not yet
been sent (e.g., the stations can buffer outgoing frames). What is the maximum value
of 𝑁?
Tutorial for Chapter 4 Problem 2
CEN444 – Computer Networks Page 5 of 48
Solution In pure ALOHA, the maximum throughput is 0.184.
Maximum usable bandwidth = 0.184 × 56000 bits/sec = 10300 bits/sec.
Each station requires 1000 bits
100 sec= 10 bits/sec.
So, 𝑁 =10300
10= 1030 stations.
Tutorial for Chapter 4 Problem 3
CEN444 – Computer Networks Page 6 of 48
Problem 3 A large population of ALOHA users manages to generate 50 requests/sec, including
both originals and retransmissions. Time is slotted in units of 40 msec.
(a) What is the chance of success on the first attempt?
(b) What is the probability of exactly 5 collisions and then a success?
(c) What is the expected number of transmission attempts needed?
Tutorial for Chapter 4 Problem 3
CEN444 – Computer Networks Page 7 of 48
Solution (a) 𝐺 = number of transmission + retransmissions per frame (slot) time
Slot time = 40 msec = 0.04 sec/slot. Number of slots per sec =1
0.04= 25 slots/sec.
Frames transmissions = 50 frames/sec. 𝐺 =50 frames/sec
25 slots/sec= 2 frames/slot.
Chance of success on first attempt 𝑃0 = 𝑒−𝐺 = 𝑒−2 = 0.135.
(b) The probability of a transmission requiring 𝑘 − 1 collisions followed by success is:
𝑃𝑘 = 𝑒−𝐺(1 − 𝑒−𝐺)𝑘 −1
In this case, 𝑘 − 1 = 5
𝑃6 = 𝑒−2(1 − 𝑒−2)5 = 0.0654
(c) The expected number of attempts = 𝑒𝐺 = 𝑒2 = 7.389
Tutorial for Chapter 4 Problem 4
CEN444 – Computer Networks Page 8 of 48
Problem 4 What is the length of a contention slot in CSMA/CD for:
(a) a 2-km cable (signal propagation speed is 82% of the speed in vacuum)?
(b) a 40-km multimode fiber optic cable (speed is 65% speed in vacuum)?
Tutorial for Chapter 4 Problem 4
CEN444 – Computer Networks Page 9 of 48
Solution (a) Signal propagation speed = 0.82 × 3 × 108 = 2.46 × 108m/sec.
Propagation time = 𝜏 =Distance
Speed=
2000 m
2.46×108 m/sec= 8.13 × 10−6 sec.
Length of contention slot = 2𝜏 = 2 × 8.13 × 10−6 = 16.26 × 10−6 sec.
(b) Signal propagation speed = 0.65 × 3 × 108 = 1.95 × 108m/sec.
Propagation time = 𝜏 =Distance
Speed=
40000 m
1.95×108 m/sec= 205.128 × 10−6 sec.
Length of contention slot = 2𝜏 = 2 × 205.128 × 10−6 = 410.256 × 10−6 sec.
Tutorial for Chapter 4 Problem 5
CEN444 – Computer Networks Page 10 of 48
Problem 5 Consider the following the token passing protocol: When a host receives the token, the
host may transmit for at most 1 ms duration at the rate of 100 Mbps, and then pass the
token to the next host. Suppose that the time required to pass the token between
adjacent hosts is 0.05 ms. Assume that the token ring consists of 10 hosts.
a. Estimate the maximum aggregate (إجمالي) throughput achievable using the above
protocol.
b. Suppose that only one of the hosts on the token ring has a backlog (عمل متراكم), and
no other host has any data to transmit. Determine the maximum throughput
achieved by the backlogged host.
Tutorial for Chapter 4 Problem 5
CEN444 – Computer Networks Page 11 of 48
Solution a. Time for token to circulate around the ring is:
Token hold time × no. of stations with data + Station transmit time × no. of stations
= 1 ms × 10 + 0.05 ms × 10 = 10.5 ms
To maximize the aggregate throughput, each host should maximally utilize 1 ms for
transmission.
The aggregate number of bits that can be transmitted during this 10.5 ms period is:
1 ms × 100Mbps × 10 = 106bits.
The aggregate throughput = total number of bits / total transmission time
= 106 bits / 10.5 ms = 95.23 Mbps.
Tutorial for Chapter 4 Problem 5
CEN444 – Computer Networks Page 12 of 48
b. Since only one host is backlogged, only one host has data to transmit.
Time for token to circulate around the ring is:
Token hold time × no. of stations with data + Station transmit time × no. of stations
= 1 ms × 1 + 0.05 ms × 10 = 1.5 ms
The aggregate number of bits that can be transmitted during this period is:
1 ms × 100Mbps = 105bits.
The aggregate throughput = total number of bits / total transmission time
= 105 bits / 1.5 ms = 66.67Mbps.
Tutorial for Chapter 4 Problem 6
CEN444 – Computer Networks Page 13 of 48
Problem 6 Consider five wireless stations, A, B, C, D, and E. Station A can communicate with all
other stations. B can communicate with A, C and E. C can communicate with A, B and
D. D can communicate with A, C and E. E can communicate A, D and B.
Show the steps of the MACA protocol until the frame is successfully transmitted.
Indicate which nodes must be silent during each step.
(a) When A sends a frame to B.
(b) When B sends a frame to A.
(c) When B sends a frame to C.
Tutorial for Chapter 4 Problem 6
CEN444 – Computer Networks Page 14 of 48
Solution (a)
1. A sends RTS to B.
All stations hear the RTS, so they must stay silent until CTS
comes back.
A B C D E
A x x x x
B x x x
C x x x
D x x x
E x x x
2. B sends CTS to A.
C and E will hear the CTS, so they must remain silent during the transmission of the
upcoming data frame.
D doesn’t hear the CTS.
3. A sends data frame to B.
C and E are silent. D can transmit.
Tutorial for Chapter 4 Problem 6
CEN444 – Computer Networks Page 15 of 48
(b)
1. B sends RTS to A.
C and E hear the RTS, so they must remain silent until CTS comes back.
2. A sends CTS to B.
All stations hear the CTS, so they must remain silent during the transmission of the
upcoming data frame.
3. B sends data frame to A.
All stations are silent.
Tutorial for Chapter 4 Problem 6
CEN444 – Computer Networks Page 16 of 48
(c)
1. B sends RTS to C.
A and E will hear the RTS, so they must remain silent until CTS comes back.
2. C sends CTS to B.
A and D hear the CTS, so they must remain silent during the transmission of the
upcoming data frame.
E doesn’t hear the CTS.
3. B sends data frame to C.
A and D are silent. E can transmit.
Tutorial for Chapter 4 Problem 7
CEN444 – Computer Networks Page 17 of 48
Problem 7 Six stations, A through F, communicate using the MACA protocol. Is it possible for
two transmissions to take place simultaneously? Explain your answer.
Tutorial for Chapter 4 Problem 7
CEN444 – Computer Networks Page 18 of 48
Solution
If they are in a straight line and that each station can reach only its nearest neighbors.
Then A can send to B while E is sending to F. So, the answer is Yes.
A B E C D F
Tutorial for Chapter 4 Problem 8
CEN444 – Computer Networks Page 19 of 48
Problem 8 A 1-km-long, 10-Mbps CSMA/CD LAN (not 802.3) has a propagation speed of 200
m/μsec. Repeaters are not allowed in this system. Data frames are 256 bits long,
including 32 bits of header, checksum, and other overhead. The first bit slot after a
successful transmission is reserved for the receiver to capture the channel in order to
send a 32-bit acknowledgement frame. What is the effective data rate, excluding
overhead, assuming that there are no collisions?
Tutorial for Chapter 4 Problem 8
CEN444 – Computer Networks Page 20 of 48
Solution
The effective data rate is calculated as: data length without headers
total time required to complete transmission
The one-way propagation delay 𝜏 =cable length
signal speed=
1000 m
200 m/10−6sec= 5 × 10−6sec
The round-trip propagation time of the cable =2𝜏
A complete transmission has six phases:
1. Transmitter seizes cable:
Required time is 2𝜏 = 10 × 10−6 sec
2. Transmit data:
Required time is frame length
data rate=
256
10×106 = 25.6 × 10−6 sec
Tutorial for Chapter 4 Problem 8
CEN444 – Computer Networks Page 21 of 48
3. Delay for last bit to get to the end:
Required time is 𝜏 = 5 × 10−6 sec
4. Receiver seizes cable:
Required time is 2𝜏 = 10 × 10−6 μsec
5. Acknowledgement sent:
Required time is ack length
data rate=
32
10×106 = 3.2 × 10−6 sec
6. Delay for last bit to get to the end:
Required time is 𝜏 = 5 × 10−6 sec
Total time required = (10 + 25.6 + 5 + 10 + 3.2 + 5) × 10−6 = 58.8 × 10−6 sec
Effective data rate =256−32
58.8×10−6 = 3862068.96 ≈ 3.8 × 106 bps
Tutorial for Chapter 4 Problem 9
CEN444 – Computer Networks Page 22 of 48
Problem 9 A switch designed for use with fast Ethernet has a backplane that can move 1 Gbps.
How many frames/sec can it handle in the worst case?
Tutorial for Chapter 4 Problem 9
CEN444 – Computer Networks Page 23 of 48
Solution The worst case is an endless stream of 64-byte (512bit) frames.
The backplane can handle 109 bps
The number of frames it can handle is:
109
512= 1953125 frames/sec
Tutorial for Chapter 4 Problem 10
CEN444 – Computer Networks Page 24 of 48
Problem 10 In the following figure, four stations, A, B, C, and D, are shown. Which of the last two
stations do you think is closest to A and why?
Tutorial for Chapter 4 Problem 10
CEN444 – Computer Networks Page 25 of 48
Solution Station C heard the RTS and responded to it by asserting its NAV signal.
D did not respond.
Thus, C is the closest to A.
D must be outside A’s range.
Tutorial for Chapter 4 Problem 11
CEN444 – Computer Networks Page 26 of 48
Problem 11 Suppose that an 11-Mbps 802.11b LAN is transmitting 64-byte frames back-to-back
over a radio channel with a bit error rate of 10−7. How many frames per second will
be damaged on average?
Tutorial for Chapter 4 Problem 11
CEN444 – Computer Networks Page 27 of 48
Solution Let error probability per bit 𝑝 = 10−7
Probability of an 𝑛-bit frame arriving correctly is 𝐴 = (1 − 𝑝)𝑛
Thus, probability of a frame arriving correctly is (1 − 10−7)64×8 = 0.9999488
Probability of frame being damaged is (1 − 𝐴) = (1 − 0.9999488) = 5.12 × 10−5
Data rate of 802.11b is 11 × 106bits/sec
Number of frames transmitted per second is 11×106 bits/sec
64×8 bits/frame= 21484.375 frames/sec
No. of damaged frames/second = No. of frames/sec × probability of frame damaged
= 21484.375 × 5.11986918 × 10−5 = 1.0999 ≈ 1.1 frames/sec
Tutorial for Chapter 4 Problem 12
CEN444 – Computer Networks Page 28 of 48
Problem 12 Consider an 802.11 wireless LAN with the following parameters:
Physical layer data rate = 54Mbps MAC layer data payload = 1452 bytes
MAC header = 28 bytes ACK Frame size = 14 bytes
RTS length = 20 bytes CTS length = 14 bytes
DIFS time = 34μs SIFS Time = 16μs
MAC layer throughput is defined as the number of bits sent by the MAC layer in a
given period of time. Assuming that there are two stations exchanging a data frame
using 802.11 DCF and that the two stations are using RTS/CTS transaction.
Tutorial for Chapter 4 Problem 12
CEN444 – Computer Networks Page 29 of 48
a. Draw a timeline diagram describing this communication.
b. Calculate the required time for this communication.
c. Calculate the MAC layer throughput.
Tutorial for Chapter 4 Problem 12
CEN444 – Computer Networks Page 30 of 48
Solution a.
Tutorial for Chapter 4 Problem 12
CEN444 – Computer Networks Page 31 of 48
b.
Total frame size = data size+ header size = 1452+28 = 1480 bytes
Data frame transmission time =1480×8 bits
54 Mbps= 219.25 μs
ACK frame transmission time = 14×8 bits
54 Mbps= 2.07 μs
RTS frame transmission time = 20×8
54= 2.96 μs
CTS frame transmission time = 14×8
54= 2.07 μs
Total time required for transmission of one frame is:
Time of DIFS + RTS + SIFS + CTS +SIFS + Data + SIFS + ACK
34 + 2.96 + 16 + 2.07 + 16 + 219.25 + 16 + 2.07 = 308.35 μs
Tutorial for Chapter 4 Problem 12
CEN444 – Computer Networks Page 32 of 48
c.
We are using 308.35 μs to transmit 1452 bytes
MAC layer throughput is:
1452 × 8 bits
308.35 μs= 37.67 Mbps
Tutorial for Chapter 4 Problem 13
CEN444 – Computer Networks Page 33 of 48
Problem 13 In the previous problem, suppose that RTS/CTS transaction is not used.
a. Draw a timeline diagram describing this communication.
b. Calculate the required time for this communication.
c. Calculate the MAC layer throughput.
Tutorial for Chapter 4 Problem 13
CEN444 – Computer Networks Page 34 of 48
Solution a.
Tutorial for Chapter 4 Problem 13
CEN444 – Computer Networks Page 35 of 48
b.
Total frame size = data size+ header size = 1452+28 = 1480 bytes
Data frame transmission time =1480×8 bits
54 Mbps= 219.25 μs
ACK frame transmission time = 14×8 bits
54 Mbps= 2.07 μs
Total time required for transmission of one frame is:
Time of DIFS + Data + SIFS + ACK
34 + 219.25 + 16 + 2.07 = 271.32 μs
Tutorial for Chapter 4 Problem 13
CEN444 – Computer Networks Page 36 of 48
c.
We are using 308.35 μs to transmit 1452 bytes
MAC layer throughput is:
1452 × 8 bits
271.32 μs= 42.81 Mbps
Tutorial for Chapter 4 Problem 14
M. Dahshan CEN444 – Computer Networks Page 37 of 48
Problem 14 Consider an 802.11 wireless LAN using DCF operation with the following parameters:
SIFS = 1 slot, DIFS = 3 slots, ACK = 1 slot, CWmin = 8, All Data frames = 4 slots.
There are four stations, S1, S2, S3 and S4.
At T = 0, S2 starts transmitting a Data frame to S3.
At T = 2, S1 has a Data frame to transmit to S4.
At T = 3, S3 has a Data frame to transmit to S2.
At T = 14, S4 has a Data frame to transmit to S2.
Assume backoff values, of S1 = 6, S3 = 3 and S4 = 1.
Draw a timeline diagram describing this communication. RTS/CTS are not used.
Tutorial for Chapter 4 Problem 14
CEN444 – Computer Networks Page 38 of 48
Solution
Tutorial for Chapter 4 Problem 15
CEN444 – Computer Networks Page 39 of 48
Problem 15 Store-and-forward switches have an advantage over cut-through switches with respect
to damaged frames. Explain what it is.
Tutorial for Chapter 4 Problem 15
CEN444 – Computer Networks Page 40 of 48
Solution Store-and-forward switches store entire frames before forwarding them.
After a frame comes in, checksum can be verified.
If the frame is damaged, it is discarded immediately.
With cut-through, damaged frames cannot be discarded by the switch because by the
time the error is detected, the frame is already gone.
Tutorial for Chapter 4 Problem 16
CEN444 – Computer Networks Page 41 of 48
Problem 16 Consider the extended LAN connected using bridges B1 and B2 in the figure. Suppose
the hash tables in the two bridges are empty. List all ports on which a packet will be
forwarded and hash table updates for the following sequence of data transmissions:
(a) A sends a packet to C. (b) E sends a packet to F.
(c) F sends a packet to E. (d) G sends a packet to E.
(e) D sends a packet to A. (f) B sends a packet to F.
Tutorial for Chapter 4 Problem 16
CEN444 – Computer Networks Page 42 of 48
Solution Initially, the hash tables are empty.
Switches don’t know which address is associated with which port.
B1 B2
Address Port Address Port
- - - -
Tutorial for Chapter 4 Problem 16
CEN444 – Computer Networks Page 43 of 48
(a) B1 will forward this packet on ports 2, 3, and 4. B2 will forward it on 1, 2 and 3.
Switch B1 B2
From To Port 1 2 3 4 1 2 3 4
A C X X X X X X
Updated hash tables:
B1 B2
Address Port Address Port
A 1 A 4
Tutorial for Chapter 4 Problem 16
CEN444 – Computer Networks Page 44 of 48
(b) B2 will forward this packet on ports 1, 3, and 4. B1 will forward it on 1, 2 and 3.
Switch B1 B2
From To Port 1 2 3 4 1 2 3 4
E F X X X X X X
Hash tables are updated as follows:
B1 B2
Address Port Address Port
A 1 A 4
E 4 E 2
Tutorial for Chapter 4 Problem 16
CEN444 – Computer Networks Page 45 of 48
(c) B2 will not forward this packet on any of its ports, and B1 will not see it.
Switch B1 B2
From To Port 1 2 3 4 1 2 3 4
F E
Hash tables are updated as follows:
B1 B2
Address Port Address Port
A 1 A 4
E 4 E 2
F 2
Tutorial for Chapter 4 Problem 16
CEN444 – Computer Networks Page 46 of 48
(d) B2 will forward this packet on port 2. B1 will not see it.
Switch B1 B2
From To Port 1 2 3 4 1 2 3 4
G E X
Hash tables are updated as follows:
B1 B2
Address Port Address Port
A 1 A 4
E 4 E 2
F 2
G 3
Tutorial for Chapter 4 Problem 16
CEN444 – Computer Networks Page 47 of 48
(e) B2 will forward this packet on port 4 and B1 will forward it on port 1.
Switch B1 B2
From To Port 1 2 3 4 1 2 3 4
D A X X
Hash tables are updated as follows:
B1 B2
Address Port Address Port
A 1 A 4
E 4 E 2
D 4 F 2
G 3
D 1
Tutorial for Chapter 4 Problem 16
Page 48 of 48
(f) B1 will forward this packet on ports 1, 3 and 4. B2 will forward it on port 2.
Switch B1 B2
From To Port 1 2 3 4 1 2 3 4
B F X X X X
Hash tables are updated as follows:
B1 B2
Address Port Address Port
A 1 A 4
E 4 E 2
D 4 F 2
B 2 G 3
D 1
B 2
CEN444 –Computer Networks