Chapter 1 EX 2
Chapter 1 EX 2
Exercises
Ion Turcanu: [email protected]
Note: the slides used in this course are adapted from the original slides
Computer Networking: A
created by Jim Kurose and Keith Rose:
https://gaia.cs.umass.edu/kurose_ross/ppt.htm
Top-Down Approach
7th edition
All material copyright 1996-2020 Jim Kurose, Keith Ross
J.F Kurose and K.W. Ross, All Rights Reserved Pearson/Addison Wesley, 2016
Introduction: 1-1
Exercise 1 – Circuit Switching (1/4)
Consider the circuit-switched network
shown in the figure below, with circuit
switches A, B, C, and D. Suppose there are
12 circuits between A and B, 20 circuits
between B and C, 11 circuits between C
and D, and 13 circuits between D and A.
1. What is the maximum number of connections that can be ongoing in the network at
any one time?
The maximum number of connections that can be ongoing at any one time is the sum of
all circuits, which happens when 12 connections go from A to B, 20 connections go from
B to C, 11 connections go from C to D, and 13 connections go from D to A. This sum is 56.
Introduction: 1-2
Exercise 1 – Circuit Switching (2/4)
Consider the circuit-switched network
shown in the figure below, with circuit
switches A, B, C, and D. Suppose there are
12 circuits between A and B, 20 circuits
between B and C, 11 circuits between C
and D, and 13 circuits between D and A.
2. Suppose that these maximum number of connections are all ongoing. What
happens when another call connection request arrives to the network, will it
be accepted? Answer Yes or No
No, it will be blocked because there are no free circuits.
Introduction: 1-3
Exercise 1 – Circuit Switching (3/4)
Consider the circuit-switched network
shown in the figure below, with circuit
switches A, B, C, and D. Suppose there are
12 circuits between A and B, 20 circuits
between B and C, 11 circuits between C
and D, and 13 circuits between D and A.
3. Suppose that every connection requires 2 consecutive hops, and calls are connected
clockwise. For example, a connection can go from A to C, from B to D, from C to A, and
from D to B. With these constraints, what is the is the maximum number of connections
that can be ongoing in the network at any one time?
There can be a maximum of 23 connections. Consider routes A->C and C->A, sum the
bottleneck links, and compare that value to the equivalent of B->D and D->B.
Introduction: 1-4
Exercise 1 – Circuit Switching (4/4)
Consider the circuit-switched network
shown in the figure below, with circuit
switches A, B, C, and D. Suppose there are
12 circuits between A and B, 20 circuits
between B and C, 11 circuits between C
and D, and 13 circuits between D and A.
4. Suppose that 15 connections are needed from A to C, and 14 connections are
needed from B to D. Can we route these calls through the four links to
accommodate all 29 connections? Answer Yes or No
The sum of our needed connections is 29, and we have 23 available connections,
so it is NOT possible.
Introduction: 1-5
Exercise 2 – Car-Caravan Analogy (1/7)
Consider the figure below. Suppose the caravan has 20 cars, and that the tollbooth services a car
at a rate of one car per 2 seconds. Once served, a car proceeds to the next toll booth, which is 500
km away at a speed of 10 km/sec. Also assume that whenever the first car of the caravan arrives at
a tollbooth, it must wait at the entrance to the tollbooth until all of the other cars in its caravan
have arrived and lined up behind it before being serviced at the toll booth. (That is, the entire
caravan must be stored at the tollbooth before the first car in the caravan can pay its toll and begin
driving towards the next tollbooth).
1. Once a car enters service at the tollbooth, how long does it take until it leaves
service?
Service time is 2 seconds
Introduction: 1-6
Exercise 2 – Car-Caravan Analogy (2/7)
Consider the figure below. Suppose the caravan has 20 cars, and that the tollbooth services a car
at a rate of one car per 2 seconds. Once served, a car proceeds to the next toll booth, which is 500
km away at a speed of 10 km/sec. Also assume that whenever the first car of the caravan arrives at
a tollbooth, it must wait at the entrance to the tollbooth until all of the other cars in its caravan
have arrived and lined up behind it before being serviced at the toll booth. (That is, the entire
caravan must be stored at the tollbooth before the first car in the caravan can pay its toll and begin
driving towards the next tollbooth).
2. How long does it take for the entire caravan to receive service at the tollbooth
(that is the time from when the first car enters service until the last car leaves
the tollbooth)?
It takes 40 seconds to service every car, (20 cars * 2 seconds per car)
Introduction: 1-7
Exercise 2 – Car-Caravan Analogy (3/7)
Consider the figure below. Suppose the caravan has 20 cars, and that the tollbooth services a car
at a rate of one car per 2 seconds. Once served, a car proceeds to the next toll booth, which is 500
km away at a speed of 10 km/sec. Also assume that whenever the first car of the caravan arrives at
a tollbooth, it must wait at the entrance to the tollbooth until all of the other cars in its caravan
have arrived and lined up behind it before being serviced at the toll booth. (That is, the entire
caravan must be stored at the tollbooth before the first car in the caravan can pay its toll and begin
driving towards the next tollbooth).
3. Once the first car leaves the tollbooth, how long does it take until it arrives at
the next tollbooth?
It takes 50 seconds to travel to the next toll booth (500 km / 10 km/s)
Introduction: 1-8
Exercise 2 – Car-Caravan Analogy (4/7)
Consider the figure below. Suppose the caravan has 20 cars, and that the tollbooth services a car
at a rate of one car per 2 seconds. Once served, a car proceeds to the next toll booth, which is 500
km away at a speed of 10 km/sec. Also assume that whenever the first car of the caravan arrives at
a tollbooth, it must wait at the entrance to the tollbooth until all of the other cars in its caravan
have arrived and lined up behind it before being serviced at the toll booth. (That is, the entire
caravan must be stored at the tollbooth before the first car in the caravan can pay its toll and begin
driving towards the next tollbooth).
4. Once the last car leaves the tollbooth, how long does it take until it arrives at
the next tollbooth?
Just like in the previous question, it takes 50 seconds, regardless of the car
Introduction: 1-9
Exercise 2 – Car-Caravan Analogy (5/7)
Consider the figure below. Suppose the caravan has 20 cars, and that the tollbooth services a car
at a rate of one car per 2 seconds. Once served, a car proceeds to the next toll booth, which is 500
km away at a speed of 10 km/sec. Also assume that whenever the first car of the caravan arrives at
a tollbooth, it must wait at the entrance to the tollbooth until all of the other cars in its caravan
have arrived and lined up behind it before being serviced at the toll booth. (That is, the entire
caravan must be stored at the tollbooth before the first car in the caravan can pay its toll and begin
driving towards the next tollbooth).
5. Once the first car leaves the tollbooth, how long does it take until it enters
service at the next tollbooth?
It takes 88 seconds until the first car gets serviced at the next toll booth (20-1 cars *
2 seconds per car + 500 km / 10 km/s)
Introduction: 1-10
Exercise 2 – Car-Caravan Analogy (6/7)
Consider the figure below. Suppose the caravan has 20 cars, and that the tollbooth services a car
at a rate of one car per 2 seconds. Once served, a car proceeds to the next toll booth, which is 500
km away at a speed of 10 km/sec. Also assume that whenever the first car of the caravan arrives at
a tollbooth, it must wait at the entrance to the tollbooth until all of the other cars in its caravan
have arrived and lined up behind it before being serviced at the toll booth. (That is, the entire
caravan must be stored at the tollbooth before the first car in the caravan can pay its toll and begin
driving towards the next tollbooth).
6. Are there ever two cars in service at the same time, one at the first toll booth
and one at the second toll booth?
No, because cars can't get service at the next tollbooth until all cars have arrived
Introduction: 1-11
Exercise 2 – Car-Caravan Analogy (7/7)
Consider the figure below. Suppose the caravan has 20 cars, and that the tollbooth services a car
at a rate of one car per 2 seconds. Once served, a car proceeds to the next toll booth, which is 500
km away at a speed of 10 km/sec. Also assume that whenever the first car of the caravan arrives at
a tollbooth, it must wait at the entrance to the tollbooth until all of the other cars in its caravan
have arrived and lined up behind it before being serviced at the toll booth. (That is, the entire
caravan must be stored at the tollbooth before the first car in the caravan can pay its toll and begin
driving towards the next tollbooth).
7. Are there ever zero cars in service at the same time, i.e., the caravan of cars has finished
at the first toll booth, but not yet arrived at the second tollbooth?
Yes, one notable example is when the last car in the caravan is serviced but is still travelling to
the next toll booth; all other cars have to wait until it arrives, thus no cars are being serviced
Introduction: 1-12
Exercise 3 – One-Hop Transmission Delay (1/2)
Introduction: 1-13
Exercise 3 – One-Hop Transmission Delay (2/2)
2. What is the maximum number of packets per second that can be transmitted
by this link?
The number of packets that can be transmitted in a second into the link = R / L =
1000000 bps / 4000 bits = 250 packets
Introduction: 1-14
Exercise 4 – Queuing Delay (1/5)
Consider the queuing delay in a router buffer, where the packet experiences a
delay as it waits to be transmitted onto the link. The length of the queuing delay
of a specific packet will depend on the number of earlier-arriving packets that
are queued and waiting for transmission onto the link. If the queue is empty
and no other packet is currently being transmitted, then our packet’s queuing
delay will be zero. On the other hand, if the traffic is heavy and many other
packets are also waiting to be transmitted, the queuing delay will be long.
Assume a constant transmission rate of R = 500000 bps, a constant packet-
length L = 8300 bits, and a is the average rate of packets/second. Traffic
intensity I = La/R, and the queuing delay is calculated as I(L/R)(1 - I) for I < 1.
Introduction: 1-15
Exercise 4 – Queuing Delay (2/5)
Consider the queuing delay in a router buffer, where the packet experiences a
delay as it waits to be transmitted onto the link. The length of the queuing delay
of a specific packet will depend on the number of earlier-arriving packets that
are queued and waiting for transmission onto the link. If the queue is empty
and no other packet is currently being transmitted, then our packet’s queuing
delay will be zero. On the other hand, if the traffic is heavy and many other
packets are also waiting to be transmitted, the queuing delay will be long.
Assume a constant transmission rate of R = 500000 bps, a constant packet-
length L = 8300 bits, and a is the average rate of packets/second. Traffic
intensity I = La/R, and the queuing delay is calculated as I(L/R)(1 - I) for I < 1.
Introduction: 1-16
Exercise 4 – Queuing Delay (3/5)
Consider the queuing delay in a router buffer, where the packet experiences a
delay as it waits to be transmitted onto the link. The length of the queuing delay
of a specific packet will depend on the number of earlier-arriving packets that
are queued and waiting for transmission onto the link. If the queue is empty
and no other packet is currently being transmitted, then our packet’s queuing
delay will be zero. On the other hand, if the traffic is heavy and many other
packets are also waiting to be transmitted, the queuing delay will be long.
Assume a constant transmission rate of R = 500000 bps, a constant packet-
length L = 8300 bits, and a is the average rate of packets/second. Traffic
intensity I = La/R, and the queuing delay is calculated as I(L/R)(1 - I) for I < 1.
Introduction: 1-17
Exercise 4 – Queuing Delay (4/5)
Consider the queuing delay in a router buffer, where the packet experiences a
delay as it waits to be transmitted onto the link. The length of the queuing delay
of a specific packet will depend on the number of earlier-arriving packets that
are queued and waiting for transmission onto the link. If the queue is empty
and no other packet is currently being transmitted, then our packet’s queuing
delay will be zero. On the other hand, if the traffic is heavy and many other
packets are also waiting to be transmitted, the queuing delay will be long.
Assume a constant transmission rate of R = 500000 bps, a constant packet-
length L = 8300 bits, and a is the average rate of packets/second. Traffic
intensity I = La/R, and the queuing delay is calculated as I(L/R)(1 - I) for I < 1.
4. Assuming the router's buffer is infinite, the queuing delay is 1.3186 ms, and 1457
packets arrive. How many packets will be in the buffer 1 second later?
Packets left in buffer = a - floor(1000/delay) = 1457 - floor(1000/1.3186) = 699 packets.
Introduction: 1-18
Exercise 4 – Queuing Delay (5/5)
Consider the queuing delay in a router buffer, where the packet experiences a
delay as it waits to be transmitted onto the link. The length of the queuing delay
of a specific packet will depend on the number of earlier-arriving packets that
are queued and waiting for transmission onto the link. If the queue is empty
and no other packet is currently being transmitted, then our packet’s queuing
delay will be zero. On the other hand, if the traffic is heavy and many other
packets are also waiting to be transmitted, the queuing delay will be long.
Assume a constant transmission rate of R = 500000 bps, a constant packet-
length L = 8300 bits, and a is the average rate of packets/second. Traffic
intensity I = La/R, and the queuing delay is calculated as I(L/R)(1 - I) for I < 1.
5. If the buffer has a maximum size of 580 packets, how many of the 1457
packets would be dropped upon arrival from the previous question?
Packets dropped = packets - buffer size = 1457 - 580 = 877 dropped packets.
Introduction: 1-19
Exercise 5 – End-to-End Delay (1/10)
Consider the figure on the right, with
three links, each with the specified
transmission rate and link length. Assume
the length of a packet is 8000 bits. The
speed of light propagation delay on each
link is 3x10^8 m/sec.
Introduction: 1-20
Exercise 5 – End-to-End Delay (2/10)
Consider the figure on the right, with
three links, each with the specified
transmission rate and link length. Assume
the length of a packet is 8000 bits. The
speed of light propagation delay on each
link is 3x10^8 m/sec.
Introduction: 1-21
Exercise 5 – End-to-End Delay (3/10)
Consider the figure on the right, with
three links, each with the specified
transmission rate and link length. Assume
the length of a packet is 8000 bits. The
speed of light propagation delay on each
link is 3x10^8 m/sec.
Introduction: 1-22
Exercise 5 – End-to-End Delay (4/10)
Consider the figure on the right, with
three links, each with the specified
transmission rate and link length. Assume
the length of a packet is 8000 bits. The
speed of light propagation delay on each
link is 3x10^8 m/sec.
Introduction: 1-23
Exercise 5 – End-to-End Delay (5/10)
Consider the figure on the right, with
three links, each with the specified
transmission rate and link length. Assume
the length of a packet is 8000 bits. The
speed of light propagation delay on each
link is 3x10^8 m/sec.
Introduction: 1-24
Exercise 5 – End-to-End Delay (6/10)
Consider the figure on the right, with
three links, each with the specified
transmission rate and link length. Assume
the length of a packet is 8000 bits. The
speed of light propagation delay on each
link is 3x10^8 m/sec.
Introduction: 1-25
Exercise 5 – End-to-End Delay (7/10)
Consider the figure on the right, with
three links, each with the specified
transmission rate and link length. Assume
the length of a packet is 8000 bits. The
speed of light propagation delay on each
link is 3x10^8 m/sec.
Introduction: 1-26
Exercise 5 – End-to-End Delay (8/10)
Consider the figure on the right, with
three links, each with the specified
transmission rate and link length. Assume
the length of a packet is 8000 bits. The
speed of light propagation delay on each
link is 3x10^8 m/sec.
Introduction: 1-27
Exercise 5 – End-to-End Delay (9/10)
Consider the figure on the right, with
three links, each with the specified
transmission rate and link length. Assume
the length of a packet is 8000 bits. The
speed of light propagation delay on each
link is 3x10^8 m/sec.
Introduction: 1-28
Exercise 5 – End-to-End Delay (10/10)
Consider the figure on the right, with
three links, each with the specified
transmission rate and link length. Assume
the length of a packet is 8000 bits. The
speed of light propagation delay on each
link is 3x10^8 m/sec.
Introduction: 1-29
Exercise 6 – End-to-End Throughput (1/5)
Consider the scenario shown on the right, with four different
servers connected to four different clients over four three-
hop paths. The four pairs share a common middle hop with a
transmission capacity of R = 100 Mbps. The four links from
the servers to the shared link have a transmission capacity of
= 90 Mbps. Each of the four links from the shared middle
link to a client has a transmission capacity of = 40 Mbps.
1. What is the maximum achievable end-end throughput (in Mbps) for each of four
client-to-server pairs, assuming that the middle link is fairly shared (divides its
transmission rate equally)?
The maximum achievable end-end throughput is the capacity of the link with the
minimum capacity, which is 25 Mbps
Introduction: 1-30
Exercise 6 – End-to-End Throughput (2/5)
Consider the scenario shown on the right, with four different
servers connected to four different clients over four three-
hop paths. The four pairs share a common middle hop with a
transmission capacity of R = 100 Mbps. The four links from
the servers to the shared link have a transmission capacity of
= 90 Mbps. Each of the four links from the shared middle
link to a client has a transmission capacity of = 40 Mbps.
Introduction: 1-31
Exercise 6 – End-to-End Throughput (3/5)
Consider the scenario shown on the right, with four different
servers connected to four different clients over four three-
hop paths. The four pairs share a common middle hop with a
transmission capacity of R = 100 Mbps. The four links from
the servers to the shared link have a transmission capacity of
= 90 Mbps. Each of the four links from the shared middle
link to a client has a transmission capacity of = 40 Mbps.
3. Assuming that the servers are sending at the maximum rate possible, what
are the link utilizations for the server links ()?
The server's utilization = / = 25 / 90 = 0.28
Introduction: 1-32
Exercise 6 – End-to-End Throughput (4/5)
Consider the scenario shown on the right, with four different
servers connected to four different clients over four three-
hop paths. The four pairs share a common middle hop with a
transmission capacity of R = 100 Mbps. The four links from
the servers to the shared link have a transmission capacity of
= 90 Mbps. Each of the four links from the shared middle
link to a client has a transmission capacity of = 40 Mbps.
4. Assuming that the servers are sending at the maximum rate possible, what
are the link utilizations for the client links ()?
The client's utilization = / = 25 / 40 = 0.63
Introduction: 1-33
Exercise 6 – End-to-End Throughput (5/5)
Consider the scenario shown on the right, with four different
servers connected to four different clients over four three-
hop paths. The four pairs share a common middle hop with a
transmission capacity of R = 100 Mbps. The four links from
the servers to the shared link have a transmission capacity of
= 90 Mbps. Each of the four links from the shared middle
link to a client has a transmission capacity of = 40 Mbps.
5. Assuming that the servers are sending at the maximum rate possible, what is
the link utilizations for the shared link (R)?
The shared link's utilization = / (R / 4) = 25 / (100 / 4) = 1
Introduction: 1-34
Exercise 7 – The IP Stack and Protocol Layering
1. What layer in the IP stack best corresponds to the phrase: 'handles messages
from a variety of network applications'
The given phrase corresponds to the Application Layer.
Introduction: 1-35
Exercise 7 – The IP Stack and Protocol Layering
2. What layer in the IP stack best corresponds to the phrase: 'passes frames from
one node to another across some medium'
The given phrase corresponds to the Link Layer.
Introduction: 1-36
Exercise 7 – The IP Stack and Protocol Layering
3. What layer in the IP stack best corresponds to the phrase: 'moves datagrams
from the source host to the destination host'
The given phrase corresponds to the Network Layer.
Introduction: 1-37
Exercise 7 – The IP Stack and Protocol Layering
Introduction: 1-38
Exercise 7 – The IP Stack and Protocol Layering
Introduction: 1-39