Tut 01 Kyo

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

CSC358 Tutorial 1

KyoKeun Park
January 17, 2020
University of Toronto Mississauga

1
Question 1: Concept Review

(a) What’s the difference between circuit switching and packet


switching?
(b) What are the types of delays when a packet travels from a
source host to a destination host?
(c) What are in the edge and core of the Internet?
(d) Why do we say the Internet is a network of networks? What are
the roles of access networks, ISP, IXP, and CDN?
(e) What’s the point of the layered protocol stack?

For the answers, review the lectures, books, go to office hours, and
use the discussion board!

2
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time. Answer the following questions.

(a) When circuit switching is used, how many users can be


supported?
(b) For the remainder of this question, suppose packet switching is
used. Find the probability that a given user is transmitting at any
given point in time.
(c) Suppose there are 120 users. Find the probability that at any
given time, exactly n users are transmitting simultaneously.
(d) Find the probability that there are 21 of more users transmitting
simultaneously.
(e) How do you interpret the meaning of this probability?

3
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(a) When circuit switching is used, how many users can be
supported?
Recall: Bandwidth has to be reserved in circuit switching.

4
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(a) When circuit switching is used, how many users can be
supported?
Recall: Bandwidth has to be reserved in circuit switching.
3Mbps 3000kbps
150kbps = 150kbps = 20
Hence, 20 users can be supported

4
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(b) For the remainder of this question, suppose packet switching is
used. Find the probability that a given user is transmitting at any
given point in time.

5
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(b) For the remainder of this question, suppose packet switching is
used. Find the probability that a given user is transmitting at any
given point in time.
p = 0.1

5
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(c) Suppose there are 120 users. Find the probability that at any given
time, exactly n users are transmitting simultaneously.
Recall: Binomial distribution

6
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(c) Suppose there are 120 users. Find the probability that at any given
time, exactly n users are transmitting simultaneously.
Recall: Binomial distribution
( )
Pr(n) = 120 n
n × p × (1 − p)
120−n

6
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(c) Suppose there are 120 users. Find the probability that at any given
time, exactly n users are transmitting simultaneously.
Recall: Binomial distribution
( )
Pr(n) = 120 n
n × p × (1 − p)
120−n

(120)
n : Different ways of choosing n users from 120 users

pn : Probability of choosing these n users


(1 − p)120−n : Probability of n − k users not being chosen

6
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(d) Find the probability that there are 21 of more users transmitting
simultaneously.
AKA. The probability that there are 21 users or 22 users or ...

7
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(d) Find the probability that there are 21 of more users transmitting
simultaneously.
AKA. The probability that there are 21 users or 22 users or ...
Pr(21 ≤ n ≤ 120)

7
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(d) Find the probability that there are 21 of more users transmitting
simultaneously.
AKA. The probability that there are 21 users or 22 users or ...
∑120
Pr(21 ≤ n ≤ 120) = n=21 Pr(n) = 0.003

7
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(e) How do you interpret the meaning of this probability?
As in, what does Pr(21 ≤ n ≤ 120) represent in our case? What’s
special about having over 20 users transmitting simultaneously?

8
Question 2: Circuit Switching vs Packet Switching

Suppose a number of users share a 3 Mbps link. Also suppose each


user requires 150 kbps when transmitting, but each user transmits
only 10 percent of the time.
(e) How do you interpret the meaning of this probability?
As in, what does Pr(21 ≤ n ≤ 120) represent in our case? What’s
special about having over 20 users transmitting simultaneously?
When there are more than 20 users transmitting simultaneously,
packets will start queueing up. Packet drop may occur during this
time.
However, note that even with 120 users, the probability of this
happening is very small.

8
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
(a) What is the propagation delay, dprop ?
(b) What is the transmission delay of a packet, dtrans ?
(c) Ignoring processing and queueing delays, obtain an expression
for the end-to-end delay
(d) Suppose Host A begins to transmit the packet at time t = 0. At
time t = dtrans , where is the last bit of the packet?
(e) Suppose dprop is greater than dtrans . At time t = dtrans , where is
the first bit of the packet?
(f) Suppose dprop is less than dtrans . At time t = dtrans , where is the
first bit of the packet?
(g) Suppose s = 2.5 × 108 , L = 120 bits, and R = 56 kbps. Find the
distance m so that dprop equals dtrans .
9
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
(a) dprop

(b) dtrans
(c) dendtoend

10
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
length of physical link m
(a) dprop = propagation speed = s seconds

(b) dtrans
(c) dendtoend

10
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
length of physical link m
(a) dprop = propagation speed = s seconds
packet size L
(b) dtrans = bandwidth = R seconds
(c) dendtoend

10
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
length of physical link m
(a) dprop = propagation speed = s seconds
packet size L
(b) dtrans = bandwidth = R seconds
m L
(c) dendtoend = dprop + dtrans + dqueue + dproc = s + R +0+0

10
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
(d) Suppose Host A begins to transmit the packet at time t = 0. At
time t = dtrans , where is the last bit of the packet?

(e) Suppose dprop is greater than dtrans . At time t = dtrans , where is the
first bit of the packet?

11
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
(d) Suppose Host A begins to transmit the packet at time t = 0. At
time t = dtrans , where is the last bit of the packet?
The bit is just leaving Host A
(e) Suppose dprop is greater than dtrans . At time t = dtrans , where is the
first bit of the packet?

11
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
(d) Suppose Host A begins to transmit the packet at time t = 0. At
time t = dtrans , where is the last bit of the packet?
The bit is just leaving Host A
(e) Suppose dprop is greater than dtrans . At time t = dtrans , where is the
first bit of the packet?
The first bit is in the link and has not reached Host B

11
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
(f) Suppose dprop is less than dtrans . At time t = dtrans , where is the
first bit of the packet?

(g) Suppose s = 2.5 × 108 , L = 120 bits, and R = 56 kbps. Find the
distance m so that dprop equals dtrans .

12
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
(f) Suppose dprop is less than dtrans . At time t = dtrans , where is the
first bit of the packet?
The first bit has reached Host B
(g) Suppose s = 2.5 × 108 , L = 120 bits, and R = 56 kbps. Find the
distance m so that dprop equals dtrans .

12
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
(f) Suppose dprop is less than dtrans . At time t = dtrans , where is the
first bit of the packet?
The first bit has reached Host B
(g) Suppose s = 2.5 × 108 , L = 120 bits, and R = 56 kbps. Find the
distance m so that dprop equals dtrans .
m L L
s = R =⇒ m = s · R

12
Question 3: Propagation Delay and Transmission Delay

Consider two hosts, A and B, connected by a single link of rate R bps.


Suppose that the two hosts are separated by m meters, and suppose
the propagation speed along the link is s meters/sec. Host A is to
send a packet of size L bits to Host B.
(f) Suppose dprop is less than dtrans . At time t = dtrans , where is the
first bit of the packet?
The first bit has reached Host B
(g) Suppose s = 2.5 × 108 , L = 120 bits, and R = 56 kbps. Find the
distance m so that dprop equals dtrans .
m L L 120
s = R =⇒ m = s · R = 2.5 × 108 · 56·1000 = 536kilometer

12
Question 4: Optimal Packet Size

Consider sending a large file of F bits from Host A to Host B using


packet switching. There are three hops of links (therefore two
switches) between A and B, and the links are uncongested, i.e., no
queueing delays. Host A segments the file into segments of S bits
each and adds 80 bits of header to each segment, forming packets of
size L = 80 + S bits. Each link has a transmission rate of R bps.

(a) Suppose you are the network administrator to decide on the


value of S. Discuss, qualitatively, the pros and cons of choices of
S values that are very large or very small.
(b) Now do the math: find the value of S that minimizes the delay of
moving the file from Host A to Host B. Disregard propagation
delay.

13
Question 4: Optimal Packet Size

A S1 S2 B

(a) Suppose you are the network administrator to decide on the


value of S. Discuss, qualitatively, the pros and cons of choices of S
values that are very large or very small.

14
Question 4: Optimal Packet Size

A S1 S2 B

(a) Suppose you are the network administrator to decide on the


value of S. Discuss, qualitatively, the pros and cons of choices of S
values that are very large or very small.
With larger S, we will have fewer, larger packets. This means less
overhead from the 80-bit buffer, but less pipelining (eg. Recall that
we need to wait for entire packet to be transmitted before moving
on)

14
Question 4: Optimal Packet Size

A S1 S2 B

(a) Suppose you are the network administrator to decide on the


value of S. Discuss, qualitatively, the pros and cons of choices of S
values that are very large or very small.
With larger S, we will have fewer, larger packets. This means less
overhead from the 80-bit buffer, but less pipelining (eg. Recall that
we need to wait for entire packet to be transmitted before moving
on)
With smaller S, we will have more, smaller packets. This means much
better pipelining, but more overhead

14
Question 4: Optimal Packet Size

(b) Now do the math: find the value of S that minimizes the delay of
moving the file from Host A to Host B. Disregard propagation delay.
Total packets:
Packet size:

15
Question 4: Optimal Packet Size

(b) Now do the math: find the value of S that minimizes the delay of
moving the file from Host A to Host B. Disregard propagation delay.
Total packets: SF
Packet size: S + 80
How long does it take for first switch to receive the last packet?

15
Question 4: Optimal Packet Size

(b) Now do the math: find the value of S that minimizes the delay of
moving the file from Host A to Host B. Disregard propagation delay.
Total packets: SF
Packet size: S + 80
How long does it take for first switch to receive the last packet?

S+80 F
R · S sec
At this time, how many packets have reached the destination? How
many are in second router?

15
Question 4: Optimal Packet Size

(b) Now do the math: find the value of S that minimizes the delay of
moving the file from Host A to Host B. Disregard propagation delay.
Total packets: SF
Packet size: S + 80
How long does it take for first switch to receive the last packet?

S+80 F
R · S sec
At this time, how many packets have reached the destination? How
many are in second router?
F
S − 2 packets in destination.
A single, SF − 1th packet will be in second router.

15
Question 4: Optimal Packet Size

Hence, the delay in sending the whole file is


Delay = S+80 F
R · ( S + 2)
(+2 to accommodate for the last two packets)

16
Question 4: Optimal Packet Size

Hence, the delay in sending the whole file is


Delay = S+80 F
R · ( S + 2)
(+2 to accommodate for the last two packets)
Now, in order to find the optimal value S to minimize Delay, derive
Delay with respect to S and set it to zero

16
Question 4: Optimal Packet Size

Hence, the delay in sending the whole file is


Delay = S+80 F
R · ( S + 2)
(+2 to accommodate for the last two packets)
Now, in order to find the optimal value S to minimize Delay, derive
Delay with respect to S and set it to zero
d 2 80F
ds · Delay = R − R · S−2 = 0

16
Question 4: Optimal Packet Size

Hence, the delay in sending the whole file is


Delay = S+80 F
R · ( S + 2)
(+2 to accommodate for the last two packets)
Now, in order to find the optimal value S to minimize Delay, derive
Delay with respect to S and set it to zero
d
· Delay = R2 − 80F
· S−2 = 0
ds √ R
=⇒ S = 40F

16

You might also like