0% found this document useful (0 votes)
98 views8 pages

Midterm F2021 Solution

This document is a midterm exam for a computer networks course. It is a 45 minute closed book exam covering topics like the Internet protocol stack, application layer protocols, and networking concepts. The exam contains both multiple choice and written answer questions worth a total of 50 marks.

Uploaded by

Skylar Will
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views8 pages

Midterm F2021 Solution

This document is a midterm exam for a computer networks course. It is a 45 minute closed book exam covering topics like the Internet protocol stack, application layer protocols, and networking concepts. The exam contains both multiple choice and written answer questions worth a total of 50 marks.

Uploaded by

Skylar Will
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

CPSC 441 L01

COMPUTER NETWORKS
MIDTERM EXAM
Professor Carey Williamson
Department of Computer Science
University of Calgary
October 27, 2021

This is a CLOSED BOOK exam. Textbooks, notes, laptops, personal digital assistants,
tablets, and cell phones are NOT allowed. However, calculators are permitted.
It is a 45 minute exam, with a total of 50 marks. There are 16 questions, and 8 pages
(including this cover page). Please read each question carefully, and write your answers
legibly in the space provided. You may do the questions in any order you wish, but please
USE YOUR TIME WISELY.
When you are finished, please hand in your exam paper and sign out. Good luck!

Student Name:

Score: / 50 = %

———————————— Optional Privacy Fold Here —————————————-

Student ID:

1
True or False
Circle either True or False for each of the following 4 questions, for a total of 4 marks.

1 1. The Internet is built using a layered stack of communication protocols.

True

1 2. The application-layer protocol for the World Wide Web is HTML.

False (it is HTTP, not HTML)

1 3. The User Datagram Protocol (UDP) offers an unreliable transport-layer service.

True

1 4. On DSL (Digital Subscriber Line), the upstream and downstream rates differ.

True

Multiple Choice
Choose the best answer for each of the following 6 questions, for a total of 6 marks.

1 5. The format of the messages exchanged between entities on a network are defined by:

(a) the transport layer

(b) end systems

(c) a protocol

(d) sockets

(e) an Internet Service Provider (ISP)

1 6. Receiving a transport-layer segment from the network layer, extracting the payload data,
and delivering the data to the correct socket is known as:

(a) multiplexing

(b) demultiplexing

(c) flow control

(d) reliable data transfer

(e) unreliable data transfer

2
1 7. For Web sites that use cookies, state information about users is provided in:

(a) the optional cookie header line of HTTP request messages

(b) the optional cookie header line of HTTP response messages

(c) a cookie file stored in the user’s browser

(d) a back-end database at the Web site

(e) all of the above

1 8. Which of the following is NOT used in the current email system on the Internet?

(a) user agent

(b) mail server

(c) SMTP

(d) TLS/SSL

(e) plain-text HTTP

1 9. Pipelined protocols are designed to:

(a) improve link utilization compared to a stop-and-wait protocol

(b) decrease RTT for large file transmissions

(c) increase RTT between sending packets and receiving ACKs

(d) decrease RTT between sending packets and receiving ACKs

(e) reduce bit errors and packet losses during transmissions

1 10. Which of the following are used in TCP’s congestion control algorithm?

(a) slow start

(b) congestion avoidance

(c) fast recovery

(d) congestion window

(e) all of the above

3
Internet Protocol Stack
7 11. Use your knowledge of the Internet protocol stack to answer the following questions.
(a) (1 mark) What is the layering principle?

- a software design principle about decomposing a large problem


into smaller modular ones
- separate key functions/responsibilities into modules (layers)
with well-defined APIs between them

(b) (6 marks) Describe the Internet protocol stack, including the name of each layer, the
key function of each layer, and the data unit handled by each layer. Include a diagram
if you wish.

- Application Layer: deals with MESSAGES (e.g., Web pages, photos,


emails) exchanged between network applications or users (e.g., HTTP)
- Transport Layer: end-to-end (process-to-process) delivery of
SEGMENTS to correct socket (e.g., TCP, UDP)
- Network Layer: host-to-host delivery of DATAGRAMS (e.g., IP)
- Datalink Layer: hop-by-hop delivery of FRAMES across a link that
directly connects network devices (e.g., Ethernet, WiFi, PPP)
- Physical Layer: transmits BITS on physical media (e.g., fiber)

Application Layer Protocols


4 12. Give two different examples of application-layer protocols that rely on caching to
improve the user-perceived performance of the network application. Make sure to indicate
why caching is used, where the caches are located, and how they work.
DNS (Domain Name Service)
- provides mapping between host names and IP addresses
- relies on hierarchy of caches at end systems, local DNS
servers, and regional DNS servers to offload root servers
- reduces latency when establishing connections (e.g., Web)

HTTP (HyperText Transfer Protocol)


- stores copies of popular objects closer to clients
to reduce user-perceived latency for those objects
- stored in browswer cache, ISP cache, Web proxy cache
- also reduces network traffic and load on servers
- relies on Conditional GET and HTTP 304 Not Modified

CDN (Content Delivery Network)


- large regional caches for multimedia objects like movies
- optimizes streaming delivery of audio/video (e.g., Netflix)
- provided by Akamai, Limelight, Fastly, etc

4
Networking Delays
5 13. During his recent commercial space flight on the Blue Origin shuttle, William Shatner
(also known as Captain Kirk from the Star Trek series) used his smartphone to take a photo
of the planet Earth while 100 km above it. The photo was 8 MB in size. Suppose that
he wants to upload this photo to his Facebook page, and is trying to decide whether to do
it immediately during his shuttle flight, or after he lands back on Earth 10 minutes later.
(Note: 1 Kbps = 103 bits per second, 1 Mbps = 106 bps, 1 MB = 220 Bytes, and 1 Byte =
8 bits).

(a) (2 marks) Assuming that his cellular provider offers signal coverage that reaches the
shuttle, with a data rate of 100 Kbps (and reasonable roaming charges), approximately
how long will it take to upload the photo while still on the shuttle? Show your work.

L size in bits 8 MB x 2**20 Bytes/MB x 8 bits/Byte


T = --- = ------------ = -----------------------------------
R bits per sec 100 x 10**3 bits/sec

67,108,864 bits
= --------------- = 671 sec
100,000 bits/sec

(b) (2 marks) Assuming that his cellular provider offers signal coverage at the shuttle
landing area, with a data rate of 1 Mbps, approximately how long will it take to
upload the photo immediately after landing? Show your work.

L size in bits 67,108,864 bits


T = --- = ------------ = --------------- = 67.1 sec
R bits per sec 1,000,000 bits/sec

(c) (1 mark) Considering that it will take 10 minutes before the shuttle lands, which of
the foregoing two approaches is faster, and by how much?

Shuttle: 671 seconds


Landing: 600 + 67.1 = 667.1 seconds

Doing the upload after landing is faster by 4 seconds!

5
Networking Concepts and Definitions
9 14. For each of the following pairs of technical terms, define each term, and clarify the key
difference(s) between the two terms. Be clear and concise. If in doubt about your definition,
feel free to supplement with a relevant example.

(a) (3 marks) “LAN” and “WAN”

LAN: Local Area Network WAN: Wide Area Network


- a set of hosts over a limited - a set of hosts over a large
geographic area, such as a home, geographic area, such as a
an office, or a building country or planet
(e.g., Ethernet, WiFi) (e.g., CANARIE, Internet)

(b) (3 marks) “transaction-oriented” and “session-oriented”

Transaction-oriented: Session-oriented:
- a type of protocol that has - a type of protocol that has
minimal state information involved a lot of state information
- also known as request-response - also known as conversation
or connectionless protocol oriented or connection-oriented
(e.g., DNS, HTTP/1.0, UDP) (e.g., SMTP, FTP, TCP)

(c) (3 marks) “telnet” and “ssh”

Telnet: SSH: Secure Shell


- a remote login protocol from - a remote login protocol for
the early days of the Internet the modern Internet
- one of the "big three" apps
- can remotely access another - can remotely access another
computer and authenticate user computer and authenticate user
- provides access to Linux shell - provides access to Linux shell
- plain-text, insecure, port 23 - encrypted, secure, port 22

6
Reliable Data Transfer (RDT)
8 15. Briefly explain the role of each of the following mechanisms in an RDT protocol at the
transport layer. Make sure to indicate how each one works, and why it is needed.

(a) (2 marks) checksum

- data integrity check to protect against corrupted segments


- adds up all bytes of segment as if they were 16-bit numbers
- computed by sender and inserted in header of segment
- computed by receiver and compared: accept ony if it matches

(b) (2 marks) negative acknowledgment (NAK)

- an error control mechanism between sender S and receiver R


- a way for R to indicate that a corrupted segmented arrived
(based on an invalid checksum)
- tells sender about this; triggers retransmission from S

(c) (2 marks) sequence number on DATA segments

- a way for R to detect duplicate segments (retransmissions)


and avoid delivering the same data more than once
- in sliding window protocols, it is also used to preserve
the ordering of data delivery, and detect loss (gaps)

(d) (2 marks) go-back-N

- an error control mechanism between sender S and receiver R


in a sliding window protocol (pipelining)
- S keeps timer for oldest unacked segment in window of N
- upon timeout, go back to oldest one and retransmit ALL of
the segments in the window
- simple strategy; no buffering required at R; but inefficient

7
Transport-Layer Protocols
7 16. Use your knowledge of TCP and UDP to answer the following questions.
(a) (3 marks) List 3 examples of features provided by TCP that are not provided by UDP.

Flow control: constrain sender so as not to overwhelm receiver with data


Congestion control: constrain sender so as not to overwhelm network with data
Sequence numbers: preserve ordering of byte stream data
Acknowledgements: positive (cumulative) ACKs to indicate next expected byte
Handshaking: 3-way handshake for reliable connection management
Timeouts: RTO value for retransmission of delayed or lost segments

(b) (4 marks) For each of the following network applications (1 mark each), indicate
whether TCP or UDP would best fit the service requirements of the application,
and briefly explain why. State any assumptions that you make for each application.

– Streaming video client/server:


If you assumed live video (e.g., sports game, election coverage),
then UDP seems like the right choice: large volume of data,
high rate of packets, delay sensitive, loss tolerant.

If you assumed stored on-demand video (e.g., Netflix, YouTube),


then TCP seems like the right choice: large volume of data,
controlled pkt rate, DASH, quality of experience (QoE), etc.

– Multiplayer online first-person shooting game:


UDP: assuming fast response (delay sensitive) is more
important than full data reliability. Gaming action is
usually loss tolerant as well. UDP can use multicast too.

– Text-based instant messaging app:


TCP: reliable delivery desirable, some delay tolerable.

(one could also argue UDP if "instant" is a priority,


and messages are small, and occasional loss is tolerable)

– Clock synchronization between computers on the Internet:


UDP: small messages, highly delay sensitive, loss tolerant.

See RFC 958 for the original Network Time Protocol (NTP).

*** THE END ***

You might also like