Assignment 4 - CSN 341
Assignment 4 - CSN 341
Assignment-4
Group Members:
Ques-1 Why is flow control important in the transport layer, and how does TCP
implement flow control through mechanisms like sliding windows? Discuss
how improper flow control can lead to issues like buffer overflow and network
congestion, and explain the potential impact on overall network performance.
Solution-
Flow control in the transport layer, like TCP, is all about making sure the sender
doesn't send more data than the receiver can handle at once.
How TCP Handles Flow Control:
TCP uses something called a sliding window:
• The sliding window is like a limit that tells the sender how much data it can
send before needing to wait for the receiver to say, "I’m ready for more."
• The receiver tells the sender, “Hey, I can only handle this much data at a time”
(based on its buffer or storage space).
• As the receiver processes the data, it sends back an acknowledgment (ACK),
saying, "Okay, I’ve handled this much, you can send more now."
If the receiver’s buffer is getting full, it tells the sender to slow down. Once space is
freed up, the sender can speed up again.
What Happens Without Proper Flow Control:
1. Buffer Overflow: If the sender sends too much data too quickly, the
receiver’s buffer could get full, causing it to lose data. This is like spilling water
because the glass is too full.
2. Network Congestion: When multiple senders overload the network by
sending too much data at once, it can clog the system, causing delays and
lost data, like a traffic jam on a busy road.
Impact on Overall Network Performance:
• Increased Latency: Improper flow control can lead to packet loss and
retransmissions, which increases the round-trip time (RTT) and overall latency
in communication.
• Decreased Throughput: Buffer overflows and retransmissions can
significantly reduce network throughput, as the sender must resend lost
packets, reducing the efficiency of data transmission.
• Unreliable Communication: In extreme cases, inadequate flow control can
lead to dropped connections, data corruption, or unreliable communication as
data transmission becomes erratic and unpredictable.
Ques-2 Why are port numbers significant in the transport layer, and how do
they facilitate multiplexing and demultiplexing of data streams? Provide
examples of specific port numbers associated with well-known services, such
as HTTP and DNS, and discuss the potential issues that can arise due to port
number conflicts or misuse.
Solution- Port numbers are essential in the transport layer (e.g., TCP and UDP) for
identifying specific processes or services running on a host. They help in
multiplexing and demultiplexing data streams, allowing multiple communication
channels between hosts to occur simultaneously.
Multiplexing and Demultiplexing:
• Multiplexing: This is when multiple data streams (from different applications)
are combined and sent over the same network connection. For example,
when you browse the web, listen to music online, and send an email, all of
these activities use the same network connection, but each uses a different
port number.
• Demultiplexing: When the data reaches your computer, the transport layer
uses the port numbers to "sort" the data and send it to the right application.
For example, web data goes to the browser (port 80 or 443), while email data
goes to the email client.
Examples of Well-Known Port Numbers
• HTTP: Port 80 (TCP)
o HTTP is the protocol for web traffic. Browsers typically communicate
with web servers over this port.
• HTTPS: Port 443 (TCP)
o Used for secure web traffic using SSL/TLS encryption.
• DNS: Port 53 (UDP)
o DNS queries often use UDP to resolve domain names to IP addresses.
• SMTP: Port 25 (TCP)
o Used for sending emails.
Port Number Conflicts and Misuse
1. Port Number Conflicts: When two applications attempt to use the same port
on a host, a conflict arises. Since only one application can bind to a particular
port at a time, this can cause one of the applications to fail or not start
properly. For example, if two web servers try to use port 80, one will encounter
a "port already in use" error.
2. Misuse of Ports: Malicious actors may exploit well-known ports for attacks,
like:
o Port Scanning: Attackers scan a host’s open ports to identify
vulnerabilities. Open ports with insecure services are a common entry
point for attacks.
o Port Hijacking: A malicious application could bind to a port that is
expected to be used by a legitimate service, redirecting traffic and
potentially stealing data.