Professional Documents
Culture Documents
Chapter 3 EX
Chapter 3 EX
Exercises
Ion Turcanu: ion.turcanu@uni.lu
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 – Internet Checksum (1/4)
Compute the Internet checksum value for these two 16-bit words:
10010101 11110111
10111001 01100000
The internet checksum is the one's complement of the sum: 11000011 10001111 = 00111100 01110000
Introduction: 1-2
Exercise 1 – Internet Checksum (2/4)
Compute the Internet checksum value for these two 16-bit words:
10010101 11110111
10111001 01100000
Introduction: 1-3
Exercise 1 – Internet Checksum (3/4)
Compute the Internet checksum value for these two 16-bit words:
01110100 01011111
01100101 10001110
Introduction: 1-4
Exercise 1 – Internet Checksum (4/4)
Compute the Internet checksum value for these two 16-bit words:
01110100 01011111
01100101 10001110
Introduction: 1-6
Exercise 2 – UDP Mux and Demux (2/4)
In the scenario below, the left and right clients communicate with a server using UDP sockets. The same
socket at the server is used to communicate with both clients. The Python code used to create the sockets
is shown in the figure. Consider the four transport-layer packets – A, B, C and D – shown in the figure
below.
Introduction: 1-7
Exercise 2 – UDP Mux and Demux (3/4)
In the scenario below, the left and right clients communicate with a server using UDP sockets. The same
socket at the server is used to communicate with both clients. The Python code used to create the sockets
is shown in the figure. Consider the four transport-layer packets – A, B, C and D – shown in the figure
below.
Introduction: 1-8
Exercise 2 – UDP Mux and Demux (4/4)
In the scenario below, the left and right clients communicate with a server using UDP sockets. The same
socket at the server is used to communicate with both clients. The Python code used to create the sockets
is shown in the figure. Consider the four transport-layer packets – A, B, C and D – shown in the figure
below.
Introduction: 1-9
Exercise 3 – TCP Mux and Demux (1/4)
In the scenario on the left, the left and right TCP
clients communicate with a TCP server using TCP
sockets. The Python code used to create a single
welcoming socket in the server is shown in the figure
(the welcoming socket itself is not shown graphically);
code is also shown for the client sockets as well. The
three sockets shown in server were created as a result
of the server accepting connection requests on this
welcoming socket from the two clients (one
connection from the client on the left, and two
connections from the client on the right).
Introduction: 1-10
Exercise 3 – TCP Mux and Demux (2/4)
In the scenario on the left, the left and right TCP
clients communicate with a TCP server using TCP
sockets. The Python code used to create a single
welcoming socket in the server is shown in the figure
(the welcoming socket itself is not shown graphically);
code is also shown for the client sockets as well. The
three sockets shown in server were created as a result
of the server accepting connection requests on this
welcoming socket from the two clients (one
connection from the client on the left, and two
connections from the client on the right).
Introduction: 1-11
Exercise 3 – TCP Mux and Demux (3/4)
In the scenario on the left, the left and right TCP
clients communicate with a TCP server using TCP
sockets. The Python code used to create a single
welcoming socket in the server is shown in the figure
(the welcoming socket itself is not shown graphically);
code is also shown for the client sockets as well. The
three sockets shown in server were created as a result
of the server accepting connection requests on this
welcoming socket from the two clients (one
connection from the client on the left, and two
connections from the client on the right).
Introduction: 1-12
Exercise 3 – TCP Mux and Demux (4/4)
In the scenario on the left, the left and right TCP
clients communicate with a TCP server using TCP
sockets. The Python code used to create a single
welcoming socket in the server is shown in the figure
(the welcoming socket itself is not shown graphically);
code is also shown for the client sockets as well. The
three sockets shown in server were created as a result
of the server accepting connection requests on this
welcoming socket from the two clients (one
connection from the client on the left, and two
connections from the client on the right).
Introduction: 1-13
Exercise 4 – Reliable Data Transfer: rdt2.2
(1/13)
Consider the figures on the right.
Suppose that the channel
connecting the sender and
receiver can corrupt but not lose
or reorder packets.
Introduction: 1-14
Exercise 4 – Reliable Data Transfer: rdt2.2
(2/13)
Consider the figures on the right.
Suppose that the channel
connecting the sender and
receiver can corrupt but not lose
or reorder packets.
Introduction: 1-15
Exercise 4 – Reliable Data Transfer: rdt2.2
(3/13)
Consider the figures on the right.
Suppose that the channel
connecting the sender and
receiver can corrupt but not lose
or reorder packets.
Introduction: 1-17
Exercise 4 – Reliable Data Transfer: rdt2.2
(5/13)
Consider the figures on the right.
Suppose that the channel
connecting the sender and
receiver can corrupt but not lose
or reorder packets.
Introduction: 1-18
Exercise 4 – Reliable Data Transfer: rdt2.2
(6/13)
Consider the figures on the right.
Suppose that the channel
connecting the sender and
receiver can corrupt but not lose
or reorder packets.
Introduction: 1-20
Exercise 4 – Reliable Data Transfer: rdt2.2
(8/13)
Consider the figures on the right.
Suppose that the channel
connecting the sender and
receiver can corrupt but not lose
or reorder packets.
Introduction: 1-21
Exercise 4 – Reliable Data Transfer: rdt2.2
(9/13)
Consider the figures on the right.
Suppose that the channel
connecting the sender and
receiver can corrupt but not lose
or reorder packets.
Introduction: 1-23
Exercise 4 – Reliable Data Transfer: rdt2.2
(11/13)
Consider the figures on the right.
Suppose that the channel
connecting the sender and
receiver can corrupt but not lose
or reorder packets.
Introduction: 1-24
Exercise 4 – Reliable Data Transfer: rdt2.2
(12/13)
Consider the figures on the right.
Suppose that the channel
connecting the sender and
receiver can corrupt but not lose
or reorder packets.
Introduction: 1-27
Exercise 6 – TCP Sequence and ACK Numbers
(1/2)
Consider the figure on the right in which a TCP sender and
receiver communicate over a connection in which the sender-
>receiver segments may be lost. The TCP sender sends an initial
window of 3 segments.
Suppose the initial value of the sender->receiver sequence
number is 191 and the first 3 segments each contain 471 bytes.
The delay between the sender and receiver is 7 time units, and
so the first segment arrives at the receiver at t=8. As shown in
the figure below, 1 of the 3 segment(s) are lost between the
segment and receiver.
Introduction: 1-31
Exercise 8 – TCP congestion
Consider the figure below, which
plots the evolution of TCP's
congestion window at the beginning
of each time unit (where the unit of
time is equal to the RTT); see Figure
3.53 in the text. In the abstract
model for this problem, TCP sends a
"flight" of packets of size cwnd at
the beginning of each time unit. The
result of sending that flight of
packets is that either (i) all packets
are ACKed at the end of the time
unit, (ii) there is a timeout for the
first packet, or (iii) there is a triple
duplicate ACK for the first packet. In
this problem, you are asked to
reconstruct the sequence of events
(ACKs, losses) that resulted in the
evolution of TCP's cwnd shown
below.