Unit 2: APPLICATION LAYER - Practice Quiz

CSE306 — Computer Networks 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is the primary function of the Domain Name System (DNS)?

Domain Name System Easy
A. To translate human-readable domain names into IP addresses
B. To route packets across the internet
C. To assign IP addresses to hosts dynamically
D. To securely transfer files between computers

2 Which port number is typically used by the DNS protocol?

Domain Name System Easy
A. Port 80
B. Port 21
C. Port 53
D. Port 25

3 Which protocol is primarily used for sending email messages?

E Mail Easy
A. HTTP
B. POP3
C. SMTP
D. IMAP

4 Which of the following protocols is used to retrieve emails from a server?

E Mail Easy
A. IMAP
B. SMTP
C. FTP
D. SNMP

5 What does MIME stand for in the context of email?

E Mail Easy
A. Multicast Internet Message Extension
B. Multipurpose Internet Mail Extensions
C. Multiple Internet Message Exchange
D. Multimedia Internet Mail Exchange

6 What is the main purpose of the File Transfer Protocol (FTP)?

FTP Easy
A. To resolve hostnames to IP addresses
B. To browse the web
C. To assign IP addresses to devices
D. To transfer files between a client and a server on a computer network

7 FTP utilizes two connections for its operation. What are they?

FTP Easy
A. Active and Passive connections
B. Local and Remote connections
C. TCP and UDP connections
D. Control and Data connections

8 The Transport Layer provides logical communication between ____, whereas the Network Layer provides logical communication between ____.

TRANSPORT LAYER: Relationship between Transport and Network Layer Easy
A. processes; hosts
B. routers; switches
C. hosts; processes
D. networks; hosts

9 In the OSI model, which layer sits directly below the Transport Layer?

TRANSPORT LAYER: Relationship between Transport and Network Layer Easy
A. Data Link Layer
B. Application Layer
C. Network Layer
D. Session Layer

10 Which of the following is NOT a typical service of the Transport layer?

Transport Layer Services Easy
A. Routing path selection
B. Reliable data transfer
C. Multiplexing and demultiplexing
D. Congestion control

11 What mechanism does the Transport Layer use to direct incoming data to the correct application process?

Transport Layer Services Easy
A. Port numbers
B. Hostnames
C. MAC addresses
D. IP addresses

12 TCP is considered a ____ protocol.

TCP- Header format and handshaking operation Easy
A. connection-oriented
B. stateless
C. best-effort
D. connectionless

13 How many steps are involved in the TCP connection establishment process?

TCP- Header format and handshaking operation Easy
A. Two (2-way handshake)
B. Three (3-way handshake)
C. Four (4-way handshake)
D. Five (5-way handshake)

14 What is the minimum size of a standard TCP header?

TCP- Header format and handshaking operation Easy
A. 20 bytes
B. 32 bytes
C. 16 bytes
D. 8 bytes

15 During the TCP 3-way handshake, what flag is set in the very first segment sent by the client to the server?

TCP- Header format and handshaking operation Easy
A. ACK
B. RST
C. SYN
D. FIN

16 UDP is a ____ protocol.

UDP- Header format Easy
A. connectionless and unreliable
B. connectionless and reliable
C. connection-oriented and reliable
D. connection-oriented and unreliable

17 What is the fixed size of the UDP header?

UDP- Header format Easy
A. 8 bytes
B. 4 bytes
C. 20 bytes
D. 16 bytes

18 Which of the following fields is NOT present in a UDP header?

UDP- Header format Easy
A. Destination Port
B. Checksum
C. Sequence Number
D. Source Port

19 Which Transport Layer protocol would be best suited for real-time video streaming where occasional frame loss is acceptable?

Transport Layer Services Easy
A. TCP
B. UDP
C. HTTP
D. FTP

20 What type of DNS record maps a domain name to an IPv4 address?

Domain Name System Easy
A. CNAME record
B. A record
C. AAAA record
D. MX record

21 A local DNS server receives a request for a domain name it does not have in its cache. If it uses an iterative query process, what will be its immediate next step?

Domain Name System Medium
A. It will query the Root DNS server, which will return the IP address of the Top-Level Domain (TLD) server.
B. It will query the Authoritative DNS server directly to minimize resolution time.
C. It will query the Root DNS server, which will recursively fetch the IP address on behalf of the local server.
D. It will broadcast the DNS query to all adjacent local DNS servers.

22 An organization wants its primary domain example.com to point to a mail server hosted at mail.example.com. Which DNS record type should be configured to route emails correctly to this server?

Domain Name System Medium
A. NS Record
B. CNAME Record
C. A Record
D. MX Record

23 If a DNS resource record is cached with a Time-To-Live (TTL) of 3600 seconds, what happens when a client requests the same domain 45 minutes later?

Domain Name System Medium
A. The DNS server returns the cached record immediately without contacting other servers.
B. The DNS server drops the cached record and queries the authoritative server.
C. The client must flush its local cache before receiving the response.
D. The DNS server sends a conditional query to check if the IP has changed.

24 A user wants to read their emails from multiple devices, ensuring that marking an email as read on their phone updates the status on their laptop. Which protocol combination is most appropriate for this scenario?

E Mail Medium
A. SMTP for sending, IMAP for receiving
B. IMAP for sending, POP3 for receiving
C. POP3 for sending, SMTP for receiving
D. SMTP for sending, POP3 for receiving

25 SMTP is strictly a 7-bit ASCII protocol. How are modern email clients able to send non-text attachments like images or PDFs over SMTP?

E Mail Medium
A. By establishing a separate FTP connection to transfer the file.
B. By using MIME to encode the binary data into 7-bit ASCII characters.
C. By using an encrypted SSL tunnel that bypasses SMTP character limits.
D. By switching to IMAP for the transmission of binary files.

26 In the context of email delivery, what is the primary distinction between a Mail Transfer Agent (MTA) and a Mail Delivery Agent (MDA)?

E Mail Medium
A. An MTA handles text-only emails, while an MDA processes MIME-encoded attachments.
B. An MTA routes emails between servers, while an MDA delivers the email to the recipient's local mailbox.
C. An MTA is used for IMAP connections, while an MDA is used for POP3 connections.
D. An MTA provides the user interface for reading emails, while an MDA routes the emails over the Internet.

27 A client behind a strict NAT firewall is trying to download a file from an FTP server. The control connection succeeds, but the data transfer fails. Which mode should the client use to resolve this issue?

FTP Medium
A. Passive Mode, so the client initiates both the control and data connections.
B. Anonymous Mode, to bypass authentication requirements.
C. Active Mode, so the server initiates the data connection.
D. Binary Mode, to prevent ASCII character translation errors.

28 FTP is described as an 'out-of-band' protocol. What does this mean in the context of file transfers?

FTP Medium
A. It uses a separate connection for sending control commands and for transferring file data.
B. It uses UDP instead of TCP for faster data transmission.
C. It encrypts the payload independently of the headers.
D. It compresses data before sending to conserve bandwidth.

29 Unlike HTTP, FTP is a stateful protocol. Which of the following best demonstrates this characteristic?

FTP Medium
A. FTP uses cookies to track user sessions.
B. FTP data connections remain open indefinitely even if no data is being sent.
C. The FTP server maintains information about the client's current working directory and authentication status across multiple requests.
D. FTP requires a new TCP handshake for every single file transferred.

30 If the Network layer provides logical communication between hosts, what specific logical communication does the Transport layer provide?

TRANSPORT LAYER: Relationship between Transport and Network Layer Medium
A. Communication between processes running on different hosts.
B. Communication between adjacent routers on a path.
C. Communication between different subnets.
D. Communication between the Data Link layer and the Application layer.

31 The Network layer (IP) is an unreliable, best-effort delivery service. How does a transport protocol like TCP provide reliability on top of IP?

TRANSPORT LAYER: Relationship between Transport and Network Layer Medium
A. TCP bypasses the IP layer and establishes a direct physical circuit between end systems.
B. TCP implements its own mechanisms such as acknowledgments, sequence numbers, and retransmissions at the end systems.
C. TCP modifies the IP headers to enforce guaranteed delivery at the router level.
D. TCP requires the Data Link layer to perform error correction before passing frames to IP.

32 A web server is handling multiple HTTP requests simultaneously. How does the transport layer demultiplex incoming TCP segments to the correct client session?

Transport Layer Services Medium
A. By analyzing the HTTP headers within the application payload.
B. By using only the destination IP address and destination port.
C. By using a 4-tuple consisting of source IP, source port, destination IP, and destination port.
D. By assigning a unique MAC address to every active connection.

33 Which of the following scenarios best highlights the difference between flow control and congestion control in the transport layer?

Transport Layer Services Medium
A. Flow control is only used in UDP, while congestion control is exclusive to TCP.
B. Flow control prevents a fast sender from overwhelming a slow receiver, while congestion control prevents a sender from overwhelming the network routers.
C. Flow control prevents the network core from dropping packets, while congestion control limits the application's data generation rate.
D. Flow control manages errors using checksums, while congestion control recovers lost packets.

34 Both TCP and UDP provide multiplexing and demultiplexing. What primary mechanism makes this service possible at the transport layer?

Transport Layer Services Medium
A. Port numbers
B. Sequence numbers
C. Checksums
D. IP addresses

35 During a TCP 3-way handshake, host A sends a SYN segment with sequence number . Host B responds with a SYN-ACK segment. What are the sequence and acknowledgment numbers in host B's response?

TCP- Header format and handshaking operation Medium
A. Sequence Number = , Acknowledgment Number =
B. Sequence Number = , Acknowledgment Number =
C. Sequence Number = , Acknowledgment Number =
D. Sequence Number = , Acknowledgment Number =

36 What is the primary function of the 'Window Size' field in the TCP header?

TCP- Header format and handshaking operation Medium
A. To specify the number of bytes the receiver is currently willing to accept.
B. To determine the size of the TCP header in 32-bit words.
C. To dictate the size of the congestion window maintained by the sender.
D. To indicate the maximum segment size (MSS) the network can handle.

37 If the 'Data Offset' (Header Length) field in a TCP header has a binary value of 0111, what is the total size of the TCP header in bytes?

TCP- Header format and handshaking operation Medium
A. 28 bytes
B. 32 bytes
C. 7 bytes
D. 14 bytes

38 In the TCP connection teardown process, Host A sends a FIN segment to Host B. Host B receives it and sends an ACK. What is the state of the connection at this exact moment?

TCP- Header format and handshaking operation Medium
A. Host B can no longer send data, but Host A can still send data to Host B.
B. The connection is completely closed in both directions.
C. Both hosts can continue to send data until a TIME_WAIT timeout occurs.
D. Host A can no longer send data, but Host B can still send data to Host A.

39 A UDP datagram carries an application payload of 40 bytes. What will be the value placed in the 'Length' field of the UDP header?

UDP- Header format Medium
A. 48
B. 40
C. 8
D. 60

40 Which of the following is true regarding the UDP checksum calculation?

UDP- Header format Medium
A. It only covers the UDP header to ensure fast processing at routers.
B. It is a mandatory 32-bit field in IPv4 to guarantee data integrity.
C. It includes a pseudo-header containing IP addresses from the network layer to detect misrouted datagrams.
D. It is heavily relied upon for error correction without retransmission.

41 In a DNS amplification attack, an attacker exploits the characteristics of the DNS protocol to overwhelm a victim. Which of the following combinations of DNS characteristics and architectural design choices makes this attack highly effective?

Domain Name System Hard
A. The use of iterative queries over TCP combined with a short Time-To-Live (TTL) for A records.
B. The recursive resolution process of root servers combined with the lack of source port randomization in resolvers.
C. The stateless nature of UDP combined with spoofed source IP addresses and large response records like ANY or DNSSEC.
D. The use of TCP for reliable zone transfers combined with DNSSEC cryptographic signatures.

42 A local DNS server receives an iterative query for a host. The local server's cache contains an NS record for the authoritative domain with a remaining TTL of 5 seconds, but the corresponding A record for that name server has expired. How must the local DNS server proceed to resolve the query?

Domain Name System Hard
A. It uses the cached NS record and broadcasts an ARP request to find the authoritative server's MAC address.
B. It must first resolve the IP address of the authoritative name server by issuing a new query for the name server's A or AAAA record.
C. It must query the root DNS server directly to re-establish the entire delegation chain.
D. It returns a non-existent domain (NXDOMAIN) error to the client since the glue record is missing.

43 Consider a scenario where a domain's zone file contains a CNAME record mapping 'www.example.com' to 'server.example.net'. Which of the following configurations violates DNS RFC standards and will likely cause resolution failures?

Domain Name System Hard
A. Creating an A record for 'server.example.net'.
B. Creating an MX record for 'server.example.net'.
C. Creating an MX record for 'www.example.com'.
D. Creating a TXT record for 'server.example.net'.

44 An email with a large binary attachment is encoded using Base64 for transmission via SMTP. If the original binary attachment size is exactly Megabytes, what will be the approximate size of the encoded attachment transmitted over the network, ignoring MIME headers and line break characters?

E Mail Hard
A. Megabytes
B. Megabytes
C. Megabytes
D. Megabytes

45 During an SMTP transaction between a sending Message Transfer Agent (MTA) and a receiving MTA, the receiver issues a '452 Requested action not taken: insufficient system storage' reply after the sender issues the DATA command. What is the standard-compliant behavior of the sending MTA?

E Mail Hard
A. Downgrade the connection to unencrypted SMTP and attempt to resend the DATA command.
B. Ignore the error and forcefully stream the message data, assuming a temporary buffer issue.
C. Queue the message and retry sending it after a predetermined delay, up to a maximum timeout period.
D. Drop the email immediately and send a Non-Delivery Report (NDR) to the original sender.

46 Which of the following best describes how the IMAP protocol handles state transitions when a client successfully authenticates and then selects a specific mailbox?

E Mail Hard
A. Disconnected Authenticated Syncing
B. Not Authenticated Selected Authenticated
C. Authenticated Selected Fetching
D. Not Authenticated Authenticated Selected

47 An FTP client behind a strict stateful NAT firewall attempts to download a file from a public FTP server using Active FTP mode. The control connection is established successfully, but the file transfer times out. What is the fundamental reason for this failure?

FTP Hard
A. The FTP protocol cannot multiplex control and data streams over a single TCP connection through a NAT.
B. The FTP server drops the incoming SYN packet from the client because the client's source IP address is a private, non-routable address.
C. The client's NAT firewall alters the PORT command payload, corrupting the TCP checksum of the control connection.
D. The NAT firewall drops the incoming SYN packet from the FTP server attempting to connect to the client's ephemeral port for the data connection.

48 During a massive, multi-hour file transfer over an FTP data connection, the FTP control connection may suddenly be dropped by intermediate stateful firewalls. How can modern FTP clients and servers mitigate this specific issue without aborting the ongoing data transfer?

FTP Hard
A. By automatically renegotiating a new passive port for the data connection every 10 minutes.
B. By enabling TCP Keep-Alive packets on the control connection or periodically sending harmless FTP commands like NOOP.
C. By switching to TFTP (Trivial File Transfer Protocol) for large files to avoid maintaining a control plane.
D. By embedding control commands within the data stream using escape sequences.

49 If an IP datagram carrying a large TCP segment is fragmented into three pieces by an intermediate router, how does the destination host's transport layer demultiplex the segment to the correct application socket?

TRANSPORT LAYER: Relationship between Transport and Network Layer Hard
A. The intermediate router duplicates the TCP header into every fragment, allowing the destination transport layer to demultiplex them concurrently.
B. The destination router reassembles the fragments before delivering them to the transport layer, so the transport layer only sees the complete TCP segment with its header.
C. The network layer at the destination host reassembles the IP fragments; the transport layer is unaware of the fragmentation and uses the port numbers in the reassembled TCP header.
D. The transport layer demultiplexes each fragment independently using the IP identification field to correlate them to the correct socket.

50 Which of the following scenarios best demonstrates a violation of the pure end-to-end principle regarding the relationship between the Transport and Network layers?

TRANSPORT LAYER: Relationship between Transport and Network Layer Hard
A. A host's transport layer calculating a checksum that includes a pseudo-header derived from IP layer addresses.
B. A router using Equal Cost Multi-Path (ECMP) to route packets of the same TCP connection over different physical paths.
C. The network layer using ICMP source quench messages to instruct the transport layer to slow down.
D. An intermediate NAT device modifying the TCP source port and recalculating the TCP checksum.

51 A custom transport protocol is designed to provide strict flow control but explicitly lacks congestion control. Under which of the following network conditions will this protocol cause severe performance degradation for the entire network?

Transport Layer Services Hard
A. When multiple senders transmit data at high rates across a shared, bottlenecked WAN link, even if all receivers have infinite buffer space.
B. When the sender and receiver are on the same local subnet with mismatched Maximum Transmission Units (MTU).
C. When the physical layer introduces a high bit error rate (BER) due to electromagnetic interference.
D. When the receiver's application processes data much slower than the sender transmits it over a gigabit LAN.

52 Why is it fundamentally impossible for Internet transport layer protocols (like TCP or UDP) to guarantee a maximum end-to-end delay (delay bounds) for application data?

Transport Layer Services Hard
A. Because TCP's sliding window mechanism dynamically alters the transmission rate, introducing variable processing delays at the sender.
B. Because UDP lacks acknowledgment mechanisms, making it impossible to measure Round Trip Time (RTT).
C. Because the underlying IP network layer provides a best-effort delivery service with variable queuing delays at intermediate routers.
D. Because transport layer checksum calculations require variable amounts of CPU time depending on the payload entropy.

53 During a TCP SYN flood attack, a server utilizes SYN cookies to avoid allocating state for half-open connections. How does the server encode the necessary connection parameters (like MSS) to reconstruct the state when the final ACK arrives from a legitimate client?

TCP- Header format and handshaking operation Hard
A. It cryptographically hashes the client IP, port, and a secret key, and embeds this hash along with an MSS index into the server's Initial Sequence Number (ISN).
B. It embeds the parameters into the TCP Options field of the SYN-ACK packet, relying on the client to echo them back in the ACK packet.
C. It modifies the TCP Window Size field in the SYN-ACK to represent a mathematical function of the MSS and a server-side secret.
D. It stores the MSS and client IP in a heavily compressed hash table indexed by the client's ISN.

54 Assume a TCP connection is operating over a Gbps link at maximum capacity. The TCP sequence number field is bits long. Approximately how long will it take for the sequence numbers to wrap around (complete one full cycle)?

TCP- Header format and handshaking operation Hard
A. seconds
B. hours
C. seconds
D. minutes

55 In a TCP header, the Data Offset field is 4 bits long and indicates the size of the TCP header in 32-bit words. If a TCP segment carries the maximum allowable length of TCP Options, what is the value of the Data Offset field in decimal, and what is the size of the TCP Options field in bytes?

TCP- Header format and handshaking operation Hard
A. Data Offset: ; Options Size: bytes
B. Data Offset: ; Options Size: bytes
C. Data Offset: ; Options Size: bytes
D. Data Offset: ; Options Size: bytes

56 Two hosts, A and B, perform a 'simultaneous open' in TCP, meaning both send SYN segments to each other simultaneously. What is the correct sequence of state transitions for Host A to establish the connection?

TCP- Header format and handshaking operation Hard
A. CLOSED SYN_RCVD SYN_SENT ESTABLISHED
B. CLOSED LISTEN SYN_RCVD ESTABLISHED
C. CLOSED SYN_SENT ESTABLISHED
D. CLOSED SYN_SENT SYN_RCVD ESTABLISHED

57 Host A initiates an active close on a TCP connection with Host B. After sending the final ACK in the 4-way handshake, Host A enters the TIME_WAIT state for an interval equal to twice the Maximum Segment Lifetime (2MSL). Which of the following is the primary reason for this specific duration?

TCP- Header format and handshaking operation Hard
A. To keep the socket buffers allocated in case the application process decides to reopen the connection immediately.
B. To synchronize the sequence numbers with the network layer's routing table updates.
C. To ensure that if the final ACK is lost, Host B can retransmit its FIN and Host A can retransmit the final ACK, while also letting old duplicate segments expire in the network.
D. To allow enough time for Host B to transition from CLOSE_WAIT to LAST_ACK.

58 When computing the UDP checksum for an IPv6 packet, the calculation includes a pseudo-header. Which of the following accurately describes a critical difference in the UDP checksum implementation between IPv4 and IPv6?

UDP- Header format Hard
A. In IPv6, the UDP checksum covers only the pseudo-header and UDP header, omitting the payload to optimize processing speed.
B. In IPv4, the pseudo-header includes the TTL field, whereas IPv6 uses the Hop Limit field in the pseudo-header.
C. In IPv6, the pseudo-header includes the flow label field to ensure QoS parameters are not tampered with, whereas IPv4 does not.
D. In IPv4, the UDP checksum calculation is optional and can be set to all zeros, whereas in IPv6, the UDP checksum is strictly mandatory.

59 The UDP header contains a -bit Length field. Given that the underlying IPv4 header also contains a Total Length field, the UDP Length field might seem redundant. In which of the following edge cases is the UDP Length field strictly necessary to correctly extract the UDP payload?

UDP- Header format Hard
A. When the IP packet is fragmented, and the UDP header is distributed across multiple IP fragments.
B. When the Ethernet frame carrying the IP datagram is padded to meet minimum frame size requirements, causing the IP payload to contain trailing garbage bytes.
C. The UDP length field is entirely redundant in IPv4 and was only included to maintain structural alignment with the TCP header.
D. When the UDP packet encapsulates an IPsec ESP header which uses aggressive padding.

60 An application requires sending the largest possible UDP payload in a single, unfragmented standard Ethernet frame (MTU = 1500 bytes) over an IPv4 network without any IP options. What is the exact maximum size of the application data (UDP payload) in bytes?

UDP- Header format Hard
A. bytes
B. bytes
C. bytes
D. bytes