ITS323Y13S1E02 Final Exam Answers
ITS323Y13S1E02 Final Exam Answers
Instructions:
• Students are not allowed to be out of the exam room during examination. Going
to the restroom may result in score deduction.
• Turn off all communication devices (mobile phone etc.) and leave them at the front
of the examination room.
• Write your name, student ID, section, and seat number clearly on the front page of
the exam, and on any separate sheets (if they exist).
• The examination paper is not allowed to be taken out of the examination room. A
violation may result in score deduction.
• Assume bits are ordered from left to right. For example, for the data 00001111, the
first (1st) bit is 0 and the last (8th) bit is 1.
(c) Which protocol provides flow control, error control and connection management:
i. ARP
ii. DNS
iii. ICMP
iv. HTTP
v. TCP
vi. UDP
i. The network portion of an IP address must be the same length across different
subnets.
ii. All subnets in an internet must have the same network portion in their IP
address.
iii. All hosts in the same subnet must have unique host portion in their
IP address.
iv. The host portion of an IP address must be the same length across different
subnets.
v. All hosts in the same subnet must have the same host portion in their IP
address.
vi. All hosts in the same subnet must have unique network portion in their IP
address
i. Circuit switching
ii. Virtual circuit packet switching
iii. Datagram packet switching
iv. Ethernet switching
v. None of the above
i. IP address
ii. port number
iii. protocol number
iv. Ethernet address
v. domain name
vi. email address
i. forwarding
ii. fragmentation
iii. congestion control
iv. connection-oriented
v. routing
vi. None of the above
(j) With some adaptive routing protocols information about the network (e.g. topology,
link costs) comes from all nodes and is updated on a periodic basis. For normal
flooding, where does the information come from and how is it updated?
• The link propagation delay in both directions is 4 ms, that is, from A to B is 4 ms
and from B to A is 4 ms.
• Each frame has a 25 B header; an ACK does not contain any data.
• A has a timeout value of 20 ms. The timer starts immediately after the transmission
of an entire data frame (i.e. after the last bit is transmitted).
(a) What is the value of the transmission delay of a DATA frame? [1 mark]
(b) What is the value of the transmission delay of an ACK frame? [1 mark]
(c) Consider a single DATA frame that is lost, and then the retransmitted frame is
successfully delivered. How long does it take from the start of transmission of the
original DATA frame, until when the ACK is received for the retransmitted frame?
[4 marks]
Answer. The original DATA frame is transmitted, after which A starts a timer.
Since the DATA frame is lost, no ACK will be returned and A will timeout 20
ms later, i.e. at time 30 ms. Then the retransmission occurs. The DATA frame
is transmitted (10 ms), propagates (4 ms), ACK frame is transmitted (2 ms) and
propagates (4 ms). It takes another 20 ms. Hence the total time is 50 ms.
(d) Now consider all DATA frames. If 500 of the transmitted DATA frames are lost,
what is the throughput for the data delivery? Assume no retransmitted DATA
frames, nor ACK frames, are lost. That is, of all original DATA frames transmitted,
500 are lost. [4 marks]
Answer. With 1,000,000 Bytes, there are 10,000 DATA frames to be sent. For
9,500 DATA frames, there is no loss. The time to deliver each of this frames
is: DATA transmission (10 ms), propagation (4 ms), ACK transmission (2 ms),
propagation (4 ms). A total of 20 ms. For 500 DATA frames, a retransmission
is needed. From the answer above, each takes 50 ms. Therefore the total time to
deliver all the data is 215 seconds. The original data delivered is 1,000,000 Bytes,
giving a throughput of 37,209 b/s.
(e) What is the optimal timeout value for this link? Explain your answer. [2 marks]
Answer. The timeout value should be large enough to give enough time for the
ACK to be returned if there is no packet loss, and not too large such that the source
spends too much time waiting for an ACK if there is packet loss. The minimum
value to allow an ACK to return is 10 ms, and hence that is the optimum value.
E G
L
B K
F
M
A C I
O
H N
D
J
Assume flooding is to be used in the network to deliver a data packet from node H to
node G.
(a) What is the optimal value of the hop limit that source node H should use? Explain
your answer. [3 marks]
Answer. The hop limit is used to limit the number of hops a packet will be for-
warded. It should be large enough such that the destination will receive a copy of
the packet, and small enough such that no more packets will be forwarded once the
destination has received a copy. In the network the shortest path from source to
destination is three hops: H—C—F—G. Therefore the hop limit should be 3. If the
hop limit was 2 or less, then the destination would not receive a copy of the packet.
If the hop limit was 4 or more, although the destination would receive a copy, there
would be unnecessary transmissions, e.g. from G to E.
• M—L—K—G—E—B
• B—E—F—C—H—I—N—O
• J—H—C—F—E—B
• B—A—D
• G—F—C—A—D
• M—L—K—F
(b) Draw the optimal routing tables for nodes B and F. An optimal routing table is
one with the least number of rows. Each row must contain only one value for the
destination and next router, with the exception that you can use * in the destination
column to indicate “any value”. In forwarding, assume the table is processed row-
by-row: if one row matches, then the subsequent rows are ignored. [5 marks]
Answer. Router B:
• A→A
• D→A
• *→E
Router F:
• B→E
• E→E
• G→G
• K→K
• L→K
• M→K
• *→C
Consider datagram packet switching being used to deliver packets on the path A—
B—E—G—K. All packets must contain a 20 Byte header. They may contain a varying
amount of data. The source A has 4,000 Bytes of data to send to K.
(c) Explain three (3) factors that are important in node A selecting the amount of data
that should be carried in each packet. [3 marks]
Answer.
• The larger the data the lower the overhead of the data. E.g. a packet containing
4,000 Bytes of data requires just one header. Two packets containing 2,000
Bytes of data each requires two headers; more overhead.
• The smaller the data the more packets can be potentially transmitted in parallel.
In this case there are four links. If there are at least four packets (e.g. 1,000
Bytes per packet), then its possibly that a packet is being transmitted by each
node in the path at the same time. G is transmitting packet 1, E is transmitting
packet 2, B is transmitting packet 3, and A is transmitting packet 4.
• The smaller the data the less needs to be retransmitted in case of error.
• The smaller the data the more likely the receiver will have space in its buffer
to store that packet.
Question 4 [7 marks]
A sliding window protocol is used over an error free link, with a window size of 7 data
frames. Each data frame has a transmission delay of 100 us, and the header is 20% of
the total size (the remaining 80% of the data frame is payload, i.e. real user data). ACK
transmission time is 4 us, while the link propagation delay is 333 us.
Assuming the source always has data to send, what is the maximum efficiency, ex-
pressed as a percentage, that can be achieved in delivering user data across the link?
Answer. With sliding window flow control, the source can send 7 frames, after which
it must wait for the ACK of the first frame before it can send another frame. The
arrival time of the first ACK is important. If it arrives after the 7th frame has been
sent, then the source must spend some time waiting for the ACK. But if it arrives during
the transmission of the 7 frames, then after transmitting the 7th frame, the source can
immediately transmit another frame. Therefore lets calculate which of the two cases it is.
The time to transmit 7 frames is 7×100 = 700 us. So if the source starts transmitting
at time 0, it will finish transmitting the 7 frames at time 700.
The time of arrival of the first ACK is: 100 + 333 + 4 + 333 = 770 us. That is, the
source is allowed to send another frame (in the next window) at time 770.
In this case the source sends 7 frames and then must spend some time waiting (i.e.
not sending) before it is allowed to send another frame.
For every 770 us, the source is transmitting for 700 us and waiting for the rest of the
time. That is, 90.90 efficient in sending frames. But note that each frame contains 80%
of user data (the rest is header), and so the overall efficiency is 72.72%.
Question 5 [7 marks]
(a) Draw a diagram to illustrate the TCP connection setup process between client A and
server B. For each segment you must indicate appropriate flags and sequence/ack
numbers. Assume A chooses an initial sequence number of 1307, and B chooses
2164. [3 marks]
A B
Flags=SYN
SN=1307
Flags=SYN,ACK
SN=2164
AN=1308
Flags=ACK
AN=2165
(b) Assume that after the TCP connection setup between A and B above, that A sends
500 bytes of data in a single segment to B, and then shortly after, sends 1000 bytes
of data to B in another segment. Then B acknowledges both received segments and
sends 2000 bytes of data to A in a single segment (that is, B uses piggybacking to
send both ack and data to A). Finally A responds with an acknowledgement. Draw
a new diagram showing the data transfer, indicating flags and numbers for each
segment. (You don’t have to draw the connection setup again) [4 marks]
A B
Flags=[none]
SN=1308
Flags=[none]
SN=1808
Flags=ACK
SN=2165
AN=2808
Flags=ACK
AN=4165
Question 6 [6 marks]
Consider the network shown in Figure 4. The data rate (measured in Mb/s) and delay
(measured in milliseconds) for each link are shown in the format: (data rate, delay).
(50,13)
B G
(40,7)
(5,20) (10,10)
(40,5)
A
D H
(20,7)
(5,25)
C (40,30) (40,2)
E F
(20,2)
(50,4)
Figure 4: Network
Assuming least-cost routing is used to find a path from C to G, indicate the path and
total cost if the cost metric was:
Question 7 [7 marks]
Assume a web browser is running with port 54321 on a host with IP address 1.2.3.4.
This host is configured to use a DNS server with IP address 5.6.7.8. A web server is
running on a host with IP address 9.10.11.12 and has domain www.example.com. The
contents of the directory the web server makes publicly available is:
The page index.html has the images header.png and logo.png embedded (using
HTML code such as <img src="file" />). The page contact.html has all three images
embedded.
Assume at time 0 seconds the user of the web browser clicks on a link with the URL
http://www.example.com/index.html. Assume an empty cache at the web browser,
and the website/server has never been visited before.
(a) What is the destination port number of the TCP segment containing a HTTP
request? [1 mark]
Answer. 80
(b) Draw a time sequence diagram that illustrates both the DNS exchange and HTTP
message exchange until the entire page (including images) is displayed in the web
browser. Label the computers involved. Label each message appropriately, e.g. for
HTTP requests you must clearly indicate the file requested and for HTTP responses
you must indicate the HTTP status code. For DNS messages you must indicate the
meaning of each message (such as showing the important information the message
contains). You do not need to draw TCP ACK or connection setup messages, only
draw HTTP and DNS. [6 marks]
Answer. Note that the browser automatically requests the images after receiving
the HTML. Alternatively, the requests for images could occur immediately after each
other.
Answer 9.10.11.12
GET /index.html
HTTP 200 Ok
GET /images/header.png
HTTP 200 Ok
GET /images/logo.png
HTTP 200 Ok
Question 8 [8 marks]
(a) There are generally three types of audio codecs: uncompressed (e.g. PCM/WAV),
lossless compression (e.g. FLAC, ALAC), and lossy compression (e.g. MP3, WMA,
AC3). Explain the three types and compare them by explaining how they differ
from the perspectives of file size and playback audio quality. [4 marks]
Answer. Uncompressed codecs do not compress the audio samples. The audio
quality will be the same as the original sampled audio. The file size will be the
largest.
Lossless compression codecs apply a compression algorithm on the sample audio.
The file size is therefore smaller than uncompressed codecs. Lossless means no
information is lost, so playback quality will be the same as uncompressed audio.
Lossy compression also applies compression, but with some original information
lost. The file size will be the smallest, but the quality will be less than the other two.
(b) Assume you have a laptop with an IEEE 802.11 wireless LAN interface and want
to record what other laptops and mobile phones are sending/receiving on the SIIT
wireless LAN. What do you need to do on your laptop to allow it to accept wireless
LAN frames sent by other devices that are not destined to your laptop? [2 marks]
Answer. The wireless LAN interface needs to be put into monitor mode so it
accepts packets sent by others to others
(c) What is the name of software that may be used to record or display packets sent
by others in part (b)? [2 marks]
(b) For a host with IP address 21.103.46.1 and subnet mask 255.255.255.192: [4.5
marks]
(c) A host does not yet have an IP address configured, nor does it know its network
address. [4.5 marks]
i. Give an IP address that the host can send to in order to send to itself.
ii. Give an IP address that the host can send to in order to deliver an IP datagram
to all nodes on its subnet.
iii. For the case of part (ii), give the source address of the IP datagram.
Question Answer
(a) i. 83.24.0.0/13
(b) i. 21.103.46.0/26
(b) iii. 26 − 2 = 62
(c) i. 127.0.0.1
Reference Material
Selected well-known ports:
• FTP 20 and 21
• SSH 22
• Telnet 23
• SMTP 25
• DNS 53
• HTTP 80
• HTTPS 443
0 4 8 14 16 19 31
Data
0 4 8 16 31
Acknowledgement Number
HLength Reserved Flags Advertised Window
Checksum Urgent Pointer
Options + Padding (optional)
Data
Figure 6: TCP Segment Format. Flags: CWR, ECE, URG, ACK, PSH, RST, SYN, FIN
0 16 31
Data
46 to
6 Bytes 6 Bytes 2 Bytes 1500 Bytes 4 Bytes
• 1 ICMP
• 6 TCP
• 17 UDP
• 200 Ok
• 401 Unauthorized