Tutorial 3 Questions with Answers
Q1. Services provided by Data Link Layer to the Network Layer
Question:
What are the key services provided by the data link layer to the network layer? Explain how
these services help in reliable data transmission.
Answer:
The data link layer provides the following key services to the network layer:
1. Framing – Breaks the bit stream into manageable units (frames).
2. Error Control – Ensures errors introduced in transmission are detected/corrected.
3. Flow Control – Prevents the sender from overwhelming the receiver.
4. Addressing – Adds physical addresses for frame delivery.
5. Access Control – Determines which device has control over the channel.
These services ensure reliable, ordered, and manageable data transmission across a physical
link.
Q2. Framing Techniques
Question:
Describe the need for framing in the data link layer. Compare character count, bit stuffing,
and byte stuffing techniques with examples.
Answer:
Framing is needed to distinguish where one frame ends and another begins.
Character Count:
Frame starts with a byte indicating the number of bytes in the frame.
Drawback: Corruption in count field can desynchronize frame boundaries.
Byte Stuffing:
Special flag byte (e.g., FLAG = 01111110) is used to mark frame start/end. If this flag
appears in the data, an escape byte (ESC) is inserted before it.
Bit Stuffing:
A 0 is inserted after five consecutive 1s in data to avoid accidentally creating a FLAG
pattern.
Example for bit stuffing:
Original data: 01111110
After stuffing: 011111010
Q3. Flow Control vs Error Control
Question:
Explain the difference between flow control and error control at the data link layer.
Describe any two flow control protocols.
Answer:
Flow Control: Prevents sender from overwhelming the receiver.
Error Control: Detects and corrects errors in frames.
Protocols:
1. Stop-and-Wait Protocol:
Sender sends one frame and waits for acknowledgment before sending the next.
2. Sliding Window Protocol:
Allows multiple frames to be sent before needing acknowledgment; increases
efficiency.
Q4. CRC (Cyclic Redundancy Check)
Question:
What is CRC? Explain how CRC is calculated and used in error detection.
Answer:
CRC (Cyclic Redundancy Check) is an error-detecting code based on binary division.
Steps:
1. Append n-1 zero bits to the message (where n is the length of the divisor polynomial).
2. Divide the message by the generator polynomial using modulo-2 division.
3. The remainder becomes the CRC bits, which are appended to the message.
4. The receiver divides the received frame by the same polynomial.
o If the remainder is zero, the frame is error-free.
Q5. Error Detecting vs Error Correcting Codes
Question:
Compare error detecting codes with error correcting codes. Show how Hamming code can
correct single-bit errors.
Answer:
Feature Error Detecting Codes Error Correcting Codes
Purpose Detect errors Detect and correct errors
Feature Error Detecting Codes Error Correcting Codes
Examples Parity, CRC Hamming Code, Reed-Solomon
Complexity Low Higher
Correction Ability No Yes
Hamming Code Example (7,4):
Data bits: D1 D2 D3 D4
Parity bits: P1, P2, P3
Construct code: [P1 P2 D1 P3 D2 D3 D4]
Receiver uses parity checks to locate error bit using syndrome bits.
A single-bit error can be identified and corrected using the syndrome pattern.
� 10 MCQs (Single Answer)
1. What is the main function of the Data Link Layer?
A. Routing
B. Encryption
C. Framing and Error Control
D. Address Resolution
✅Answer: C. Framing and Error Control
2. Which framing method uses special flag bytes and escape characters?
A. Bit Stuffing
B. Byte Stuffing
C. Character Count
D. Parity Check
✅Answer: B. Byte Stuffing
3. Which flow control mechanism allows multiple frames to be sent before acknowledgment?
A. Stop-and-Wait
B. Sliding Window
C. CRC
D. Hamming Code
✅Answer: B. Sliding Window
4. In bit stuffing, which bit is inserted after five consecutive 1s?
A. 1
B. 0
C. 10
D. Flag byte
✅Answer: B. 0
5. What is the purpose of error detection?
A. To recover lost data
B. To detect corrupted data
C. To speed up transmission
D. To encrypt data
✅Answer: B. To detect corrupted data
6. Which of the following is an error detecting code?
A. Hamming Code
B. CRC
C. Reed-Solomon
D. Convolutional Code
✅Answer: B. CRC
7. Which error correction method can correct single-bit errors?
A. CRC
B. Checksum
C. Hamming Code
D. Bit Stuffing
✅Answer: C. Hamming Code
8. In Stop-and-Wait ARQ, after sending a frame, the sender must:
A. Send the next frame immediately
B. Wait for acknowledgment
C. Reset the connection
D. Change the parity
✅Answer: B. Wait for acknowledgment
9. Which of the following is not a function of the data link layer?
A. Flow Control
B. Error Detection
C. Framing
D. Path Determination
✅Answer: D. Path Determination
10. CRC is based on:
A. Subtraction
B. Addition
C. Polynomial Division
D. XOR Encryption
✅Answer: C. Polynomial Division
Tutorial 4 Questions with Answers
Q1. IPv4 vs IPv6
Question:
Compare IPv4 and IPv6 in terms of address structure, header format, and support for QoS.
Why was IPv6 introduced?
Answer:
Address Structure:
o IPv4: 32-bit addresses (e.g., 192.168.1.1), ~4.3 billion unique addresses.
o IPv6: 128-bit addresses (e.g., 2001:0db8::1), ~340 undecillion addresses.
Header Format:
o IPv4: Variable-length header (20–60 bytes).
o IPv6: Fixed-length header (40 bytes), simplified for faster processing.
QoS Support:
o IPv4: Limited support via Type of Service (ToS).
o IPv6: Enhanced with Flow Label field for identifying traffic requiring special
handling.
Why IPv6?
o To solve address exhaustion, simplify headers, and improve security and QoS.
Q2. Routing Algorithms
Question:
Explain the key differences between Distance Vector and Link State routing algorithms.
Answer:
Feature Distance Vector Link State
Basis Distance to destination Complete network topology
Updates Periodic, sent to neighbors Event-driven, sent to all routers
Convergence Slower Faster
Examples RIP (Routing Information Protocol) OSPF (Open Shortest Path First)
Example:
Distance Vector: Router A tells neighbor B its distance to destination D.
Link State: Each router floods its link info, all routers compute shortest paths.
Q3. TCP, UDP, and Sockets
Question:
Compare TCP and UDP. How does socket programming use these protocols?
Answer:
Feature TCP UDP
Connection Connection-oriented Connectionless
Reliability Reliable (ACKs, retransmissions) Unreliable
Order Ensures order No guarantee
Speed Slower Faster
Use Cases Web, Email, File Transfer Streaming, VoIP, DNS
Socket Programming:
Allows programs to communicate over a network.
A socket is an endpoint (IP + Port).
TCP and UDP sockets are used to send/receive data using respective protocols.
Q4. Congestion Control
Question:
What are the general principles of congestion control? Describe two congestion prevention
policies.
Answer:
General Principles:
Prevent overload of the network.
Manage traffic before congestion occurs.
Use feedback to adjust transmission rates.
Prevention Policies:
1. Admission Control: Limit new connections when the network is busy.
2. Traffic Shaping: Regulate data entry into the network (e.g., token bucket algorithm).
These help ensure stable and predictable performance.
Q5. Quality of Service (QoS)
Question:
Define QoS and explain packet scheduling, traffic shaping, jitter control, and Integrated
Services.
Answer:
QoS (Quality of Service):
A set of techniques to guarantee performance metrics like bandwidth, delay, jitter, and
loss rate.
Packet Scheduling:
Prioritizes packets using algorithms (e.g., FIFO, Weighted Fair Queuing).
Traffic Shaping:
Smooths traffic by controlling rate (e.g., leaky bucket, token bucket).
Jitter Control:
Reduces variation in packet arrival time using buffers or scheduling.
Integrated Services (IntServ):
Uses RSVP protocol to reserve resources across the network for specific flows.
� 10 Multiple Choice Questions (MCQs)
1. What is the address size of IPv6?
A. 32-bit
B. 64-bit
C. 128-bit
D. 256-bit
✅Answer: C. 128-bit
2. Which of the following protocols uses Distance Vector routing?
A. OSPF
B. RIP
C. BGP
D. IS-IS
✅Answer: B. RIP
3. TCP is considered a __________ protocol.
A. Connectionless
B. Unreliable
C. Connection-oriented
D. Stateless
✅Answer: C. Connection-oriented
4. UDP is best suited for:
A. File transfer
B. Remote login
C. Voice over IP (VoIP)
D. Web browsing
✅Answer: C. Voice over IP (VoIP)
5. Which technique is used to regulate outgoing traffic flow?
A. Packet Scheduling
B. Routing
C. Traffic Shaping
D. Forwarding
✅Answer: C. Traffic Shaping
6. Which field in IPv6 header supports QoS?
A. Source Address
B. Payload Length
C. Flow Label
D. Next Header
✅Answer: C. Flow Label
7. What does RSVP stand for in Integrated Services?
A. Reliable Service for Virtual Paths
B. Rapid Service Validation Protocol
C. Resource Reservation Protocol
D. Real-time Streaming Verification Protocol
✅Answer: C. Resource Reservation Protocol
8. In Link State routing, each router builds a:
A. Routing vector
B. Distance table
C. Cost matrix
D. Topological map of the network
✅Answer: D. Topological map of the network
9. Which congestion control method avoids congestion before it happens?
A. Retransmission
B. Backoff
C. Admission Control
D. Selective Acknowledgment
✅Answer: C. Admission Control
10. Jitter refers to:
A. Delay in packet delivery
B. Variation in packet arrival time
C. Packet loss
D. Queue overflow
✅Answer: B. Variation in packet arrival time
Tutorial 5 Questions with Answers
Q1. Application Layer Protocols Overview
Question:
Compare the functionalities of DNS, SMTP, POP3, FTP, and HTTP. For each protocol,
mention its purpose, port, and connection type.
Answer:
Protocol Purpose Port Connection Type
DNS Resolves domain names to IPs 53 Mostly UDP (can use TCP)
SMTP Sends emails between servers 25 TCP
POP3 Retrieves emails from server 110 TCP
FTP Transfers files over network 20 (data), 21 (control) TCP
HTTP Transfers hypertext (web pages) 80 TCP
Q2. DNS Functionality
Question:
Explain the role of DNS. Describe the DNS resolution process when a URL is entered in a
browser.
Answer:
DNS (Domain Name System) translates human-readable domain names (like example.com)
into IP addresses.
Resolution Process:
1. Browser checks cache for IP.
2. If not found, query goes to recursive DNS resolver.
3. Resolver contacts:
o Root DNS server
o Top-Level Domain (TLD) server (e.g., .com)
o Authoritative DNS server for the domain
4. IP address is returned to the client.
5. Browser uses the IP to contact the server and load the site.
Q3. Authentication & Cryptography
Question:
What is authentication? How do public and private key cryptography help secure
communication?
Answer:
Authentication verifies the identity of users or systems before granting access.
Public/Private Key Cryptography:
Public Key: Shared openly; used to encrypt data.
Private Key: Kept secret; used to decrypt data.
Ensures confidentiality and identity verification during communication (e.g., in
HTTPS, email encryption).
Q4. Digital Signatures & Certificates
Question:
Define a digital signature and a digital certificate. How do they help with secure
communication?
Answer:
Digital Signature: A hash of a message encrypted with the sender's private key.
Confirms message integrity and origin.
Digital Certificate: Issued by a Certificate Authority (CA); binds a public key to an
identity (e.g., a website or organization).
Together, they ensure:
Authentication of sender/website
Data integrity
Non-repudiation
Q5. Firewalls
Question:
What is a firewall? Explain its types and role in network security.
Answer:
A firewall is a security device/software that monitors and controls incoming/outgoing
network traffic based on predefined rules.
Types:
1. Packet-filtering Firewall: Checks packets against rules.
2. Stateful Inspection Firewall: Tracks connection state.
3. Application Layer Firewall (Proxy): Filters traffic at the application level.
4. Next-Gen Firewall: Combines multiple features like intrusion prevention, deep
packet inspection.
Role: Blocks unauthorized access, prevents malware, enforces policies.
� 10 Multiple Choice Questions (MCQs)
1. Which protocol is used to transfer web pages?
A. FTP
B. SMTP
C. HTTP
D. POP3
✅Answer: C. HTTP
2. What port number does FTP use for control connection?
A. 20
B. 21
C. 25
D. 110
✅Answer: B. 21
3. What is the primary function of DNS?
A. Encrypt data
B. Transfer files
C. Map domain names to IP addresses
D. Send emails
✅Answer: C. Map domain names to IP addresses
4. Which protocol is used to send email between servers?
A. POP3
B. IMAP
C. SMTP
D. HTTP
✅Answer: C. SMTP
5. POP3 is used to:
A. Send emails
B. Receive emails and delete them from the server
C. Transfer web pages
D. Monitor network
✅Answer: B. Receive emails and delete them from the server
6. In public key cryptography, which key is used to encrypt data?
A. Private key of sender
B. Public key of sender
C. Private key of receiver
D. Public key of receiver
✅Answer: D. Public key of receiver
7. A digital signature ensures:
A. Confidentiality
B. Anonymity
C. Integrity and authenticity
D. Compression
✅Answer: C. Integrity and authenticity
8. Which of the following issues digital certificates?
A. Internet Service Providers
B. Web Servers
C. Certificate Authorities
D. DNS Servers
✅Answer: C. Certificate Authorities
9. Which firewall type operates at the application layer?
A. Packet filter
B. Stateful firewall
C. Proxy firewall
D. Static firewall
✅Answer: C. Proxy firewall
10. The private key in asymmetric encryption is:
A. Shared with everyone
B. Used to verify digital certificates
C. Kept secret by the owner
D. Stored on DNS servers
✅Answer: C. Kept secret by the owner