Unit 2 (Application Layer)
1] Give the well defined port number for the following protocols: 1) SMTP 2)
DNS 3) HTTP 4) POP3 5) HTTPS 6) FTP 7) IMAP
Here are the well-defined port numbers:
1. SMTP – 25
2. DNS – 53
3. HTTP – 80
4. POP3 – 110
5. HTTPS – 443
6. FTP – 21
7. IMAP – 143
2] For the below mentioned internet applications protocol, mention the
underlying transport protocol (TCP or UDP). i) Telnet ii) FTP iii) HTTP iv) DNS
v) SMTP
Here are the underlying transport protocols (TCP or UDP) for the given internet
application protocols:
i) Telnet – TCP
ii) FTP – TCP
iii) HTTP – TCP
iv) DNS – Both TCP and UDP
• UDP is commonly used for standard queries
• TCP is used for zone transfers or when response data size exceeds 512
bytes
v) SMTP – TCP
3] Why do HTTP, FTP, SMTP, and POP3 run on top of TCP rather than on UDP?
Name one application that uses UDP and why?
These protocols require reliable communication, which TCP provides through:
1. Reliable Data Transfer – Ensures all data is delivered correctly and in order.
2. Error Checking – Detects and retransmits lost or corrupted packets.
3. Flow Control – Manages data flow to avoid overwhelming the receiver.
4. Connection-Oriented Communication – Establishes a connection before data transfer
begins, ensuring both sides are ready.
Protocols like HTTP, FTP, SMTP, and POP3 involve critical data (e.g., emails, files, web
content) that must not be lost or corrupted, making TCP the ideal choice.
Example of an application that uses UDP and why:
Application: DNS (Domain Name System)
Why:
• Speed is critical – DNS queries are short and need fast response times.
• Overhead is minimal – UDP is lightweight with less delay compared to TCP.
• If a response is lost, the client can simply retry the request.
So, UDP is preferred in DNS for faster, low-overhead communication, where occasional
packet loss is acceptable.
4] What is HTTP? Explain Non-persistent and Persistent connections of HTTP.
HTTP (HyperText Transfer Protocol) is the application-layer protocol used for transferring
web content (like HTML pages, images, videos, etc.) between a web browser (client) and a
web server over the internet.
• It follows a client-server model.
• It is stateless, meaning each request is independent and does not retain information
about previous requests.
• Runs on TCP, usually on port 80 (or 443 for HTTPS).
Non-Persistent and Persistent HTTP Connections:
1. Non-Persistent HTTP:
• A new TCP connection is established for each request/response pair.
• After the server sends the response, the connection is closed.
Example:
• To load a webpage with 5 images, the browser makes 6 separate TCP connections (1
for the HTML + 5 for images).
Pros:
• Simple implementation.
Cons:
• High overhead due to multiple TCP handshakes.
• Slower loading due to repeated connection setups.
2. Persistent HTTP (HTTP Keep-Alive):
• One TCP connection is kept open and used for multiple requests/responses between
client and server.
• Connection closes after a timeout or when explicitly closed.
Example:
• Loading the same webpage with 5 images uses only 1 TCP connection for all 6 items.
Pros:
• Faster page loading.
• Reduces latency and overhead.
• More efficient use of network resources.
Cons:
• Slightly more complex to manage connection lifetimes.
5] Explain SMTP Protocol.
SMTP (Simple Mail Transfer Protocol):
• SMTP is a protocol used to send emails from one server to another.
• It works in the application layer of the internet protocol suite.
• Uses TCP port 25 for communication.
• Mainly used for sending and forwarding emails, not for receiving (POP3 or IMAP are
used for receiving).
• It is a push protocol, meaning it pushes emails to the server.
How it works (Simple Steps):
1. Email client sends the email to the SMTP server.
2. SMTP server forwards it to the recipient's email server.
3. Recipient retrieves the email using POP3 or IMAP.
Let me know if you want a simple diagram too!
6] What is POP3 protocol? How the limitations of POP3 protocols are
overcome by IMAP?
What is POP3?
• POP3 (Post Office Protocol version 3) is used to receive emails from a mail server to a
local device.
• It downloads emails and usually deletes them from the server after download.
• Uses TCP port 110.
• Best for offline access to emails.
Limitations of POP3:
• Emails are tied to one device (downloaded and removed from server).
• No synchronization between multiple devices.
• Cannot manage folders or view email status (read/unread) from multiple devices.
How IMAP overcomes these limitations:
• IMAP (Internet Message Access Protocol) keeps emails on the server, allowing access
from multiple devices.
• Supports email folder management and syncs read/unread status across devices.
• Uses TCP port 143 (or 993 for secure IMAP).
7] Discriminate fully qualified domain name from partially qualified domain
name.
Type Definition Example Ends with dot (.)?
FQDN (Fully
Qualified Complete domain name that www.example.com. Yes (optional in
Domain Name) includes all levels, from the practice, but
Type Definition Example Ends with dot (.)?
host to the top-level domain technically ends with
(TLD). a dot)
PQDN (Partially Incomplete domain name,
www or
Qualified missing some parts, like TLD or No
www.example
Domain Name) domain.
In Short:
• FQDN = Complete address (absolute path in DNS)
• PQDN = Incomplete address (relative path)
8] Explain the hierarchical DNS system.
The Domain Name System (DNS) is a hierarchical system used to translate domain names
(like www.google.com) into IP addresses.
Hierarchy Levels:
1. Root Level
o Represented by a dot .
o Top of the hierarchy
o Points to root servers
2. Top-Level Domain (TLD)
o Examples: .com, .org, .net, .in
o Managed by TLD servers
3. Second-Level Domain
o Example: google in google.com
o Registered by individuals or organizations
4. Subdomain/Host
o Example: www in www.google.com
o Represents specific services or machines
Example:
www.google.com.
│ │ │
│ │ └── TLD (.com)
│ └────────── Second-level domain (google)
└──────────────── Subdomain/Host (www)
9] Explain the purpose of DNS and its role in translating domain names into IP
addresses.
Purpose of DNS:
DNS (Domain Name System) is used to translate human-readable domain names (like
www.google.com) into IP addresses (like 142.250.195.36), which computers use to
communicate.
Role of DNS:
• Acts like the phonebook of the internet
• Helps users access websites using names instead of remembering numeric IP
addresses
• When you enter a domain name, DNS finds the corresponding IP address so your
browser can connect to the correct server
10] How does recursive queries in DNS work? Explain message format of DNS.
How Recursive Queries in DNS Work:
• When a DNS client asks a DNS server for a domain’s IP, the server does all the work to
find the answer.
• If the server doesn’t know the IP, it queries other DNS servers (root, TLD,
authoritative) on behalf of the client.
• Finally, it returns the complete answer to the client.
• This means the client only sends one request and gets the final IP without further
queries.
DNS Message Format (Simple):
A DNS message has 5 main parts:
1. Header – Contains info like ID, flags, and counts of questions/answers.
2. Question – The domain name being queried.
3. Answer – The resource records answering the query (like IP address).
4. Authority – Info about authoritative DNS servers.
5. Additional – Extra helpful info (like IP of authoritative servers).
Unit -3 (Transport Layer)
1] What is multiplexing and demultiplexinng in transport layer?
Multiplexing in the transport layer is the process of collecting data from multiple
applications on a device and sending it over a single network connection.
Demultiplexing is the process of receiving the data from the network and delivering it to the
correct application on the receiving device, based on information like port numbers.
In short:
• Multiplexing: Combining multiple application data streams into one for transmission.
• Demultiplexing: Separating received data and sending it to the right application.
2] What are the functions of transport layer in OSI reference model? How
segmentation and reassemble is performed in transport layer?
Functions of Transport Layer in OSI Model:
1. Reliable Data Transfer: Ensures data is delivered error-free and in order.
2. Segmentation and Reassembly: Splits large messages into smaller segments and
reassembles them at the receiver.
3. Flow Control: Manages data flow to prevent congestion or overload.
4. Error Detection and Correction: Detects errors and requests retransmission if
needed.
5. Multiplexing/Demultiplexing: Manages multiple communication sessions using port
numbers.
6. Connection Management: Establishes, maintains, and terminates connections
between devices (for connection-oriented protocols).
Segmentation and Reassembly:
• Segmentation: The transport layer divides large application data into smaller
segments for easier and efficient transmission.
• Reassembly: The receiver's transport layer collects the incoming segments and
combines them in the correct order to recreate the original data before passing it to
the application.
3] Differentiate Congestion Control, Flow control and Error Control.
Feature Congestion Control Flow Control Error Control
Prevents network Prevents sender from
congestion by controlling overwhelming the Detects and corrects errors
Purpose
the amount of data receiver by controlling in transmitted data
entering the network data flow
Where it Network layer and
Transport layer Transport layer
Occurs Transport layer
Controls data flow
Controls overall network Ensures accurate and
Scope between sender and
traffic and resource usage error-free data delivery
receiver
Network-wide traffic Point-to-point data Data integrity and
Focus
management rate regulation reliability
Adjusts data sending rate Uses feedback (ACKs, Uses error detection codes
based on network window sizes) from (checksums),
Mechanism
conditions (e.g., packet receiver to control acknowledgments, and
loss, delay) sending rate retransmissions
TCP congestion avoidance
Sliding window
algorithms like slow start, Checksum, CRC, ARQ
Example protocol, stop-and-
congestion avoidance, and (Automatic Repeat
Techniques wait, and buffer
congestion window Request), retransmission
management
adjustment
Network overload or Receiver’s buffer
Detection of corrupted or
Triggered By packet loss due to capacity and
lost packets
congestion processing speed
Feature Congestion Control Flow Control Error Control
Prevent receiver
Avoid network collapse,
buffer overflow, Deliver error-free data to
Goal maintain fair resource
maintain smooth data the application
usage
flow
Matches sender May cause
Can reduce throughput
Effect on speed to receiver retransmissions, affecting
temporarily to prevent
Throughput capacity for optimal throughput but ensuring
congestion
throughput correctness
4] Explain the various fields of TCP header What are the advantages and
disadvantages of TCP
Fields of TCP Header (simple):
1. Source Port: Identifies sender’s application.
2. Destination Port: Identifies receiver’s application.
3. Sequence Number: Number of the first byte in this segment.
4. Acknowledgment Number: Next expected byte from the other side.
5. Data Offset: Size of the TCP header.
6. Flags: Control bits (e.g., SYN, ACK, FIN) to manage connection.
7. Window Size: Amount of data the receiver can accept.
8. Checksum: Error-checking for header and data.
9. Urgent Pointer: Indicates urgent data position.
10. Options: Additional features (optional).
11. Padding: Ensures header length is multiple of 32 bits.
Advantages of TCP:
• Reliable data transfer (error-free).
• Ordered delivery of data.
• Flow control prevents receiver overload.
• Connection-oriented (establishes a session).
• Congestion control manages network traffic.
Disadvantages of TCP:
• More overhead due to connection setup and control info.
• Slower than UDP because of error checking and flow control.
• Not suitable for real-time applications needing fast delivery.
5] Explain Go-back N protocol? What is the limitation of it? How selective
repeat protocol does overcome the limitation of Go back N protocol?
Go-Back-N Protocol:
• The sender can send multiple frames (up to a fixed window size) without waiting for
individual acknowledgments.
• The receiver only accepts frames in order.
• If an error or lost frame is detected, the receiver discards that frame and all following
frames.
• The sender, upon timeout or receiving a negative acknowledgment, goes back and
retransmits the erroneous frame and all subsequent frames.
Limitation of Go-Back-N:
• Inefficient because it retransmits many frames even if only one frame was lost or
damaged, wasting bandwidth.
How Selective Repeat Overcomes This:
• The sender retransmits only the specific frames that were lost or damaged.
• The receiver buffers out-of-order frames and delivers them in order to the upper
layer.
• This makes transmission more efficient by avoiding unnecessary retransmission.
6] What is store and forward packet switching?
Store and Forward Packet Switching is a method where a network device (like a router)
receives the entire data packet, stores it temporarily, checks for errors, and then forwards it
to the next device.
In simple terms:
• The packet is fully received first.
• Then it’s checked for errors.
• If okay, it’s sent forward to the next node.
This helps ensure error-free transmission but can cause some delay due to the storing step.
7] Compare TCP and UDP.
8] What is piggybacking? Explain the advantage of it.
Piggybacking is a technique in data communication where an acknowledgment (ACK) for
received data is sent along with outgoing data in the same frame, instead of sending a
separate acknowledgment.
Advantage of Piggybacking:
• Reduces overhead: Fewer separate frames are sent because ACKs are combined with
data frames.
• Improves efficiency: Saves bandwidth and reduces network congestion by minimizing
the number of control messages.
9] Explain RDT 2.0.
RDT 2.0 (Reliable Data Transfer version 2.0) is a protocol designed to handle errors during
data transmission.
• It works over a noisy channel where packets can get corrupted.
• When the receiver gets a packet, it checks for errors using a checksum.
• If the packet is correct, the receiver sends an ACK (acknowledgment).
• If the packet is corrupted, the receiver sends a NACK (negative acknowledgment)
asking the sender to resend the packet.
• The sender resends the packet when it gets a NACK or doesn’t get an ACK within a
timeout.
In short: RDT 2.0 detects errors and uses ACK/NACK to ensure data is correctly received.
10] Explain TCP segment structure and justify the importance of its field
values.What is the significance of the following flags in TCP segment? i) URG
ii) SYN iii) FIN iv) PSH
TCP Segment Structure and Importance of Fields:
1. Source Port & Destination Port: Identify sending and receiving applications.
2. Sequence Number: Indicates the order of bytes sent; helps in ordering data.
3. Acknowledgment Number: Confirms receipt of data by indicating the next expected
byte.
4. Data Offset: Shows the size of the TCP header.
5. Flags (Control bits): Control connection setup, termination, and data flow (like SYN,
ACK, FIN, etc.).
6. Window Size: Specifies how much data the receiver can accept (flow control).
7. Checksum: Ensures error-free transmission of header and data.
8. Urgent Pointer: Points to urgent data in the segment.
9. Options: Additional features (like timestamps).
10. Data: Actual payload sent.
Significance of TCP Flags:
• URG (Urgent): Indicates the segment contains urgent data; the urgent pointer field is
valid.
• SYN (Synchronize): Used to initiate a connection between sender and receiver
(during handshake).
• FIN (Finish): Signals the sender has finished sending data and wants to close the
connection.
• PSH (Push): Tells the receiver to pass data to the application immediately without
buffering.